jdraw.graphicalobjects
Class Rectangle
java.lang.Object
|
+--jdraw.graphicalobjects.GraphicalObject
|
+--jdraw.graphicalobjects.SizedGraphicalObject
|
+--jdraw.graphicalobjects.Rectangle
- public class Rectangle
- extends SizedGraphicalObject
A graphical rectangle.
Constructor Summary |
Rectangle(int iX,
int iY,
Color colColor,
int iWidth,
int iHeight)
Creates a new Rectangle 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.
ptCenter
private final Point ptCenter
- The center of this rectangle.
l2dTopLine
private Line2D.Double l2dTopLine
- The
Line2D
object used to compute distances from top edge.
l2dRightLine
private Line2D.Double l2dRightLine
- The
Line2D
object used to compute distances from right edge.
Rectangle
public Rectangle(int iX,
int iY,
Color colColor,
int iWidth,
int iHeight)
- Creates a new
Rectangle
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 retangle.
- Overrides:
getFriendlyName
in class GraphicalObject
paint
public void paint(Graphics g)
- Paints this rectangle.
- Overrides:
paint
in class GraphicalObject
getDistanceSq
public int getDistanceSq(Point ptPoint)
- Returns the square of the minimal distance between this rectangle 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