net.sf.latexdraw.instruments
Class Border.DnD2Scale

java.lang.Object
  extended by org.malai.instrument.Link<ScaleShapes,DnD,Border>
      extended by net.sf.latexdraw.instruments.Border.DnD2Scale
All Implemented Interfaces:
InteractionHandler
Enclosing class:
Border

private static class Border.DnD2Scale
extends Link<ScaleShapes,DnD,Border>

This link maps a DnD interaction on a scale handler to an action that scales the selection.


Field Summary
protected  IPoint p1
          The point corresponding to the 'press' position.
protected  double xGap
          The x gap (gap between the pressed position and the targeted position) of the X-scaling.
protected  double yGap
          The y gap (gap between the pressed position and the targeted position) of the Y-scaling.
 
Fields inherited from class org.malai.instrument.Link
action, clazzAction, execute, instrument, interaction
 
Constructor Summary
protected Border.DnD2Scale(Border ins)
           
 
Method Summary
private  ScaleHandler getScaleHandler()
           
 void initAction()
          After being created by method createAction, the action must be initialised by this method.
 void interimFeedback()
          Defines the interim feedback of the link.
 boolean isConditionRespected()
           
private  void setXGap(IShape.Position refPosition, IPoint tl, IPoint br)
           
private  void setYGap(IShape.Position refPosition, IPoint tl, IPoint br)
           
 void updateAction()
          Updates the current action.
 
Methods inherited from class org.malai.instrument.Link
addEventable, clearEvents, createAction, getAction, getInstrument, getInteraction, interactionAborts, interactionStarts, interactionStops, interactionUpdates, isActivated, isExecute, isInteractionMustBeAborted, isRunnable, isRunning, setActivated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

p1

protected IPoint p1
The point corresponding to the 'press' position.


xGap

protected double xGap
The x gap (gap between the pressed position and the targeted position) of the X-scaling.


yGap

protected double yGap
The y gap (gap between the pressed position and the targeted position) of the Y-scaling.

Constructor Detail

Border.DnD2Scale

protected Border.DnD2Scale(Border ins)
                    throws java.lang.InstantiationException,
                           java.lang.IllegalAccessException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
Method Detail

setXGap

private void setXGap(IShape.Position refPosition,
                     IPoint tl,
                     IPoint br)

setYGap

private void setYGap(IShape.Position refPosition,
                     IPoint tl,
                     IPoint br)

initAction

public void initAction()
Description copied from class: Link
After being created by method createAction, the action must be initialised by this method.

Specified by:
initAction in class Link<ScaleShapes,DnD,Border>

updateAction

public void updateAction()
Description copied from class: Link
Updates the current action. To override.

Overrides:
updateAction in class Link<ScaleShapes,DnD,Border>

isConditionRespected

public boolean isConditionRespected()
Specified by:
isConditionRespected in class Link<ScaleShapes,DnD,Border>
Returns:
True if the condition of the link is respected.

interimFeedback

public void interimFeedback()
Description copied from class: Link
Defines the interim feedback of the link. If overridden, the interim feedback of its instrument should be define too.

Overrides:
interimFeedback in class Link<ScaleShapes,DnD,Border>

getScaleHandler

private ScaleHandler getScaleHandler()