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
ConstructorsModifierConstructorDescriptionprotected
AbstractHandle
(Figure figure, FigureStyle normalStyle, FigureStyle selectedStyle) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes this figure.final void
Draws this figure using the given rendering.protected void
The bounds of the handle.getRank()
getShape()
Gets the shape (geometry) for this figure.double
getX()
double
getY()
boolean
isCloseTo
(Point2D point, AffineTransform m2v) Tests if the given point is "close to" this figure.boolean
Tests if this figure is a figure collection.boolean
The default implementation returnstrue
.abstract void
move
(double dx, double dy) Moves the figure by the given delta in model coordinates.void
setLocation
(double x, double y) void
setLocation
(Point2D location) void
Sets the shape (geometry) for this figure.abstract void
Methods 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, setSelectedStyle
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, setSelectedStyle
Methods 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:Figure
Tests if this figure is a figure collection.- Specified by:
isCollection
in interfaceFigure
- Returns:
true
, if so.
-
getLocation
- Specified by:
getLocation
in 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:Handle
Gets the shape (geometry) for this figure.- Specified by:
getShape
in interfaceHandle
- Specified by:
getShape
in interfaceShapeFigure
- Returns:
- The shape in view coordinates.
-
setShape
Description copied from interface:Handle
Sets the shape (geometry) for this figure.- Specified by:
setShape
in interfaceHandle
- Specified by:
setShape
in interfaceShapeFigure
- Parameters:
shape
- The shape in view coordinates.
-
getBounds
Description copied from interface:Handle
The bounds of the handle. -
isSelectable
public boolean isSelectable()The default implementation returnstrue
.- Specified by:
isSelectable
in interfaceFigure
- Overrides:
isSelectable
in classAbstractFigure
- Returns:
- Always
true
.
-
isCloseTo
Description copied from interface:Figure
Tests if the given point is "close to" this figure. -
dispose
public void dispose()Description copied from interface:Figure
Disposes this figure. Indicates that it will no longer be used.- Specified by:
dispose
in interfaceFigure
- Overrides:
dispose
in classAbstractFigure
-
getCursor
-
move
public abstract void move(double dx, double dy) Description copied from interface:Figure
Moves the figure by the given delta in model coordinates.- Specified by:
move
in interfaceFigure
- Overrides:
move
in classAbstractFigure
- Parameters:
dx
- Delta X in model coordinates.dy
- Delta Y in model coordinates.
-
draw
Description copied from interface:Figure
Draws this figure using the given rendering. -
drawHandle
-