|
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()
|
void |
insertPoint(Point pt,
int index)
Inserts a given point at a specified index in the Polyline. |
boolean |
isOpaque()
Returns false as shapes only draw themselves onto other figures, and
generally dont have rectangular dimensions. |
protected void |
outlineShape(Graphics g)
Outlines this shape using the foreground color. |
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 to outline 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 Polylinepublic 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
g
- the graphics objectShape.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 addedpublic boolean isOpaque()
Shape
false
as shapes only draw themselves onto other figures, and
generally dont have rectangular dimensions.
isOpaque
in interface IFigure
isOpaque
in class Shape
false
because Polyline's aren't filledFigure.isOpaque()
protected void outlineShape(Graphics g)
Shape
outlineShape
in class Shape
g
- the graphics objectShape.outlineShape(Graphics)
public void primTranslate(int x, int y)
Figure
primTranslate
in class Figure
x
- The amount to translate horizontallyy
- The amount to translate verticallyFigure.primTranslate(int, int)
public void removeAllPoints()
Points
.
public void removePoint(int index)
index
- the position of the point to be removedpublic void setEnd(Point end)
end
- the point that will become the last point in the Polylinepublic void setEndpoints(Point start, Point end)
start
- the point to become the first point in the Polylineend
- the point to become the last point in the Polylinepublic void setLineWidth(int w)
Shape
setLineWidth
in class Shape
w
- the new widthShape.setLineWidth(int)
public void setPoint(Point pt, int index)
index
to the Point pt
. Calling this method
results in a recalculation of the polyline's bounding box. If you're going to set
multiple Points, use setPoints(PointList)
.
pt
- the pointindex
- the indexpublic void setPoints(PointList points)
points
- new set of pointspublic void setStart(Point start)
start
- the point that will become the first point in the Polylineprotected 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 coordinatesFigure.useLocalCoordinates()
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |