com.yworks.yfiles.bpmn.view
Class BpmnRealizerFactory

java.lang.Object
  extended bycom.yworks.yfiles.bpmn.view.BpmnRealizerFactory

public class BpmnRealizerFactory
extends Object

This is a factory for elements conforming to the Business Process Modeling Notation (BPMN).

Realizers for the different kinds of BPMN elements can be created (see the many createXXX methods of this class), queried for BPMN properties (see e.g. getType or isShadowEnabled), and updated (see e.g. setType or collapse and expand).

Changing the type of a BPMN node in a graph (using setType) is possible. Since changing the BPMN type may require changing the realizer and/or the grouping state, this is only supported for nodes that belong to a graph with a hierarchy manager (but not for (unbound) realizers). BPMN nodes with ProxyShapeNodeRealizers are supported, if the proxy realizers are not nested.

Changing the type of a BPMN edge in a graph (using setType) is supported as well.

 

Method Summary
static void collapse(Node node)
          Collapses the collapsible BPMN node realizer.
static NodeRealizer createActivity(ActivityTypeEnum activityType, TaskTypeEnum taskType)
          Creates a BPMN activity node realizer for the given activity type and task type.
static NodeRealizer createActivity(ActivityTypeEnum activityType, TaskTypeEnum taskType, MarkerTypeEnum marker)
          Creates a BPMN activity node realizer for the given activity type, task type, and activity marker.
static NodeRealizer createActivity(ActivityTypeEnum activityType, TaskTypeEnum taskType, MarkerTypeEnum[] markers)
          Creates a BPMN activity node realizer for the given activity type, task type, and activity markers.
static NodeRealizer createActivity(BpmnTypeEnum activityStatefulType)
          Creates a BPMN activity node realizer for the given activity type.
static NodeRealizer createArtifact(BpmnTypeEnum artifactType)
          Creates a BPMN artifact node realizer for the given artifact type.
static NodeRealizer createArtifact(BpmnTypeEnum artifactType, DataObjectTypeEnum dataObjectType, MarkerTypeEnum[] markers)
          Creates a BPMN artifact node realizer for the given artifact type, data object type, and artifact markers.
static NodeRealizer createChoreography(ChoreographyTypeEnum choreographyType, MarkerTypeEnum[] markers)
          Creates a BPMN choreography node realizer for the given choreography type and choreography markers.
static EdgeRealizer createConnection(BpmnTypeEnum connectionType)
          Returns a BPMN connection edge realizer for the given connection type.
static NodeRealizer createConversation(ConversationTypeEnum conversationType, boolean isSubConversation)
          Creates a BPMN conversation node realizer for the given conversation type.
static NodeRealizer createEvent(BpmnTypeEnum eventType, EventCharEnum eventCharacteristic)
          Returns a BPMN event node realizer for the given event type and characteristic.
static NodeRealizer createGateway(BpmnTypeEnum gatewayType)
          Returns a BPMN gateway node realizer for the given gateway type.
static TableGroupNodeRealizer createPool(BpmnTypeEnum poolType)
          Creates a BPMN Pool node realizer.
static void expand(Node node)
          Expands the collapsible BPMN node realizer.
static ActivityTypeEnum getActivityType(NodeRealizer nodeRealizer)
          Returns the activity type constant of the given node realizer.
static ChoreographyTypeEnum getChoreographyType(NodeRealizer nodeRealizer)
          Returns the choreography type constant of the given node realizer.
static ConversationTypeEnum getConversationType(NodeRealizer nodeRealizer)
          Returns the conversation type constant of the given node realizer.
static DataObjectTypeEnum getDataObjectType(NodeRealizer nodeRealizer)
          Returns the data object type constant of the given node realizer.
static EventCharEnum getEventCharacteristic(NodeRealizer nodeRealizer)
          Returns the BPMN event characteristic of the given node realizer.
static MarkerTypeEnum[] getMarkers(NodeRealizer nodeRealizer)
          Returns the BPMN markers of the given node realizer.
static TaskTypeEnum getTaskType(NodeRealizer nodeRealizer)
          Returns the task type of the given node realizer.
