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 booleanhollowSourceArrowShapebooleanhollowTargetArrowShapeFields 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 voidbuildShape(EdgeGraphicAttribute graphics, NodeShape source, NodeShape target)Called when one of the nodes belonging to this edge has changed.abstract booleancontains(double x, double y)Decides whether or not a point lies within this shape.booleancontains(double x, double y, double w, double h)Checks whether or not a rectangle lies entirely within this shape.booleancontains(Point2D p)DOCUMENT ME!booleancontains(Rectangle2D r)DOCUMENT ME!RectanglegetBounds()DOCUMENT ME!Rectangle2DgetBounds2D()DOCUMENT ME!ShapegetHeadArrow()Returns the arrow at the target side.PathIteratorgetPathIterator(AffineTransform t)DOCUMENT ME!PathIteratorgetPathIterator(AffineTransform t, double d)DOCUMENT ME!Rectangle2DgetRealBounds2D()Returns the correct bounding box with coordinates relative to the view.ShapegetTailArrow()Returns the arrow at the source side.booleanintersects(double x, double y, double w, double h)DOCUMENT ME!booleanintersects(Rectangle2D r)DOCUMENT ME!booleanlineContains(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, waitMethods 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:
getBounds2Din interfaceShape- Returns:
- DOCUMENT ME!
-
getHeadArrow
Returns the arrow at the target side.- Specified by:
getHeadArrowin interfaceEdgeShape- Returns:
- the arrow at the target side.
-
getPathIterator
DOCUMENT ME!- Specified by:
getPathIteratorin interfaceShape- Parameters:
t- DOCUMENT ME!d- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPathIterator
DOCUMENT ME!- Specified by:
getPathIteratorin interfaceShape- Parameters:
t- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getRealBounds2D
Returns the correct bounding box with coordinates relative to the view.- Specified by:
getRealBounds2Din 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:
buildShapein interfaceEdgeShape- Parameters:
graphics- the attribute that has changedsource- theNodeShapeof the source nodetarget- theNodeShapeof the target node- Throws:
ShapeNotFoundException
-
getTailArrow
Returns the arrow at the source side.- Specified by:
getTailArrowin 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:
containsin 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:
intersectsin interfaceShape- Parameters:
x- DOCUMENT ME!y- DOCUMENT ME!w- DOCUMENT ME!h- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
intersects
DOCUMENT ME!- Specified by:
intersectsin 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_TOLERANCEas 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!
-