org.eclipse.etrice.ui.behavior.support
Class SupportUtil

java.lang.Object
  extended by org.eclipse.etrice.ui.behavior.support.SupportUtil

public class SupportUtil
extends java.lang.Object

Author:
Henrik Rentz-Reichert - Initial contribution and API

Constructor Summary
SupportUtil()
           
 
Method Summary
static void addChoicePoint(ChoicePoint cp, ContainerShape sgShape, int pos, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static void addChoicePoints(java.util.List<ChoicePoint> cps, ContainerShape sgShape, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static void addInitialPointIff(java.util.List<Transition> transitions, ContainerShape sgShape, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static void addState(State s, ContainerShape sgShape, int pos, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static void addStates(java.util.List<State> states, ContainerShape sgShape, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static void addTransitionPoints(java.util.List<TrPoint> trps, ContainerShape sgShape, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static void addTransitions(java.util.List<Transition> transitions, ContainerShape sgShape, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static void addTrPoint(TrPoint tp, ContainerShape sgShape, int pos, IFeatureProvider fp, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static boolean canConnect(Anchor asrc, Anchor atgt, ContainerShape cs, IFeatureProvider fp)
           
static boolean canConnect(Anchor asrc, Anchor atgt, Transition trans, ContainerShape cs, IFeatureProvider fp)
           
static void deleteSubStructureRecursive(State s, ActorClass ac, Diagram diagram, IFeatureProvider fp)
           
static ActorClass getActorClass(Diagram diag)
           
static void getAnchors(State state, PictogramElement stateShape, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static java.util.List<ChoicePoint> getChoicePoints(ContainerShape shape, IFeatureProvider fp)
           
static java.util.List<ChoicePoint> getChoicePoints(ContainerShape shape, IFeatureProvider fp, java.util.Map<java.lang.String,Anchor> item2anchor)
           
static Diagram getDiagram(GraphicsAlgorithm ga)
           
static Diagram getDiagram(PictogramElement pe)
           
static java.lang.String getKey(EObject obj, StateGraph sg)
           
static StateGraph getStateGraph(ContainerShape cs, IFeatureProvider fp)
           
static ContainerShape getStateGraphContainer(ContainerShape shape)
          This method exploits the fact that the immediate children of the diagram are associated with the state graphs.
static java.util.List<State> getStates(ContainerShape shape, IFeatureProvider fp)
           
static java.util.List<State> getStates(ContainerShape shape, IFeatureProvider fp, java.util.Map<java.lang.String,Anchor> item2anchor)
           
static void getSubTpAnchors(ContainerShape sgShape, java.util.HashMap<java.lang.String,Anchor> node2anchor)
           
static State getTargettingState(State state, Diagram diagram)
           
static java.util.List<Transition> getTransitions(Diagram diagram, IFeatureProvider fp)
           
static TransitionTerminal getTransitionTerminal(Anchor anchor, IFeatureProvider fp)
           
static java.util.List<TrPoint> getTrPoints(StateGraph sg, ContainerShape shape, IFeatureProvider fp)
           
static java.util.List<TrPoint> getTrPoints(StateGraph sg, ContainerShape shape, IFeatureProvider fp, java.util.Map<java.lang.String,Anchor> item2anchor)
           
static StateGraph insertRefinedState(StateGraph sg, ActorClass ac, ContainerShape targetContainer, IFeatureProvider fp)
           
static boolean isInherited(Diagram diag, EObject obj)
           
static boolean isInherited(StateGraphItem item, ContainerShape cs)
           
static boolean isInitialPoint(Anchor anchor, IFeatureProvider fp)
           
static void undoInsertRefinedState(StateGraph sg, ActorClass ac, ContainerShape targetContainer, IFeatureProvider fp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SupportUtil

public SupportUtil()
Method Detail

isInherited

public static boolean isInherited(StateGraphItem item,
                                  ContainerShape cs)

isInherited

public static boolean isInherited(Diagram diag,
                                  EObject obj)

getDiagram

public static Diagram getDiagram(GraphicsAlgorithm ga)

getDiagram

public static Diagram getDiagram(PictogramElement pe)
Parameters:
pictogramElement -
Returns:

getActorClass

public static ActorClass getActorClass(Diagram diag)

insertRefinedState

public static StateGraph insertRefinedState(StateGraph sg,
                                            ActorClass ac,
                                            ContainerShape targetContainer,
                                            IFeatureProvider fp)
Parameters:
sg -
ac -
targetContainer -
fp -
Returns:

undoInsertRefinedState

public static void undoInsertRefinedState(StateGraph sg,
                                          ActorClass ac,
                                          ContainerShape targetContainer,
                                          IFeatureProvider fp)
Parameters:
sg -
ac -
targetContainer -

getTargettingState

public static State getTargettingState(State state,
                                       Diagram diagram)
Parameters:
state -
diagram -
Returns:

getStateGraphContainer

public static ContainerShape getStateGraphContainer(ContainerShape shape)
This method exploits the fact that the immediate children of the diagram are associated with the state graphs.

Parameters:
shape -
Returns:
the container shape that is associated with the state graph of the diagram

getStateGraph

public static StateGraph getStateGraph(ContainerShape cs,
                                       IFeatureProvider fp)

getTransitionTerminal

public static TransitionTerminal getTransitionTerminal(Anchor anchor,
                                                       IFeatureProvider fp)

isInitialPoint

public static boolean isInitialPoint(Anchor anchor,
                                     IFeatureProvider fp)

canConnect

public static boolean canConnect(Anchor asrc,
                                 Anchor atgt,
                                 ContainerShape cs,
                                 IFeatureProvider fp)

canConnect

public static boolean canConnect(Anchor asrc,
                                 Anchor atgt,
                                 Transition trans,
                                 ContainerShape cs,
                                 IFeatureProvider fp)

deleteSubStructureRecursive

public static void deleteSubStructureRecursive(State s,
                                               ActorClass ac,
                                               Diagram diagram,
                                               IFeatureProvider fp)
Parameters:
s - the state whose sub structure should be deleted
ac - the ActorClass
diagram - the current diagram
fp - the feature provider

getStates

public static java.util.List<State> getStates(ContainerShape shape,
                                              IFeatureProvider fp)

getStates

public static java.util.List<State> getStates(ContainerShape shape,
                                              IFeatureProvider fp,
                                              java.util.Map<java.lang.String,Anchor> item2anchor)

getChoicePoints

public static java.util.List<ChoicePoint> getChoicePoints(ContainerShape shape,
                                                          IFeatureProvider fp)

getChoicePoints

public static java.util.List<ChoicePoint> getChoicePoints(ContainerShape shape,
                                                          IFeatureProvider fp,
                                                          java.util.Map<java.lang.String,Anchor> item2anchor)
Parameters:
shape -
fp -
Returns:

getTrPoints

public static java.util.List<TrPoint> getTrPoints(StateGraph sg,
                                                  ContainerShape shape,
                                                  IFeatureProvider fp)

getTrPoints

public static java.util.List<TrPoint> getTrPoints(StateGraph sg,
                                                  ContainerShape shape,
                                                  IFeatureProvider fp,
                                                  java.util.Map<java.lang.String,Anchor> item2anchor)

getTransitions

public static java.util.List<Transition> getTransitions(Diagram diagram,
                                                        IFeatureProvider fp)
Parameters:
diagram -
fp -
Returns:

getSubTpAnchors

public static void getSubTpAnchors(ContainerShape sgShape,
                                   java.util.HashMap<java.lang.String,Anchor> node2anchor)
Parameters:
sgShape -
node2anchor -

addTransitions

public static void addTransitions(java.util.List<Transition> transitions,
                                  ContainerShape sgShape,
                                  IFeatureProvider fp,
                                  java.util.HashMap<java.lang.String,Anchor> node2anchor)

addTransitionPoints

public static void addTransitionPoints(java.util.List<TrPoint> trps,
                                       ContainerShape sgShape,
                                       IFeatureProvider fp,
                                       java.util.HashMap<java.lang.String,Anchor> node2anchor)

addTrPoint

public static void addTrPoint(TrPoint tp,
                              ContainerShape sgShape,
                              int pos,
                              IFeatureProvider fp,
                              java.util.HashMap<java.lang.String,Anchor> node2anchor)

addStates

public static void addStates(java.util.List<State> states,
                             ContainerShape sgShape,
                             IFeatureProvider fp,
                             java.util.HashMap<java.lang.String,Anchor> node2anchor)

addState

public static void addState(State s,
                            ContainerShape sgShape,
                            int pos,
                            IFeatureProvider fp,
                            java.util.HashMap<java.lang.String,Anchor> node2anchor)

addChoicePoints

public static void addChoicePoints(java.util.List<ChoicePoint> cps,
                                   ContainerShape sgShape,
                                   IFeatureProvider fp,
                                   java.util.HashMap<java.lang.String,Anchor> node2anchor)

addChoicePoint

public static void addChoicePoint(ChoicePoint cp,
                                  ContainerShape sgShape,
                                  int pos,
                                  IFeatureProvider fp,
                                  java.util.HashMap<java.lang.String,Anchor> node2anchor)

addInitialPointIff

public static void addInitialPointIff(java.util.List<Transition> transitions,
                                      ContainerShape sgShape,
                                      IFeatureProvider fp,
                                      java.util.HashMap<java.lang.String,Anchor> node2anchor)

getAnchors

public static void getAnchors(State state,
                              PictogramElement stateShape,
                              java.util.HashMap<java.lang.String,Anchor> node2anchor)

getKey

public static java.lang.String getKey(EObject obj,
                                      StateGraph sg)