static BpmnTypeEnum getType(Edge edge)
          Returns the BPMN type of the realizer for the given edge.
static BpmnTypeEnum getType(EdgeRealizer realizer)
          Returns the BPMN type of the given edge realizer.
static BpmnTypeEnum getType(Node node)
          Returns the BPMN type of the realizer for the given node.
static BpmnTypeEnum getType(NodeRealizer realizer)
          Returns the BPMN type of the given node realizer.
static boolean isBpmnEdgeRealizer(EdgeRealizer realizer)
          Determines whether or not the given edge realizer is a BPMN edge realizer.
static boolean isBpmnNodeRealizer(NodeRealizer nodeRealizer)
          Determines whether or not the given node realizer is a BPMN node realizer.
static boolean isShadowEnabled(NodeRealizer realizer)
          Returns whether or not the given BPMN node realizer has a shadow.
static boolean isTypeDependentLineStrokeEnabled(NodeRealizer realizer)
          Determines whether or not the border of the specified node realizer is drawn using the realizer's lineType or using a stroke that is determined by the BPMN type of the node.
static void setActivityType(NodeRealizer nodeRealizer, ActivityTypeEnum type)
          Sets the activity type for the given node realizer.
static void setChoreographyType(NodeRealizer nodeRealizer, ChoreographyTypeEnum type)
          Sets the choreography type for the given node realizer.
static void setConversationType(NodeRealizer nodeRealizer, ConversationTypeEnum type)
          Sets the conversation type for the given node realizer.
static void setDataObjectType(NodeRealizer nodeRealizer, DataObjectTypeEnum type)
          Sets the data object type for the given node realizer.
static void setEventCharacteristic(NodeRealizer nodeRealizer, EventCharEnum characteristic)
          Sets the BPMN event characteristic for the given node realizer.
static void setMarkers(NodeRealizer nodeRealizer, MarkerTypeEnum[] markers)
          Sets the BPMN markers (maximum of four) for the given node realizer.
static void setShadowEnabled(NodeRealizer realizer, boolean enabled)
          Specifies whether or not the given BPMN node realizer has a shadow.
static void setTaskType(NodeRealizer nodeRealizer, TaskTypeEnum taskType)
          Sets the task type for the given node realizer.
static EdgeRealizer setType(Edge edge, BpmnTypeEnum type)
          Sets the BPMN type of the given edge.
static NodeRealizer setType(Node node, BpmnTypeEnum bpmnType)
          Sets the BPMN type for the given node.
static NodeRealizer setType(Node node, MarkerTypeEnum[] markers, ActivityTypeEnum activityType, TaskTypeEnum taskType)
          Sets the BPMN type of the given node to an activity type with the given activity markers and the given task type.
static NodeRealizer setType(Node node, MarkerTypeEnum[] markers, ChoreographyTypeEnum choreographyType)
          Sets the BPMN type of the given node to a choreography type with the given choreography markers.
static void setTypeDependentLineStrokeEnabled(NodeRealizer realizer, boolean enabled)
          Specifies whether or not the border of the specified node realizer is drawn using the realizer's lineType or using a stroke that is determined by the BPMN type of the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getType

public static BpmnTypeEnum getType(NodeRealizer realizer)
Returns the BPMN type of the given node realizer. This method also handles one-level ProxyShapeNodeRealizers.

Parameters:
realizer - a node realizer
Returns:
the BPMN type BpmnTypeEnum or null
See Also:
getType(Node), getType(EdgeRealizer)

getType

public static BpmnTypeEnum getType(Node node)
Returns the BPMN type of the realizer for the given node.

Parameters:
node - a node
Returns:
the BPMN type BpmnTypeEnum or null
See Also:
getType(NodeRealizer)

getType

public static BpmnTypeEnum getType(EdgeRealizer realizer)
Returns the BPMN type of the given edge realizer.

Parameters:
realizer - an edge realizer
Returns:
the BPMN type BpmnTypeEnum or null
See Also:
getType(Edge), getType(NodeRealizer)

getType

