Package com.bc.ceres.swing.figure
Class AbstractHandle
java.lang.Object
com.bc.ceres.swing.figure.AbstractFigure
com.bc.ceres.swing.figure.AbstractHandle
- All Implemented Interfaces:
Figure,Handle,ShapeFigure,Restorable,Cloneable
- Direct Known Subclasses:
PointHandle,RotateHandle,ScaleHandle,VertexHandle
The base class for all
Handle implementations.- Since:
- Ceres 0.10
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.bc.ceres.swing.figure.Figure
Figure.Rank -
Field Summary
Fields inherited from class com.bc.ceres.swing.figure.AbstractFigure
NO_FIGURES, NO_HANDLES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractHandle(Figure figure, FigureStyle normalStyle, FigureStyle selectedStyle) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes this figure.final voidDraws this figure using the given rendering.protected voidThe bounds of the handle.getRank()getShape()Gets the shape (geometry) for this figure.doublegetX()doublegetY()booleanisCloseTo(Point2D point, AffineTransform m2v) Tests if the given point is "close to" this figure.booleanTests if this figure is a figure collection.booleanThe default implementation returnstrue.abstract voidmove(double dx, double dy) Moves the figure by the given delta in model coordinates.voidsetLocation(double x, double y) voidsetLocation(Point2D location) voidSets the shape (geometry) for this figure.abstract voidMethods inherited from class com.bc.ceres.swing.figure.AbstractFigure
addChangeListener, addFigure, addFigure, addFigureImpl, addFigureImpl, addFigures, addFiguresImpl, addSegment, clone, contains, createHandles, createMemento, createScaleHandles, fireFigureChanged, fireFigureChanged, fireFiguresAdded, fireFiguresRemoved, getChangeListeners, getEffectiveStyle, getFigure, getFigure, getFigureCount, getFigureIndex, getFigures, getFigures, getHandleStyle, getMaxSelectionStage, getNormalStyle, getSegment, getSelectedHandleStyle, getSelectedStyle, isSelected, removeAllFigures, removeChangeListener, removeFigure, removeFigureImpl, removeFigures, removeFiguresImpl, removeFiguresImpl, removeSegment, rotate, scale, setMemento, setNormalStyle, setSegment, setSelectable, setSelected, setSelectedStyleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.bc.ceres.swing.figure.Figure
addChangeListener, addFigure, addFigure, addFigures, addSegment, clone, contains, createHandles, getChangeListeners, getEffectiveStyle, getFigure, getFigure, getFigureCount, getFigureIndex, getFigures, getFigures, getMaxSelectionStage, getNormalStyle, getSegment, getSelectedStyle, isSelected, removeAllFigures, removeChangeListener, removeFigure, removeFigures, removeSegment, rotate, scale, setNormalStyle, setSegment, setSelected, setSelectedStyleMethods inherited from interface com.bc.ceres.swing.undo.Restorable
createMemento, setMemento
-
Constructor Details
-
AbstractHandle
Constructor.- Parameters:
figure- The figure to which this handle belongs.normalStyle- The handle's normal style.selectedStyle- The handle's selected style.
-
-
Method Details
-
getX
public double getX() -
getY
public double getY() -
isCollection
public boolean isCollection()Description copied from interface:FigureTests if this figure is a figure collection.- Specified by:
isCollectionin interfaceFigure- Returns:
true, if so.
-
getLocation
- Specified by:
getLocationin interfaceHandle- Returns:
- The current location in model coordinates.
-
setLocation
-
setLocation
public void setLocation(double x, double y) -
updateLocation
public abstract void updateLocation() -
getFigure
- Returns:
- The figure to which this handle belongs.
-
getRank
-
getShape
Description copied from interface:HandleGets the shape (geometry) for this figure.- Specified by:
getShapein interfaceHandle- Specified by:
getShapein interfaceShapeFigure- Returns:
- The shape in view coordinates.
-
setShape
Description copied from interface:HandleSets the shape (geometry) for this figure.- Specified by:
setShapein interfaceHandle- Specified by:
setShapein interfaceShapeFigure- Parameters:
shape- The shape in view coordinates.
-
getBounds
Description copied from interface:HandleThe bounds of the handle. -
isSelectable
public boolean isSelectable()The default implementation returnstrue.- Specified by:
isSelectablein interfaceFigure- Overrides:
isSelectablein classAbstractFigure- Returns:
- Always
true.
-
isCloseTo
Description copied from interface:FigureTests if the given point is "close to" this figure. -
dispose
public void dispose()Description copied from interface:FigureDisposes this figure. Indicates that it will no longer be used.- Specified by:
disposein interfaceFigure- Overrides:
disposein classAbstractFigure
-
getCursor
-
move
public abstract void move(double dx, double dy) Description copied from interface:FigureMoves the figure by the given delta in model coordinates.- Specified by:
movein interfaceFigure- Overrides:
movein classAbstractFigure- Parameters:
dx- Delta X in model coordinates.dy- Delta Y in model coordinates.
-
draw
Description copied from interface:FigureDraws this figure using the given rendering. -
drawHandle
-