Package org.eclipse.draw2d
Class AbstractPointListShape
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.Shape
org.eclipse.draw2d.AbstractPointListShape
- All Implemented Interfaces:
IFigure
- Direct Known Subclasses:
PolygonShape
,Polyline
,PolylineShape
,ScalablePolygonShape
Base superclass for all polylines/polygons
- Since:
- 3.5
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIterator
Nested 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, toolTip
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the passed point to this figure.protected boolean
childrenContainsPoint
(int x, int y) Returnstrue
if the point(x, y)
is contained within one of the child figures.boolean
containsPoint
(int x, int y) Returnstrue
if the point(x, y)
is contained within this IFigure's bounds.getEnd()
Returns the last point in this Figure.Returns the points in this figure by reference.getStart()
void
insertPoint
(Point pt, int index) Inserts a given point at a specified index in this figure.void
Erases this figure and removes all of itsPoints
.void
removePoint
(int index) Removes a point from this figure.void
Sets the end point of this figurevoid
setEndpoints
(Point start, Point end) Sets the points at both extremes of this figurevoid
Sets the point atindex
to the Pointpt
.void
Sets the list of points to be used by this figure.void
Sets the start point of this figureprotected abstract boolean
shapeContainsPoint
(int x, int y) Returnstrue
if the point(x, y)
is contained within this figure.Methods inherited from class org.eclipse.draw2d.Shape
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
Methods inherited from class org.eclipse.draw2d.Figure
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, 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, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, 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
-
Constructor Details
-
AbstractPointListShape
public AbstractPointListShape()
-
-
Method Details
-
containsPoint
public boolean containsPoint(int x, int y) Description copied from interface:IFigure
Returnstrue
if the point(x, y)
is contained within this IFigure's bounds.- Specified by:
containsPoint
in interfaceIFigure
- Overrides:
containsPoint
in classFigure
- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
true
if the point (x,y) is contained in this IFigure's bounds- See Also:
-
childrenContainsPoint
protected boolean childrenContainsPoint(int x, int y) Returnstrue
if the point(x, y)
is contained within one of the child figures.- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
true
if the point (x,y) is contained in one of the child figures
-
shapeContainsPoint
protected abstract boolean shapeContainsPoint(int x, int y) Returnstrue
if the point(x, y)
is contained within this figure.- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
true
if the point (x,y) is contained in this figure
-
addPoint
Adds the passed point to this figure.- Parameters:
pt
- the Point to be added to this figure
-
getStart
- Returns:
- the first point in this figure
-
getEnd
Returns the last point in this Figure.- Returns:
- the last point
-
getPoints
Returns the points in this figure by reference. If the returned list is modified, this figure must be informed by callingsetPoints(PointList)
. Failure to do so will result in layout and paint problems.- Returns:
- this Polyline's points
-
insertPoint
Inserts a given point at a specified index in this figure.- Parameters:
pt
- the point to be addedindex
- the position in this figure where the point is to be added
-
removeAllPoints
public void removeAllPoints()Erases this figure and removes all of itsPoints
. -
removePoint
public void removePoint(int index) Removes a point from this figure.- Parameters:
index
- the position of the point to be removed
-
setStart
Sets the start point of this figure- Parameters:
start
- the point that will become the first point in this figure
-
setEnd
Sets the end point of this figure- Parameters:
end
- the point that will become the last point in this figure
-
setEndpoints
Sets the points at both extremes of this figure- Parameters:
start
- the point to become the first point in this figureend
- the point to become the last point in this figure
-
setPoint
Sets the point atindex
to the Pointpt
. If you're going to set multiple Points, usesetPoints(PointList)
.- Parameters:
pt
- the pointindex
- the index
-
setPoints
Sets the list of points to be used by this figure. Removes any previously existing points. This figure will hold onto the given list by reference.- Parameters:
points
- new set of points
-