public static BpmnTypeEnum getType(Edge edge)
Returns the BPMN type of the realizer for the given edge.

Parameters:
edge - an edge
Returns:
the BPMN type BpmnTypeEnum or null
See Also:
getType(EdgeRealizer)

setType

public static NodeRealizer setType(Node node,
                                   BpmnTypeEnum bpmnType)
Sets the BPMN type for the given node.

If the type is a BPMN event type, this method also sets the characteristic for the resulting node using an arbitrary value, which forms a valid combination with the given event type.

Setting the BPMN type may result in a change of the realizer and/or its grouping state. This method supports nodes that use ProxyShapeNodeRealizers.

For unsupported types and nodes not belonging to a Graph2D an illegal argument exception is thrown. It is also thrown, if the graph does not have a hierarchy manager.

Parameters:
node - a node
bpmnType - a BPMN bpmnType BpmnTypeEnum
Returns:
the (new) realizer used for the node.
Throws:
IllegalArgumentException - for unsupported types and nodes not belonging to a Graph2D or if the graph has no hierarchy manager.
See Also:
getType(Node), setEventCharacteristic(NodeRealizer, EventCharEnum)

setType

public static NodeRealizer setType(Node node,
                                   MarkerTypeEnum[] markers,
                                   ActivityTypeEnum activityType,
                                   TaskTypeEnum taskType)
Sets the BPMN type of the given node to an activity type with the given activity markers and the given task type.

Setting the marker(s) may result in a change of the realizer and/or its grouping state. This method supports nodes with ProxyShapeNodeRealizers.

For unsupported types and nodes not belonging to a Graph2D an illegal argument exception is thrown. It is also thrown, if the graph does not have a hierarchy manager.

Parameters:
node - a node
markers - the activity markers to set.
activityType - the activity type to set.
taskType - the task type to set.
Returns:
the (new) realizer used for the node.
Throws:
IllegalArgumentException - for unsupported types and nodes not belonging to a Graph2D or if the graph has no hierarchy manager.
See Also:
setMarkers(y.view.NodeRealizer, MarkerTypeEnum[]), setActivityType(y.view.NodeRealizer, ActivityTypeEnum), setTaskType(y.view.NodeRealizer, TaskTypeEnum)

setType

public static NodeRealizer setType(Node node,
                                   MarkerTypeEnum[] markers,
                                   ChoreographyTypeEnum choreographyType)
Sets the BPMN type of the given node to a choreography type with the given choreography markers.

Setting the marker(s) may result in a change of the realizer and/or its grouping state. This method supports nodes with ProxyShapeNodeRealizers.

For unsupported types and nodes not belonging to a Graph2D an illegal argument exception is thrown. It is also thrown, if the graph does not have a hierarchy manager.

Parameters:
node - the node whose BPMN type is set.
markers - the choreography markers to set.
choreographyType - the choreography type to set.
Returns:
the (new) realizer used for the node.
Throws:
IllegalArgumentException - for unsupported types and nodes not belonging to a Graph2D or if the graph has no hierarchy manager.
See Also:
setMarkers(y.view.NodeRealizer, MarkerTypeEnum[]), setChoreographyType(y.view.NodeRealizer, ChoreographyTypeEnum)

setType

public static EdgeRealizer setType(Edge edge,
                                   BpmnTypeEnum type)
Sets the BPMN type of the given edge. Setting the type may result in a change of the realizer.

Parameters:
edge - an edge
type - a BPMN type BpmnTypeEnum
Returns:
returns the (new) realizer used for the edge
Throws:
IllegalArgumentException - for unsupported types and edges not belonging to a Graph2D

collapse

public static void collapse(Node node)
Collapses the collapsible BPMN node realizer. This method does nothing, if the realizer is not collapsible or already collapsed.

Parameters:
node - a collapsible BPMN node
See Also:
expand(Node)

expand

public static void expand(Node node)
Expands the collapsible BPMN node realizer. This method does nothing, if the realizer is not collapsible or already expanded.

Parameters:
node - a collapsible BPMN element
See Also:
collapse(Node)

createActivity

