Interface MTEdgePath


public interface MTEdgePath
  • Method Details

    • createShape

      Shape createShape()
      Creates a shape for this edge.
    • hasValidRouter

      boolean hasValidRouter()
      Returns true if this edge path has a valid router, false otherwise. A router is invalid if it can no longer be found. This might happen if the router that the edge was created with is no longer available.
      Returns:
      true if this edge path has a valid router, false otherwise
    • hasEqualRouter

      boolean hasEqualRouter(EdgeRouter other)
      Returns true if this edge path has a valid router and is the same router as other
      Returns:
      true if this edge path has a valid router and is the same router as other, false otherwise
    • contains

      boolean contains(Point p)
      Returns true if the point is on the edge.
    • getFirstControlPoint

      Point getFirstControlPoint()
      Returns the first control point.
    • getLastControlPoint

      Point getLastControlPoint()
      Returns the first control point.
    • isEndHidden

      boolean isEndHidden()
    • isStartHidden

      boolean isStartHidden()
    • getPathBounds

      Rectangle getPathBounds()
      Returns the bounds of the edge.
    • getControlPoints

      List<Point> getControlPoints()
      Returns a list of control points. This list must not be modified.
    • setControlPoints

      void setControlPoints(List<Point> points)
      Sets the list of control points.
    • removeControlPoint

      void removeControlPoint(Point cp)
      Removes the given control point from the list of control points.
    • moveControlPoint

      void moveControlPoint(List<Point> points, Point controlPoint, Point offset, List<Point[]> otherSegments)
      Moves the given control point and updates the edge.
      Parameters:
      points - the list of control points to use for the calculation, or null if the edge's control points should be used
      controlPoint - the control point to move
      offset - the distance the control point should move
    • moveSegment

      void moveSegment(List<Point> points, Point[] segment, Point[] newSegment, Point offset, List<Point[]> otherPoints)
      Moves the given segment and updates the edge.
      Parameters:
      points - the list of control points to use for the calculation, or null if the edge's control points should be used
      segment - the segment that should be moved
      newSegment - will be modified to point to the new segment
      offset - the distance the segment should be moved
    • updateEndpoints

      void updateEndpoints(List<Point> points, Shape oldFrom, Shape oldNew, Point relativeOffset)
      Update the endpoints when the vertex bounds has changed.
      Parameters:
      points - the list of control points to use for the calculation, or null if the edge's control points should be used
      oldFrom - the shape of the from vertex before it changed
      oldNew - the shape of the to vertex before it changed
    • getSegment

      Point[] getSegment(Point p)
      Returns the segment that is closest to point p.
    • snapLabelBoundsToPath

      void snapLabelBoundsToPath(Rectangle oldBounds)
      Snaps the bounds of the label (in the current language) to the edge as close as possible to old bounds. The old bounds is not necessarily the current bounds of the label (for example when resizing we try to keep the bounds as close as possible to the bounds when the resize operation started).
      Parameters:
      oldBounds - The old bounds of the label.
    • snapLabelBoundsToPath

      void snapLabelBoundsToPath(MTLanguage language, Rectangle oldBounds)
      Snaps the bounds of the label (for a given language) to the edge as close as possible to old bounds. The old bounds is not necessarily the current bounds of the label (for example when resizing we try to keep the bounds as close as possible to the bounds when the resize operation started).
      Parameters:
      language - The language to update the bounds for
      oldBounds - The old bounds of the label.
    • clearControlPoints

      void clearControlPoints()
      Clears the control points of the edge and sets a default set of valid control points between the two vertices.
    • clearControlPoints

      void clearControlPoints(double fromAngle, double toAngle)
      Clears the control points of the edge and sets a default set of valid control points between the two vertices.
      Parameters:
      fromAngle - The direction to start with at the "source" vertex.
      toAngle - The direction to end with at the "target" vertex.
    • addControlPoint

      void addControlPoint(Point toAdd)
      Adds a control point to the edge. The implementation might have to add additional control points to keep the edge consistent.
      Parameters:
      toAdd - The new point to add. The implementation should try to add the new point as close as possible to toAdd.
    • setIntersections

      void setIntersections(List<IntersectionPoint> intersections)
    • setOverlappingSegments

      void setOverlappingSegments(List<OverlappingSegment> segments)
    • getOverlappingSegments

      List<OverlappingSegment> getOverlappingSegments(MTEdgePath path, int zorder)
    • getIntersections

      List<IntersectionPoint> getIntersections(MTEdgePath path, int zorder)
    • getBreakdownLocation

      Point getBreakdownLocation()
      Returns the point where the breakdown decorator should be drawn.