net.sf.latexdraw.instruments
Class MultiClic2AddShape

java.lang.Object
  extended by org.malai.instrument.Link<AddShape,I,Pencil>
      extended by net.sf.latexdraw.instruments.PencilLink<MultiClick>
          extended by net.sf.latexdraw.instruments.MultiClic2AddShape
All Implemented Interfaces:
InteractionHandler

 class MultiClic2AddShape
extends PencilLink<MultiClick>

This link allows to create shapes using a multi-clic interaction.


Field Summary
 
Fields inherited from class org.malai.instrument.Link
action, clazzAction, execute, instrument, interaction
 
Constructor Summary
protected MultiClic2AddShape(Pencil ins, boolean exec)
          The constructor by default.
 
Method Summary
 void initAction()
          After being created by method createAction, the action must be initialised by this method.
 void interactionStarts(Interaction inter)
          Happens when the interaction quits its initial state.
 void interimFeedback()
          Defines the interim feedback of the link.
 boolean isConditionRespected()
           
 boolean isInteractionMustBeAborted()
          Sometimes the interaction of two different links can overlap themselves.
 void updateAction()
          Updates the current action.
 
Methods inherited from class org.malai.instrument.Link
addEventable, clearEvents, createAction, getAction, getInstrument, getInteraction, interactionAborts, interactionStops, interactionUpdates, isActivated, isExecute, isRunnable, isRunning, setActivated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiClic2AddShape

protected MultiClic2AddShape(Pencil ins,
                             boolean exec)
                      throws java.lang.InstantiationException,
                             java.lang.IllegalAccessException
The constructor by default.

Parameters:
ins - The pencil.
exec - True: the action will be executed each time the interaction is updated.
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
Since:
3.0
Method Detail

isInteractionMustBeAborted

public boolean isInteractionMustBeAborted()
Description copied from class: Link
Sometimes the interaction of two different links can overlap themselves. It provokes that the first interaction can stops while the second is blocked in a intermediary state. Two solutions are possible to avoid such a problem:
- the use of this function that perform some tests. If the test fails, the starting interaction is aborted and the resulting action is never created;
- the modification of one of the interactions to avoid the overlapping.

Overrides:
isInteractionMustBeAborted in class Link<AddShape,MultiClick,Pencil>
Returns:
True: if the starting interaction must be aborted so that the action is never created.

updateAction

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

Overrides:
updateAction in class Link<AddShape,MultiClick,Pencil>

initAction

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

Overrides:
initAction in class PencilLink<MultiClick>

isConditionRespected

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

interactionStarts

public void interactionStarts(Interaction inter)
                       throws MustAbortStateMachineException
Description copied from interface: InteractionHandler
Happens when the interaction quits its initial state.

Specified by:
interactionStarts in interface InteractionHandler
Overrides:
interactionStarts in class Link<AddShape,MultiClick,Pencil>
Parameters:
inter - The concerned interaction.
Throws:
MustAbortStateMachineException - If the interaction must be aborted.

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<AddShape,MultiClick,Pencil>