org.eclipse.draw2d
Interface IFigure
-
All Known Subinterfaces:
-
Connection,
FreeformFigure,
Orientable,
RotatableDecoration,
ScalableFigure
-
All Known Implementing Classes:
-
ArrowButton,
Figure,
FreeformLayer,
FreeformLayeredPane,
PolygonDecoration,
PolylineConnection,
PolylineDecoration,
ScalableFreeformLayeredPane,
ScalableLayeredPane,
ScrollBar,
Triangle
- public interface IFigure
A lightweight graphical object. Figures are rendered to a
Graphics
object.
Figures can be composed to create complex graphics.
WARNING: This interface is not intended to be implemented by clients.
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,
java.lang.Object constraint)
Adds the given IFigure as a child of this IFigure with the given constraint. |
void
|
add
(
IFigure figure,
java.lang.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
(java.beans.PropertyChangeListener listener)
Registers the given listener as a PropertyChangeListener of this IFigure. |
void
|
addPropertyChangeListener
(java.lang.String property,
java.beans.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,
java.util.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. |
java.util.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. |
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
(java.beans.PropertyChangeListener listener)
Unregisters the given listener, so that it will no longer receive notification of any
property changes. |
void
|
removePropertyChangeListener
(java.lang.String property,
java.beans.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
|
setConstraint
(
IFigure child,
java.lang.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. |
MAX_DIMENSION
public static final
Dimension MAX_DIMENSION
- The maximum allowable dimension. (
Integer.MAX_VALUE
,Integer.MAX_VALUE
)
MIN_DIMENSION
public static final
Dimension MIN_DIMENSION
- The minimum allowable dimension. (5,5)
NO_INSETS
public static final
Insets NO_INSETS
- Empty Insets.
add
public void add(
IFigure figure)
- Adds the given IFigure as a child of this IFigure. The same as calling
add(figure, null, -1)
.
-
-
Parameters:
-
figure
- The IFigure to add
add
public void add(
IFigure figure,
int index)
- Adds the given IFigure as a child of this IFigure at the given index. The same as
calling
add(figure, null, index)
.
-
-
Parameters:
-
figure
- The IFigure to add -
index
- The index where the IFigure should be added
add
public void add(
IFigure figure,
java.lang.Object constraint)
- Adds the given IFigure as a child of this IFigure with the given constraint. The same
as calling
add(figure, constraint, -1)
.
-
-
Parameters:
-
figure
- The IFigure to add -
constraint
- The newly added IFigure's constraint
add
public void add(
IFigure figure,
java.lang.Object constraint,
int index)
- Adds the child with the specified index and constraint. The child's parent is currently
not null, it is removed from that parent. If this figure has a LayoutManager, then
LayoutManager.setConstraint(IFigure, Object)
shall be called on the layout.
-
-
Parameters:
-
figure
- The IFigure to add -
constraint
- The newly added IFigure's constraint -
index
- The index where the IFigure should be added
-
Throws:
-
java.lang.IndexOutOfBoundsException
- if the index is out of range
-
java.lang.IllegalArgumentException
- if adding the child creates a cycle
addAncestorListener
public void addAncestorListener(
AncestorListener listener)
- Registers the given listener as an AncestorListener of this figure.
-
-
Parameters:
-
listener
- The listener to add
addCoordinateListener
public void addCoordinateListener(
CoordinateListener listener)
- Registers the given listener as a CoordinateListener of this figure.
-
-
Parameters:
-
listener
- the listener to add -
Since:
- 3.1
addFigureListener
public void addFigureListener(
FigureListener listener)
- Registers the given listener as a FigureListener of this figure.
-
-
Parameters:
-
listener
- The listener to add
addFocusListener
public void addFocusListener(
FocusListener listener)
- Registers the given listener as a FocusListener of this figure.
-
-
Parameters:
-
listener
- The listener to add
addKeyListener
public void addKeyListener(
KeyListener listener)
- Registers the given listener as a KeyListener of this figure.
-
-
Parameters:
-
listener
- The listener to add
addLayoutListener
public void addLayoutListener(
LayoutListener listener)
- Registers the given listener on this figure.
-
-
Parameters:
-
listener
- The listener to add -
Since:
- 3.1
addMouseListener
public void addMouseListener(
MouseListener listener)
- Registers the given listener as a MouseListener of this IFigure.
-
-
Parameters:
-
listener
- The listener to add
addMouseMotionListener
public void addMouseMotionListener(
MouseMotionListener listener)
- Registers the given listener as a MouseMotionListener of this IFigure.
-
-
Parameters:
-
listener
- The listener to add
addNotify
public void addNotify()
- Called after this IFigure is added to its parent.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Registers the given listener as a PropertyChangeListener of this IFigure.
-
-
Parameters:
-
listener
- The listener to add
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
- Registers the given listener as a PropertyChangeListener of this IFigure, interested
only in the given property.
-
-
Parameters:
-
property
- The property the listener is interested in -
listener
- The listener to add
containsPoint
public boolean containsPoint(int x,
int y)
- Returns
true
if the point (x, y)
is contained within this
IFigure's bounds.
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate
-
Returns:
-
true
if the point (x,y) is contained in this IFigure's bounds
containsPoint
public boolean containsPoint(
Point p)
- Returns
true
if the Point p is contained within this IFigure's bounds.
-
-
Parameters:
-
p
- The point
-
Returns:
-
true
if the Point p is contained within this IFigure's bounds
erase
public void erase()
- Erases this IFigure.
-
findFigureAt
public
IFigure findFigureAt(int x,
int y)
- Returns the IFigure at the specified location. May return
this
or
null
.
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate
-
Returns:
- The IFigure at the specified location
findFigureAt
public
IFigure findFigureAt(int x,
int y,
TreeSearch search)
- Returns the IFigure at the specified location based on the conditional TreeSearch. May
return
this
or null
-
-
Parameters:
-
x
- the X coordinate -
y
- the Y coordinate -
search
- the conditional TreeSearch
-
Returns:
- the IFigure at the specified location
findFigureAt
public
IFigure findFigureAt(
Point p)
- Returns the IFigure at the specified location. May return
this
or
null
.
-
-
Parameters:
-
p
- The point
-
Returns:
- The IFigure at the specified location
findFigureAtExcluding
public
IFigure findFigureAtExcluding(int x,
int y,
java.util.Collection collection)
- Returns the IFigure at the specified location, excluding any IFigures in
collection
. May return this
or null
.
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate -
collection
- A collection of IFigures to be excluded
-
Returns:
- The IFigure at the specified location, excluding any IFigures in collection
findMouseEventTargetAt
public
IFigure findMouseEventTargetAt(int x,
int y)
- Returns the IFigure located at the given location which will accept mouse events.
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate
-
Returns:
- The IFigure located at the given location which will accept mouse events
getBackgroundColor
public Color getBackgroundColor()
- Returns the background color. Background color can be inherited from the parent.
-
-
Returns:
- The background color
getBorder
public
Border getBorder()
- Returns the current border by reference.
-
-
Returns:
- The current border
getBounds
public
Rectangle getBounds()
- Returns the smallest rectangle completely enclosing the IFigure. Implementation may
return the Rectangle by reference. For this reason, callers of this method must not
modify the returned Rectangle. The Rectangle's values may change in the future.
-
-
Returns:
- This IFigure's bounds
getChildren
public java.util.List getChildren()
- Returns an unmodifiable list of children by reference.
-
-
Returns:
- An unmodifiable list of children by reference
getClientArea
public
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.
-
-
Returns:
- The client area
getClientArea
public
Rectangle getClientArea(
Rectangle rect)
- Copies the client area into the specificied Recangle, and returns that rectangle for
convenience.
-
-
Parameters:
-
rect
- The destination rectangle for the client area
-
Returns:
- The same instance that was passed in, modified to contain the client area
getCursor
public Cursor getCursor()
- Returns the Cursor used when the mouse is over this IFigure.
-
-
Returns:
- The Cursor used when the mouse is over this IFigure
getFont
public Font getFont()
- Returns the current Font by reference.
-
-
Returns:
- The current Font
getForegroundColor
public Color getForegroundColor()
- Returns the foreground color.
-
-
Returns:
- The foreground color
getInsets
public
Insets getInsets()
- Returns the current Insets. May be returned by reference. The returned value should
not be modified.
-
-
Returns:
- The current Insets.
getLayoutManager
public
LayoutManager getLayoutManager()
- Returns the current LayoutManager by reference.
-
-
Returns:
- The current LayoutManager by reference
getLocalBackgroundColor
public Color getLocalBackgroundColor()
- Returns the background Color of this Figure. Does not inherit this Color from the
parent, may return null.
-
-
Returns:
- The local background Color
getLocalForegroundColor
public Color getLocalForegroundColor()
- Returns the local foreground Color of this Figure. Does not inherit this Color from the
parent, may return null.
-
-
Returns:
- The local foreground Color
getMaximumSize
public
Dimension getMaximumSize()
- Returns a hint indicating the largest desireable size for the IFigure. Returned
Dimension is by value.
-
-
Returns:
- The maximum size
getMinimumSize
public
Dimension getMinimumSize()
- Returns a hint indicating the smallest desireable size for the IFigure.
The returned dimension may be by reference, and it must not be modified by the
caller.
-
-
Returns:
- The minimum size
getMinimumSize
public
Dimension getMinimumSize(int wHint,
int hHint)
- Returns a hint indicating the smallest desireable size for the IFigure.
The returned dimension may be by reference, and it must not be modified by the
caller.
-
-
Parameters:
-
wHint
- the width hint -
hHint
- the height hint
-
Returns:
- The minimum size
getParent
public
IFigure getParent()
- Returns the IFigure that is the current parent of this IFigure or
null
if
there is no parent.
-
-
Returns:
-
null
or the parent figure
getPreferredSize
public
Dimension getPreferredSize()
- Returns the preferred size for this IFigure. The returned value must not be modified
by the caller. If the figure has no preference, it returns its current size. The same
as calling
getPreferredSize(-1, -1)
.
-
-
Returns:
- The preferred size
getPreferredSize
public
Dimension getPreferredSize(int wHint,
int hHint)
- Returns the preferred size for this IFigure using the provided width and height hints.
The returned dimension may be by reference, and it must not be modified by the
caller. A value of
-1
indicates that there is no constraint in that
direction.
-
-
Parameters:
-
wHint
- a width hint -
hHint
- a height hint
-
Returns:
- The preferred size
getSize
public
Dimension getSize()
- Returns the current size. Returned Dimension is by value.
-
-
Returns:
- The current size
getToolTip
public
IFigure getToolTip()
- Returns a IFigure that is the tooltip for this IFigure.
-
-
Returns:
- This IFigure's tooltip
getUpdateManager
public
UpdateManager getUpdateManager()
- Returns the UpdateManager for this IFigure by reference.
-
-
Returns:
- The update manager
handleFocusGained
public void handleFocusGained(
FocusEvent event)
- Called when this IFigure has gained focus.
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.
-
-
Parameters:
-
event
- The focus event
handleFocusLost
public void handleFocusLost(
FocusEvent event)
- Called when this IFigure has lost focus.
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.
-
-
Parameters:
-
event
- The focus event
handleKeyPressed
public void handleKeyPressed(
KeyEvent event)
- Called when a key is pressed while this IFigure has focus.
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.
-
-
Parameters:
-
event
- The key event
handleKeyReleased
public void handleKeyReleased(
KeyEvent event)
- Called when a key is released while this IFigure has focus.
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.
-
-
Parameters:
-
event
- The key event
handleMouseDoubleClicked
public void handleMouseDoubleClicked(
MouseEvent event)
- Called when a mouse button has been double-clicked while within this IFigure's bounds.
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.
-
-
Parameters:
-
event
- The mouse event
handleMouseDragged
public void handleMouseDragged(
MouseEvent event)
- Called when the mouse has been dragged within this IFigure's bounds.
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.
-
-
Parameters:
-
event
- The mouse event
handleMouseEntered
public void handleMouseEntered(
MouseEvent event)
- Called when the mouse has entered this IFigure's bounds.
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.
-
-
Parameters:
-
event
- The mouse event
handleMouseExited
public void handleMouseExited(
MouseEvent event)
- Called when the mouse has exited this IFigure's bounds.
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.
-
-
Parameters:
-
event
- The mouse event
handleMouseHover
public void handleMouseHover(
MouseEvent event)
- Called when the mouse has hovered over this IFigure.
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.
-
-
Parameters:
-
event
- The mouse event
handleMouseMoved
public void handleMouseMoved(
MouseEvent event)
- Called when the mouse has moved within this IFigure's bounds.
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.
-
-
Parameters:
-
event
- The mouse event
handleMousePressed
public void handleMousePressed(
MouseEvent event)
- Called when a mouse button has been pressed while within this IFigure's bounds.
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.
-
-
Parameters:
-
event
- The mouse event
handleMouseReleased
public void handleMouseReleased(
MouseEvent event)
- Called when a mouse button has been released while within this IFigure's bounds.
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.
-
-
Parameters:
-
event
- The mouse event
hasFocus
public boolean hasFocus()
- Returns
true
if this IFigure has focus.
-
-
Returns:
-
true
if this IFigure has focus
internalGetEventDispatcher
public
EventDispatcher internalGetEventDispatcher()
- This method is for internal purposes only and should not be called.
-
-
Returns:
- The event dispatcher
intersects
public boolean intersects(
Rectangle rect)
- Returns
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.
-
-
Parameters:
-
rect
- The rectangle to check for intersection
-
Returns:
-
true
if this IFigure's bounds intersect with the given Rectangle
invalidate
public void invalidate()
- Invalidates this IFigure. If this figure has a LayoutManager, then
LayoutManager.invalidate()
should be called on that layout.
-
invalidateTree
public void invalidateTree()
- Invalidates this figure as well as all contained within.
-
isCoordinateSystem
public boolean isCoordinateSystem()
- Returns
true
if this figure is capable of applying a local coordinate
system which affects its children.
-
-
Returns:
-
true
if this figure provides local coordinates to children -
Since:
- 3.1
isEnabled
public boolean isEnabled()
- Returns
true
if this IFigure is enabled.
-
-
Returns:
-
true
if this IFigure is enabled
isFocusTraversable
public boolean isFocusTraversable()
- Returns
true
if this IFigure can gain focus on a
TraverseEvent
.
-
-
Returns:
-
true
if this IFigure can gain focus on a TraverseEvent
isMirrored
public boolean isMirrored()
-
-
Returns:
-
true
if this figure is hosted in a Control that is mirrored -
Since:
- 3.1
isOpaque
public boolean isOpaque()
- Returns
true
if this IFigure is opaque.
-
-
Returns:
-
true
if this IFigure is opaque
isRequestFocusEnabled
public boolean isRequestFocusEnabled()
- Returns
true
if this IFigure can receive focus on a call to
requestFocus()
.
-
-
Returns:
-
true
if this IFigure can receive focus on a call to requestFocus()
isShowing
public boolean isShowing()
- Returns
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.
-
-
Returns:
-
true
if this IFigure is showing
isVisible
public boolean isVisible()
- returns
true
if this figure's visibility flag is set to true. Does not
walk up the parent chain.
-
-
Returns:
-
true
if the figure's visibility flag is set
paint
public void paint(
Graphics graphics)
- Paints this IFigure and its children.
-
-
Parameters:
-
graphics
- The Graphics object used for painting
remove
public void remove(
IFigure figure)
- Removes the given child from this figure's children. If this figure has a
LayoutManager, then
LayoutManager.remove(IFigure)
shall be called on that
layout with the child.
-
-
Parameters:
-
figure
- The IFigure to remove
removeAncestorListener
public void removeAncestorListener(
AncestorListener listener)
- Unregisters the given listener, so that it will no longer receive notification of
ancestor events.
-
-
Parameters:
-
listener
- The listener to remove
removeCoordinateListener
public void removeCoordinateListener(
CoordinateListener listener)
- Unregisters the given listener, so that it will no longer receive notification of
coordinate changes.
-
-
Parameters:
-
listener
- the listener to remove -
Since:
- 3.1
removeFigureListener
public void removeFigureListener(
FigureListener listener)
- Unregisters the given listener, so that it will no longer receive notification of
IFigure events.
-
-
Parameters:
-
listener
- The listener to remove
removeFocusListener
public void removeFocusListener(
FocusListener listener)
- Unregisters the given listener, so that it will no longer receive notification of focus
events.
-
-
Parameters:
-
listener
- The listener to remove
removeKeyListener
public void removeKeyListener(
KeyListener listener)
- Removes the first occurence of the given listener.
-
-
Parameters:
-
listener
- The listener to remove
removeLayoutListener
public void removeLayoutListener(
LayoutListener listener)
- Removes the most recent occurence of the given listener.
-
-
Parameters:
-
listener
- the listener to remove -
Since:
- 3.1
removeMouseListener
public void removeMouseListener(
MouseListener listener)
- Unregisters the given listener, so that it will no longer receive notification of mouse
events.
-
-
Parameters:
-
listener
- The listener to remove
removeMouseMotionListener
public void removeMouseMotionListener(
MouseMotionListener listener)
- Unregisters the given listener, so that it will no longer receive notification of mouse
motion events.
-
-
Parameters:
-
listener
- The listener to remove
removeNotify
public void removeNotify()
- Called before this IFigure is removed from its parent.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Unregisters the given listener, so that it will no longer receive notification of any
property changes.
-
-
Parameters:
-
listener
- The listener to remove
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
- Unregisters the given listener, so that it will no longer receive notification of
changes in the given property. This will only unregister the listener for the given
property. If the listener is registered to listen to other properties, this will not
affect the notification of the listener regarding those properties.
-
-
Parameters:
-
property
- The property that the listener is no longer interested in -
listener
- The listener no longer interested in the property
repaint
public void repaint()
- Repaints this IFigure.
-
repaint
public 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.
-
-
Parameters:
-
x
- The X coordinate of the area to repaint -
y
- The Y coordinate of the area to repaint -
w
- The width of the area to repaint -
h
- The height of the area to repaint
repaint
public void repaint(
Rectangle rect)
- Repaints the rectangular area within this IFigure represented by
rect
.
-
-
Parameters:
-
rect
- The rectangular area to be repainted
requestFocus
public void requestFocus()
- Requests focus from the
EventDispatcher
.
-
revalidate
public void revalidate()
- Invalidates this figure and revalidates() its parent. If a figure does not have a
parent, it will request a validation from it UpdateManager. Calling this method does
not guarantee that a repaint will occur.
-
setBackgroundColor
public void setBackgroundColor(Color c)
- Sets the background color.
-
-
Parameters:
-
c
- The new background color
setBorder
public void setBorder(
Border b)
- Sets the border.
-
-
Parameters:
-
b
- The new border
setBounds
public void setBounds(
Rectangle rect)
- Sets the bounds to the bounds of the specified
Rectangle
.
-
-
Parameters:
-
rect
- The new bounds
setConstraint
public void setConstraint(
IFigure child,
java.lang.Object constraint)
- Convenience method to set the constraint of the specified child in the current
LayoutManager.
-
-
Parameters:
-
child
- The figure whose constraint is being set -
constraint
- the constraint
-
Throws:
-
java.lang.IllegalArgumentException
- if the child is not contained by this Figure
setCursor
public void setCursor(Cursor cursor)
- Sets the cursor.
-
-
Parameters:
-
cursor
- The new cursor
setEnabled
public void setEnabled(boolean value)
- Sets this IFigure to be enabled.
-
-
Parameters:
-
value
- true
if this IFigure should be enabled
setFocusTraversable
public void setFocusTraversable(boolean value)
- Sets the ability for this IFigure to gain focus on a
TraverseEvent
.
-
-
Parameters:
-
value
- true
if this IFigure should gain focus on a TraverseEvent
setFont
public void setFont(Font f)
- Sets the font.
-
-
Parameters:
-
f
- The new font
setForegroundColor
public void setForegroundColor(Color c)
- Sets the foreground color.
-
-
Parameters:
-
c
- The new foreground color
setLayoutManager
public void setLayoutManager(
LayoutManager lm)
- Sets the LayoutManager.
-
-
Parameters:
-
lm
- The new layout manager
setLocation
public void setLocation(
Point p)
- Sets the location of this IFigure.
-
-
Parameters:
-
p
- The new location
setMaximumSize
public void setMaximumSize(
Dimension size)
- Sets the maximum size this IFigure can be.
-
-
Parameters:
-
size
- The new maximum size
setMinimumSize
public void setMinimumSize(
Dimension size)
- Sets the minimum size this IFigure can be.
-
-
Parameters:
-
size
- The new minimum size
setOpaque
public void setOpaque(boolean isOpaque)
- Sets this IFigure to be opaque if isOpaque is
true
and transparent
if isOpaque is false
.
-
-
Parameters:
-
isOpaque
- true
is this IFigure should be opaque
setParent
public void setParent(
IFigure parent)
- Sets this IFigure's parent.
-
-
Parameters:
-
parent
- The new parent IFigure
setPreferredSize
public void setPreferredSize(
Dimension size)
- Sets this IFigure's preferred size.
-
-
Parameters:
-
size
- The new preferred size
setRequestFocusEnabled
public void setRequestFocusEnabled(boolean requestFocusEnabled)
- Sets the ability for this Figure to gain focus on a call to
requestFocus()
.
-
-
Parameters:
-
requestFocusEnabled
- true
if this IFigure should gain focus on a call
to requestFocus()
setSize
public void setSize(
Dimension d)
- Sets this IFigure's size.
-
-
Parameters:
-
d
- The new size
setSize
public void setSize(int w,
int h)
- Sets this IFigure's size.
-
-
Parameters:
-
w
- The new width -
h
- The new height
setToolTip
public void setToolTip(
IFigure figure)
- Sets a tooltip that is displayed when the mouse hovers over this IFigure.
-
-
Parameters:
-
figure
- The tooltip IFigure
setVisible
public void setVisible(boolean visible)
- Sets this IFigure's visibility.
-
-
Parameters:
-
visible
- true
if this IFigure should be visible
translate
public void translate(int x,
int y)
- Moves this IFigure
x
pixels horizontally and y
pixels
vertically.
-
-
Parameters:
-
x
- The amount to move this IFigure horizontally -
y
- The amount to move this IFigure vertically
translateFromParent
public void translateFromParent(
Translatable t)
- Translates a Translatable from this IFigure's parent's coordinates to this IFigure's
local coordinates.
-
-
Parameters:
-
t
- The object to translate
translateToAbsolute
public void translateToAbsolute(
Translatable t)
- Translates a Translatable that is relative to this figure's bounds to absolute.
-
-
Parameters:
-
t
- The object to translate
translateToParent
public void translateToParent(
Translatable t)
- Translates a Translatable from this IFigure's coordinates to its parent's coordinates.
-
-
Parameters:
-
t
- The object to translate
translateToRelative
public void translateToRelative(
Translatable t)
- Translates a Translatable in absolute coordinates to be relative to this figure's
bounds.
-
-
Parameters:
-
t
- The object to translate
validate
public void validate()
- Indicates that this figure should make itself valid. Validation includes invoking
layout on a LayoutManager if present, and then validating all children figures.
Default validation uses pre-order, depth-first ordering.
-
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.