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.ReverseFigureChildrenIteratorNested 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, toolTipFields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS -
Constructor Summary
Constructors -
Method Summary
Modifier 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.AbstractPointListShape
addPoint, childrenContainsPoint, getEnd, getPoints, getStart, insertPoint, removePoint, setEnd, setEndpoints, setPoint, setStartMethods 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, setXORMethods inherited from class org.eclipse.draw2d.Figure
add, 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
-
Polyline
public Polyline()
-
-
Method Details
-
containsPoint
public 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 interfaceIFigure- Overrides:
containsPointin classAbstractPointListShape- Parameters:
x- The X coordinatey- The Y coordinate- Returns:
trueif 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:AbstractPointListShapeReturnstrueif the point(x, y)is contained within this figure.- Specified by:
shapeContainsPointin classAbstractPointListShape- Parameters:
x- The X coordinatey- The Y coordinate- Returns:
trueif the point (x,y) is contained in this figure
-
fillShape
Null implementation for a line. -
getBounds
Description 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. -
isOpaque
public boolean isOpaque()Description copied from interface:IFigureReturnstrueif this IFigure is opaque. -
outlineShape
Description copied from class:ShapeOutlines this shape using the foreground color.- Specified by:
outlineShapein classShape- Parameters:
g- the graphics object- See Also:
-
primTranslate
public void primTranslate(int x, int y) Description copied from class:FigureTranslates this Figure's bounds, without firing a move.- Overrides:
primTranslatein 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:
removeAllPointsin classAbstractPointListShape- Since:
- 2.0
-
setLineWidth
public void setLineWidth(int w) Description copied from class:ShapeSets the line width to be used to outline the shape.- Overrides:
setLineWidthin 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:
setPointsin 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:IFigureRepaints this IFigure.
-