|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.Figure | +--org.eclipse.draw2d.Shape | +--org.eclipse.draw2d.Polyline
Provides for graphical lines comprised of Points
.
Nested Class Summary |
Nested classes inherited from class org.eclipse.draw2d.Figure |
Figure.FigureIterator |
Nested classes inherited from class org.eclipse.draw2d.IFigure |
IFigure.NoInsets |
Field Summary |
Fields inherited from class org.eclipse.draw2d.Shape |
lineStyle, lineWidth |
Fields inherited from class org.eclipse.draw2d.Figure |
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip |
Fields inherited from interface org.eclipse.draw2d.IFigure |
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS |
Constructor Summary | |
Polyline()
|
Method Summary | |
void |
addPoint(Point pt)
Adds the passed point to the Polyline. |
boolean |
containsPoint(int x,
int y)
Returns true if the point (x, y) is contained within this
IFigure's bounds. |
protected void |
fillShape(Graphics g)
Null implementation for a line |
Rectangle |
getBounds()
Returns the smallest rectangle completely enclosing the figure. |
Point |
getEnd()
Returns the last point in the Polyline. |
PointList |
getPoints()
Returns the points in this Polyline by reference. |
Point |
getStart()
Returns the first point in the Polyline. |
void |
insertPoint(Point pt,
int index)
Inserts a given point at a specified index in the Polyline. |
boolean |
isOpaque()
Returns the opaque state of this shape. |
protected void |
outlineShape(Graphics g)
|
void |
primTranslate(int x,
int y)
Translates this Figure's bounds, without firing a move. |
void |
removeAllPoints()
Erases the Polyline and removes all of its Points . |
void |
removePoint(int index)
Removes a point from the Polyline. |
void |
setEnd(Point end)
Sets the end point of the Polyline |
void |
setEndpoints(Point start,
Point end)
Sets the points at both extremes of the Polyline |
void |
setLineWidth(int w)
Sets the line width to be used by the shape. |
void |
setPoint(Point pt,
int index)
Sets the point at index to the Point
pt . |
void |
setPoints(PointList points)
Sets the list of points to be used by this polyline connection. |
void |
setStart(Point start)
Sets the start point of the Polyline |
protected boolean |
useLocalCoordinates()
Returns true if this Figure uses local coordinates. |
Methods inherited from class org.eclipse.draw2d.Shape |
getLineStyle, getLineWidth, paintFigure, setFill, setFillXOR, setLineStyle, setOutline, setOutlineXOR, setXOR |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Polyline()
Method Detail |
public void addPoint(Point pt)
pt
- The Point to be added to the Polyline.public boolean containsPoint(int x, int y)
IFigure
true
if the point (x, y)
is contained within this
IFigure's bounds.
containsPoint
in interface IFigure
containsPoint
in class Figure
IFigure.containsPoint(int, int)
protected void fillShape(Graphics g)
fillShape
in class Shape
Shape.fillShape(Graphics)
public Rectangle getBounds()
Figure
getBounds
in interface IFigure
getBounds
in class Figure
IFigure.getBounds()
public Point getEnd()
public PointList getPoints()
setPoints(PointList)
. Failure to do so will result in
layout and paint problems.
public Point getStart()
public void insertPoint(Point pt, int index)
pt
- The point to be addedindex
- The position in the Polyline where the
point is to be added.public boolean isOpaque()
Shape
isOpaque
in interface IFigure
isOpaque
in class Shape
false
as shapes only
draw themselves onto other figures, and
generally dont have rectangular dimensions.protected void outlineShape(Graphics g)
outlineShape
in class Shape
public void primTranslate(int x, int y)
Figure
primTranslate
in class Figure
x
- The amount to translate horizontallyy
- The amount to translate verticallyFigure.translate(int, int)
public void removeAllPoints()
Points
.
public void removePoint(int index)
index
- The position of the point to be removed.public void setEnd(Point end)
end
- The point that will become the last point
in the Polyline.public void setEndpoints(Point start, Point end)
start
- The point to become the first point in the Polyline.end
- The point to become the last point in the Polyline.public void setLineWidth(int w)
Shape
setLineWidth
in class Shape
w
- Width of the line to be used.public void setPoint(Point pt, int index)
index
to the Point
pt
. Calling this method results in a
repaint. If you're going to set multiple Points,
use setPoints(PointList)
.
public void setPoints(PointList points)
points
- New set of points.public void setStart(Point start)
start
- The point that will become the first point
in the Polyline.protected boolean useLocalCoordinates()
Figure
true
if this Figure uses local coordinates. This means its
children are placed relative to this Figure's top-left corner.
useLocalCoordinates
in class Figure
true
if this Figure uses local coordinates
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |