Class StraightConnectorShape

java.lang.Object
org.pathvisio.libgpml.model.connector.AbstractConnector
org.pathvisio.libgpml.model.connector.StraightConnectorShape
All Implemented Interfaces:
ConnectorShape

public class StraightConnectorShape
extends AbstractConnector
Implements a straight connector Shape, i.e. a Connector with only 90-degree angles.
Author:
unknown
  • Constructor Details

    • StraightConnectorShape

      public StraightConnectorShape()
  • Method Details

    • recalculateShape

      public void recalculateShape​(ConnectorRestrictions restrictions)
      Forces the connector to redraw it's path. The cache for segments, waypoints and shape.
      Parameters:
      restrictions - the ConnectorRestrictions that provides the start, end and preferred waypoints
    • calculateShape

      protected java.awt.Shape calculateShape​(ConnectorShape.Segment[] segments)
      Calculates shape from the width of the line endings.
      Specified by:
      calculateShape in class AbstractConnector
      Parameters:
      segments - the array of segments.
      Returns:
      the calculated shape.
    • hasValidWaypoints

      public boolean hasValidWaypoints​(ConnectorRestrictions restrictions)
      Description copied from interface: ConnectorShape
      Checks whether the waypoints as provided by the ConnectorRestrictions are valid and will be used to draw the connector path
      Parameters:
      restrictions - the connector restrictions.
      Returns:
      true if the waypoints are used, false if not
    • fromLineCoordinate

      public java.awt.geom.Point2D fromLineCoordinate​(double l)
      Translates a 1-dimensional line coordinate to a 2-dimensional view coordinate. The 1-dimensional line coordinate is position objects that are attached to the line.
      Parameters:
      l - the double.
    • toLineCoordinate

      public double toLineCoordinate​(java.awt.geom.Point2D v)
      Translates a 2-dimensional view coordinate to a 1-dimensional line coordinate.
      Parameters:
      v - the Point2D