http://www.jpicedt.org

jpicedt.graphic.toolkit
Class AbstractMouseTransformFactory.SelectAreaTransform

java.lang.Object
  extended by jpicedt.graphic.toolkit.AbstractMouseTransformFactory.SelectAreaTransform
All Implemented Interfaces:
MouseTransform
Direct Known Subclasses:
EditConvexZoneMouseTransformFactory.SelectConvexZonesInAreaTransform, EditElementMouseTransformFactory.SelectElementsInAreaTransform, EditPointMouseTransformFactory.SelectPointsInAreaTransform
Enclosing class:
AbstractMouseTransformFactory

protected class AbstractMouseTransformFactory.SelectAreaTransform
extends 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
protected AbstractMouseTransformFactory.SelectAreaTransform()
           
 
Method Summary
 Rectangle2D getClipRectangle()
          Returns a rectangle defining the clip boundary for this mouse-transform, in model-coordinates
 Cursor getCursor()
          Return the cursor for this MouseTransform
 String getHelpMessage()
          Return a help-message for the UI, that makes sense with this transform.
protected  Rectangle2D getSelectionRectangle()
          Return the selection rectangle as built from the first mouse-pressed event and the current drag position.
 boolean next(PEMouseEvent e)
          Called when the mouse is released.
 void paint(Graphics2D g, Rectangle2D allocation, double scale)
          Rendu de la plage rectangulaire sélectionnée.
 void process(PEMouseEvent e)
          Called when the mouse is dragged.
 void start(PEMouseEvent e)
          Invoked by mousePressed().
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMouseTransformFactory.SelectAreaTransform

protected AbstractMouseTransformFactory.SelectAreaTransform()
Method Detail

getSelectionRectangle

protected final 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:
start in interface MouseTransform

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:
process in interface MouseTransform

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:
next in interface MouseTransform
Returns:
true if there's another task in the sequence, false if mouse-transform has completed with this mouse-event.

paint

public void paint(Graphics2D g,
                  Rectangle2D allocation,
                  double scale)
Rendu de la plage rectangulaire sélectionnée.

Specified by:
paint in interface MouseTransform
Parameters:
scale - le facteur d'échelle Graphics2D entre modèle et vue.

getClipRectangle

public Rectangle2D getClipRectangle()
Returns a rectangle defining the clip boundary for this mouse-transform, in model-coordinates


getHelpMessage

public String getHelpMessage()
Description copied from interface: MouseTransform
Return a help-message for the UI, that makes sense with this transform.

Specified by:
getHelpMessage in interface MouseTransform
Returns:
A help-message for the UI, that makes sense with this transform.

toString

public String toString()
Overrides:
toString in class Object
Returns:
a textual representation of this transform for debugging purpose

getCursor

public Cursor getCursor()
Description copied from interface: MouseTransform
Return the cursor for this MouseTransform

Specified by:
getCursor in interface MouseTransform
Returns:
a cursor adequate with this mouse-transform, delegating to CursorFactory.

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org