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 Summary
Fields Modifier and Type Field Description boolean
hollowSourceArrowShape
boolean
hollowTargetArrowShape
Fields inherited from interface org.graffiti.plugin.view.EdgeShape
CLICK_TOLERANCE
-
Constructor Summary
Constructors Constructor Description LineEdgeShape()
The constructor creates a line using default values. -
Method Summary
Modifier and Type Method Description abstract void
buildShape(EdgeGraphicAttribute graphics, NodeShape source, NodeShape target)
Called when one of the nodes belonging to this edge has changed.abstract boolean
contains(double x, double y)
Decides whether or not a point lies within this shape.boolean
contains(double x, double y, double w, double h)
Checks whether or not a rectangle lies entirely within this shape.boolean
contains(Point2D p)
DOCUMENT ME!boolean
contains(Rectangle2D r)
DOCUMENT ME!Rectangle
getBounds()
DOCUMENT ME!Rectangle2D
getBounds2D()
DOCUMENT ME!Shape
getHeadArrow()
Returns the arrow at the target side.PathIterator
getPathIterator(AffineTransform t)
DOCUMENT ME!PathIterator
getPathIterator(AffineTransform t, double d)
DOCUMENT ME!Rectangle2D
getRealBounds2D()
Returns the correct bounding box with coordinates relative to the view.Shape
getTailArrow()
Returns the arrow at the source side.boolean
intersects(double x, double y, double w, double h)
DOCUMENT ME!boolean
intersects(Rectangle2D r)
DOCUMENT ME!boolean
lineContains(Line2D line, double x, double y)
Checks whether or not a point is said to be locateds on a line.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.graffiti.plugin.view.GraphElementShape
getXexcess, getYexcess, setCoordinateSystem
-
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
DOCUMENT ME! -
getBounds2D
DOCUMENT ME!- Specified by:
getBounds2D
in interfaceShape
- Returns:
- DOCUMENT ME!
-
getHeadArrow
Returns the arrow at the target side.- Specified by:
getHeadArrow
in interfaceEdgeShape
- Returns:
- the arrow at the target side.
-
getPathIterator
DOCUMENT ME!- Specified by:
getPathIterator
in interfaceShape
- Parameters:
t
- DOCUMENT ME!d
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPathIterator
DOCUMENT ME!- Specified by:
getPathIterator
in interfaceShape
- Parameters:
t
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getRealBounds2D
Returns the correct bounding box with coordinates relative to the view.- Specified by:
getRealBounds2D
in interfaceGraphElementShape
- Returns:
- the correct bounding box with coordinates relative to the view.
-
buildShape
public abstract void buildShape(EdgeGraphicAttribute graphics, NodeShape source, NodeShape target) throws ShapeNotFoundExceptionCalled when one of the nodes belonging to this edge has changed.- Specified by:
buildShape
in interfaceEdgeShape
- Parameters:
graphics
- the attribute that has changedsource
- theNodeShape
of the source nodetarget
- theNodeShape
of the target node- Throws:
ShapeNotFoundException
-
getTailArrow
Returns the arrow at the source side.- Specified by:
getTailArrow
in interfaceEdgeShape
- 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 interfaceShape
- Parameters:
x
- the x-coordinate of the point to check.y
- the y-coordinate of the point to check.w
- widthh
- 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. -
contains
DOCUMENT ME! -
contains
DOCUMENT ME! -
intersects
public boolean intersects(double x, double y, double w, double h)DOCUMENT ME!- Specified by:
intersects
in interfaceShape
- Parameters:
x
- DOCUMENT ME!y
- DOCUMENT ME!w
- DOCUMENT ME!h
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
intersects
DOCUMENT ME!- Specified by:
intersects
in interfaceShape
- Parameters:
r
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
lineContains
Checks whether or not a point is said to be locateds on a line. It uses the fieldLINE_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!
-