http://www.jpicedt.org

jpicedt.graphic.toolkit
Class EditElementMouseTransformFactory._MoveControlPointTransform

java.lang.Object
  extended by jpicedt.graphic.toolkit.AbstractMouseTransform
      extended by jpicedt.graphic.toolkit.EditElementMouseTransformFactory._MoveControlPointTransform
All Implemented Interfaces:
MouseTransform
Enclosing class:
EditElementMouseTransformFactory

protected class EditElementMouseTransformFactory._MoveControlPointTransform
extends AbstractMouseTransform

a mouse-transform that moves element's end-points, ie aka scales elements


Constructor Summary
EditElementMouseTransformFactory._MoveControlPointTransform(Element target, int pointIndex, EditPointConstraint constraint, String helpMessage, Grid grid)
           
 
Method Summary
 Cursor getCursor()
          Return the cursor for this MouseTransform
 String getHelpMessage()
          Return a help-message for the UI, that makes sense with this transform.
 boolean next(PEMouseEvent e)
          Called when the mouse is released.
 void process(PEMouseEvent e)
          Called when the mouse is dragged.
 String toString()
           
 
Methods inherited from class jpicedt.graphic.toolkit.AbstractMouseTransform
getClone, getTarget, paint, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditElementMouseTransformFactory._MoveControlPointTransform

public EditElementMouseTransformFactory._MoveControlPointTransform(Element target,
                                                                   int pointIndex,
                                                                   EditPointConstraint constraint,
                                                                   String helpMessage,
                                                                   Grid grid)
Parameters:
target - the element upon which is transform will act
pointIndex - index of the Element's point that will be moved
grid - the Grid instance used for alignment (if it's snap-on)
constraint - the geometrical constraint to be used when moving control-points ; may be null
helpMessage - if non-null, this will be displayed on mouse-move events instead of the default help-message for this mouse-transform.
See Also:
Element.setCtrlPt(int, jpicedt.graphic.PicPoint)
Method Detail

process

public void process(PEMouseEvent e)
Called when the mouse is dragged. If !isCompleted, sets the clone's point (with the index given as parameter in the constructor) to the current mouse position, or its nearet-neighbour on the grid if grid-snap is on.


next

public boolean next(PEMouseEvent e)
Called when the mouse is released. Updates the original element, then call superclass.

Specified by:
next in interface MouseTransform
Overrides:
next in class AbstractMouseTransform
Returns:
true if there's another task in the sequence, false if mouse-transform has completed with this mouse-event.

getHelpMessage

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

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

Returns:
a cursor adequate with this mouse-transform, delegating to CursorFactory. If the target-element of PicGroup, returns a cursor according to pointIndex.

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org