public abstract class ProcessModel extends java.lang.Object implements ProcessObjectListener, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_ID |
static java.lang.String |
ATTR_NAME |
static java.lang.String |
ATTR_PARENT_REF
Optional attribute that references to the model that has a reference to the actual model (and was used to open it)
|
static java.lang.String |
ATTR_TYPE |
static java.lang.String |
ATTR_XMLNS
Serialization properties
|
static java.lang.String |
ATTR_XMLNS_XSI |
static java.lang.String |
ATTR_XSI_SCHEMALOCATION |
protected java.lang.String |
id |
protected java.util.Map<ProcessNode,java.util.List<ProcessEdge>> |
precEdgeCache
A cache for the incoming edges of a node
|
protected java.util.Map<ProcessNode,java.util.List<ProcessNode>> |
predecessorCache
A cache for the predecessors of a node
|
protected ProcessUtils |
processUtils
An instance of a sub-class of ProcessUtils
|
static java.lang.String |
PROP_AUTHOR
The author of this ProcessModel
|
static java.lang.String |
PROP_COMMENT
A comment for this ProcessModel
|
static java.lang.String |
PROP_CREATE_DATE
The creation date of the ProcessModel
|
static java.lang.String |
PROP_EDITOR
A field for the owner of this model (if applicable
|
static java.lang.String |
PROP_FOLDERALIAS
An optional property holding the source folder alias
|
static java.lang.String |
PROP_LASTCHECKIN
The last time this model was changed
|
static java.lang.String |
PROP_PROCESS_NAME
The name of the ProcessModel
|
static java.lang.String |
PROP_PROCESS_URI
The URI for this model (if applicable)
|
static java.lang.String |
PROP_SOURCE_VERSION
The source version of this ProcessModel (optional)
|
static java.lang.String |
TAG_EDGES |
static java.lang.String |
TAG_MODEL |
static java.lang.String |
TAG_NODES |
static java.lang.String |
TAG_PROPERTIES |
protected java.util.LinkedList<ProcessNode> |
topLevelNodesCache
A cache for the top level nodes
|
static java.lang.String |
VALUE_XMLNS |
static java.lang.String |
VALUE_XMLNS_XSI |
static java.lang.String |
VALUE_XSI_SCHEMALOCATION |
protected java.util.List<ProcessNode> |
visibleNodesCache
A cache for the currently visible nodes
|
Constructor and Description |
---|
ProcessModel()
Creates a new ProcessModel.
|
ProcessModel(java.lang.String name)
Creates a new ProcessModel with a name.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(ProcessEdge f)
Adds a process edge to the model.
|
void |
addListener(ProcessModelListener listener)
Adds a listener to this ProcessModel.
|
void |
addNode(ProcessNode node)
Adds a process node to the model.
|
void |
addObject(ProcessObject object) |
void |
addTransactionHandler(TransactionHandlerInterface h)
Adds a transaction handler.
|
protected void |
clearCaches()
Clears the caches after a model change.
|
ProcessModel |
clone()
Creates a deep-copy of this ProcessModel, including all edges and
nodes, but NOT listeners AND only reference to transient properties.
|
ProcessModel |
clonePersistent()
Like clone, but does not copy transient properties.
|
AttachedNode |
getAttachedNode(ProcessNode parent) |
AttachedNodeHandler |
getAttachedNodeHandler()
Returns an (optional) AttachedNodeHandler.
|
java.awt.Color |
getBackgroundColor() |
Cluster |
getClusterForNode(ProcessNode node)
Returns the Cluster where the ProcessNode is contained, null
if not in any Cluster.
|
java.util.List<Cluster> |
getClusters()
Returns the list of contained Clusters.
|
ProcessEdge |
getConnectingEdge(ProcessNode node1,
ProcessNode node2) |
java.util.List<java.lang.Class<? extends ProcessNode>> |
getCreateableNodeClasses() |
java.lang.String |
getCreationDate()
Returns the creation date of this ProcessModel.
|
abstract java.lang.String |
getDescription()
Returns a single string describing the kind of model this ProcessModel
supports.
|
java.util.List<ProcessEdge> |
getEdges()
Returns the list of process edges.
|
java.lang.String |
getId()
Returns the id of this ProcessModel
|
java.util.List<ProcessEdge> |
getIncomingEdges(java.lang.Class<? extends ProcessEdge> type,
ProcessNode node)
Returns all incoming Edges of a certain type.
|
java.util.List<ProcessNode> |
getNeighbourNodes(java.lang.Class<? extends ProcessEdge> type,
ProcessNode node)
Returns all nodes that are connected via exactly one edge to the given node
|
ProcessNode |
getNodeAt(java.awt.Point p)
Returns the ProcessNode of the model that lies on the given position
|
ProcessNode |
getNodeById(java.lang.String id)
Returns the ProcessNode of the model that belongs to a certain id.
|
java.util.LinkedList<ProcessNode> |
getNodeByName(java.lang.String name)
Returns the ProcessNode(s) of the model that have the given name.
|
java.util.List<ProcessNode> |
getNodes()
Returns the list of contained process nodes.
|
java.util.List<ProcessNode> |
getNodesByClass(java.lang.Class<?> c)
Returns a list of all contained nodes with a certain class.
|
ProcessObject |
getObjectById(java.lang.String id) |
java.util.List<ProcessObject> |
getObjects()
Returns all ProcessObjects (combination of Nodes and Edges) in this
model.
|
java.util.List<ProcessEdge> |
getOutgoingEdges(java.lang.Class<? extends ProcessEdge> type,
ProcessNode node)
Returns all outgoing edges of a certain type.
|
java.util.List<ProcessNode> |
getPrecedingNodes(java.lang.Class<? extends ProcessEdge> type,
ProcessNode node)
Returns all nodes that lead to the given Node directly.
|
java.util.List<ProcessEdge> |
getPreceedingEdges(ProcessNode node) |
java.util.List<ProcessNode> |
getPredecessors(ProcessNode n)
Returns the list of predecessor nodes for a node n.
|
java.lang.String |
getProcessModelURI()
Returns the URI for this ProcessModel.
|
java.lang.String |
getProcessName()
Returns the name of the process model.
|
java.lang.String |
getProperty(java.lang.String key)
Returns a property.
|
java.util.Set<java.lang.String> |
getPropertyKeys()
Returns the set of keys of the properties.
|
org.w3c.dom.Document |
getSerialization()
Returns a serialization of the Process Model.
|
java.awt.Dimension |
getSize()
Returns the dimension of this model.
|
java.util.List<ProcessNode> |
getSucceedingNodes(java.lang.Class<? extends ProcessEdge> type,
ProcessNode node)
Returns all nodes that follow the given Node directly.
|
java.util.List<ProcessNode> |
getSuccessors(ProcessNode n)
Returns the list of successor nodes for a node n.
|
abstract java.util.List<java.lang.Class<? extends ProcessEdge>> |
getSupportedEdgeClasses()
Returns the list of supported edge classes for this model.
|
abstract java.util.List<java.lang.Class<? extends ProcessNode>> |
getSupportedNodeClasses()
Returns the list of supported node classes for this model.
|
java.util.LinkedList<ProcessNode> |
getTopLevelNodes()
This method returns the top level nodes of this model (i.e. all that
are not contained in a Cluster)
|
java.lang.Object |
getTransientProperty(java.lang.String key)
Returns a transient (non-serialized) property.
|
java.util.Set<java.lang.String> |
getTransientPropertyKeys()
Returns the currently registered transient property keys.
|
ProcessUtils |
getUtils()
Returns the corresponding ProcessUtils.
|
java.util.List<ProcessNode> |
getVisibleNodes()
This method returns a list of all currently vissible nodes, i.e.
|
protected void |
init() |
boolean |
isDirty() |
boolean |
isLayouted()
Returns false if all of the nodes of this ProcessModel are located at
(0,0).
|
boolean |
isOnlineModel()
Checks whether this model has an URI on a server, so that it can be found online.
|
void |
markAsDirty(boolean dirty) |
void |
moveAfter(ProcessNode n,
ProcessNode baseNode)
Moves the given ProcessNode n after the ProcessNode baseNode; i.e.
|
void |
moveToBack(ProcessNode n)
Moves the given ProcessNode to the start of the NodeList; i.e. it
should be drawn first.
|
void |
moveToFront(ProcessNode n)
Moves the given ProcessNode to the end of the NodeList; i.e. it
should be drawn last.
|
void |
propertyChanged(ProcessObject o,
java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue) |
void |
removeEdge(ProcessEdge f)
Removes a process edge from the model.
|
void |
removeListener(ProcessModelListener listener)
Removes a istener from this ProcessModel.
|
void |
removeNode(ProcessNode node)
Removes a ProcessNode from the ProcessModel (incl. edges).
|
void |
removeNode(ProcessNode node,
boolean includeEdges)
Removes a ProcessNode from the ProcessModel (care of Edge handling
required).
|
void |
removeObject(ProcessObject object) |
void |
removeObject(ProcessObject object,
boolean includeEdges) |
void |
removeProperty(java.lang.String key)
Removes a property.
|
void |
removeTransactionHandler(TransactionHandlerInterface h)
Removes a transaction handler.
|
void |
removeTransientProperty(java.lang.String key)
Removes a transient (non-serialized) property.
|
void |
setBackgroundColor(java.awt.Color c) |
void |
setId(java.lang.String id)
Sets the id of this ProcessModel.
|
void |
setProcessModelURI(java.lang.String processModelURI)
Sets the URI for this ProcessModel.
|
void |
setProcessName(java.lang.String processName)
Sets the name for this process model.
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets a property.
|
void |
setTransientProperty(java.lang.String key,
java.lang.Object value)
Sets a transient (non-serialized) property.
|
void |
setUtils(ProcessUtils utils)
Sets the ProcessUtils.
|
void |
startTransaction()
Starts a transaction on this model.
|
void |
stopTransaction()
Ends a transaction on this model.
|
void |
substitute(ProcessObject original,
ProcessObject substituteBy) |
void |
substitute(ProcessObject original,
ProcessObject substituteBy,
boolean onlyUpdateEnvironment) |
java.lang.String |
toString()
Returns a short textual description of the process model.
|
public static final java.lang.String ATTR_XMLNS
public static final java.lang.String VALUE_XMLNS
public static final java.lang.String ATTR_XMLNS_XSI
public static final java.lang.String VALUE_XMLNS_XSI
public static final java.lang.String ATTR_XSI_SCHEMALOCATION
public static final java.lang.String VALUE_XSI_SCHEMALOCATION
public static final java.lang.String TAG_MODEL
public static final java.lang.String TAG_NODES
public static final java.lang.String TAG_EDGES
public static final java.lang.String TAG_PROPERTIES
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_TYPE
public static final java.lang.String ATTR_ID
public static final java.lang.String ATTR_PARENT_REF
protected ProcessUtils processUtils
protected java.util.Map<ProcessNode,java.util.List<ProcessNode>> predecessorCache
protected java.util.LinkedList<ProcessNode> topLevelNodesCache
protected java.util.List<ProcessNode> visibleNodesCache
protected java.util.Map<ProcessNode,java.util.List<ProcessEdge>> precEdgeCache
protected java.lang.String id
public static final java.lang.String PROP_PROCESS_NAME
public static final java.lang.String PROP_PROCESS_URI
public static final java.lang.String PROP_EDITOR
public static final java.lang.String PROP_CREATE_DATE
public static final java.lang.String PROP_AUTHOR
public static final java.lang.String PROP_COMMENT
public static final java.lang.String PROP_SOURCE_VERSION
public static final java.lang.String PROP_FOLDERALIAS
public static final java.lang.String PROP_LASTCHECKIN
public ProcessModel()
public ProcessModel(java.lang.String name)
name
- protected void init()
public void markAsDirty(boolean dirty)
public boolean isDirty()
public abstract java.lang.String getDescription()
protected void clearCaches()
public ProcessModel clonePersistent() throws java.lang.Exception
java.lang.Exception
public ProcessModel clone()
clone
in class java.lang.Object
public ProcessNode getNodeById(java.lang.String id)
id
- public java.util.LinkedList<ProcessNode> getNodeByName(java.lang.String name)
id
- public ProcessObject getObjectById(java.lang.String id)
public ProcessNode getNodeAt(java.awt.Point p)
id
- public AttachedNodeHandler getAttachedNodeHandler()
public void addListener(ProcessModelListener listener)
listener
- public void removeListener(ProcessModelListener listener)
listener
- public java.lang.String getProcessName()
public void setProcessName(java.lang.String processName)
processName
- public java.lang.String getId()
public void setId(java.lang.String id)
id
- public java.lang.String getProcessModelURI()
public void setProcessModelURI(java.lang.String processModelURI)
processModelURI
- public java.lang.String getCreationDate()
public void addEdge(ProcessEdge f)
f
- public void removeEdge(ProcessEdge f)
f
- public java.util.List<ProcessEdge> getEdges()
public void addNode(ProcessNode node)
o
- public void removeNode(ProcessNode node)
o
- public void removeNode(ProcessNode node, boolean includeEdges)
node
- public java.util.List<ProcessNode> getNodes()
public java.util.List<ProcessNode> getNodesByClass(java.lang.Class<?> c)
c
- public java.util.List<Cluster> getClusters()
public java.util.List<ProcessObject> getObjects()
public Cluster getClusterForNode(ProcessNode node)
node
- public java.util.List<ProcessNode> getSuccessors(ProcessNode n)
n
- public java.util.List<ProcessNode> getPredecessors(ProcessNode n)
n
- public abstract java.util.List<java.lang.Class<? extends ProcessNode>> getSupportedNodeClasses()
public java.util.List<java.lang.Class<? extends ProcessNode>> getCreateableNodeClasses()
public java.awt.Dimension getSize()
public abstract java.util.List<java.lang.Class<? extends ProcessEdge>> getSupportedEdgeClasses()
public ProcessUtils getUtils()
public void setUtils(ProcessUtils utils)
utils
- public void moveAfter(ProcessNode n, ProcessNode baseNode)
n
- baseNode
- public void moveToBack(ProcessNode n)
n
- public void moveToFront(ProcessNode n)
n
- public boolean isLayouted()
public boolean isOnlineModel()
public java.util.List<ProcessEdge> getIncomingEdges(java.lang.Class<? extends ProcessEdge> type, ProcessNode node)
type
- node
- public java.util.List<ProcessEdge> getOutgoingEdges(java.lang.Class<? extends ProcessEdge> type, ProcessNode node)
type
- node
- public java.util.List<ProcessNode> getSucceedingNodes(java.lang.Class<? extends ProcessEdge> type, ProcessNode node)
type
- connecting edge need to be descendant of given typenode
- public java.util.List<ProcessNode> getPrecedingNodes(java.lang.Class<? extends ProcessEdge> type, ProcessNode node)
type
- connecting edge need to be descendant of given typenode
- public java.util.List<ProcessNode> getNeighbourNodes(java.lang.Class<? extends ProcessEdge> type, ProcessNode node)
type
- connecting edge need to be descendant of given typenode
- public java.lang.String toString()
toString
in class java.lang.Object
public org.w3c.dom.Document getSerialization() throws java.lang.Exception
java.lang.Exception
public void setProperty(java.lang.String key, java.lang.String value)
key
- value
- public void removeProperty(java.lang.String key)
key
- public java.lang.String getProperty(java.lang.String key)
key
- public java.util.Set<java.lang.String> getPropertyKeys()
public void setTransientProperty(java.lang.String key, java.lang.Object value)
key
- value
- public void removeTransientProperty(java.lang.String key)
key
- public java.lang.Object getTransientProperty(java.lang.String key)
key
- public java.util.Set<java.lang.String> getTransientPropertyKeys()
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color c)
public void addObject(ProcessObject object)
object
- java.lang.Exception
public void removeObject(ProcessObject object)
object
- public void removeObject(ProcessObject object, boolean includeEdges)
public void substitute(ProcessObject original, ProcessObject substituteBy, boolean onlyUpdateEnvironment)
public void substitute(ProcessObject original, ProcessObject substituteBy)
public ProcessEdge getConnectingEdge(ProcessNode node1, ProcessNode node2)
public AttachedNode getAttachedNode(ProcessNode parent)
public java.util.LinkedList<ProcessNode> getTopLevelNodes()
public java.util.List<ProcessNode> getVisibleNodes()
public java.util.List<ProcessEdge> getPreceedingEdges(ProcessNode node)
public void startTransaction()
public void stopTransaction()
public void addTransactionHandler(TransactionHandlerInterface h)
h
- public void removeTransactionHandler(TransactionHandlerInterface h)
h
- public void propertyChanged(ProcessObject o, java.lang.String key, java.lang.String oldValue, java.lang.String newValue)
propertyChanged
in interface ProcessObjectListener