|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFigure
A lightweight graphical object. Figures are rendered to a Graphics
object. Figures can be composed to create complex graphics.
Nested Class Summary | |
---|---|
static class |
IFigure.NoInsets
Insets that are all 0. |
Field Summary | |
---|---|
static Dimension |
MAX_DIMENSION
The maximum allowable dimension. |
static Dimension |
MIN_DIMENSION
The minimum allowable dimension. (5,5) |
static Insets |
NO_INSETS
Empty Insets. |
Method Summary | |
---|---|
void |
add(IFigure figure)
Adds the given IFigure as a child of this IFigure. |
void |
add(IFigure figure,
int index)
Adds the given IFigure as a child of this IFigure at the given index. |
void |
add(IFigure figure,
Object constraint)
Adds the given IFigure as a child of this IFigure with the given constraint. |
void |
add(IFigure figure,
Object constraint,
int index)
Adds the child with the specified index and constraint. |
void |
addAncestorListener(AncestorListener listener)
Registers the given listener as an AncestorListener of this figure. |
void |
addCoordinateListener(CoordinateListener listener)
Registers the given listener as a CoordinateListener of this figure. |
void |
addFigureListener(FigureListener listener)
Registers the given listener as a FigureListener of this figure. |
void |
addFocusListener(FocusListener listener)
Registers the given listener as a FocusListener of this figure. |
void |
addKeyListener(KeyListener listener)
Registers the given listener as a KeyListener of this figure. |
void |
addLayoutListener(LayoutListener listener)
Registers the given listener on this figure. |
void |
addMouseListener(MouseListener listener)
Registers the given listener as a MouseListener of this IFigure. |
void |
addMouseMotionListener(MouseMotionListener listener)
Registers the given listener as a MouseMotionListener of this IFigure. |
void |
addNotify()
Called after this IFigure is added to its parent. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers the given listener as a PropertyChangeListener of this IFigure. |
void |
addPropertyChangeListener(String property,
PropertyChangeListener listener)
Registers the given listener as a PropertyChangeListener of this IFigure, interested only in the given property. |
boolean |
containsPoint(int x,
int y)
Returns true if the point (x, y) is contained
within this IFigure's bounds. |
boolean |
containsPoint(Point p)
Returns true if the Point p is contained within this
IFigure's bounds. |
void |
erase()
Erases this IFigure. |
IFigure |
findFigureAt(int x,
int y)
Returns the IFigure at the specified location. |
IFigure |
findFigureAt(int x,
int y,
TreeSearch search)
Returns the IFigure at the specified location based on the conditional TreeSearch. |
IFigure |
findFigureAt(Point p)
Returns the IFigure at the specified location. |
IFigure |
findFigureAtExcluding(int x,
int y,
Collection collection)
Returns the IFigure at the specified location, excluding any IFigures in collection . |
IFigure |
findMouseEventTargetAt(int x,
int y)
Returns the IFigure located at the given location which will accept mouse events. |
Color |
getBackgroundColor()
Returns the background color. |
Border |
getBorder()
Returns the current border by reference. |
Rectangle |
getBounds()
Returns the smallest rectangle completely enclosing the IFigure. |
List |
getChildren()
Returns an unmodifiable list of children by reference. |
Rectangle |
getClientArea()
Returns the rectangular area within this Figure's bounds in which children will be placed (via LayoutManagers ) and
the painting of children will be clipped. |
Rectangle |
getClientArea(Rectangle rect)
Copies the client area into the specificied Recangle, and returns that rectangle for convenience. |
IClippingStrategy |
getClippingStrategy()
Returns the IClippingStrategy used by this figure to clip its children |
Cursor |
getCursor()
Returns the Cursor used when the mouse is over this IFigure. |
Font |
getFont()
Returns the current Font by reference. |
Color |
getForegroundColor()
Returns the foreground color. |
Insets |
getInsets()
Returns the current Insets. |
LayoutManager |
getLayoutManager()
Returns the current LayoutManager by reference. |
Color |
getLocalBackgroundColor()
Returns the background Color of this Figure. |
Color |
getLocalForegroundColor()
Returns the local foreground Color of this Figure. |
Dimension |
getMaximumSize()
Returns a hint indicating the largest desireable size for the IFigure. |
Dimension |
getMinimumSize()
Returns a hint indicating the smallest desireable size for the IFigure. |
Dimension |
getMinimumSize(int wHint,
int hHint)
Returns a hint indicating the smallest desireable size for the IFigure. |
IFigure |
getParent()
Returns the IFigure that is the current parent of this IFigure or null if there is no parent. |
Dimension |
getPreferredSize()
Returns the preferred size for this IFigure. |
Dimension |
getPreferredSize(int wHint,
int hHint)
Returns the preferred size for this IFigure using the provided width and height hints. |
Dimension |
getSize()
Returns the current size. |
IFigure |
getToolTip()
Returns a IFigure that is the tooltip for this IFigure. |
UpdateManager |
getUpdateManager()
Returns the UpdateManager for this IFigure by reference. |
void |
handleFocusGained(FocusEvent event)
Called when this IFigure has gained focus. |
void |
handleFocusLost(FocusEvent event)
Called when this IFigure has lost focus. |
void |
handleKeyPressed(KeyEvent event)
Called when a key is pressed while this IFigure has focus. |
void |
handleKeyReleased(KeyEvent event)
Called when a key is released while this IFigure has focus. |
void |
handleMouseDoubleClicked(MouseEvent event)
Called when a mouse button has been double-clicked while within this IFigure's bounds. |
void |
handleMouseDragged(MouseEvent event)
Called when the mouse has been dragged within this IFigure's bounds. |
void |
handleMouseEntered(MouseEvent event)
Called when the mouse has entered this IFigure's bounds. |
void |
handleMouseExited(MouseEvent event)
Called when the mouse has exited this IFigure's bounds. |
void |
handleMouseHover(MouseEvent event)
Called when the mouse has hovered over this IFigure. |
void |
handleMouseMoved(MouseEvent event)
Called when the mouse has moved within this IFigure's bounds. |
void |
handleMousePressed(MouseEvent event)
Called when a mouse button has been pressed while within this IFigure's bounds. |
void |
handleMouseReleased(MouseEvent event)
Called when a mouse button has been released while within this IFigure's bounds. |
boolean |
hasFocus()
Returns true if this IFigure has focus. |
EventDispatcher |
internalGetEventDispatcher()
This method is for internal purposes only and should not be called. |
boolean |
intersects(Rectangle rect)
Returns true if this IFigure's bounds intersect with the
given Rectangle. |
void |
invalidate()
Invalidates this IFigure. |
void |
invalidateTree()
Invalidates this figure as well as all contained within. |
boolean |
isCoordinateSystem()
Returns true if this figure is capable of applying a local
coordinate system which affects its children. |
boolean |
isEnabled()
Returns true if this IFigure is enabled. |
boolean |
isFocusTraversable()
Returns true if this IFigure can gain focus on a
TraverseEvent . |
boolean |
isMirrored()
|
boolean |
isOpaque()
Returns true if this IFigure is opaque. |
boolean |
isRequestFocusEnabled()
Returns true if this IFigure can receive focus on a call to
requestFocus() . |
boolean |
isShowing()
Returns true if this IFigure is showing. |
boolean |
isVisible()
returns true if this figure's visibility flag is set to
true. |
void |
paint(Graphics graphics)
Paints this IFigure and its children. |
void |
remove(IFigure figure)
Removes the given child from this figure's children. |
void |
removeAncestorListener(AncestorListener listener)
Unregisters the given listener, so that it will no longer receive notification of ancestor events. |
void |
removeCoordinateListener(CoordinateListener listener)
Unregisters the given listener, so that it will no longer receive notification of coordinate changes. |
void |
removeFigureListener(FigureListener listener)
Unregisters the given listener, so that it will no longer receive notification of IFigure events. |
void |
removeFocusListener(FocusListener listener)
Unregisters the given listener, so that it will no longer receive notification of focus events. |
void |
removeKeyListener(KeyListener listener)
Removes the first occurence of the given listener. |
void |
removeLayoutListener(LayoutListener listener)
Removes the most recent occurence of the given listener. |
void |
removeMouseListener(MouseListener listener)
Unregisters the given listener, so that it will no longer receive notification of mouse events. |
void |
removeMouseMotionListener(MouseMotionListener listener)
Unregisters the given listener, so that it will no longer receive notification of mouse motion events. |
void |
removeNotify()
Called before this IFigure is removed from its parent. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Unregisters the given listener, so that it will no longer receive notification of any property changes. |
void |
removePropertyChangeListener(String property,
PropertyChangeListener listener)
Unregisters the given listener, so that it will no longer receive notification of changes in the given property. |
void |
repaint()
Repaints this IFigure. |
void |
repaint(int x,
int y,
int w,
int h)
Repaints the rectangular area within this IFigure whose upper-left corner is located at the point (x,y) and whose width and height are
w and h , respectively. |
void |
repaint(Rectangle rect)
Repaints the rectangular area within this IFigure represented by rect . |
void |
requestFocus()
Requests focus from the EventDispatcher . |
void |
revalidate()
Invalidates this figure and revalidates() its parent. |
void |
setBackgroundColor(Color c)
Sets the background color. |
void |
setBorder(Border b)
Sets the border. |
void |
setBounds(Rectangle rect)
Sets the bounds to the bounds of the specified Rectangle . |
void |
setClippingStrategy(IClippingStrategy clippingStrategy)
Registers a clipping strategy to specify how clipping is performed for child figures. |
void |
setConstraint(IFigure child,
Object constraint)
Convenience method to set the constraint of the specified child in the current LayoutManager. |
void |
setCursor(Cursor cursor)
Sets the cursor. |
void |
setEnabled(boolean value)
Sets this IFigure to be enabled. |
void |
setFocusTraversable(boolean value)
Sets the ability for this IFigure to gain focus on a TraverseEvent . |
void |
setFont(Font f)
Sets the font. |
void |
setForegroundColor(Color c)
Sets the foreground color. |
void |
setLayoutManager(LayoutManager lm)
Sets the LayoutManager. |
void |
setLocation(Point p)
Sets the location of this IFigure. |
void |
setMaximumSize(Dimension size)
Sets the maximum size this IFigure can be. |
void |
setMinimumSize(Dimension size)
Sets the minimum size this IFigure can be. |
void |
setOpaque(boolean isOpaque)
Sets this IFigure to be opaque if isOpaque is true
and transparent if isOpaque is false . |
void |
setParent(IFigure parent)
Sets this IFigure's parent. |
void |
setPreferredSize(Dimension size)
Sets this IFigure's preferred size. |
void |
setRequestFocusEnabled(boolean requestFocusEnabled)
Sets the ability for this Figure to gain focus on a call to requestFocus() . |
void |
setSize(Dimension d)
Sets this IFigure's size. |
void |
setSize(int w,
int h)
Sets this IFigure's size. |
void |
setToolTip(IFigure figure)
Sets a tooltip that is displayed when the mouse hovers over this IFigure. |
void |
setVisible(boolean visible)
Sets this IFigure's visibility. |
void |
translate(int x,
int y)
Moves this IFigure x pixels horizontally and y
pixels vertically. |
void |
translateFromParent(Translatable t)
Translates a Translatable from this IFigure's parent's coordinates to this IFigure's local coordinates. |
void |
translateToAbsolute(Translatable t)
Translates a Translatable that is relative to this figure's bounds to absolute. |
void |
translateToParent(Translatable t)
Translates a Translatable from this IFigure's coordinates to its parent's coordinates. |
void |
translateToRelative(Translatable t)
Translates a Translatable in absolute coordinates to be relative to this figure's bounds. |
void |
validate()
Indicates that this figure should make itself valid. |
Field Detail |
---|
static final Dimension MAX_DIMENSION
Integer.MAX_VALUE
,
Integer.MAX_VALUE
)
static final Dimension MIN_DIMENSION
static final Insets NO_INSETS
Method Detail |
---|
void add(IFigure figure)
add(figure, null, -1)
.
figure
- The IFigure to addvoid add(IFigure figure, int index)
add(figure, null,
index)
.
figure
- The IFigure to addindex
- The index where the IFigure should be addedvoid add(IFigure figure, Object constraint)
add(figure, constraint, -1)
.
figure
- The IFigure to addconstraint
- The newly added IFigure's constraintvoid add(IFigure figure, Object constraint, int index)
LayoutManager.setConstraint(IFigure, Object)
shall be called on
the layout.
figure
- The IFigure to addconstraint
- The newly added IFigure's constraintindex
- The index where the IFigure should be added
IndexOutOfBoundsException
- if the index is out of range
IllegalArgumentException
- if adding the child creates a cyclevoid addAncestorListener(AncestorListener listener)
listener
- The listener to addvoid addCoordinateListener(CoordinateListener listener)
listener
- the listener to addvoid addFigureListener(FigureListener listener)
listener
- The listener to addvoid addFocusListener(FocusListener listener)
listener
- The listener to addvoid addKeyListener(KeyListener listener)
listener
- The listener to addvoid addLayoutListener(LayoutListener listener)
listener
- The listener to addvoid addMouseListener(MouseListener listener)
listener
- The listener to addvoid addMouseMotionListener(MouseMotionListener listener)
listener
- The listener to addvoid addNotify()
void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to addvoid addPropertyChangeListener(String property, PropertyChangeListener listener)
property
- The property the listener is interested inlistener
- The listener to addboolean containsPoint(int x, int y)
true
if the point (x, y)
is contained
within this IFigure's bounds.
x
- The X coordinatey
- The Y coordinate
true
if the point (x,y) is contained in this
IFigure's boundsboolean containsPoint(Point p)
true
if the Point p is contained within this
IFigure's bounds.
p
- The point
true
if the Point p is contained within this
IFigure's boundsvoid erase()
IFigure findFigureAt(int x, int y)
this
or null
.
x
- The X coordinatey
- The Y coordinate
IFigure findFigureAt(int x, int y, TreeSearch search)
this
or null
x
- the X coordinatey
- the Y coordinatesearch
- the conditional TreeSearch
IFigure findFigureAt(Point p)
this
or null
.
p
- The point
IFigure findFigureAtExcluding(int x, int y, Collection collection)
collection
. May return this
or
null
.
x
- The X coordinatey
- The Y coordinatecollection
- A collection of IFigures to be excluded
IFigure findMouseEventTargetAt(int x, int y)
x
- The X coordinatey
- The Y coordinate
Color getBackgroundColor()
Border getBorder()
Rectangle getBounds()
List getChildren()
Rectangle getClientArea()
LayoutManagers
) and
the painting of children will be clipped.
Rectangle getClientArea(Rectangle rect)
rect
- The destination rectangle for the client area
IClippingStrategy getClippingStrategy()
Cursor getCursor()
Font getFont()
Color getForegroundColor()
Insets getInsets()
LayoutManager getLayoutManager()
Color getLocalBackgroundColor()
Color getLocalForegroundColor()
Dimension getMaximumSize()
Dimension getMinimumSize()
Dimension getMinimumSize(int wHint, int hHint)
wHint
- the width hinthHint
- the height hint
IFigure getParent()
null
if there is no parent.
null
or the parent figureDimension getPreferredSize()
getPreferredSize(-1, -1)
.
Dimension getPreferredSize(int wHint, int hHint)
-1
indicates
that there is no constraint in that direction.
wHint
- a width hinthHint
- a height hint
Dimension getSize()
IFigure getToolTip()
UpdateManager getUpdateManager()
void handleFocusGained(FocusEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
FocusListener
with this IFigure.
event
- The focus eventvoid handleFocusLost(FocusEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
FocusListener
with this IFigure.
event
- The focus eventvoid handleKeyPressed(KeyEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
KeyListener
with this IFigure.
event
- The key eventvoid handleKeyReleased(KeyEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
KeyListener
with this IFigure.
event
- The key eventvoid handleMouseDoubleClicked(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseListener
with this IFigure.
event
- The mouse eventvoid handleMouseDragged(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseMotionListener
with this IFigure.
event
- The mouse eventvoid handleMouseEntered(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseMotionListener
with this IFigure.
event
- The mouse eventvoid handleMouseExited(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseMotionListener
with this IFigure.
event
- The mouse eventvoid handleMouseHover(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseMotionListener
with this IFigure.
event
- The mouse eventvoid handleMouseMoved(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseMotionListener
with this IFigure.
event
- The mouse eventvoid handleMousePressed(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseListener
with this IFigure.
event
- The mouse eventvoid handleMouseReleased(MouseEvent event)
NOTE: You should not override this method. If you are interested
in receiving notification of this type of event, you should register a
MouseListener
with this IFigure.
event
- The mouse eventboolean hasFocus()
true
if this IFigure has focus.
true
if this IFigure has focusEventDispatcher internalGetEventDispatcher()
boolean intersects(Rectangle rect)
true
if this IFigure's bounds intersect with the
given Rectangle. Figure is asked so that non-rectangular IFigures can
reduce the frequency of paints.
rect
- The rectangle to check for intersection
true
if this IFigure's bounds intersect with the
given Rectanglevoid invalidate()
LayoutManager.invalidate()
should be called on that layout.
void invalidateTree()
boolean isCoordinateSystem()
true
if this figure is capable of applying a local
coordinate system which affects its children.
true
if this figure provides local coordinates to
childrenboolean isEnabled()
true
if this IFigure is enabled.
true
if this IFigure is enabledboolean isFocusTraversable()
true
if this IFigure can gain focus on a
TraverseEvent
.
true
if this IFigure can gain focus on a
TraverseEventboolean isMirrored()
true
if this figure is hosted in a Control that is
mirroredboolean isOpaque()
true
if this IFigure is opaque.
true
if this IFigure is opaqueboolean isRequestFocusEnabled()
true
if this IFigure can receive focus on a call to
requestFocus()
.
true
if this IFigure can receive focus on a call to
requestFocus()boolean isShowing()
true
if this IFigure is showing. This figure is only
showing if it is visible and its parent is showing, or it has no parent.
true
if this IFigure is showingboolean isVisible()
true
if this figure's visibility flag is set to
true. Does not walk up the parent chain.
true
if the figure's visibility flag is setvoid paint(Graphics graphics)
graphics
- The Graphics object used for paintingvoid remove(IFigure figure)
LayoutManager.remove(IFigure)
shall be called
on that layout with the child.
figure
- The IFigure to removevoid removeAncestorListener(AncestorListener listener)
listener
- The listener to removevoid removeCoordinateListener(CoordinateListener listener)
listener
- the listener to removevoid removeFigureListener(FigureListener listener)
listener
- The listener to removevoid removeFocusListener(FocusListener listener)
listener
- The listener to removevoid removeKeyListener(KeyListener listener)
listener
- The listener to removevoid removeLayoutListener(LayoutListener listener)
listener
- the listener to removevoid removeMouseListener(MouseListener listener)
listener
- The listener to removevoid removeMouseMotionListener(MouseMotionListener listener)
listener
- The listener to removevoid removeNotify()
void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to removevoid removePropertyChangeListener(String property, PropertyChangeListener listener)
property
- The property that the listener is no longer interested inlistener
- The listener no longer interested in the propertyvoid repaint()
void repaint(int x, int y, int w, int h)
(x,y)
and whose width and height are
w
and h
, respectively.
x
- The X coordinate of the area to repainty
- The Y coordinate of the area to repaintw
- The width of the area to repainth
- The height of the area to repaintvoid repaint(Rectangle rect)
rect
.
rect
- The rectangular area to be repaintedvoid requestFocus()
EventDispatcher
.
void revalidate()
void setBackgroundColor(Color c)
c
- The new background colorvoid setBorder(Border b)
b
- The new bordervoid setBounds(Rectangle rect)
Rectangle
.
rect
- The new boundsvoid setClippingStrategy(IClippingStrategy clippingStrategy)
clippingStrategy
- void setConstraint(IFigure child, Object constraint)
child
- The figure whose constraint is being setconstraint
- the constraint
IllegalArgumentException
- if the child is not contained by this Figurevoid setCursor(Cursor cursor)
cursor
- The new cursorvoid setEnabled(boolean value)
value
- true
if this IFigure should be enabledvoid setFocusTraversable(boolean value)
TraverseEvent
.
value
- true
if this IFigure should gain focus on a
TraverseEventvoid setFont(Font f)
f
- The new fontvoid setForegroundColor(Color c)
c
- The new foreground colorvoid setLayoutManager(LayoutManager lm)
lm
- The new layout managervoid setLocation(Point p)
p
- The new locationvoid setMaximumSize(Dimension size)
size
- The new maximum sizevoid setMinimumSize(Dimension size)
size
- The new minimum sizevoid setOpaque(boolean isOpaque)
true
and transparent if isOpaque is false
.
isOpaque
- true
is this IFigure should be opaquevoid setParent(IFigure parent)
parent
- The new parent IFigurevoid setPreferredSize(Dimension size)
size
- The new preferred sizevoid setRequestFocusEnabled(boolean requestFocusEnabled)
requestFocus()
.
requestFocusEnabled
- true
if this IFigure should gain focus on a call
to requestFocus()void setSize(Dimension d)
d
- The new sizevoid setSize(int w, int h)
w
- The new widthh
- The new heightvoid setToolTip(IFigure figure)
figure
- The tooltip IFigurevoid setVisible(boolean visible)
visible
- true
if this IFigure should be visiblevoid translate(int x, int y)
x
pixels horizontally and y
pixels vertically.
x
- The amount to move this IFigure horizontallyy
- The amount to move this IFigure verticallyvoid translateFromParent(Translatable t)
t
- The object to translatevoid translateToAbsolute(Translatable t)
t
- The object to translatevoid translateToParent(Translatable t)
t
- The object to translatevoid translateToRelative(Translatable t)
t
- The object to translatevoid validate()
|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |