Class ConnectorShape.Segment

java.lang.Object
org.pathvisio.libgpml.model.connector.ConnectorShape.Segment
Direct Known Subclasses:
CurvedConnectorShape.CurvedSegment
Enclosing interface:
ConnectorShape

public static class ConnectorShape.Segment
extends java.lang.Object
A single segment of the connector path. This is simply a combination of a start and end Point2D.
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.awt.geom.Point2D end  
    private java.awt.geom.Point2D start  
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected Segment​(java.awt.geom.Point2D start, java.awt.geom.Point2D end)  
  • Method Summary

    Modifier and Type Method Description
    java.awt.geom.Point2D calculateNewEndPoint​(double reduceBy)
    The coordinates of the new end point if the length of the segment is reduced by the parameter.
    java.awt.geom.Point2D calculateNewStartPoint​(double reduceBy)
    The coordinates of the new start point if the length of the segment is reduced by the parameter.
    java.awt.geom.Point2D getMCenter()
    the center of the bounding box around start, end
    java.awt.geom.Point2D getMEnd()  
    double getMLength()  
    java.awt.geom.Point2D getMStart()  
    void setMEnd​(java.awt.geom.Point2D end)  
    void setMStart​(java.awt.geom.Point2D start)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • start

      private java.awt.geom.Point2D start
    • end

      private java.awt.geom.Point2D end
  • Constructor Details

    • Segment

      protected Segment​(java.awt.geom.Point2D start, java.awt.geom.Point2D end)
  • Method Details

    • getMEnd

      public java.awt.geom.Point2D getMEnd()
    • getMStart

      public java.awt.geom.Point2D getMStart()
    • setMEnd

      public void setMEnd​(java.awt.geom.Point2D end)
    • setMStart

      public void setMStart​(java.awt.geom.Point2D start)
    • getMCenter

      public java.awt.geom.Point2D getMCenter()
      the center of the bounding box around start, end
    • getMLength

      public double getMLength()
    • calculateNewEndPoint

      public java.awt.geom.Point2D calculateNewEndPoint​(double reduceBy)
      The coordinates of the new end point if the length of the segment is reduced by the parameter.
    • calculateNewStartPoint

      public java.awt.geom.Point2D calculateNewStartPoint​(double reduceBy)
      The coordinates of the new start point if the length of the segment is reduced by the parameter. Easier to use the NewEndPoint method than rewrite it CAUTION:: may need examining with curved lines, The Math may not hold Also caution for elbow lines where the last line may be smaller than the width of the arrow shape We may have to put this function in each individual Connector Shape implementation
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object