public abstract class AbstractPointListShape extends Shape
Figure.FigureIterator, Figure.IdentitySearch
IFigure.NoInsets
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
Constructor and Description |
---|
AbstractPointListShape() |
Modifier and Type | Method and Description |
---|---|
void |
addPoint(Point pt)
Adds the passed point to this figure.
|
protected boolean |
childrenContainsPoint(int x,
int y)
Returns
true if the point (x, y) is contained
within one of the child figures. |
boolean |
containsPoint(int x,
int y)
Returns
true if the point (x, y) is contained
within this IFigure's bounds. |
Point |
getEnd()
Returns the last point in this Figure.
|
PointList |
getPoints()
Returns the points in this figure by reference.
|
Point |
getStart() |
void |
insertPoint(Point pt,
int index)
Inserts a given point at a specified index in this figure.
|
void |
removeAllPoints()
Erases this figure and removes all of its
Points . |
void |
removePoint(int index)
Removes a point from this figure.
|
void |
setEnd(Point end)
Sets the end point of this figure
|
void |
setEndpoints(Point start,
Point end)
Sets the points at both extremes of this figure
|
void |
setPoint(Point pt,
int index)
Sets the point at
index to the Point pt . |
void |
setPoints(PointList points)
Sets the list of points to be used by this figure.
|
void |
setStart(Point start)
Sets the start point of this figure
|
protected abstract boolean |
shapeContainsPoint(int x,
int y)
Returns
true if the point (x, y) is contained
within this figure. |
fillShape, getAlpha, getAntialias, getLineAttributes, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, outlineShape, paintFigure, setAlpha, setAlpha, setAntialias, setAntialias, setFill, setFillXOR, setLineAttributes, setLineCap, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidth, setLineWidthFloat, setOutline, setOutlineXOR, setXOR
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, getBounds, 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, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, 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
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 Figure
x
- The X coordinatey
- The Y coordinatetrue
if the point (x,y) is contained in this
IFigure's boundsIFigure.containsPoint(int, int)
protected boolean childrenContainsPoint(int x, int y)
true
if the point (x, y)
is contained
within one of the child figures.x
- The X coordinatey
- The Y coordinatetrue
if the point (x,y) is contained in one of the
child figuresprotected abstract boolean shapeContainsPoint(int x, int y)
true
if the point (x, y)
is contained
within this figure.x
- The X coordinatey
- The Y coordinatetrue
if the point (x,y) is contained in this figurepublic void addPoint(Point pt)
pt
- the Point to be added to this figurepublic Point getStart()
public Point getEnd()
public PointList getPoints()
setPoints(PointList)
. Failure to do so will result in layout and
paint problems.public void insertPoint(Point pt, int index)
pt
- the point to be addedindex
- the position in this figure where the point is to be addedpublic void removeAllPoints()
Points
.public void removePoint(int index)
index
- the position of the point to be removedpublic void setStart(Point start)
start
- the point that will become the first point in this figurepublic void setEnd(Point end)
end
- the point that will become the last point in this figurepublic void setEndpoints(Point start, Point end)
start
- the point to become the first point in this figureend
- the point to become the last point in this figurepublic void setPoint(Point pt, int index)
index
to the Point pt
. If
you're going to set multiple Points, use setPoints(PointList)
.pt
- the pointindex
- the indexpublic void setPoints(PointList points)
points
- new set of pointsCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.