public static NodeRealizer createActivity(BpmnTypeEnum activityStatefulType)
Creates a BPMN activity node realizer for the given activity type. The realizer is not bound to a node.

Parameters:
activityStatefulType - a BPMN activity type.
Returns:
a BPMN activity node realizer. If the specified activity type corresponds to a container type, a ProxyShapeNodeRealizer will be returned.
Throws:
IllegalArgumentException - if the activity type is unknown.
See Also:
BpmnTypeEnum.isActivityType(BpmnTypeEnum)

createActivity

public static NodeRealizer createActivity(ActivityTypeEnum activityType,
                                          TaskTypeEnum taskType)
Creates a BPMN activity node realizer for the given activity type and task type. The realizer is not bound to a node.

Parameters:
activityType - the activity type.
taskType - the task type.
Returns:
a BPMN activity node realizer. If the specified activity type corresponds to a container type, a ProxyShapeNodeRealizer will be returned.

createActivity

public static NodeRealizer createActivity(ActivityTypeEnum activityType,
                                          TaskTypeEnum taskType,
                                          MarkerTypeEnum marker)
Creates a BPMN activity node realizer for the given activity type, task type, and activity marker. The realizer is not bound to a node.

Parameters:
activityType - the activity type.
taskType - the task type.
marker - the activity marker.
Returns:
a BPMN activity node realizer. If the specified activity type corresponds to a container type, a ProxyShapeNodeRealizer will be returned.

createActivity

public static NodeRealizer createActivity(ActivityTypeEnum activityType,
                                          TaskTypeEnum taskType,
                                          MarkerTypeEnum[] markers)
Creates a BPMN activity node realizer for the given activity type, task type, and activity markers. The realizer is not bound to a node.

Parameters:
activityType - the activity type.
taskType - the task type.
markers - the activity markers.
Returns:
a BPMN activity node realizer. If the specified activity type corresponds to a container type, a ProxyShapeNodeRealizer will be returned.

createGateway

public static NodeRealizer createGateway(BpmnTypeEnum gatewayType)
Returns a BPMN gateway node realizer for the given gateway type. The realizer is not bound to a node.

Parameters:
gatewayType - a BPMN gateway type
Returns:
a BPMN gateway node realizer
Throws:
IllegalArgumentException - if the gateway type is unknown
See Also:
BpmnTypeEnum.getGatewayTypes()

createArtifact

public static NodeRealizer createArtifact(BpmnTypeEnum artifactType)
Creates a BPMN artifact node realizer for the given artifact type. The realizer is not bound to a node.

Parameters:
artifactType - a BPMN artifact type.
Returns:
a BPMN artifact node realizer. If the specified artifact type corresponds to a container type, a ProxyShapeNodeRealizer will be returned.
Throws:
IllegalArgumentException - if the artifact type is unknown.
See Also:
BpmnTypeEnum.isArtifactType(BpmnTypeEnum)

createArtifact

public static NodeRealizer createArtifact(BpmnTypeEnum artifactType,
                                          DataObjectTypeEnum dataObjectType,
                                          MarkerTypeEnum[] markers)
Creates a BPMN artifact node realizer for the given artifact type, data object type, and artifact markers. The realizer is not bound to a node.

Parameters:
artifactType - the artifact type.
dataObjectType - the data object type. Ignored if the specified artifact type is not BpmnTypeEnum.ARTIFACT_TYPE_DATA_OBJECT.
markers - the artifact markers.
Returns:
a BPMN artifact node realizer. If the specified artifact type corresponds to a container type, a ProxyShapeNodeRealizer will be returned.

createEvent

public static NodeRealizer createEvent(BpmnTypeEnum eventType,
                                       EventCharEnum eventCharacteristic)
Returns a BPMN event node realizer for the given event type and characteristic. The realizer is not bound to a node.

Parameters:
eventType - a BPMN event type
eventCharacteristic - a BPMN event characteristic
Returns:
a BPMN event node realizer
Throws:
IllegalArgumentException - if the given event type/characteristic combination is unknown

createConversation

public static NodeRealizer createConversation(ConversationTypeEnum conversationType,
                                              boolean isSubConversation)
Creates a BPMN conversation node realizer for the given conversation type. The realizer is not bound to a node.

Parameters:
conversationType - the conversation type.
isSubConversation - if true, the node realizer is marked using MarkerTypeEnum.CLOSED.
Returns:
a BPMN conversation node realizer.

createChoreography

public static NodeRealizer createChoreography(ChoreographyTypeEnum choreographyType,
                                              MarkerTypeEnum[] markers)
Creates a BPMN choreography node realizer for the given choreography type and choreography markers. The realizer is not bound to a node.

Parameters:
choreographyType - the choreography type.
markers - the choreography markers.
Returns:
a BPMN choreography node realizer.

isTypeDependentLineStrokeEnabled

public static boolean isTypeDependentLineStrokeEnabled(NodeRealizer realizer)
Determines whether or not the border of the specified node realizer is drawn using the realizer's lineType or using a stroke that is determined by the BPMN type of the node.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!

Parameters:
realizer - the realizer of a BPMN node.
Returns:
true if the stroke depends on the node's BPMN type and false otherwise.
See Also:
setTypeDependentLineStrokeEnabled(y.view.NodeRealizer, boolean)

setTypeDependentLineStrokeEnabled

public static void setTypeDependentLineStrokeEnabled(NodeRealizer realizer,
                                                     boolean enabled)
Specifies whether or not the border of the specified node realizer is drawn using the realizer's lineType or using a stroke that is determined by the BPMN type of the node.

Note: If the specified realizer is a proxy realizer, this property is set for the proxy's delegate realizer only!

Parameters:
realizer - the realizer of a BPMN node.
enabled - true if the stroke depends on the node's BPMN type and false if the node's lineType should be used.
See Also:
isTypeDependentLineStrokeEnabled(y.view.NodeRealizer)

createPool

public static TableGroupNodeRealizer createPool(BpmnTypeEnum poolType)
Creates a BPMN Pool node realizer.

Parameters:
poolType - the pool type.
Returns:
a BPMN Pool node realizer.

getTaskType

public static TaskTypeEnum getTaskType(NodeRealizer nodeRealizer)
Returns the task type of the given node realizer.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!


setTaskType

public static void setTaskType(NodeRealizer nodeRealizer,
                               TaskTypeEnum taskType)
Sets the task type for the given node realizer.

Note: If the specified realizer is a proxy realizer, this property is set for the proxy's delegate realizer only!


getMarkers

public static MarkerTypeEnum[] getMarkers(NodeRealizer nodeRealizer)
Returns the BPMN markers of the given node realizer.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!


setMarkers

public static void setMarkers(NodeRealizer nodeRealizer,
                              MarkerTypeEnum[] markers)
Sets the BPMN markers (maximum of four) for the given node realizer.

Note: If the specified realizer is a proxy realizer, markers are set for the proxy's delegate realizer only!


getEventCharacteristic

public static EventCharEnum getEventCharacteristic(NodeRealizer nodeRealizer)
Returns the BPMN event characteristic of the given node realizer.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!

Parameters:
nodeRealizer - a node realizer
Returns:
the BPMN event characteristic or null
See Also:
BpmnTypeEnum

setEventCharacteristic

public static void setEventCharacteristic(NodeRealizer nodeRealizer,
                                          EventCharEnum characteristic)
Sets the BPMN event characteristic for the given node realizer.

Note: If the specified realizer is a proxy realizer, this property is set for the proxy's delegate realizer only!

Parameters:
nodeRealizer - a node realizer
characteristic - the BPMN event characteristic
See Also:
BpmnTypeEnum

isShadowEnabled

public static boolean isShadowEnabled(NodeRealizer realizer)
Returns whether or not the given BPMN node realizer has a shadow.

Note: This method requires the specified realizer to be one that has been created by one of the factory methods provided by this class. If this is not the case, its behavior is undefined.

Parameters:
realizer - a BPMN node realizer created by one of the factory methods of this class.
Returns:
true if the given BPMN node realizer paints a shadow; false otherwise.
See Also:
setShadowEnabled(NodeRealizer, boolean)

setShadowEnabled

public static void setShadowEnabled(NodeRealizer realizer,
                                    boolean enabled)
Specifies whether or not the given BPMN node realizer has a shadow.

Note: This method requires the specified realizer to be one that has been created by one of the factory methods provided by this class. If this is not the case, its behavior is undefined.

Parameters:
realizer - a BPMN node realizer created by one of the factory methods of this class.
enabled - if true the realizer will paint a shadow; if false the realizer will not paint a shadow.
See Also:
isShadowEnabled(NodeRealizer)

isBpmnNodeRealizer

public static boolean isBpmnNodeRealizer(NodeRealizer nodeRealizer)
Determines whether or not the given node realizer is a BPMN node realizer. In this context, a BPMN node realizer is a realizer that has been created by one of the factory methods provided by this class.

Parameters:
nodeRealizer - the node realizer to check.
Returns:
true if the given edge realizer is a BPMN node realizer; false otherwise.
See Also:
isBpmnEdgeRealizer(EdgeRealizer), createActivity(BpmnTypeEnum), createArtifact(BpmnTypeEnum), createEvent(BpmnTypeEnum, EventCharEnum), createGateway(BpmnTypeEnum), createPool(BpmnTypeEnum)

isBpmnEdgeRealizer

public static boolean isBpmnEdgeRealizer(EdgeRealizer realizer)
Determines whether or not the given edge realizer is a BPMN edge realizer. In this context, a BPMN edge realizer is a realizer that has been created by one of the factory methods provided by this class.

Parameters:
realizer - the edge realizer to check.
Returns:
true if the given edge realizer is a BPMN edge realizer; false otherwise.
See Also:
isBpmnNodeRealizer(NodeRealizer), createConnection(BpmnTypeEnum)

createConnection

public static EdgeRealizer createConnection(BpmnTypeEnum connectionType)
Returns a BPMN connection edge realizer for the given connection type. The realizer is not bound to any edge.

Parameters:
connectionType - a BPMN connection type
Returns:
a BPMN connection edge realizer
Throws:
IllegalArgumentException - if the connection type is unknown
See Also:
BpmnTypeEnum.getConnectionTypes()

getActivityType

public static ActivityTypeEnum getActivityType(NodeRealizer nodeRealizer)
Returns the activity type constant of the given node realizer.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!


setActivityType

public static void setActivityType(NodeRealizer nodeRealizer,
                                   ActivityTypeEnum type)
Sets the activity type for the given node realizer.

Note: If the specified realizer is a proxy realizer, this property is set for the proxy's delegate realizer only!


getDataObjectType

public static DataObjectTypeEnum getDataObjectType(NodeRealizer nodeRealizer)
Returns the data object type constant of the given node realizer.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!


setDataObjectType

public static void setDataObjectType(NodeRealizer nodeRealizer,
                                     DataObjectTypeEnum type)
Sets the data object type for the given node realizer.

Note: If the specified realizer is a proxy realizer, this property is set for the proxy's delegate realizer only!


getConversationType

public static ConversationTypeEnum getConversationType(NodeRealizer nodeRealizer)
Returns the conversation type constant of the given node realizer.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!


setConversationType

public static void setConversationType(NodeRealizer nodeRealizer,
                                       ConversationTypeEnum type)
Sets the conversation type for the given node realizer.

Note: If the specified realizer is a proxy realizer, this property is set for the proxy's delegate realizer only!


getChoreographyType

public static ChoreographyTypeEnum getChoreographyType(NodeRealizer nodeRealizer)
Returns the choreography type constant of the given node realizer.

Note: If the specified realizer is a proxy realizer, the proxy's delegate realizer is queried!


setChoreographyType

public static void setChoreographyType(NodeRealizer nodeRealizer,
                                       ChoreographyTypeEnum type)
Sets the choreography type for the given node realizer.

Note: If the specified realizer is a proxy realizer, this property is set for the proxy's delegate realizer only!



© Copyright 2010-2014,
yWorks GmbH.
All rights reserved.