com.yworks.yfiles.bpmn.view
Class BpmnConnectionPainter

java.lang.Object
  extended bycom.yworks.yfiles.bpmn.view.BpmnConnectionPainter
All Implemented Interfaces:
GenericEdgeRealizer.BridgeCalculatorHandler, GenericEdgeRealizer.Painter

public class BpmnConnectionPainter
extends Object
implements GenericEdgeRealizer.BridgeCalculatorHandler, GenericEdgeRealizer.Painter

Painter implementation for BPN connections that support bridge rendering.

See Also:
BpmnRealizerFactory.createConnection(BpmnTypeEnum), BridgeCalculator, DefaultGraph2DRenderer.setBridgeCalculator(y.view.BridgeCalculator)
 

Constructor Summary
BpmnConnectionPainter()
          Initializes a new BpmnConnectionPainter instance.
BpmnConnectionPainter(GenericEdgeRealizer.Painter painterDelegate)
          Initializes a new BpmnConnectionPainter instance.
 
Method Summary
protected  BridgeCalculator getBridgeCalculator(EdgeRealizer context, Graphics2D gfx)
          Retrieves the the currently used BridgeCalculator instance for the specified edge realizer and graphics context.
 GenericEdgeRealizer.Painter getPainterDelegate()
          Returns the decorated painter.
 void paint(EdgeRealizer context, BendList bends, GeneralPath path, Graphics2D gfx, boolean selected)
          Handles high-detail rendering for the given edge,
 void paintSloppy(EdgeRealizer context, BendList bends, GeneralPath path, Graphics2D gfx, boolean selected)
          Handles low-detail rendering for the given edge,
 void registerObstacles(EdgeRealizer context, BendList bends, GeneralPath path, BridgeCalculator calculator)
          Registers appropriate obstacles using the specified bridge calculator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BpmnConnectionPainter

public BpmnConnectionPainter()
Initializes a new BpmnConnectionPainter instance. A GenericEdgePainter instance is used as painter delegate.


BpmnConnectionPainter

public BpmnConnectionPainter(GenericEdgeRealizer.Painter painterDelegate)
Initializes a new BpmnConnectionPainter instance.

Parameters:
painterDelegate - the decorated painter.
Method Detail

getPainterDelegate

public GenericEdgeRealizer.Painter getPainterDelegate()
Returns the decorated painter.

Returns:
the decorated painter.

paint

public void paint(EdgeRealizer context,
                  BendList bends,
                  GeneralPath path,
                  Graphics2D gfx,
                  boolean selected)
Handles high-detail rendering for the given edge,

Specified by:
paint in interface GenericEdgeRealizer.Painter
Parameters:
context - the EdgeRealizer context that is used for the painting.
bends - the list of bends that the current context holds.
path - the GeneralPath instance that is associated with the current context.
selected - whether the edge should be painted in selected state.

paintSloppy

public void paintSloppy(EdgeRealizer context,
                        BendList bends,
                        GeneralPath path,
                        Graphics2D gfx,
                        boolean selected)
Handles low-detail rendering for the given edge,

Specified by:
paintSloppy in interface GenericEdgeRealizer.Painter
Parameters:
context - the EdgeRealizer context that is used for the painting.
bends - the list of bends that the current context holds.
path - the GeneralPath instance that is associated with the current context.
selected - whether the edge should be painted in selected state.

registerObstacles

public void registerObstacles(EdgeRealizer context,
                              BendList bends,
                              GeneralPath path,
                              BridgeCalculator calculator)
Registers appropriate obstacles using the specified bridge calculator. Obstacles are used for the second pass during the rendering of the edges.

Specified by:
registerObstacles in interface GenericEdgeRealizer.BridgeCalculatorHandler
Parameters:
context - the EdgeRealizer context that is used for the painting.
bends - the list of bends that the current context holds
path - the GeneralPath instance that is associated with the current context.
calculator - the calculator instance to register the obstacles with

getBridgeCalculator

protected BridgeCalculator getBridgeCalculator(EdgeRealizer context,
                                               Graphics2D gfx)
Retrieves the the currently used BridgeCalculator instance for the specified edge realizer and graphics context.

Called from paint(y.view.EdgeRealizer, y.view.BendList, java.awt.geom.GeneralPath, java.awt.Graphics2D, boolean).

Parameters:
context - the visualization of the edge that should display bridges.
gfx - the graphics context that will be used to render the edge.
Returns:
an appropriate BridgeCalculator instance or null if there is no calculator.


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