Package jpicedt.graphic.toolkit
Class AbstractMouseTransformFactory.SelectAreaTransform
- java.lang.Object
-
- jpicedt.graphic.toolkit.AbstractMouseTransformFactory.SelectAreaTransform
-
- All Implemented Interfaces:
MouseTransform
- Direct Known Subclasses:
EditElementMouseTransformFactory.SelectElementsInAreaTransform,EditPointMouseTransformFactory.SelectPointsInAreaTransform
- Enclosing class:
- AbstractMouseTransformFactory
protected class AbstractMouseTransformFactory.SelectAreaTransform extends java.lang.Object implements MouseTransform
a mouse-transform dedicated to select objects (Element's, control-point's,...) inside a rectangle dragged by the user. Only a skeletal implementation is provided here. This implementation grows the selection rectangle, yet where *really* selecting things is concerned, subclassers may override methods by calling super.method_name before hand.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSelectAreaTransform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Rectangle2DgetClipRectangle()Returns a rectangle defining the clip boundary for this mouse-transform, in model-coordinatesjava.awt.CursorgetCursor()Return the cursor for this MouseTransformjava.lang.StringgetHelpMessage()Return a help-message for the UI, that makes sense with this transform.protected java.awt.geom.Rectangle2DgetSelectionRectangle()Return the selection rectangle as built from the first mouse-pressed event and the current drag position.booleannext(PEMouseEvent e)Called when the mouse is released.voidpaint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)render the selection rectanglevoidprocess(PEMouseEvent e)Called when the mouse is dragged.voidstart(PEMouseEvent e)Invoked by mousePressed().java.lang.StringtoString()
-
-
-
Method Detail
-
getSelectionRectangle
protected final java.awt.geom.Rectangle2D getSelectionRectangle()
Return the selection rectangle as built from the first mouse-pressed event and the current drag position.
-
start
public void start(PEMouseEvent e)
Invoked by mousePressed(). This implementation simply initializes the geometry of the selection rectangle. Override if you must carry out specific selection operations on mousePressed().- Specified by:
startin interfaceMouseTransform
-
process
public void process(PEMouseEvent e)
Called when the mouse is dragged. This simply grows the selection rectangle. Override if you must carry out specific selection operations while the mouse is being dragged.- Specified by:
processin interfaceMouseTransform
-
next
public boolean next(PEMouseEvent e)
Called when the mouse is released. This implementation simply repaint the selection rectangle. Override if you must carry out specific selection operations while the mouse is being released.- Specified by:
nextin interfaceMouseTransform- Returns:
- true if there's another task in the sequence, false if mouse-transform has completed with this mouse-event.
-
paint
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)render the selection rectangle- Specified by:
paintin interfaceMouseTransform- Parameters:
scale- Graphics2D's current scale factor b/w model and view
-
getClipRectangle
public java.awt.geom.Rectangle2D getClipRectangle()
Returns a rectangle defining the clip boundary for this mouse-transform, in model-coordinates
-
getHelpMessage
public java.lang.String getHelpMessage()
Description copied from interface:MouseTransformReturn a help-message for the UI, that makes sense with this transform.- Specified by:
getHelpMessagein interfaceMouseTransform- Returns:
- a help-message for the UI, that makes sense with this transform.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a textual representation of this transform for debugging purpose
-
getCursor
public java.awt.Cursor getCursor()
Description copied from interface:MouseTransformReturn the cursor for this MouseTransform- Specified by:
getCursorin interfaceMouseTransform- Returns:
- a cursor adequate with this mouse-transform, delegating to CursorFactory.
-
-