All Packages Class Hierarchy This Package Previous Next Index
Class CH.ifa.draw.figures.PolyLineFigure
java.lang.Object
|
+----CH.ifa.draw.standard.AbstractFigure
|
+----CH.ifa.draw.figures.PolyLineFigure
- public class PolyLineFigure
- extends AbstractFigure
A poly line figure consists of a list of points.
It has an optional line decoration at the start and end.
- See Also:
- LineDecoration
-
ARROW_TIP_BOTH
-
-
ARROW_TIP_END
-
-
ARROW_TIP_NONE
-
-
ARROW_TIP_START
-
-
fEndDecoration
-
-
fFrameColor
-
-
fPoints
-
-
fStartDecoration
-
-
PolyLineFigure()
-
-
PolyLineFigure(int)
-
-
PolyLineFigure(int, int)
-
-
addPoint(int, int)
- Adds a node to the list of points.
-
basicDisplayBox(Point, Point)
- Sets the display box of a figure.
-
basicMoveBy(int, int)
- Moves the figure.
-
connectorAt(int, int)
- Returns the Figures connector for the specified location.
-
containsPoint(int, int)
- Checks if a point is inside the figure.
-
displayBox()
- Gets the display box of a figure.
-
draw(Graphics)
- Draws the figure.
-
findSegment(int, int)
- Gets the segment of the polyline that is hit by
the given point.
-
getAttribute(String)
- Gets the attribute with the given name.
-
getFrameColor()
-
-
handles()
- Returns the handles of a Figure that can be used
to manipulate some of its attributes.
-
insertPointAt(Point, int)
- Insert a node at the given point.
-
isEmpty()
- Checks if the figure is empty.
-
joinSegments(int, int)
- Joins to segments into one if the given point hits a node
of the polyline.
-
locator(int)
- Creates a locator for the point with the given index.
-
pointAt(int)
-
-
pointCount()
-
-
points()
-
-
read(StorableInput)
- Reads the Figure from a StorableInput.
-
removePointAt(int)
-
-
setAttribute(String, Object)
- Sets the attribute with the given name.
-
setEndDecoration(LineDecoration)
- Sets the end decoration.
-
setFrameColor(Color)
-
-
setPointAt(Point, int)
- Changes the position of a node.
-
setStartDecoration(LineDecoration)
- Sets the start decoration.
-
splitSegment(int, int)
- Splits the segment at the given point if a segment was hit.
-
write(StorableOutput)
- Stores the Figure to a StorableOutput.
ARROW_TIP_NONE
public static final int ARROW_TIP_NONE
ARROW_TIP_START
public static final int ARROW_TIP_START
ARROW_TIP_END
public static final int ARROW_TIP_END
ARROW_TIP_BOTH
public static final int ARROW_TIP_BOTH
fPoints
protected Vector fPoints
fStartDecoration
protected LineDecoration fStartDecoration
fEndDecoration
protected LineDecoration fEndDecoration
fFrameColor
protected Color fFrameColor
PolyLineFigure
public PolyLineFigure()
PolyLineFigure
public PolyLineFigure(int size)
PolyLineFigure
public PolyLineFigure(int x,
int y)
displayBox
public Rectangle displayBox()
- Gets the display box of a figure.
- Overrides:
- displayBox in class AbstractFigure
isEmpty
public boolean isEmpty()
- Checks if the figure is empty.
- Overrides:
- isEmpty in class AbstractFigure
handles
public Vector handles()
- Returns the handles of a Figure that can be used
to manipulate some of its attributes.
- Overrides:
- handles in class AbstractFigure
basicDisplayBox
public void basicDisplayBox(Point origin,
Point corner)
- Sets the display box of a figure.
- Overrides:
- basicDisplayBox in class AbstractFigure
addPoint
public void addPoint(int x,
int y)
- Adds a node to the list of points.
points
public Enumeration points()
pointCount
public int pointCount()
basicMoveBy
protected void basicMoveBy(int dx,
int dy)
- Moves the figure.
- Overrides:
- basicMoveBy in class AbstractFigure
setPointAt
public void setPointAt(Point p,
int i)
- Changes the position of a node.
insertPointAt
public void insertPointAt(Point p,
int i)
- Insert a node at the given point.
removePointAt
public void removePointAt(int i)
splitSegment
public int splitSegment(int x,
int y)
- Splits the segment at the given point if a segment was hit.
- Returns:
- the index of the segment or -1 if no segment was hit.
pointAt
public Point pointAt(int i)
joinSegments
public boolean joinSegments(int x,
int y)
- Joins to segments into one if the given point hits a node
of the polyline.
- Returns:
- true if the two segments were joined.
connectorAt
public Connector connectorAt(int x,
int y)
- Returns the Figures connector for the specified location.
- Overrides:
- connectorAt in class AbstractFigure
setStartDecoration
public void setStartDecoration(LineDecoration l)
- Sets the start decoration.
setEndDecoration
public void setEndDecoration(LineDecoration l)
- Sets the end decoration.
draw
public void draw(Graphics g)
- Draws the figure.
- Overrides:
- draw in class AbstractFigure
containsPoint
public boolean containsPoint(int x,
int y)
- Checks if a point is inside the figure.
- Overrides:
- containsPoint in class AbstractFigure
findSegment
public int findSegment(int x,
int y)
- Gets the segment of the polyline that is hit by
the given point.
- Returns:
- the index of the segment or -1 if no segment was hit.
getAttribute
public Object getAttribute(String name)
- Gets the attribute with the given name.
PolyLineFigure maps "ArrowMode"to a
line decoration.
- Overrides:
- getAttribute in class AbstractFigure
setAttribute
public void setAttribute(String name,
Object value)
- Sets the attribute with the given name.
PolyLineFigure interprets "ArrowMode"to set
the line decoration.
- Overrides:
- setAttribute in class AbstractFigure
write
public void write(StorableOutput dw)
- Stores the Figure to a StorableOutput.
- Overrides:
- write in class AbstractFigure
read
public void read(StorableInput dr) throws IOException
- Reads the Figure from a StorableInput.
- Overrides:
- read in class AbstractFigure
locator
public static Locator locator(int pointIndex)
- Creates a locator for the point with the given index.
getFrameColor
protected Color getFrameColor()
setFrameColor
protected void setFrameColor(Color c)
All Packages Class Hierarchy This Package Previous Next Index