|
Draw2d 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.Figure
org.eclipse.draw2d.Shape
org.eclipse.draw2d.AbstractPointListShape
org.eclipse.draw2d.Polyline
public class Polyline
Renders a PointList
as a series of line segments. A Polyline figure
should be positioned by manipulating its points, NOT by calling
Figure.setBounds(Rectangle)
.
A polyline's bounds will be calculated automatically based on its PointList. The bounds will be the smallest Rectangle large enough to render the line properly. Children should not be added to a Polyline and will not affect the bounds calculation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure |
---|
Figure.FigureIterator, Figure.IdentitySearch |
Nested classes/interfaces inherited from interface 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 | |
---|---|
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. |
boolean |
isOpaque()
Returns true if this IFigure is opaque. |
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 |
repaint()
Repaints this IFigure. |
void |
setLineWidth(int w)
Sets the line width to be used to outline the shape. |
void |
setPoints(PointList points)
Sets the list of points to be used by this polyline connection. |
void |
setTolerance(int tolerance)
Sets the tolerance |
protected boolean |
shapeContainsPoint(int x,
int y)
Returns true if the point (x, y) is contained
within this figure. |
Methods inherited from class org.eclipse.draw2d.AbstractPointListShape |
---|
addPoint, childrenContainsPoint, getEnd, getPoints, getStart, insertPoint, removePoint, setEnd, setEndpoints, setPoint, setStart |
Methods inherited from class org.eclipse.draw2d.Shape |
---|
getAlpha, getAntialias, getLineAttributes, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, paintFigure, setAlpha, setAlpha, setAntialias, setAntialias, setFill, setFillXOR, setLineAttributes, setLineCap, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidthFloat, 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 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 AbstractPointListShape
x
- The X coordinatey
- The Y coordinate
true
if the point (x,y) is contained in this
IFigure's boundsIFigure.containsPoint(int, int)
protected boolean shapeContainsPoint(int x, int y)
AbstractPointListShape
true
if the point (x, y)
is contained
within this figure.
shapeContainsPoint
in class AbstractPointListShape
x
- The X coordinatey
- The Y coordinate
true
if the point (x,y) is contained in this figureprotected 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 boolean isOpaque()
IFigure
true
if this IFigure is opaque.
isOpaque
in interface IFigure
isOpaque
in class Figure
false
because Polyline's aren't filledIFigure.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
.
removeAllPoints
in class AbstractPointListShape
public void setLineWidth(int w)
Shape
setLineWidth
in class Shape
w
- the new widthShape.setLineWidth(int)
public void setPoints(PointList points)
setPoints
in class AbstractPointListShape
points
- new set of pointspublic void setTolerance(int tolerance)
tolerance
- the new tolerance value of the Polylinepublic void repaint()
IFigure
repaint
in interface IFigure
repaint
in class Figure
IFigure.repaint()
|
Draw2d 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |