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 SummaryNested classes/interfaces inherited from class org.eclipse.draw2d.FigureFigure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigureIFigure.NoInsets
- 
Field SummaryFields inherited from class org.eclipse.draw2d.FigurebgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigureMAX_DIMENSION, MIN_DIMENSION, NO_INSETS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsPoint(int x, int y) Returnstrueif the point(x, y)is contained within this IFigure's bounds.protected voidNull implementation for a line.Returns the smallest rectangle completely enclosing the figure.booleanisOpaque()Returnstrueif this IFigure is opaque.protected voidOutlines this shape using the foreground color.voidprimTranslate(int x, int y) Translates this Figure's bounds, without firing a move.voidErases the Polyline and removes all of itsPoints.voidrepaint()Repaints this IFigure.voidsetLineWidth(int w) Sets the line width to be used to outline the shape.voidSets the list of points to be used by this polyline connection.voidsetTolerance(int tolerance) Sets the toleranceprotected booleanshapeContainsPoint(int x, int y) Returnstrueif the point(x, y)is contained within this figure.Methods inherited from class org.eclipse.draw2d.AbstractPointListShapeaddPoint, childrenContainsPoint, getEnd, getPoints, getStart, insertPoint, removePoint, setEnd, setEndpoints, setPoint, setStartMethods inherited from class org.eclipse.draw2d.ShapegetAlpha, 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, setXORMethods inherited from class org.eclipse.draw2d.Figureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, 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, handleMouseWheelScrolled, 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, removeMouseWheelListener, 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- 
Polylinepublic Polyline()
 
- 
- 
Method Details- 
containsPointpublic boolean containsPoint(int x, int y) Description copied from interface:IFigureReturnstrueif the point(x, y)is contained within this IFigure's bounds.- Specified by:
- containsPointin interface- IFigure
- Overrides:
- containsPointin class- AbstractPointListShape
- Parameters:
- x- The X coordinate
- y- The Y coordinate
- Returns:
- trueif the point (x,y) is contained in this IFigure's bounds
- See Also:
 
- 
shapeContainsPointprotected boolean shapeContainsPoint(int x, int y) Description copied from class:AbstractPointListShapeReturnstrueif the point(x, y)is contained within this figure.- Specified by:
- shapeContainsPointin class- AbstractPointListShape
- Parameters:
- x- The X coordinate
- y- The Y coordinate
- Returns:
- trueif the point (x,y) is contained in this figure
 
- 
fillShapeNull implementation for a line.
- 
getBoundsDescription copied from class:FigureReturns 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.
- 
isOpaquepublic boolean isOpaque()Description copied from interface:IFigureReturnstrueif this IFigure is opaque.
- 
outlineShapeDescription copied from class:ShapeOutlines this shape using the foreground color.- Specified by:
- outlineShapein class- Shape
- Parameters:
- g- the graphics object
- See Also:
 
- 
primTranslatepublic void primTranslate(int x, int y) Description copied from class:FigureTranslates this Figure's bounds, without firing a move.- Overrides:
- primTranslatein class- Figure
- Parameters:
- x- The amount to translate horizontally
- y- The amount to translate vertically
- See Also:
 
- 
removeAllPointspublic void removeAllPoints()Erases the Polyline and removes all of itsPoints.- Overrides:
- removeAllPointsin class- AbstractPointListShape
- Since:
- 2.0
 
- 
setLineWidthpublic void setLineWidth(int w) Description copied from class:ShapeSets the line width to be used to outline the shape.- Overrides:
- setLineWidthin class- Shape
- Parameters:
- w- the new width
- See Also:
 
- 
setPointsSets 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:
- setPointsin class- AbstractPointListShape
- Parameters:
- points- new set of points
- Since:
- 2.0
 
- 
setTolerancepublic void setTolerance(int tolerance) Sets the tolerance- Parameters:
- tolerance- the new tolerance value of the Polyline
 
- 
repaintpublic void repaint()Description copied from interface:IFigureRepaints this IFigure.
 
-