de.cau.cs.kieler.synccharts.kivi
Class PointerEffect

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.AbstractEffect
      extended by de.cau.cs.kieler.synccharts.kivi.PointerEffect
All Implemented Interfaces:
IEffect

public class PointerEffect
extends AbstractEffect

Draws a transient arrow pointing to some target edit part. This pointer only requires one target (and no source). The pointer will either point towards the target or away from it. It can be configured such that the pointer will be located on either side of the pointed object. Much code is copied from the ArrowEffect.

Rating red

Constructor Summary
PointerEffect()
          Default constructor.
PointerEffect(EObject theTarget, Color theColor, int theLength, boolean isTowards, de.cau.cs.kieler.synccharts.kivi.PointerEffect.Direction theDirection, boolean connectionLayer)
          Create a new pointer (arrow with no concrete source) effect for the given target EObject.
 
Method Summary
 void execute()
          Execute the effect.
 boolean isMergeable()
          Determines whether this effect can be merged with previously scheduled effects.
 IEffect merge(IEffect other)
          Merge this effect with another effect.
 void undo()
          Attempt to undo the effect.
 
Methods inherited from class de.cau.cs.kieler.core.kivi.AbstractEffect
schedule, scheduleUndo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointerEffect

public PointerEffect()
Default constructor.


PointerEffect

public PointerEffect(EObject theTarget,
                     Color theColor,
                     int theLength,
                     boolean isTowards,
                     de.cau.cs.kieler.synccharts.kivi.PointerEffect.Direction theDirection,
                     boolean connectionLayer)
Create a new pointer (arrow with no concrete source) effect for the given target EObject. Attempts to find appropriate edit parts, will not do anything if target can not be found.

Parameters:
theTarget - the target EObject
theColor - the color to paint the arrow with
theLength - the length of the pointing arrow
isTowards - true iff the arrow should point towards the target, false if it should point away from the target
theDirection - determines the side where the pointer will be located, e.g. on center top (NORTH) or center right (NORTHEAST)
connectionLayer - true if the connection layer shall be used for drawing on instead of the figure of the source's parent
Method Detail

execute

public void execute()
Execute the effect.


undo

public void undo()
Attempt to undo the effect.

Specified by:
undo in interface IEffect
Overrides:
undo in class AbstractEffect

isMergeable

public boolean isMergeable()
Description copied from class: AbstractEffect
Determines whether this effect can be merged with previously scheduled effects.

Specified by:
isMergeable in interface IEffect
Overrides:
isMergeable in class AbstractEffect
Returns:
true if it can be merged, false if no search through the effect queue is necessary

merge

public IEffect merge(IEffect other)
Description copied from class: AbstractEffect
Merge this effect with another effect. Will return null if the effects can not be merged.

Specified by:
merge in interface IEffect
Overrides:
merge in class AbstractEffect
Parameters:
other - the effect to merge with
Returns:
the newly merged effect, or null if no merge was possible.