Search this API

y.view
Class SmoothBendsPathCalculator

java.lang.Object
  extended by y.view.SmoothBendsPathCalculator
All Implemented Interfaces:
GenericEdgeRealizer.PathCalculator

public class SmoothBendsPathCalculator
extends java.lang.Object
implements GenericEdgeRealizer.PathCalculator

A custom PathCalculator implementation that will smooth the bends of the path that is being calculated by the given inner path calculator.

 

Constructor Summary
SmoothBendsPathCalculator(GenericEdgeRealizer.PathCalculator innerCalculator)
           
 
Method Summary
 byte calculatePath(EdgeRealizer context, BendList bends, java.awt.geom.GeneralPath path, java.awt.geom.Point2D sourceIntersectionPointOut, java.awt.geom.Point2D targetIntersectionPointOut)
          Callback method for GenericEdgeRealizer.calculatePath(java.awt.geom.Point2D, java.awt.geom.Point2D) ()}.
 GenericEdgeRealizer.PathCalculator getInnerCalculator()
          Returns the inner GenericEdgeRealizer.PathCalculator that will calculate the path that shall be used.
 void setInnerCalculator(GenericEdgeRealizer.PathCalculator innerCalculator)
          Sets the inner GenericEdgeRealizer.PathCalculator that will calculate the path that shall be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmoothBendsPathCalculator

public SmoothBendsPathCalculator(GenericEdgeRealizer.PathCalculator innerCalculator)
Method Detail

getInnerCalculator

public GenericEdgeRealizer.PathCalculator getInnerCalculator()
Returns the inner GenericEdgeRealizer.PathCalculator that will calculate the path that shall be used.

Returns:
the inner GenericEdgeRealizer.PathCalculator that will calculate the path that shall be used.

setInnerCalculator

public void setInnerCalculator(GenericEdgeRealizer.PathCalculator innerCalculator)
Sets the inner GenericEdgeRealizer.PathCalculator that will calculate the path that shall be used.

Parameters:
innerCalculator - the inner GenericEdgeRealizer.PathCalculator that will calculate the path that shall be used.

calculatePath

public byte calculatePath(EdgeRealizer context,
                          BendList bends,
                          java.awt.geom.GeneralPath path,
                          java.awt.geom.Point2D sourceIntersectionPointOut,
                          java.awt.geom.Point2D targetIntersectionPointOut)
Description copied from interface: GenericEdgeRealizer.PathCalculator
Callback method for GenericEdgeRealizer.calculatePath(java.awt.geom.Point2D, java.awt.geom.Point2D) ()}. This method should modify the given path instance and return whether it took into account the length of the source and/or target arrow.

Specified by:
calculatePath in interface GenericEdgeRealizer.PathCalculator
Parameters:
context - the context EdgeRealizer
bends - the current BendList
path - the current GeneralPath
sourceIntersectionPointOut - the point to place the source intersection point in
targetIntersectionPointOut - the point to place the target intersection point in
Returns:
either EdgeRealizer.PATH_UNCLIPPED, EdgeRealizer.PATH_CLIPPED_AT_SOURCE, EdgeRealizer.PATH_CLIPPED_AT_TARGET, or EdgeRealizer.PATH_CLIPPED_AT_SOURCE_AND_TARGET

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.