com.yworks.yfiles.bpmn.view
Class BpmnIconDecorator

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

public abstract class BpmnIconDecorator
extends AbstractBpmnPainter

Decorates an AbstractBpmnPainter to paint an icon on its shape.

 

Field Summary
 
Fields inherited from class com.yworks.yfiles.bpmn.view.AbstractBpmnPainter
ICON_FILL_COLOR, ICON_FILL_COLOR2, ICON_LINE_COLOR
 
Constructor Summary
protected BpmnIconDecorator(AbstractBpmnPainter painterDelegate)
          Initializes a new BpmnIconDecorator instance.
 
Method Summary
protected  Rectangle2D getIconBoundingBox(NodeRealizer context)
          Determines the bounds of the icon that is painted by this decorator.
protected abstract  Rectangle2D getIconBoundingBox(NodeRealizer context, Rectangle2D availableRegion)
          Determines the bounds of the icon that is painted by this decorator.
protected abstract  BpmnIconPainter getIconPainter(NodeRealizer context)
          Returns the icon that is painted by this decorator.
protected  AbstractBpmnPainter getPainterDelegate()
          Returns the decorated painter.
 double getPaintIconThreshold()
          Delegates to AbstractBpmnPainter.getPaintIconThreshold().
protected  void paintNode(NodeRealizer context, Graphics2D graphics, boolean sloppy)
          Paints the delegate and the icon returned by getIconPainter(y.view.NodeRealizer).
 void setPaintIconThreshold(double threshold)
          Delegates to AbstractBpmnPainter.setPaintIconThreshold(double).
 
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

BpmnIconDecorator

protected BpmnIconDecorator(AbstractBpmnPainter painterDelegate)
Initializes a new BpmnIconDecorator instance.

Parameters:
painterDelegate - the decorated painter.
See Also:
getPainterDelegate()
Method Detail

getPainterDelegate

protected AbstractBpmnPainter getPainterDelegate()
Returns the decorated painter.

Returns:
the decorated painter.

getPaintIconThreshold

public double getPaintIconThreshold()
Delegates to AbstractBpmnPainter.getPaintIconThreshold().

Overrides:
getPaintIconThreshold in class AbstractBpmnPainter
Returns:
the size threshold for displaying the inner icon of this painter.
See Also:
setPaintIconThreshold(double)

setPaintIconThreshold

public void setPaintIconThreshold(double threshold)
Delegates to AbstractBpmnPainter.setPaintIconThreshold(double).

Overrides:
setPaintIconThreshold in class AbstractBpmnPainter
Parameters:
threshold - the size threshold for displaying the inner icon of this painter.
See Also:
getPaintIconThreshold()

paintNode

protected void paintNode(NodeRealizer context,
                         Graphics2D graphics,
                         boolean sloppy)
Paints the delegate and the icon returned by getIconPainter(y.view.NodeRealizer). The size and location of the icon is determined by getIconBoundingBox(y.view.NodeRealizer).

Overrides:
paintNode in class AbstractBpmnPainter
Parameters:
context - the visual representation of the node being painted.
graphics - the graphics context to paint upon.
sloppy - true if a low-detail version of the node should be painted; false if a high-detail version of the node should be painted.

getIconBoundingBox

protected Rectangle2D getIconBoundingBox(NodeRealizer context)
Determines the bounds of the icon that is painted by this decorator. The default implementation calls getIconBoundingBox(y.view.NodeRealizer, java.awt.geom.Rectangle2D).

Parameters:
context - the visual representation of the node being painted.
Returns:
the location and size of the icon is painted by this decorator.

getIconBoundingBox

protected abstract Rectangle2D getIconBoundingBox(NodeRealizer context,
                                                  Rectangle2D availableRegion)
Determines the bounds of the icon that is painted by this decorator. Called from getIconBoundingBox(y.view.NodeRealizer).

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 abstract BpmnIconPainter getIconPainter(NodeRealizer context)
Returns the icon that is painted by this decorator. Called from paintNode(y.view.NodeRealizer, java.awt.Graphics2D, boolean).

Parameters:
context - the visual representation of the node being painted.
Returns:
the icon that is painted by this decorator.


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