jdraw.graphicalobjects
Class Segment
java.lang.Object
|
+--jdraw.graphicalobjects.GraphicalObject
|
+--jdraw.graphicalobjects.SizedGraphicalObject
|
+--jdraw.graphicalobjects.Segment
- public class Segment
- extends SizedGraphicalObject
A graphical segment.
Constructor Summary |
Segment(int iX,
int iY,
Color colColor,
int iWidth,
int iHeight)
Creates a new Segment with specified position, color, "width" and "height". |
Methods inherited from class jdraw.graphicalobjects.GraphicalObject |
addPropertyChangeListener, commitDragAndDrop, drag, fireBoudingBoxChange, getColor, getDistance, getDistanceSq, getDistanceSq, getX, getY, isDragInProgress, moveTo_silent, moveTo, openPropertyDialog, prepareBoudingBoxEvent, removePropertyChangeListener, rollbackDragAndDrop, setColor_silent, setColor, setX_silent, setX, setY_silent, setY, startDragAndDrop, suspendDragAndDrop |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
FRIENDLYNAME
public static final String FRIENDLYNAME
- The friendly name of objects of this class.
CURSOR
private static final Cursor CURSOR
- The mouse cursor for this object.
l2dLine
private Line2D.Double l2dLine
- The
Line2D
object used to compute distances.
Segment
public Segment(int iX,
int iY,
Color colColor,
int iWidth,
int iHeight)
- Creates a new
Segment
with specified position, color, "width" and "height".
getCursor
public Cursor getCursor()
- Returns the mouse cursor for this object.
- Overrides:
getCursor
in class GraphicalObject
getFriendlyName
public String getFriendlyName()
- Returns the friendly name of this segment.
- Overrides:
getFriendlyName
in class GraphicalObject
paint
public void paint(Graphics g)
- Paints this segment.
- Overrides:
paint
in class GraphicalObject
getDistanceSq
public int getDistanceSq(Point ptPoint)
- Returns the square of the minimal distance between this segment and the specified point.
- Overrides:
getDistanceSq
in class GraphicalObject
updateCachedData
protected void updateCachedData()
- Invoked when cached data have to be updated.
- Overrides:
updateCachedData
in class GraphicalObject