public abstract class AbstractShapeHandle extends java.lang.Object implements IHandle
IHandle
's methods stubbed out so a subclass can only implement
what it is interested in.Modifier and Type | Field and Description |
---|---|
protected java.awt.Shape |
drawShape
The shape that represents this IHandle.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractShapeHandle() |
Modifier and Type | Method and Description |
---|---|
java.awt.Rectangle |
getBounds(DesignPanel panel)
Return the bounds of this handle, in 2d (zoomed) space.
|
java.lang.String |
getStatusBarText(int inputMask)
Called on mouseover and during drag to get the status bar text for the handle.
|
protected java.awt.Shape |
newDrawShape()
Called to create a new draw shape.
|
void |
onClick(int inputMask)
The mouse was clicked within the handle's bounds.
|
void |
onDrag(double dX,
double dY,
int inputMask)
Called while the handle is being dragged.
|
void |
onDragEnd(double dX,
double dY,
int inputMask)
The drag event is complete (mouse has been released).
|
void |
onDragStart(double dX,
double dY,
int inputMask)
The handle has started to be dragged.
|
void |
paintHandle(DesignPanel panel,
java.awt.Graphics2D g,
ShapePaint paint) |
protected abstract void |
position(java.awt.geom.Point2D.Double location)
Updates the argument location with the correct position of this handle's anchor point.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
paintHandle
protected java.awt.Shape drawShape
newDrawShape()
public void paintHandle(DesignPanel panel, java.awt.Graphics2D g, ShapePaint paint)
protected java.awt.Shape newDrawShape()
public java.awt.Rectangle getBounds(DesignPanel panel)
IHandle
protected abstract void position(java.awt.geom.Point2D.Double location)
public java.lang.String getStatusBarText(int inputMask)
IHandle
getStatusBarText
in interface IHandle
public void onClick(int inputMask)
IHandle
public void onDrag(double dX, double dY, int inputMask)
IHandle
onDrag
in interface IHandle
dX
- The distance along the horizontal axis away from the drag starting point. (Unzoomed, logical)dY
- The distance along the vertical axis away from the drag starting point. (Unzoomed, logical)inputMask
- The extended modifiers from the underlying mouse drag (see MouseEvent.getModifiersEx()
.)public void onDragStart(double dX, double dY, int inputMask)
IHandle
onDragStart
in interface IHandle
dX
- The distance along the horizontal axis away from the drag starting point. (Unzoomed, logical)dY
- The distance along the vertical axis away from the drag starting point. (Unzoomed, logical)inputMask
- The extended modifiers from the underlying mouse drag (see MouseEvent.getModifiersEx()
.)public void onDragEnd(double dX, double dY, int inputMask)
IHandle
onDragEnd
in interface IHandle
dX
- The distance along the horizontal axis away from the drag starting point. (Unzoomed, logical)dY
- The distance along the vertical axis away from the drag starting point. (Unzoomed, logical)inputMask
- The extended modifiers from the underlying mouse drag (see MouseEvent.getModifiersEx()
.)