public class ScalablePolygonShape extends AbstractPointListShape
PointList as a polygonal shape
scaled in accordance with bounds to fill whole figure. This class is similar
to PolygonShape, except the polygon should be scaled
expanded/compressed to fit in current bounds.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 |
|---|
ScalablePolygonShape() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPoint(Point pt)
Adds the passed point to this figure.
|
protected void |
fillShape(Graphics graphics)
Fills the interior of the shape with the background color.
|
PointList |
getScaledPoints() |
void |
insertPoint(Point pt,
int index)
Inserts a given point at a specified index in this figure.
|
protected void |
outlineShape(Graphics graphics)
Outlines this shape using the foreground color.
|
void |
removeAllPoints()
Erases this figure and removes all of its
Points. |
void |
removePoint(int index)
Removes a point from this figure.
|
void |
setBounds(Rectangle rect)
Sets the bounds of this Figure to the Rectangle rect.
|
void |
setEnd(Point end)
Sets the end point of this figure
|
void |
setLineWidth(int w)
Sets the line width to be used to outline the shape.
|
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 boolean |
shapeContainsPoint(int x,
int y)
Returns
true if the point (x, y) is contained
within this figure. |
childrenContainsPoint, containsPoint, getEnd, getPoints, getStart, setEndpointsgetAlpha, 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, 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, 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, validateprotected 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 graphics)
Shapeprotected void outlineShape(Graphics graphics)
ShapeoutlineShape in class Shapegraphics - the graphics objectpublic PointList getScaledPoints()
public void addPoint(Point pt)
AbstractPointListShapeaddPoint in class AbstractPointListShapept - the Point to be added to this figurepublic void insertPoint(Point pt, int index)
AbstractPointListShapeinsertPoint in class AbstractPointListShapept - the point to be addedindex - the position in this figure where the point is to be addedpublic void removeAllPoints()
AbstractPointListShapePoints.removeAllPoints in class AbstractPointListShapepublic void removePoint(int index)
AbstractPointListShaperemovePoint in class AbstractPointListShapeindex - the position of the point to be removedpublic void setStart(Point start)
AbstractPointListShapesetStart in class AbstractPointListShapestart - the point that will become the first point in this figurepublic void setEnd(Point end)
AbstractPointListShapesetEnd in class AbstractPointListShapeend - the point that will become the last point in this figurepublic void setPoint(Point pt, int index)
AbstractPointListShapeindex to the Point pt. If
you're going to set multiple Points, use AbstractPointListShape.setPoints(PointList).setPoint in class AbstractPointListShapept - the pointindex - the indexpublic void setPoints(PointList points)
AbstractPointListShapesetPoints in class AbstractPointListShapepoints - new set of pointspublic void setBounds(Rectangle rect)
FigureFigure.getBounds() may return the current bounds by reference, it is
not safe to modify that Rectangle and then call setBounds() after making
modifications. The figure would assume that the bounds are unchanged, and
no layout or paint would occur. For proper behavior, always use a copy.public void setLineWidth(int w)
ShapesetLineWidth in class Shapew - the new widthCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.