de.upb.swt.epctools.model
Class EPC

java.lang.Object
  extended by de.upb.swt.epctools.model.EPC
All Implemented Interfaces:
ModelListener
Direct Known Subclasses:
SimEPC

public class EPC
extends java.lang.Object
implements ModelListener

This class represents a complete EPC diagram with event and function nodes, connectors and arcs


Nested Class Summary
 class EPC.MappingCopy
           
 
Field Summary
static byte FALSE
           
private  java.util.Vector m_arcs
           
private  ModelIdManager m_id_manager
           
private  ModelListenerList m_listener
           
private  boolean m_multiple_folders
           
private  java.util.Vector m_nodes
           
protected  EPC m_this
           
static byte STRONG
           
static byte TRUE
           
static byte UNKNOWN
           
static byte WEAK
           
 
Fields inherited from interface de.upb.swt.epctools.model.tools.ModelListener
MSG_ARC_ADDED, MSG_ARC_RECONNECTED, MSG_ARC_REMOVED, MSG_BEND_POINT_CHANGE, MSG_CHANGED_ALGORITHM, MSG_CONSTRAINT_CHANGED, MSG_DESCRIPTION_CHANGED, MSG_FOLDERS_CHANGED, MSG_HIGHLIGHTING_CHANGED, MSG_IN_ARC_ADDED, MSG_IN_ARC_REMOVED, MSG_INFO_CHANGED, MSG_LOCATION_CHANGED, MSG_NAME_CHANGED, MSG_NODE_ADDED, MSG_NODE_REMOVED, MSG_OUT_ARC_ADDED, MSG_OUT_ARC_REMOVED, MSG_SIZE_CHANGED, MSG_SOURCE_CHANGED, MSG_STRUCTURE_CHANGED, MSG_TARGET_CHANGED
 
Constructor Summary
EPC()
          Initialization
 
Method Summary
 void addListener(ModelListener obj)
          ...
 void allowMultipleFolders(boolean flag)
          Set...
 boolean allowsMultipleFolders()
          Returns ture if Arcs can hold multiple folders, else it returns false meaning that Arcs can hold at most one folder.
 void forwardMessage(int message)
          Forwards a message to all listener objects.
 Arc getArc(int id)
          Returns the corresponding arc to an id.
 java.util.Vector getArcs()
          Returns a Vector with all Arcs related to "this" EPC.
 EPC getCopy()
          Returns a copy of "this" EPC
 EPC.MappingCopy getExactCopy()
          Returns a copy of "this" EPC with a map from the current Node set to the copied Node set.
 ModelIdManager getIdManager()
          Returns the IdManager; the IdManager computes unique id's for Nodes and Arcs.
 void getMessage(int msg_id)
          This function is called upon changes on the model object.
 Node getNode(int id)
          Returns the corresponding node to an id.
 java.util.Vector getNodes()
          Returns a Vector with all Nodes related to "this" EPC.
 boolean hasOnlyLocalNodes()
          Returns true iff all Nodes have locally defined semantics.
 boolean isConsistent()
          This function computes whether the epc is syntactically correct and can be used by a Simulator.
 byte isInContactSituation()
          Returns true if the EPC is in a contact situation in the actual state.
 boolean isReadyForSimulation()
          Returns true iff "this" EPC is ready for simulation.
 void removeListener(ModelListener obj)
          ...
 void resetFolders()
          Sets all folders to 0 for all Arcs
 void resetHighlighting()
          This function resets the Nodes highlighting so that no Node is highlighted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_this

protected EPC m_this

m_nodes

private java.util.Vector m_nodes

m_arcs

private java.util.Vector m_arcs

m_id_manager

private ModelIdManager m_id_manager

m_listener

private ModelListenerList m_listener

m_multiple_folders

private boolean m_multiple_folders

FALSE

public static final byte FALSE
See Also:
Constant Field Values

TRUE

public static final byte TRUE
See Also:
Constant Field Values

UNKNOWN

public static final byte UNKNOWN
See Also:
Constant Field Values

WEAK

public static final byte WEAK
See Also:
Constant Field Values

STRONG

public static final byte STRONG
See Also:
Constant Field Values
Constructor Detail

EPC

public EPC()
Initialization

Method Detail

addListener

public void addListener(ModelListener obj)
...


removeListener

public void removeListener(ModelListener obj)
...


forwardMessage

public void forwardMessage(int message)
Forwards a message to all listener objects.


getCopy

public EPC getCopy()
Returns a copy of "this" EPC


hasOnlyLocalNodes

public boolean hasOnlyLocalNodes()
Returns true iff all Nodes have locally defined semantics.


getMessage

public void getMessage(int msg_id)
This function is called upon changes on the model object. This function belongs to the ModelListener interface.

Specified by:
getMessage in interface ModelListener
Parameters:
msg_id - Message id

resetHighlighting

public void resetHighlighting()
This function resets the Nodes highlighting so that no Node is highlighted.


getIdManager

public ModelIdManager getIdManager()
Returns the IdManager; the IdManager computes unique id's for Nodes and Arcs.


getNodes

public java.util.Vector getNodes()
Returns a Vector with all Nodes related to "this" EPC.


getArcs

public java.util.Vector getArcs()
Returns a Vector with all Arcs related to "this" EPC.


getNode

public Node getNode(int id)
Returns the corresponding node to an id. Here we could optimize with a hashtable

Parameters:
id -

getArc

public Arc getArc(int id)
Returns the corresponding arc to an id. Here we could optimize with a hashtable

Parameters:
id -

getExactCopy

public EPC.MappingCopy getExactCopy()
Returns a copy of "this" EPC with a map from the current Node set to the copied Node set.


isConsistent

public boolean isConsistent()
This function computes whether the epc is syntactically correct and can be used by a Simulator.

Returns:
true if the epc is correct

isInContactSituation

public byte isInContactSituation()
Returns true if the EPC is in a contact situation in the actual state.


resetFolders

public void resetFolders()
Sets all folders to 0 for all Arcs


isReadyForSimulation

public boolean isReadyForSimulation()
Returns true iff "this" EPC is ready for simulation.


allowsMultipleFolders

public boolean allowsMultipleFolders()
Returns ture if Arcs can hold multiple folders, else it returns false meaning that Arcs can hold at most one folder.


allowMultipleFolders

public void allowMultipleFolders(boolean flag)
Set...