com.yworks.yfiles.bpmn.view
Class BpmnTaskTypeDecorator

java.lang.Object
  extended byy.view.AbstractCustomNodePainter
      extended bycom.yworks.yfiles.bpmn.view.AbstractBpmnPainter
          extended bycom.yworks.yfiles.bpmn.view.BpmnIconDecorator
              extended bycom.yworks.yfiles.bpmn.view.BpmnTaskTypeDecorator
All Implemented Interfaces:
GenericNodeRealizer.ContainsTest, GenericNodeRealizer.GenericSizeConstraintProvider, GenericNodeRealizer.Painter

public class BpmnTaskTypeDecorator
extends BpmnIconDecorator
implements GenericNodeRealizer.GenericSizeConstraintProvider

Decorates an BpmnActivityPainter instance to paint task type icons on the upper left corner of its shape.

See Also:
TaskTypeEnum, BpmnRealizerFactory.setTaskType(y.view.NodeRealizer, TaskTypeEnum)
 

Field Summary
 
Fields inherited from class com.yworks.yfiles.bpmn.view.AbstractBpmnPainter
ICON_FILL_COLOR, ICON_FILL_COLOR2, ICON_LINE_COLOR
 
Constructor Summary
BpmnTaskTypeDecorator(AbstractBpmnPainter delegate)
          Initializes a new BpmnTaskTypeDecorator instance.
 
Method Summary
protected  Rectangle2D getIconBoundingBox(NodeRealizer context, Rectangle2D availableRegion)
           
protected  BpmnIconPainter getIconPainter(NodeRealizer context)
           
 YDimension getMaximumSize(NodeRealizer context)
           
 YDimension getMinimumSize(NodeRealizer context)
           
protected  BpmnIconPainter getTaskTypeIconPainter(TaskTypeEnum type)
          Retrieves an icon painter for the specified task type.
 
Methods inherited from class com.yworks.yfiles.bpmn.view.BpmnIconDecorator
getIconBoundingBox, getPainterDelegate, getPaintIconThreshold, paintNode, setPaintIconThreshold
 
Methods inherited from class com.yworks.yfiles.bpmn.view.AbstractBpmnPainter
contains, getFillPaint
 
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
 

Constructor Detail

BpmnTaskTypeDecorator

public BpmnTaskTypeDecorator(AbstractBpmnPainter delegate)
Initializes a new BpmnTaskTypeDecorator instance.

Parameters:
delegate - the decorated painter.
Method Detail

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)
Description copied from class: BpmnIconDecorator
Returns the icon that is painted by this decorator. Called from BpmnIconDecorator.paintNode(y.view.NodeRealizer, java.awt.Graphics2D, boolean).

Specified by:
getIconPainter in class BpmnIconDecorator
Parameters:
context - the visual representation of the node being painted.
Returns:
the icon that is painted by this decorator.

getTaskTypeIconPainter

protected BpmnIconPainter getTaskTypeIconPainter(TaskTypeEnum type)
Retrieves an icon painter for the specified task type.

Parameters:
type - the task type.
Returns:
an icon painter for the specified task type or null if there is no painter for the specified type.

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


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