Package org.eclipse.draw2d
Class Polyline
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.Shape
org.eclipse.draw2d.AbstractPointListShape
org.eclipse.draw2d.Polyline
- All Implemented Interfaces:
IFigure
- Direct Known Subclasses:
Polygon
,PolylineConnection
,PolylineDecoration
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, Figure.ReverseFigureChildrenIterator
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
IFigure.NoInsets
-
Field Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsPoint
(int x, int y) Returnstrue
if the point(x, y)
is contained within this IFigure's bounds.protected void
Null implementation for a line.Returns the smallest rectangle completely enclosing the figure.boolean
isOpaque()
Returnstrue
if this IFigure is opaque.protected void
Outlines this shape using the foreground color.void
primTranslate
(int x, int y) Translates this Figure's bounds, without firing a move.void
Erases the Polyline and removes all of itsPoints
.void
repaint()
Repaints this IFigure.void
setLineWidth
(int w) Sets the line width to be used to outline the shape.void
Sets the list of points to be used by this polyline connection.void
setTolerance
(int tolerance) Sets the toleranceprotected boolean
shapeContainsPoint
(int x, int y) Returnstrue
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 org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Constructor Details
-
Polyline
public Polyline()
-
-
Method Details
-
containsPoint
public boolean containsPoint(int x, int y) Description copied from interface:IFigure
Returnstrue
if the point(x, y)
is contained within this IFigure's bounds.- Specified by:
containsPoint
in interfaceIFigure
- Overrides:
containsPoint
in classAbstractPointListShape
- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
true
if the point (x,y) is contained in this IFigure's bounds- See Also:
-
shapeContainsPoint
protected boolean shapeContainsPoint(int x, int y) Description copied from class:AbstractPointListShape
Returnstrue
if the point(x, y)
is contained within this figure.- Specified by:
shapeContainsPoint
in classAbstractPointListShape
- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
true
if the point (x,y) is contained in this figure
-
fillShape
Null implementation for a line. -
getBounds
Description copied from class:Figure
Returns the smallest rectangle completely enclosing the figure. Implementors may return the Rectangle by reference. For this reason, callers of this method must not modify the returned Rectangle. -
isOpaque
public boolean isOpaque()Description copied from interface:IFigure
Returnstrue
if this IFigure is opaque. -
outlineShape
Description copied from class:Shape
Outlines this shape using the foreground color.- Specified by:
outlineShape
in classShape
- Parameters:
g
- the graphics object- See Also:
-
primTranslate
public void primTranslate(int x, int y) Description copied from class:Figure
Translates this Figure's bounds, without firing a move.- Overrides:
primTranslate
in classFigure
- Parameters:
x
- The amount to translate horizontallyy
- The amount to translate vertically- See Also:
-
removeAllPoints
public void removeAllPoints()Erases the Polyline and removes all of itsPoints
.- Overrides:
removeAllPoints
in classAbstractPointListShape
- Since:
- 2.0
-
setLineWidth
public void setLineWidth(int w) Description copied from class:Shape
Sets the line width to be used to outline the shape.- Overrides:
setLineWidth
in classShape
- Parameters:
w
- the new width- See Also:
-
setPoints
Sets the list of points to be used by this polyline connection. Removes any previously existing points. The polyline will hold onto the given list by reference.- Overrides:
setPoints
in classAbstractPointListShape
- Parameters:
points
- new set of points- Since:
- 2.0
-
setTolerance
public void setTolerance(int tolerance) Sets the tolerance- Parameters:
tolerance
- the new tolerance value of the Polyline
-
repaint
public void repaint()Description copied from interface:IFigure
Repaints this IFigure.
-