com.yworks.yfiles.bpmn.view
Class BpmnMarkerDecorator
java.lang.Object
y.view.AbstractCustomNodePainter
com.yworks.yfiles.bpmn.view.AbstractBpmnPainter
com.yworks.yfiles.bpmn.view.BpmnIconDecorator
com.yworks.yfiles.bpmn.view.BpmnMarkerDecorator
- All Implemented Interfaces:
- GenericNodeRealizer.ContainsTest, GenericNodeRealizer.GenericMouseInputEditorProvider, GenericNodeRealizer.GenericSizeConstraintProvider, GenericNodeRealizer.Painter
- public class BpmnMarkerDecorator
- extends BpmnIconDecorator
- implements GenericNodeRealizer.GenericMouseInputEditorProvider, GenericNodeRealizer.GenericSizeConstraintProvider
Decorates an AbstractBpmnPainter instance to paint marker icons on the bottom center of its shape.
- See Also:
MarkerTypeEnum,
BpmnRealizerFactory.setMarkers(y.view.NodeRealizer, MarkerTypeEnum[])-
-
| Methods inherited from class y.view.AbstractCustomNodePainter |
backupGraphics, createSelectionColor, getFillColor, getFillColor2, getLineColor, getLinePaint, getLineStroke, initializeFill, initializeLine, paint, paintHotSpots, paintPorts, paintSloppy, paintText, restoreGraphics |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BpmnMarkerDecorator
public BpmnMarkerDecorator(AbstractBpmnPainter delegate)
- Initializes a new
BpmnMarkerDecorator instance.
- Parameters:
delegate - the decorated painter.
getIconBoundingBox
protected Rectangle2D getIconBoundingBox(NodeRealizer context,
Rectangle2D availableRegion)
- Description copied from class:
BpmnIconDecorator
- Determines the bounds of the icon that is painted by this decorator.
Called from
BpmnIconDecorator.getIconBoundingBox(y.view.NodeRealizer).
- Specified by:
getIconBoundingBox in class BpmnIconDecorator
- Parameters:
context - the visual representation of the node being painted.availableRegion - the region in which the icon bounds should lie.
- Returns:
- the location and size of the icon is painted by this decorator.
getIconPainter
protected BpmnIconPainter getIconPainter(NodeRealizer context)
- Returns a painter painting all marker icons for the specified node.
- Specified by:
getIconPainter in class BpmnIconDecorator
- Parameters:
context - the visual representation of the node to paint.
- Returns:
- a painter painting all marker icons for the specified node.
getMarkerIconPainter
protected BpmnIconPainter getMarkerIconPainter(MarkerTypeEnum type)
- Retrieves an icon painter for the specified marker type.
- Parameters:
type - the marker type.
- Returns:
- an icon painter for the specified marker type or
null if there is no painter for the specified type.
findMouseInputEditor
public MouseInputEditor findMouseInputEditor(NodeRealizer context,
Graph2DView view,
double x,
double y,
HitInfo hitInfo)
- Returns an editor to handle mouse events for group/folder nodes that are
configured to use this
BpmnMarkerDecorator instance as their
GenericNodeRealizer.GenericMouseInputEditorProvider.
By default, a GroupNodePainter.GroupStateEditor
instance is returned that closes groups/opens folders when the node's group
state icon is clicked.
- Specified by:
findMouseInputEditor in interface GenericNodeRealizer.GenericMouseInputEditorProvider
- Parameters:
context - the node context.view - the component that received the mouse event.x - the x-component of the world (graph) coordinate of the event.y - the y-component of the world (graph) coordinate of the event.hitInfo - the elements of the specified view's graph at the event
location.
- Returns:
- a
MouseInputEditor instance that handles mouse events
at the given coordinates or null if events at the given
coordinates are ignored. - See Also:
isStateIconHit(y.view.NodeRealizer, double, double),
GroupNodePainter.GroupStateEditor
isStateIconHit
protected boolean isStateIconHit(NodeRealizer context,
double x,
double y)
- Checks whether or not the specified coordinates lie inside the specified
node's group state icon. The default implementation checks whether or not
the coordinates lie inside either the icon corresponding to
MarkerTypeEnum.OPEN or MarkerTypeEnum.CLOSED.
- Parameters:
context - the visual representation of the node to check.x - the x-coordinate to check.y - the y-coordinate to check.
- Returns:
true if the specified coordinates lie inside a group
state icon; false otherwise.- See Also:
getMarkerIconPainter(MarkerTypeEnum)
getMaximumSize
public YDimension getMaximumSize(NodeRealizer context)
- Specified by:
getMaximumSize in interface GenericNodeRealizer.GenericSizeConstraintProvider
getMinimumSize
public YDimension getMinimumSize(NodeRealizer context)
- Specified by:
getMinimumSize in interface GenericNodeRealizer.GenericSizeConstraintProvider