|
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
- public abstract class AbstractPointListShape
- extends
Shape
Base superclass for all polylines/polygons
-
Since:
- 3.5
Fields inherited from class org.eclipse.draw2d.
Figure
|
bgColor,
border,
bounds,
fgColor,
flags,
font,
MAX_FLAG,
maxSize,
minSize,
NO_MANAGER,
prefSize,
toolTip
|
Method Summary
|
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. |
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,
getClientArea,
getClientArea,
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,
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
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
AbstractPointListShape
public AbstractPointListShape()
containsPoint
public boolean containsPoint(int x,
int y)
-
Description copied from interface:
IFigure
- Returns
true if the point (x, y) is contained within this
IFigure's bounds.
-
-
Specified by:
-
containsPoint
in interface
IFigure
-
Overrides:
-
containsPoint
in class
Figure
-
-
See Also:
-
IFigure.containsPoint(int, int)
childrenContainsPoint
protected boolean childrenContainsPoint(int x,
int y)
- Returns
true if the point (x, y) is contained
within one of the child figures.
-
-
Parameters:
-
x - The X coordinate -
y - 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)
- Returns
true if the point (x, y) is contained
within this figure.
-
-
Parameters:
-
x - The X coordinate -
y - The Y coordinate
-
Returns:
-
true if the point (x,y) is contained in this figure
addPoint
public void addPoint(
Point pt)
- Adds the passed point to this figure.
-
-
Parameters:
-
pt - the Point to be added to this figure
getStart
public
Point getStart()
-
-
Returns:
- the first point in this figure
getEnd
public
Point getEnd()
- Returns the last point in this Figure.
-
-
Returns:
- the last point
getPoints
public
PointList getPoints()
- Returns the points in this figure by reference. If the returned
list is modified, this figure must be informed by calling
setPoints(PointList) . Failure to do so will result in layout and paint
problems.
-
-
Returns:
- this Polyline's points
insertPoint
public void insertPoint(
Point pt,
int index)
- Inserts a given point at a specified index in this figure.
-
-
Parameters:
-
pt - the point to be added -
index - the position in this figure where the point is to be added
removeAllPoints
public void removeAllPoints()
- Erases this figure and removes all of its
Points .
-
removePoint
public void removePoint(int index)
- Removes a point from this figure.
-
-
Parameters:
-
index - the position of the point to be removed
setStart
public void setStart(
Point start)
- Sets the start point of this figure
-
-
Parameters:
-
start - the point that will become the first point in this figure
setEnd
public void setEnd(
Point end)
- Sets the end point of this figure
-
-
Parameters:
-
end - the point that will become the last point in this figure
setEndpoints
public void setEndpoints(
Point start,
Point end)
- Sets the points at both extremes of this figure
-
-
Parameters:
-
start - the point to become the first point in this figure -
end - the point to become the last point in this figure
setPoint
public void setPoint(
Point pt,
int index)
- Sets the point at
index to the Point pt . If
you're going to set multiple Points, use
setPoints(PointList) .
-
-
Parameters:
-
pt - the point -
index - the index
setPoints
public void setPoints(
PointList points)
- 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
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.
|
|