jdraw.graphicalobjects
Class Segment

java.lang.Object
  |
  +--jdraw.graphicalobjects.GraphicalObject
        |
        +--jdraw.graphicalobjects.SizedGraphicalObject
              |
              +--jdraw.graphicalobjects.Segment

public class Segment
extends SizedGraphicalObject

A graphical segment.


Field Summary
private static Cursor CURSOR
          The mouse cursor for this object.
static String FRIENDLYNAME
          The friendly name of objects of this class.
private  Line2D.Double l2dLine
          The Line2D object used to compute distances.
 
Fields inherited from class jdraw.graphicalobjects.SizedGraphicalObject
iHeight, iWidth
 
Fields inherited from class jdraw.graphicalobjects.GraphicalObject
bDragInProgress, colColor, iX, iY, lstPropertyChangeListeners, ptDragAndDropStartPosition, ptInitialObjectPosition, rectInitialBoundingBox
 
Constructor Summary
Segment(int iX, int iY, Color colColor, int iWidth, int iHeight)
          Creates a new Segment with specified position, color, "width" and "height".
 
Method Summary
 Cursor getCursor()
          Returns the mouse cursor for this object.
 int getDistanceSq(Point ptPoint)
          Returns the square of the minimal distance between this segment and the specified point.
 String getFriendlyName()
          Returns the friendly name of this segment.
 void paint(Graphics g)
          Paints this segment.
protected  void updateCachedData()
          Invoked when cached data have to be updated.
 
Methods inherited from class jdraw.graphicalobjects.SizedGraphicalObject
getBoundingBox, getHeight, getPropertyDialog, getWidth, setHeight, setWidth
 
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
 

Field Detail

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.
Constructor Detail

Segment

public Segment(int iX,
               int iY,
               Color colColor,
               int iWidth,
               int iHeight)
Creates a new Segment with specified position, color, "width" and "height".
Method Detail

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