Package com.bc.ceres.swing.figure
Class AbstractPointFigure
java.lang.Object
com.bc.ceres.swing.figure.AbstractFigure
com.bc.ceres.swing.figure.AbstractPointFigure
- All Implemented Interfaces:
Figure,PointFigure,Restorable,Cloneable
- Direct Known Subclasses:
DefaultPointFigure
Base class for all
PointFigure implementations.
Sub-classes have to provide the location and radius of the point in model coordinates.
- 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
ConstructorsModifierConstructorDescriptionprotectedAbstractPointFigure(FigureStyle normalStyle, FigureStyle selectedStyle) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidDraws this figure using the given rendering.protected voidDraws thesymboland other items that are used to graphically represent the figure, for example labels.abstract doublefinal Figure.RankgetRank()Gets the symbol used for the current state of the figure.booleanisCloseTo(Point2D point, AffineTransform m2v) Tests if the given point is "close to" this figure.booleanTests if this figure is a figure collection.voidmove(double dx, double dy) Moves the figure by the given delta in model coordinates.voidRotates the figure by the given angle.voidScales the figure by the given scale factors.abstract voidsetLocation(double x, double y) voidsetLocation(Point2D location) Methods inherited from class com.bc.ceres.swing.figure.AbstractFigure
addChangeListener, addFigure, addFigure, addFigureImpl, addFigureImpl, addFigures, addFiguresImpl, addSegment, clone, contains, createHandles, createMemento, createScaleHandles, dispose, fireFigureChanged, fireFigureChanged, fireFiguresAdded, fireFiguresRemoved, getChangeListeners, getFigure, getFigure, getFigureCount, getFigureIndex, getFigures, getFigures, getHandleStyle, getMaxSelectionStage, getNormalStyle, getSegment, getSelectedHandleStyle, getSelectedStyle, isSelectable, isSelected, removeAllFigures, removeChangeListener, removeFigure, removeFigureImpl, removeFigures, removeFiguresImpl, removeFiguresImpl, removeSegment, 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, dispose, getChangeListeners, getFigure, getFigure, getFigureCount, getFigureIndex, getFigures, getFigures, getMaxSelectionStage, getNormalStyle, getSegment, getSelectedStyle, isSelectable, isSelected, removeAllFigures, removeChangeListener, removeFigure, removeFigures, removeSegment, setNormalStyle, setSegment, setSelected, setSelectedStyleMethods inherited from interface com.bc.ceres.swing.figure.PointFigure
getX, getYMethods inherited from interface com.bc.ceres.swing.undo.Restorable
createMemento, setMemento
-
Constructor Details
-
AbstractPointFigure
Constructor. The rank will always beFigure.Rank.POINT.- Parameters:
normalStyle- The style used for the "normal" state of the figure.selectedStyle- The style used for the "selected" state of the figure.
-
-
Method Details
-
getSymbol
Gets the symbol used for the current state of the figure.- Specified by:
getSymbolin interfacePointFigure- Returns:
- The symbol used to display the point.
-
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 interfacePointFigure- Returns:
- The current location in model coordinates.
-
setLocation
- Specified by:
setLocationin interfacePointFigure- Parameters:
location- The current location in model coordinates.
-
setLocation
public abstract void setLocation(double x, double y) -
getRadius
public abstract double getRadius()- Returns:
- The point radius in model coordinates.
-
getRank
-
scale
Description copied from interface:FigureScales the figure by the given scale factors.- Specified by:
scalein interfaceFigure- Overrides:
scalein classAbstractFigure- Parameters:
point- The reference point in model coordinates.sx- Scale X factor.sy- Scale Y factor.
-
rotate
Description copied from interface:FigureRotates the figure by the given angle.- Specified by:
rotatein interfaceFigure- Overrides:
rotatein classAbstractFigure- Parameters:
point- The reference point in model coordinates.theta- The rotation angle in degree.
-
move
public 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.
-
getBounds
-
isCloseTo
Description copied from interface:FigureTests if the given point is "close to" this figure. -
getEffectiveStyle
- Specified by:
getEffectiveStylein interfaceFigure- Overrides:
getEffectiveStylein classAbstractFigure- Returns:
- The effective style used for the current state of the figure.
-
draw
Description copied from interface:FigureDraws this figure using the given rendering. -
drawPoint
Draws thesymboland other items that are used to graphically represent the figure, for example labels. For convenience, the rendering's drawing context is translated by the point's location, so that drawing of items can be performed in symbol coordinates using view units.- Parameters:
rendering- The rendering.
-