public class Polyline extends AbstractPointListShape
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.
Figure.FigureIterator, Figure.IdentitySearchIFigure.NoInsetsbgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipMAX_DIMENSION, MIN_DIMENSION, NO_INSETS| Constructor and Description |
|---|
Polyline() |
| Modifier and Type | Method and Description |
|---|---|
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. |
addPoint, childrenContainsPoint, getEnd, getPoints, getStart, insertPoint, removePoint, setEnd, setEndpoints, setPoint, setStartgetAlpha, 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, setXORadd, 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, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, 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, 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, validatepublic boolean containsPoint(int x,
int y)
IFiguretrue if the point (x, y) is contained
within this IFigure's bounds.containsPoint in interface IFigurecontainsPoint in class AbstractPointListShapex - The X coordinatey - The Y coordinatetrue if the point (x,y) is contained in this
IFigure's boundsIFigure.containsPoint(int, int)protected boolean shapeContainsPoint(int x,
int y)
AbstractPointListShapetrue if the point (x, y) is contained
within this figure.shapeContainsPoint in class AbstractPointListShapex - The X coordinatey - The Y coordinatetrue if the point (x,y) is contained in this figureprotected void fillShape(Graphics g)
fillShape in class Shapeg - the graphics objectShape.fillShape(Graphics)public Rectangle getBounds()
FiguregetBounds in interface IFiguregetBounds in class FigureIFigure.getBounds()public boolean isOpaque()
IFiguretrue if this IFigure is opaque.isOpaque in interface IFigureisOpaque in class Figurefalse because Polyline's aren't filledIFigure.isOpaque()protected void outlineShape(Graphics g)
ShapeoutlineShape in class Shapeg - the graphics objectShape.outlineShape(Graphics)public void primTranslate(int x,
int y)
FigureprimTranslate in class Figurex - The amount to translate horizontallyy - The amount to translate verticallyFigure.primTranslate(int, int)public void removeAllPoints()
Points.removeAllPoints in class AbstractPointListShapepublic void setLineWidth(int w)
ShapesetLineWidth in class Shapew - the new widthShape.setLineWidth(int)public void setPoints(PointList points)
setPoints in class AbstractPointListShapepoints - new set of pointspublic void setTolerance(int tolerance)
tolerance - the new tolerance value of the PolylineCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.