Class LineEdgeShape

java.lang.Object
org.graffiti.plugins.views.defaults.LineEdgeShape
All Implemented Interfaces:
Shape, EdgeShape, GraffitiShape, GraphElementShape
Direct Known Subclasses:
PolyLineEdgeShape, StraightLineEdgeShape

public abstract class LineEdgeShape
extends Object
implements EdgeShape
Class representing an edge as one straight line.
Version:
$Revision: 1.23 $
  • Field Details

    • hollowTargetArrowShape

      public boolean hollowTargetArrowShape
    • hollowSourceArrowShape

      public boolean hollowSourceArrowShape
  • Constructor Details

    • LineEdgeShape

      public LineEdgeShape()
      The constructor creates a line using default values. The shapes of the source and target nodes are given to enable the edge to paint itself correctly between those nodes. The line is painted between the centers of the source and target shape. No arrows are painted.
  • Method Details

    • getBounds

      public Rectangle getBounds()
      DOCUMENT ME!
      Specified by:
      getBounds in interface Shape
      Returns:
      DOCUMENT ME!
    • getBounds2D

      public Rectangle2D getBounds2D()
      DOCUMENT ME!
      Specified by:
      getBounds2D in interface Shape
      Returns:
      DOCUMENT ME!
    • getHeadArrow

      public Shape getHeadArrow()
      Returns the arrow at the target side.
      Specified by:
      getHeadArrow in interface EdgeShape
      Returns:
      the arrow at the target side.
    • getPathIterator

      public PathIterator getPathIterator​(AffineTransform t, double d)
      DOCUMENT ME!
      Specified by:
      getPathIterator in interface Shape
      Parameters:
      t - DOCUMENT ME!
      d - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getPathIterator

      public PathIterator getPathIterator​(AffineTransform t)
      DOCUMENT ME!
      Specified by:
      getPathIterator in interface Shape
      Parameters:
      t - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getRealBounds2D

      public Rectangle2D getRealBounds2D()
      Returns the correct bounding box with coordinates relative to the view.
      Specified by:
      getRealBounds2D in interface GraphElementShape
      Returns:
      the correct bounding box with coordinates relative to the view.
    • buildShape

      public abstract void buildShape​(EdgeGraphicAttribute graphics, NodeShape source, NodeShape target) throws ShapeNotFoundException
      Called when one of the nodes belonging to this edge has changed.
      Specified by:
      buildShape in interface EdgeShape
      Parameters:
      graphics - the attribute that has changed
      source - the NodeShape of the source node
      target - the NodeShape of the target node
      Throws:
      ShapeNotFoundException
    • getTailArrow

      public Shape getTailArrow()
      Returns the arrow at the source side.
      Specified by:
      getTailArrow in interface EdgeShape
      Returns:
      the arrow at the source side.
    • contains

      public boolean contains​(double x, double y, double w, double h)
      Checks whether or not a rectangle lies entirely within this shape.
      Specified by:
      contains in interface Shape
      Parameters:
      x - the x-coordinate of the point to check.
      y - the y-coordinate of the point to check.
      w - width
      h - height
      Returns:
      true if the point lies within this shape.
      Throws:
      RuntimeException - DOCUMENT ME!
    • contains

      public abstract boolean contains​(double x, double y)
      Decides whether or not a point lies within this shape.
      Specified by:
      contains in interface Shape
      Parameters:
      x - the x-coordinate of the point to check.
      y - the y-coordinate of the point to check.
      Returns:
      true if the point lies within this shape.
    • contains

      public boolean contains​(Point2D p)
      DOCUMENT ME!
      Specified by:
      contains in interface Shape
      Parameters:
      p - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • contains

      public boolean contains​(Rectangle2D r)
      DOCUMENT ME!
      Specified by:
      contains in interface Shape
      Parameters:
      r - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • intersects

      public boolean intersects​(double x, double y, double w, double h)
      DOCUMENT ME!
      Specified by:
      intersects in interface Shape
      Parameters:
      x - DOCUMENT ME!
      y - DOCUMENT ME!
      w - DOCUMENT ME!
      h - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • intersects

      public boolean intersects​(Rectangle2D r)
      DOCUMENT ME!
      Specified by:
      intersects in interface Shape
      Parameters:
      r - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • lineContains

      public boolean lineContains​(Line2D line, double x, double y)
      Checks whether or not a point is said to be locateds on a line. It uses the field LINE_TOLERANCE as a certain tolerance, i.e. it really checks whether or not the point lies inside a rectangle around the line.
      Parameters:
      line -
      x -
      y -
      Returns:
      DOCUMENT ME!