com.yworks.yfiles.bpmn.view
Class EventPortConfiguration

java.lang.Object
  extended bycom.yworks.yfiles.bpmn.view.EventPortConfiguration
All Implemented Interfaces:
NodePort.BoundsProvider, NodePort.ContainsTest, NodePort.Painter

public class EventPortConfiguration
extends Object
implements NodePort.BoundsProvider, NodePort.ContainsTest, NodePort.Painter

An adapter class that allows existing NodeRealizer implementations to be used for NodePort visualization.

This class is used to visualize attached events of BPMN activity nodes.

See Also:
EventPortSupport
 

Nested Class Summary
static interface EventPortConfiguration.EventProvider
          Provides the node realizer that has to be used as visual representation of node ports that use EventPortConfiguration.
static class EventPortConfiguration.UserDataEventProvider
          EventProvider that retrieves the visual representation of a node port from the port's user data.
 
Constructor Summary
EventPortConfiguration(EventPortConfiguration.EventProvider eventProvider)
          Initializes an new EventPortConfiguration instance that queries the specified event provider for the node realizer to visualize node ports.
 
Method Summary
 boolean contains(NodePort port, double x, double y)
           
 YRectangle getBounds(NodePort port)
           
 EventPortConfiguration.EventProvider getEventProvider()
          Returns the event provider used by this configuration.
 YPoint getRatio()
          Returns the ratio that is used to determine the edge connection point with respect to the NodePorts bounds.
 void paint(NodePort port, Graphics2D g)
           
 void setRatio(double x, double y)
          Specifies the ratio that is used to determine the edge connection point with respect to the NodePorts width.
 void setRatio(YPoint ratio)
          Specifies the ratio that is used to determine the edge connection point with respect to the NodePorts width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventPortConfiguration

public EventPortConfiguration(EventPortConfiguration.EventProvider eventProvider)
Initializes an new EventPortConfiguration instance that queries the specified event provider for the node realizer to visualize node ports.

Parameters:
eventProvider - the event provider used by this configuration.
Method Detail

getEventProvider

public EventPortConfiguration.EventProvider getEventProvider()
Returns the event provider used by this configuration.

Returns:
the event provider used by this configuration.
See Also:
EventPortConfiguration(EventPortConfiguration.EventProvider)

getRatio

public YPoint getRatio()
Returns the ratio that is used to determine the edge connection point with respect to the NodePorts bounds. A x/y value of 0 means the edge connection point is at the left/top border of the NodePort's visual representation; a x/y value of 0.5 means the edge connection point is in the center of the NodePort's visual representation; and a x/y value of 1 means the edge connection point is at the right/bottom border of the NodePort's visual representation.

By default, this property is set to (0.5,0.5).

Returns:
a value in [0,1]^2.
See Also:
setRatio(y.geom.YPoint), setRatio(double, double)

setRatio

public void setRatio(YPoint ratio)
Specifies the ratio that is used to determine the edge connection point with respect to the NodePorts width. A x/y value of 0 means the edge connection point is at the left/top border of the NodePort's visual representation; a x/y value of 0.5 means the edge connection point is in the center of the NodePort's visual representation; and a x/y value of 1 means the edge connection point is at the right/bottom border of the NodePort's visual representation.

By default, this property is set to (0.5,0.5).

Parameters:
ratio - a value in [0,1]^2.
Throws:
IllegalArgumentException - if x/y is less than 0, larger than 1, or NaN.
See Also:
getRatio(), setRatio(double, double)

setRatio

public void setRatio(double x,
                     double y)
Specifies the ratio that is used to determine the edge connection point with respect to the NodePorts width.

Calling this method is equivalent to

setRatio(new YPoint(x, y))

Parameters:
x - a value in [0,1].
y - a value in [0,1].
Throws:
IllegalArgumentException - if x/y is less than 0, larger than 1, or NaN.
See Also:
getRatio(), setRatio(double, double)

getBounds

public YRectangle getBounds(NodePort port)
Specified by:
getBounds in interface NodePort.BoundsProvider

contains

public boolean contains(NodePort port,
                        double x,
                        double y)
Specified by:
contains in interface NodePort.ContainsTest

paint

public void paint(NodePort port,
                  Graphics2D g)
Specified by:
paint in interface NodePort.Painter


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