|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yworks.yfiles.bpmn.view.ChoreographyLabelModel
Label model for BPMN choreography nodes. A choreography node can have any number of participants labels at the top and bottom and one label for its name in the middle or on the upper left corner below the top participants.
Serialization and deserialization of the model and its parameter is done in the inner classChoreographyLabelModel.Handler
.
An instance of this class must be registered with the GraphMLIOHandler
used for reading/writing
BPMN diagrams that contains choreography labels unless BpmnGraphMLIOHandler
is used.
Important: Dragging labels of choreography nodes does not work well. Therefore the method
createModelParameter(y.geom.OrientedRectangle, y.layout.NodeLayout)
returns the
default model parameter and label dragging is turned off in the BPMN edit mode
BpmnView.BpmnEditMode
.
Nested Class Summary | |
static class |
ChoreographyLabelModel.Handler
Handles serialization and deserialization of the model and its parameter. |
Field Summary | |
static byte |
NAME_CENTER
Position specifier for name labels that are horizontally centered. |
static byte |
NAME_TOP_LEFT
Position specifier for name labels that are left aligned. |
static byte |
PARTICIPANT_BOTTOM
Position specifier for participant labels that are positioned at the top of a choreography node. |
static byte |
PARTICIPANT_TOP
Position specifier for participant labels that are positioned at the top of a choreography node. |
Constructor Summary | |
ChoreographyLabelModel()
|
Method Summary | |
Object |
createModelParameter(OrientedRectangle labelBounds,
NodeLayout nodeLayout)
Returns the default model parameter. |
static NodeLabel |
createNameLabel(NodeRealizer realizer,
byte position)
Sets and returns the name label of the given node realizer for the given position. |
static NodeLabel |
createParticipantLabel(NodeRealizer realizer,
byte position)
Adds and returns a new participant label to the given node realizer for the given position. |
Object |
getDefaultParameter()
Returns the model parameter for the centered name. |
YList |
getLabelCandidates(NodeLabelLayout nl,
NodeLayout nodeLayout)
Returns a list of possible label candidates. |
OrientedRectangle |
getLabelPlacement(YDimension labelSize,
NodeLayout nodeLayout,
Object param)
Returns the placement of a label with the given model parameter. |
static NodeLabel |
getNameLabel(NodeRealizer realizer)
Returns the name label of given node realizer. |
static List |
getParticipantLabels(NodeRealizer realizer,
byte position)
Returns all participant labels of the given position. |
static byte |
getPosition(Object modelParameter)
Returns the positions specifier encoded in the specified model parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte PARTICIPANT_TOP
createParticipantLabel(y.view.NodeRealizer, byte)
,
Constant Field Valuespublic static final byte PARTICIPANT_BOTTOM
createParticipantLabel(y.view.NodeRealizer, byte)
,
Constant Field Valuespublic static final byte NAME_CENTER
createNameLabel(y.view.NodeRealizer, byte)
,
Constant Field Valuespublic static final byte NAME_TOP_LEFT
createNameLabel(y.view.NodeRealizer, byte)
,
Constant Field ValuesConstructor Detail |
public ChoreographyLabelModel()
Method Detail |
public Object createModelParameter(OrientedRectangle labelBounds, NodeLayout nodeLayout)
createModelParameter
in interface NodeLabelModel
public Object getDefaultParameter()
getDefaultParameter
in interface NodeLabelModel
public OrientedRectangle getLabelPlacement(YDimension labelSize, NodeLayout nodeLayout, Object param)
getLabelPlacement
in interface NodeLabelModel
public YList getLabelCandidates(NodeLabelLayout nl, NodeLayout nodeLayout)
getLabelCandidates
in interface NodeLabelModel
public static byte getPosition(Object modelParameter)
modelParameter
- the model parameter from which the position specifier
has to be extracted.
IllegalArgumentException
- if the specified model parameter is not
valid for this model.NAME_CENTER
,
NAME_TOP_LEFT
,
PARTICIPANT_BOTTOM
,
PARTICIPANT_TOP
public static NodeLabel getNameLabel(NodeRealizer realizer)
null
if there
is no name label.public static List getParticipantLabels(NodeRealizer realizer, byte position)
position
- either ChoreographyLabelModel.PARTICIPANT_TOP
or ChoreographyLabelModel.PARTICIPANT_BOTTOM
.
IllegalArgumentException
- if the specified position does not equal
any of the position constants defined by this class.public static NodeLabel createParticipantLabel(NodeRealizer realizer, byte position)
position
- either ChoreographyLabelModel.PARTICIPANT_TOP
or ChoreographyLabelModel.PARTICIPANT_BOTTOM
.
IllegalArgumentException
- if the specified position does not equal
any of the position constants defined by this class.public static NodeLabel createNameLabel(NodeRealizer realizer, byte position)
position
- either ChoreographyLabelModel.NAME_CENTER
or ChoreographyLabelModel.NAME_TOP_LEFT
.
IllegalArgumentException
- if the specified position does not equal
any of the position constants defined by this class.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |