org.eclipse.draw2d
Class Figure
java.lang.Object
org.eclipse.draw2d.Figure
-
All Implemented Interfaces:
-
IFigure
-
Direct Known Subclasses:
-
Clickable,
FlowFigure,
ImageFigure,
Label,
LabeledContainer,
Layer,
LightweightSystem.RootFigure,
Panel,
ScrollBar,
ScrollPane,
Shape,
Thumbnail,
Viewport
- public class Figure
- extends java.lang.Object
- implements
IFigure
The base implementation for graphical figures.
Method Summary
|
void
|
add
(
IFigure figure)
Calls
add(IFigure, Object, int) with null as the constraint and
-1 as the index. |
void
|
add
(
IFigure figure,
int index)
Calls
add(IFigure, Object, int) with null as the constraint. |
void
|
add
(
IFigure figure,
java.lang.Object constraint)
Calls
add(IFigure, Object, int) with -1 as the index. |
void
|
add
(
IFigure figure,
java.lang.Object constraint,
int index)
Adds the child with the specified index and constraint. |
void
|
addAncestorListener
(
AncestorListener ancestorListener)
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)
Appends the given layout listener to the list of layout listeners. |
protected void
|
addListener
(java.lang.Class clazz,
java.lang.Object listener)
Adds a listener of type clazz to this Figure's list of event listeners. |
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 the receiver's parent has been set and it has been 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)
This method is final. |
void
|
erase
()
Erases this IFigure. |
protected
IFigure
|
findDescendantAtExcluding
(int x,
int y,
TreeSearch search)
Returns a descendant of this Figure such that the Figure returned contains the point
(x, y), and is accepted by the given TreeSearch. |
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 pt)
Returns the IFigure at the specified location. |
IFigure
|
findFigureAtExcluding
(int x,
int y,
java.util.Collection c)
Returns the IFigure at the specified location, excluding any IFigures in
collection . |
IFigure
|
findMouseEventTargetAt
(int x,
int y)
Returns the deepest descendant for which
isMouseEventTarget() returns
true or null if none found. |
protected
IFigure
|
findMouseEventTargetInDescendantsAt
(int x,
int y)
Searches this Figure's children for the deepest descendant for which
isMouseEventTarget() returns true and returns that descendant or
null if none found. |
protected void
|
fireCoordinateSystemChanged
()
Notifies to all
CoordinateListener s that this figure's local coordinate system
has changed in a way which affects the absolute bounds of figures contained within. |
protected void
|
fireFigureMoved
()
Notifies to all
FigureListener s that this figure has moved. |
protected void
|
fireMoved
()
Deprecated. call fireFigureMoved() or fireCoordinateSystemChanged() as appropriate
|
protected void
|
firePropertyChange
(java.lang.String property,
boolean old,
boolean current)
Notifies any PropertyChangeListeners listening to this
Figure that the boolean property with id property has changed. |
protected void
|
firePropertyChange
(java.lang.String property,
int old,
int current)
Notifies any PropertyChangeListeners listening to this
figure that the integer property with id property has changed. |
protected void
|
firePropertyChange
(java.lang.String property,
java.lang.Object old,
java.lang.Object current)
Notifies any PropertyChangeListeners listening to this
figure that the Object property with id property has changed. |
Color
|
getBackgroundColor
()
Returns this Figure's background color. |
Border
|
getBorder
()
Returns the current border by reference. |
Rectangle
|
getBounds
()
Returns the smallest rectangle completely enclosing the figure. |
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. |
protected boolean
|
getFlag
(int flag)
Returns the value of the given flag. |
Font
|
getFont
()
Returns the current Font by reference. |
Color
|
getForegroundColor
()
Returns the foreground color. |
Insets
|
getInsets
()
Returns the border's Insets if the border is set. |
LayoutManager
|
getLayoutManager
()
Returns the current LayoutManager by reference. |
protected java.util.Iterator
|
getListeners
(java.lang.Class clazz)
Returns an Iterator over the listeners of type clazz that are listening to
this Figure. |
Color
|
getLocalBackgroundColor
()
Returns null or the local background Color of this Figure. |
protected Font
|
getLocalFont
()
Returns null or the local font setting for this figure. |
Color
|
getLocalForegroundColor
()
Returns null or the local foreground Color of this Figure. |
Point
|
getLocation
()
Returns the top-left corner of this Figure's bounds. |
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
()
|
protected boolean
|
isMouseEventTarget
()
Returns true if this Figure can receive
MouseEvents . |
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. |
protected boolean
|
isValid
()
Returns true if this Figure is valid. |
protected boolean
|
isValidationRoot
()
Returns true if revalidating this Figure does not require revalidating its
parent. |
boolean
|
isVisible
()
returns true if this figure's visibility flag is set to true. |
protected void
|
layout
()
Lays out this Figure using its
LayoutManager . |
void
|
paint
(
Graphics graphics)
Paints this Figure and its children. |
protected void
|
paintBorder
(
Graphics graphics)
Paints the border associated with this Figure, if one exists. |
protected void
|
paintChildren
(
Graphics graphics)
Paints this Figure's children. |
protected void
|
paintClientArea
(
Graphics graphics)
Paints this Figure's client area. |
protected void
|
paintFigure
(
Graphics graphics)
Paints this Figure's primary representation, or background. |
protected void
|
primTranslate
(int dx,
int dy)
Translates this Figure's bounds, without firing a move. |
void
|
remove
(
IFigure figure)
Removes the given child Figure from this Figure's hierarchy and revalidates this
Figure. |
void
|
removeAll
()
Removes all children from this Figure. |
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 first occurence of the given listener. |
protected void
|
removeListener
(java.lang.Class clazz,
java.lang.Object listener)
Removes listener of type clazz from this Figure's list of listeners. |
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 prior to this figure's removal 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 bg)
Sets the background color. |
void
|
setBorder
(
Border border)
Sets the border. |
void
|
setBounds
(
Rectangle rect)
Sets the bounds of this Figure to the Rectangle rect. |
protected void
|
setChildrenDirection
(int direction)
Sets the direction of any
Orientable children. |
protected void
|
setChildrenEnabled
(boolean value)
Sets all childrens' enabled property to value. |
protected void
|
setChildrenOrientation
(int orientation)
Sets the orientation of any
Orientable children. |
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. |
protected void
|
setFlag
(int flag,
boolean value)
Sets the given flag to the given value. |
void
|
setFocusTraversable
(boolean focusTraversable)
Sets the ability for this IFigure to gain focus on a
TraverseEvent . |
void
|
setFont
(Font f)
Sets the font. |
void
|
setForegroundColor
(Color fg)
Sets the foreground color. |
void
|
setLayoutManager
(
LayoutManager manager)
Sets the LayoutManager. |
void
|
setLocation
(
Point p)
Sets the location of this IFigure. |
void
|
setMaximumSize
(
Dimension d)
Sets the maximum size this IFigure can be. |
void
|
setMinimumSize
(
Dimension d)
Sets the minimum size this IFigure can be. |
void
|
setOpaque
(boolean opaque)
Sets this IFigure to be opaque if isOpaque is true and transparent
if isOpaque is false . |
void
|
setParent
(
IFigure p)
Sets this IFigure's parent. |
void
|
setPreferredSize
(
Dimension size)
Sets this IFigure's preferred size. |
void
|
setPreferredSize
(int w,
int h)
Sets the preferred size of this figure. |
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 f)
Sets a tooltip that is displayed when the mouse hovers over this IFigure. |
void
|
setValid
(boolean value)
Sets this figure to be valid if value is true and invalid
otherwise. |
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. |
protected boolean
|
useLocalCoordinates
()
Returns true if this Figure uses local coordinates. |
void
|
validate
()
Indicates that this figure should make itself valid. |
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
MAX_FLAG
protected static int MAX_FLAG
- The largest flag defined in this class. If subclasses define flags, they should
declare them as larger than this value and redefine MAX_FLAG to be their largest flag
value.
This constant is evaluated at runtime and will not be inlined by the compiler.
bounds
protected
Rectangle bounds
- The rectangular area that this Figure occupies.
flags
protected int flags
- The flags for this Figure.
prefSize
protected
Dimension prefSize
- This Figure's preferred size.
minSize
protected
Dimension minSize
- This Figure's minimum size.
maxSize
protected
Dimension maxSize
- This Figure's maximum size.
font
protected Font font
-
Deprecated. access using
getLocalFont()
bgColor
protected Color bgColor
-
Deprecated. access using
getLocalBackgroundColor()
.
fgColor
protected Color fgColor
-
Deprecated. access using
getLocalForegroundColor()
.
border
protected
Border border
-
Deprecated. access using
getBorder()
toolTip
protected
IFigure toolTip
-
Deprecated. access using
getToolTip()
NO_MANAGER
protected static final
UpdateManager NO_MANAGER
- An UpdateManager that does nothing.
Figure
public Figure()
add
public final void add(
IFigure figure,
java.lang.Object constraint)
- Calls
add(IFigure, Object, int)
with -1 as the index.
-
-
Specified by:
-
add
in interface
IFigure
-
-
Parameters:
-
figure
- The IFigure to add -
constraint
- The newly added IFigure's constraint -
See Also:
-
IFigure.add(IFigure, Object)
add
public void add(
IFigure figure,
java.lang.Object constraint,
int index)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
add
in interface
IFigure
-
-
Parameters:
-
figure
- The IFigure to add -
constraint
- The newly added IFigure's constraint -
index
- The index where the IFigure should be added -
See Also:
-
IFigure.add(IFigure, Object, int)
add
public final void add(
IFigure figure)
- Calls
add(IFigure, Object, int)
with null
as the constraint and
-1 as the index.
-
-
Specified by:
-
add
in interface
IFigure
-
-
Parameters:
-
figure
- The IFigure to add -
See Also:
-
IFigure.add(IFigure)
add
public final void add(
IFigure figure,
int index)
- Calls
add(IFigure, Object, int)
with null
as the constraint.
-
-
Specified by:
-
add
in interface
IFigure
-
-
Parameters:
-
figure
- The IFigure to add -
index
- The index where the IFigure should be added -
See Also:
-
IFigure.add(IFigure, int)
addAncestorListener
public void addAncestorListener(
AncestorListener ancestorListener)
-
Description copied from interface:
IFigure
- Registers the given listener as an AncestorListener of this figure.
-
-
Specified by:
-
addAncestorListener
in interface
IFigure
-
-
Parameters:
-
ancestorListener
- The listener to add -
See Also:
-
IFigure.addAncestorListener(AncestorListener)
addCoordinateListener
public void addCoordinateListener(
CoordinateListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a CoordinateListener of this figure.
-
-
Specified by:
-
addCoordinateListener
in interface
IFigure
-
-
Parameters:
-
listener
- the listener to add -
See Also:
-
IFigure.addCoordinateListener(CoordinateListener)
addFigureListener
public void addFigureListener(
FigureListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a FigureListener of this figure.
-
-
Specified by:
-
addFigureListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to add -
See Also:
-
IFigure.addFigureListener(FigureListener)
addFocusListener
public void addFocusListener(
FocusListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a FocusListener of this figure.
-
-
Specified by:
-
addFocusListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to add -
See Also:
-
IFigure.addFocusListener(FocusListener)
addKeyListener
public void addKeyListener(
KeyListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a KeyListener of this figure.
-
-
Specified by:
-
addKeyListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to add -
See Also:
-
IFigure.addKeyListener(KeyListener)
addLayoutListener
public void addLayoutListener(
LayoutListener listener)
- Appends the given layout listener to the list of layout listeners.
-
-
Specified by:
-
addLayoutListener
in interface
IFigure
-
-
Parameters:
-
listener
- the listener being added -
Since:
- 3.1
addListener
protected void addListener(java.lang.Class clazz,
java.lang.Object listener)
- Adds a listener of type clazz to this Figure's list of event listeners.
-
-
-
Parameters:
-
clazz
- The listener type -
listener
- The listener
addMouseListener
public void addMouseListener(
MouseListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a MouseListener of this IFigure.
-
-
Specified by:
-
addMouseListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to add -
See Also:
-
IFigure.addMouseListener(MouseListener)
addMouseMotionListener
public void addMouseMotionListener(
MouseMotionListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a MouseMotionListener of this IFigure.
-
-
Specified by:
-
addMouseMotionListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to add -
See Also:
-
IFigure.addMouseMotionListener(MouseMotionListener)
addNotify
public void addNotify()
- Called after the receiver's parent has been set and it has been added to its parent.
-
-
Specified by:
-
addNotify
in interface
IFigure
-
-
Since:
- 2.0
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a PropertyChangeListener of this IFigure, interested
only in the given property.
-
-
Specified by:
-
addPropertyChangeListener
in interface
IFigure
-
-
Parameters:
-
property
- The property the listener is interested in -
listener
- The listener to add -
See Also:
-
IFigure.addPropertyChangeListener(String, PropertyChangeListener)
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
-
Description copied from interface:
IFigure
- Registers the given listener as a PropertyChangeListener of this IFigure.
-
-
Specified by:
-
addPropertyChangeListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to add -
See Also:
-
IFigure.addPropertyChangeListener(PropertyChangeListener)
containsPoint
public final boolean containsPoint(
Point p)
- This method is final. Override
containsPoint(int, int)
if needed.
-
-
Specified by:
-
containsPoint
in interface
IFigure
-
-
Parameters:
-
p
- The point
-
Returns:
-
true
if the Point p is contained within this IFigure's bounds -
Since:
- 2.0
-
See Also:
-
IFigure.containsPoint(Point)
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
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate
-
Returns:
-
true
if the point (x,y) is contained in this IFigure's bounds -
See Also:
-
IFigure.containsPoint(int, int)
erase
public void erase()
-
Description copied from interface:
IFigure
- Erases this IFigure.
-
-
Specified by:
-
erase
in interface
IFigure
-
-
See Also:
-
IFigure.erase()
findDescendantAtExcluding
protected
IFigure findDescendantAtExcluding(int x,
int y,
TreeSearch search)
- Returns a descendant of this Figure such that the Figure returned contains the point
(x, y), and is accepted by the given TreeSearch. Returns
null
if none
found.
-
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate -
search
- the TreeSearch
-
Returns:
- The descendant Figure at (x,y)
findFigureAt
public final
IFigure findFigureAt(
Point pt)
-
Description copied from interface:
IFigure
- Returns the IFigure at the specified location. May return
this
or
null
.
-
-
Specified by:
-
findFigureAt
in interface
IFigure
-
-
Parameters:
-
pt
- The point
-
Returns:
- The IFigure at the specified location
-
See Also:
-
IFigure.findFigureAt(Point)
findFigureAt
public final
IFigure findFigureAt(int x,
int y)
-
Description copied from interface:
IFigure
- Returns the IFigure at the specified location. May return
this
or
null
.
-
-
Specified by:
-
findFigureAt
in interface
IFigure
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate
-
Returns:
- The IFigure at the specified location
-
See Also:
-
IFigure.findFigureAt(int, int)
findFigureAt
public
IFigure findFigureAt(int x,
int y,
TreeSearch search)
-
Description copied from interface:
IFigure
- Returns the IFigure at the specified location based on the conditional TreeSearch. May
return
this
or null
-
-
Specified by:
-
findFigureAt
in interface
IFigure
-
-
Parameters:
-
x
- the X coordinate -
y
- the Y coordinate -
search
- the conditional TreeSearch
-
Returns:
- the IFigure at the specified location
-
See Also:
-
IFigure.findFigureAt(int, int, TreeSearch)
findFigureAtExcluding
public final
IFigure findFigureAtExcluding(int x,
int y,
java.util.Collection c)
-
Description copied from interface:
IFigure
- Returns the IFigure at the specified location, excluding any IFigures in
collection
. May return this
or null
.
-
-
Specified by:
-
findFigureAtExcluding
in interface
IFigure
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate -
c
- A collection of IFigures to be excluded
-
Returns:
- The IFigure at the specified location, excluding any IFigures in collection
-
See Also:
-
IFigure.findFigureAtExcluding(int, int, Collection)
findMouseEventTargetAt
public
IFigure findMouseEventTargetAt(int x,
int y)
- Returns the deepest descendant for which
isMouseEventTarget()
returns
true
or null
if none found. The Parameters x and
y are absolute locations. Any Graphics transformations applied by this Figure to
its children during
paintChildren(Graphics)
(thus causing the children to
appear transformed to the user) should be applied inversely to the points x and
y when called on the children.
-
-
Specified by:
-
findMouseEventTargetAt
in interface
IFigure
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate
-
Returns:
- The deepest descendant for which isMouseEventTarget() returns true
findMouseEventTargetInDescendantsAt
protected
IFigure findMouseEventTargetInDescendantsAt(int x,
int y)
- Searches this Figure's children for the deepest descendant for which
isMouseEventTarget()
returns true
and returns that descendant or
null
if none found.
-
-
-
Parameters:
-
x
- The X coordinate -
y
- The Y coordinate
-
Returns:
- The deepest descendant for which isMouseEventTarget() returns true
-
See Also:
-
findMouseEventTargetAt(int, int)
fireCoordinateSystemChanged
protected void fireCoordinateSystemChanged()
- Notifies to all
CoordinateListener
s that this figure's local coordinate system
has changed in a way which affects the absolute bounds of figures contained within.
-
-
-
Since:
- 3.1
fireFigureMoved
protected void fireFigureMoved()
- Notifies to all
FigureListener
s that this figure has moved. Moved means
that the bounds have changed in some way, location and/or size.
-
-
-
Since:
- 3.1
fireMoved
protected void fireMoved()
-
Deprecated. call fireFigureMoved() or fireCoordinateSystemChanged() as appropriate
- Fires both figuremoved and coordinate system changed. This method exists for
compatibility. Some listeners which used to listen for figureMoved now listen for
coordinates changed. So to be sure that those new listeners are notified, any client
code which used called this method will also result in notification of coordinate
changes.
-
-
-
Since:
- 2.0
firePropertyChange
protected void firePropertyChange(java.lang.String property,
boolean old,
boolean current)
- Notifies any
PropertyChangeListeners
listening to this
Figure that the boolean property with id property has changed.
-
-
-
Parameters:
-
property
- The id of the property that changed -
old
- The old value of the changed property -
current
- The current value of the changed property -
Since:
- 2.0
firePropertyChange
protected void firePropertyChange(java.lang.String property,
java.lang.Object old,
java.lang.Object current)
- Notifies any
PropertyChangeListeners
listening to this
figure that the Object property with id property has changed.
-
-
-
Parameters:
-
property
- The id of the property that changed -
old
- The old value of the changed property -
current
- The current value of the changed property -
Since:
- 2.0
firePropertyChange
protected void firePropertyChange(java.lang.String property,
int old,
int current)
- Notifies any
PropertyChangeListeners
listening to this
figure that the integer property with id property
has changed.
-
-
-
Parameters:
-
property
- The id of the property that changed -
old
- The old value of the changed property -
current
- The current value of the changed property -
Since:
- 2.0
getBackgroundColor
public Color getBackgroundColor()
- Returns this Figure's background color. If this Figure's background color is
null
and its parent is not null
, the background color is
inherited from the parent.
-
-
Specified by:
-
getBackgroundColor
in interface
IFigure
-
-
Returns:
- The background color
-
See Also:
-
IFigure.getBackgroundColor()
getBorder
public
Border getBorder()
-
Description copied from interface:
IFigure
- Returns the current border by reference.
-
-
Specified by:
-
getBorder
in interface
IFigure
-
-
Returns:
- The current border
-
See Also:
-
IFigure.getBorder()
getBounds
public
Rectangle getBounds()
- Returns the smallest rectangle completely enclosing the figure. Implementors may return
the Rectangle by reference. For this reason, callers of this method must not modify the
returned Rectangle.
-
-
Specified by:
-
getBounds
in interface
IFigure
-
-
Returns:
- The bounds of this Figure
getChildren
public java.util.List getChildren()
-
Description copied from interface:
IFigure
- Returns an unmodifiable list of children by reference.
-
-
Specified by:
-
getChildren
in interface
IFigure
-
-
Returns:
- An unmodifiable list of children by reference
-
See Also:
-
IFigure.getChildren()
getClientArea
public
Rectangle getClientArea(
Rectangle rect)
-
Description copied from interface:
IFigure
- Copies the client area into the specificied Recangle, and returns that rectangle for
convenience.
-
-
Specified by:
-
getClientArea
in interface
IFigure
-
-
Parameters:
-
rect
- The destination rectangle for the client area
-
Returns:
- The same instance that was passed in, modified to contain the client area
-
See Also:
-
IFigure.getClientArea(Rectangle)
getClientArea
public final
Rectangle getClientArea()
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
getClientArea
in interface
IFigure
-
-
Returns:
- The client area
-
See Also:
-
IFigure.getClientArea()
getCursor
public Cursor getCursor()
-
Description copied from interface:
IFigure
- Returns the Cursor used when the mouse is over this IFigure.
-
-
Specified by:
-
getCursor
in interface
IFigure
-
-
Returns:
- The Cursor used when the mouse is over this IFigure
-
See Also:
-
IFigure.getCursor()
getFlag
protected boolean getFlag(int flag)
- Returns the value of the given flag.
-
-
-
Parameters:
-
flag
- The flag to get
-
Returns:
- The value of the given flag
getFont
public Font getFont()
-
Description copied from interface:
IFigure
- Returns the current Font by reference.
-
-
Specified by:
-
getFont
in interface
IFigure
-
-
Returns:
- The current Font
-
See Also:
-
IFigure.getFont()
getForegroundColor
public Color getForegroundColor()
-
Description copied from interface:
IFigure
- Returns the foreground color.
-
-
Specified by:
-
getForegroundColor
in interface
IFigure
-
-
Returns:
- The foreground color
-
See Also:
-
IFigure.getForegroundColor()
getInsets
public
Insets getInsets()
- Returns the border's Insets if the border is set. Otherwise returns NO_INSETS, an
instance of Insets with all 0s. Returns Insets by reference. DO NOT Modify returned
value. Cannot return null.
-
-
Specified by:
-
getInsets
in interface
IFigure
-
-
Returns:
- This Figure's Insets
getLayoutManager
public
LayoutManager getLayoutManager()
-
Description copied from interface:
IFigure
- Returns the current LayoutManager by reference.
-
-
Specified by:
-
getLayoutManager
in interface
IFigure
-
-
Returns:
- The current LayoutManager by reference
-
See Also:
-
IFigure.getLayoutManager()
getListeners
protected java.util.Iterator getListeners(java.lang.Class clazz)
- Returns an Iterator over the listeners of type clazz that are listening to
this Figure. If there are no listeners of type clazz, an empty iterator is
returned.
-
-
-
Parameters:
-
clazz
- The type of listeners to get
-
Returns:
- An Iterator over the requested listeners
-
Since:
- 2.0
getLocalBackgroundColor
public Color getLocalBackgroundColor()
- Returns
null
or the local background Color of this Figure. Does not
inherit this Color from the parent.
-
-
Specified by:
-
getLocalBackgroundColor
in interface
IFigure
-
-
Returns:
- bgColor
null
or the local background Color
getLocalFont
protected Font getLocalFont()
- Returns
null
or the local font setting for this figure. Does not return
values inherited from the parent figure.
-
-
-
Returns:
-
null
or the local font -
Since:
- 3.1
getLocalForegroundColor
public Color getLocalForegroundColor()
- Returns
null
or the local foreground Color of this Figure. Does not
inherit this Color from the parent.
-
-
Specified by:
-
getLocalForegroundColor
in interface
IFigure
-
-
Returns:
- fgColor
null
or the local foreground Color
getLocation
public final
Point getLocation()
- Returns the top-left corner of this Figure's bounds.
-
-
-
Returns:
- The top-left corner of this Figure's bounds
-
Since:
- 2.0
getMaximumSize
public
Dimension getMaximumSize()
-
Description copied from interface:
IFigure
- Returns a hint indicating the largest desireable size for the IFigure. Returned
Dimension is by value.
-
-
Specified by:
-
getMaximumSize
in interface
IFigure
-
-
Returns:
- The maximum size
-
See Also:
-
IFigure.getMaximumSize()
getMinimumSize
public final
Dimension getMinimumSize()
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
getMinimumSize
in interface
IFigure
-
-
Returns:
- The minimum size
-
See Also:
-
IFigure.getMinimumSize()
getMinimumSize
public
Dimension getMinimumSize(int wHint,
int hHint)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
getMinimumSize
in interface
IFigure
-
-
Parameters:
-
wHint
- the width hint -
hHint
- the height hint
-
Returns:
- The minimum size
-
See Also:
-
IFigure.getMinimumSize(int, int)
getParent
public
IFigure getParent()
-
Description copied from interface:
IFigure
- Returns the IFigure that is the current parent of this IFigure or
null
if
there is no parent.
-
-
Specified by:
-
getParent
in interface
IFigure
-
-
Returns:
-
null
or the parent figure -
See Also:
-
IFigure.getParent()
getPreferredSize
public final
Dimension getPreferredSize()
-
Description copied from interface:
IFigure
- 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)
.
-
-
Specified by:
-
getPreferredSize
in interface
IFigure
-
-
Returns:
- The preferred size
-
See Also:
-
IFigure.getPreferredSize()
getPreferredSize
public
Dimension getPreferredSize(int wHint,
int hHint)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
getPreferredSize
in interface
IFigure
-
-
Parameters:
-
wHint
- a width hint -
hHint
- a height hint
-
Returns:
- The preferred size
-
See Also:
-
IFigure.getPreferredSize(int, int)
getSize
public final
Dimension getSize()
-
Description copied from interface:
IFigure
- Returns the current size. Returned Dimension is by value.
-
-
Specified by:
-
getSize
in interface
IFigure
-
-
Returns:
- The current size
-
See Also:
-
IFigure.getSize()
getToolTip
public
IFigure getToolTip()
-
Description copied from interface:
IFigure
- Returns a IFigure that is the tooltip for this IFigure.
-
-
Specified by:
-
getToolTip
in interface
IFigure
-
-
Returns:
- This IFigure's tooltip
-
See Also:
-
IFigure.getToolTip()
getUpdateManager
public
UpdateManager getUpdateManager()
-
Description copied from interface:
IFigure
- Returns the UpdateManager for this IFigure by reference.
-
-
Specified by:
-
getUpdateManager
in interface
IFigure
-
-
Returns:
- The update manager
-
See Also:
-
IFigure.getUpdateManager()
handleFocusGained
public void handleFocusGained(
FocusEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleFocusGained
in interface
IFigure
-
-
Parameters:
-
event
- The focus event -
See Also:
-
IFigure.handleFocusGained(FocusEvent)
handleFocusLost
public void handleFocusLost(
FocusEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleFocusLost
in interface
IFigure
-
-
Parameters:
-
event
- The focus event -
See Also:
-
IFigure.handleFocusLost(FocusEvent)
handleKeyPressed
public void handleKeyPressed(
KeyEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleKeyPressed
in interface
IFigure
-
-
Parameters:
-
event
- The key event -
See Also:
-
IFigure.handleKeyPressed(KeyEvent)
handleKeyReleased
public void handleKeyReleased(
KeyEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleKeyReleased
in interface
IFigure
-
-
Parameters:
-
event
- The key event -
See Also:
-
IFigure.handleKeyReleased(KeyEvent)
handleMouseDoubleClicked
public void handleMouseDoubleClicked(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMouseDoubleClicked
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMouseDoubleClicked(MouseEvent)
handleMouseDragged
public void handleMouseDragged(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMouseDragged
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMouseDragged(MouseEvent)
handleMouseEntered
public void handleMouseEntered(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMouseEntered
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMouseEntered(MouseEvent)
handleMouseExited
public void handleMouseExited(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMouseExited
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMouseExited(MouseEvent)
handleMouseHover
public void handleMouseHover(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMouseHover
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMouseHover(MouseEvent)
handleMouseMoved
public void handleMouseMoved(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMouseMoved
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMouseMoved(MouseEvent)
handleMousePressed
public void handleMousePressed(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMousePressed
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMousePressed(MouseEvent)
handleMouseReleased
public void handleMouseReleased(
MouseEvent event)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
handleMouseReleased
in interface
IFigure
-
-
Parameters:
-
event
- The mouse event -
See Also:
-
IFigure.handleMouseReleased(MouseEvent)
hasFocus
public boolean hasFocus()
-
Description copied from interface:
IFigure
- Returns
true
if this IFigure has focus.
-
-
Specified by:
-
hasFocus
in interface
IFigure
-
-
Returns:
-
true
if this IFigure has focus -
See Also:
-
IFigure.hasFocus()
internalGetEventDispatcher
public
EventDispatcher internalGetEventDispatcher()
-
Description copied from interface:
IFigure
- This method is for internal purposes only and should not be called.
-
-
Specified by:
-
internalGetEventDispatcher
in interface
IFigure
-
-
Returns:
- The event dispatcher
-
See Also:
-
IFigure.internalGetEventDispatcher()
intersects
public boolean intersects(
Rectangle rect)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
intersects
in interface
IFigure
-
-
Parameters:
-
rect
- The rectangle to check for intersection
-
Returns:
-
true
if this IFigure's bounds intersect with the given Rectangle -
See Also:
-
IFigure.intersects(Rectangle)
invalidate
public void invalidate()
-
Description copied from interface:
IFigure
- Invalidates this IFigure. If this figure has a LayoutManager, then
LayoutManager.invalidate()
should be called on that layout.
-
-
Specified by:
-
invalidate
in interface
IFigure
-
-
See Also:
-
IFigure.invalidate()
invalidateTree
public void invalidateTree()
-
Description copied from interface:
IFigure
- Invalidates this figure as well as all contained within.
-
-
Specified by:
-
invalidateTree
in interface
IFigure
-
-
See Also:
-
IFigure.invalidateTree()
isCoordinateSystem
public boolean isCoordinateSystem()
-
Description copied from interface:
IFigure
- Returns
true
if this figure is capable of applying a local coordinate
system which affects its children.
-
-
Specified by:
-
isCoordinateSystem
in interface
IFigure
-
-
Returns:
-
true
if this figure provides local coordinates to children -
See Also:
-
IFigure.isCoordinateSystem()
isEnabled
public boolean isEnabled()
-
Description copied from interface:
IFigure
- Returns
true
if this IFigure is enabled.
-
-
Specified by:
-
isEnabled
in interface
IFigure
-
-
Returns:
-
true
if this IFigure is enabled -
See Also:
-
IFigure.isEnabled()
isFocusTraversable
public boolean isFocusTraversable()
-
Description copied from interface:
IFigure
- Returns
true
if this IFigure can gain focus on a
TraverseEvent
.
-
-
Specified by:
-
isFocusTraversable
in interface
IFigure
-
-
Returns:
-
true
if this IFigure can gain focus on a TraverseEvent -
See Also:
-
IFigure.isFocusTraversable()
isMouseEventTarget
protected boolean isMouseEventTarget()
- Returns
true
if this Figure can receive
MouseEvents
.
-
-
-
Returns:
-
true
if this Figure can receive
MouseEvents
-
Since:
- 2.0
isMirrored
public boolean isMirrored()
-
-
Specified by:
-
isMirrored
in interface
IFigure
-
-
Returns:
-
true
if this figure is hosted in a Control that is mirrored -
See Also:
-
IFigure.isMirrored()
isOpaque
public boolean isOpaque()
-
Description copied from interface:
IFigure
- Returns
true
if this IFigure is opaque.
-
-
Specified by:
-
isOpaque
in interface
IFigure
-
-
Returns:
-
true
if this IFigure is opaque -
See Also:
-
IFigure.isOpaque()
isRequestFocusEnabled
public boolean isRequestFocusEnabled()
-
Description copied from interface:
IFigure
- Returns
true
if this IFigure can receive focus on a call to
IFigure.requestFocus()
.
-
-
Specified by:
-
isRequestFocusEnabled
in interface
IFigure
-
-
Returns:
-
true
if this IFigure can receive focus on a call to requestFocus() -
See Also:
-
IFigure.isRequestFocusEnabled()
isShowing
public boolean isShowing()
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
isShowing
in interface
IFigure
-
-
Returns:
-
true
if this IFigure is showing -
See Also:
-
IFigure.isShowing()
isValid
protected boolean isValid()
- Returns
true
if this Figure is valid.
-
-
-
Returns:
-
true
if this Figure is valid -
Since:
- 2.0
isValidationRoot
protected boolean isValidationRoot()
- Returns
true
if revalidating this Figure does not require revalidating its
parent.
-
-
-
Returns:
-
true
if revalidating this Figure doesn't require revalidating its
parent. -
Since:
- 2.0
isVisible
public boolean isVisible()
-
Description copied from interface:
IFigure
- returns
true
if this figure's visibility flag is set to true. Does not
walk up the parent chain.
-
-
Specified by:
-
isVisible
in interface
IFigure
-
-
Returns:
-
true
if the figure's visibility flag is set -
See Also:
-
IFigure.isVisible()
layout
protected void layout()
- Lays out this Figure using its
LayoutManager
.
-
-
-
Since:
- 2.0
paint
public void paint(
Graphics graphics)
- Paints this Figure and its children.
-
-
Specified by:
-
paint
in interface
IFigure
-
-
Parameters:
-
graphics
- The Graphics object used for painting -
See Also:
-
paintFigure(Graphics)
,
paintClientArea(Graphics)
,
paintBorder(Graphics)
paintBorder
protected void paintBorder(
Graphics graphics)
- Paints the border associated with this Figure, if one exists.
-
-
-
Parameters:
-
graphics
- The Graphics used to paint -
Since:
- 2.0
-
See Also:
-
Border.paint(IFigure, Graphics, Insets)
paintChildren
protected void paintChildren(
Graphics graphics)
- Paints this Figure's children. The caller must save the state of the graphics prior to
calling this method, such that
graphics.restoreState()
may be called
safely, and doing so will return the graphics to its original state when the method was
entered.
This method must leave the Graphics in its original state upon return.
-
-
-
Parameters:
-
graphics
- the graphics used to paint -
Since:
- 2.0
paintClientArea
protected void paintClientArea(
Graphics graphics)
- Paints this Figure's client area. The client area is typically defined as the anything
inside the Figure's
Border
or
Insets
, and by default includes the
children of this Figure. On return, this method must leave the given Graphics in its
initial state.
-
-
-
Parameters:
-
graphics
- The Graphics used to paint -
Since:
- 2.0
paintFigure
protected void paintFigure(
Graphics graphics)
- Paints this Figure's primary representation, or background. Changes made to the
graphics to the graphics current state will not affect the subsequent calls to
paintClientArea(Graphics)
and
paintBorder(Graphics)
. Furthermore, it is safe
to call graphics.restoreState()
within this method, and doing so will
restore the graphics to its original state upon entry.
-
-
-
Parameters:
-
graphics
- The Graphics used to paint -
Since:
- 2.0
primTranslate
protected void primTranslate(int dx,
int dy)
- Translates this Figure's bounds, without firing a move.
-
-
-
Parameters:
-
dx
- The amount to translate horizontally -
dy
- The amount to translate vertically -
Since:
- 2.0
-
See Also:
-
translate(int, int)
remove
public void remove(
IFigure figure)
- Removes the given child Figure from this Figure's hierarchy and revalidates this
Figure. The child Figure's
removeNotify()
method is also called.
-
-
Specified by:
-
remove
in interface
IFigure
-
-
Parameters:
-
figure
- The Figure to remove
removeAll
public void removeAll()
- Removes all children from this Figure.
-
-
-
Since:
- 2.0
-
See Also:
-
remove(IFigure)
removeAncestorListener
public void removeAncestorListener(
AncestorListener listener)
-
Description copied from interface:
IFigure
- Unregisters the given listener, so that it will no longer receive notification of
ancestor events.
-
-
Specified by:
-
removeAncestorListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to remove -
See Also:
-
IFigure.removeAncestorListener(AncestorListener)
removeCoordinateListener
public void removeCoordinateListener(
CoordinateListener listener)
-
Description copied from interface:
IFigure
- Unregisters the given listener, so that it will no longer receive notification of
coordinate changes.
-
-
Specified by:
-
removeCoordinateListener
in interface
IFigure
-
-
Parameters:
-
listener
- the listener to remove -
See Also:
-
IFigure.removeCoordinateListener(CoordinateListener)
removeFigureListener
public void removeFigureListener(
FigureListener listener)
-
Description copied from interface:
IFigure
- Unregisters the given listener, so that it will no longer receive notification of
IFigure events.
-
-
Specified by:
-
removeFigureListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to remove -
See Also:
-
IFigure.removeFigureListener(FigureListener)
removeFocusListener
public void removeFocusListener(
FocusListener listener)
-
Description copied from interface:
IFigure
- Unregisters the given listener, so that it will no longer receive notification of focus
events.
-
-
Specified by:
-
removeFocusListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to remove -
See Also:
-
IFigure.removeFocusListener(FocusListener)
removeKeyListener
public void removeKeyListener(
KeyListener listener)
-
Description copied from interface:
IFigure
- Removes the first occurence of the given listener.
-
-
Specified by:
-
removeKeyListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to remove -
See Also:
-
IFigure.removeKeyListener(KeyListener)
removeLayoutListener
public void removeLayoutListener(
LayoutListener listener)
- Removes the first occurence of the given listener.
-
-
Specified by:
-
removeLayoutListener
in interface
IFigure
-
-
Parameters:
-
listener
- the listener being removed -
Since:
- 3.1
removeListener
protected void removeListener(java.lang.Class clazz,
java.lang.Object listener)
- Removes listener of type clazz from this Figure's list of listeners.
-
-
-
Parameters:
-
clazz
- The type of listener -
listener
- The listener to remove -
Since:
- 2.0
removeMouseListener
public void removeMouseListener(
MouseListener listener)
-
Description copied from interface:
IFigure
- Unregisters the given listener, so that it will no longer receive notification of mouse
events.
-
-
Specified by:
-
removeMouseListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to remove -
See Also:
-
IFigure.removeMouseListener(MouseListener)
removeMouseMotionListener
public void removeMouseMotionListener(
MouseMotionListener listener)
-
Description copied from interface:
IFigure
- Unregisters the given listener, so that it will no longer receive notification of mouse
motion events.
-
-
Specified by:
-
removeMouseMotionListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to remove -
See Also:
-
IFigure.removeMouseMotionListener(MouseMotionListener)
removeNotify
public void removeNotify()
- Called prior to this figure's removal from its parent
-
-
Specified by:
-
removeNotify
in interface
IFigure
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
-
Description copied from interface:
IFigure
- Unregisters the given listener, so that it will no longer receive notification of any
property changes.
-
-
Specified by:
-
removePropertyChangeListener
in interface
IFigure
-
-
Parameters:
-
listener
- The listener to remove -
See Also:
-
IFigure.removePropertyChangeListener(PropertyChangeListener)
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
removePropertyChangeListener
in interface
IFigure
-
-
Parameters:
-
property
- The property that the listener is no longer interested in -
listener
- The listener no longer interested in the property -
See Also:
-
IFigure.removePropertyChangeListener(String, PropertyChangeListener)
repaint
public final void repaint(
Rectangle rect)
-
Description copied from interface:
IFigure
- Repaints the rectangular area within this IFigure represented by
rect
.
-
-
Specified by:
-
repaint
in interface
IFigure
-
-
Parameters:
-
rect
- The rectangular area to be repainted -
See Also:
-
IFigure.repaint(Rectangle)
repaint
public void repaint(int x,
int y,
int w,
int h)
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
repaint
in interface
IFigure
-
-
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 -
See Also:
-
IFigure.repaint(int, int, int, int)
repaint
public void repaint()
-
Description copied from interface:
IFigure
- Repaints this IFigure.
-
-
Specified by:
-
repaint
in interface
IFigure
-
-
See Also:
-
IFigure.repaint()
requestFocus
public final void requestFocus()
-
Description copied from interface:
IFigure
- Requests focus from the
EventDispatcher
.
-
-
Specified by:
-
requestFocus
in interface
IFigure
-
-
See Also:
-
IFigure.requestFocus()
revalidate
public void revalidate()
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
revalidate
in interface
IFigure
-
-
See Also:
-
IFigure.revalidate()
setBackgroundColor
public void setBackgroundColor(Color bg)
-
Description copied from interface:
IFigure
- Sets the background color.
-
-
Specified by:
-
setBackgroundColor
in interface
IFigure
-
-
Parameters:
-
bg
- The new background color -
See Also:
-
IFigure.setBackgroundColor(Color)
setBorder
public void setBorder(
Border border)
-
Description copied from interface:
IFigure
- Sets the border.
-
-
Specified by:
-
setBorder
in interface
IFigure
-
-
Parameters:
-
border
- The new border -
See Also:
-
IFigure.setBorder(Border)
setBounds
public void setBounds(
Rectangle rect)
- Sets the bounds of this Figure to the Rectangle rect. Note that rect is
compared to the Figure's current bounds to determine what needs to be repainted and/or
exposed and if validation is required. Since
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.
-
-
Specified by:
-
setBounds
in interface
IFigure
-
-
Parameters:
-
rect
- The new bounds -
Since:
- 2.0
setChildrenDirection
protected void setChildrenDirection(int direction)
- Sets the direction of any
Orientable
children. Allowable values for
dir
are found in
PositionConstants
.
-
-
-
Parameters:
-
direction
- The direction -
Since:
- 2.0
-
See Also:
-
Orientable.setDirection(int)
setChildrenEnabled
protected void setChildrenEnabled(boolean value)
- Sets all childrens' enabled property to value.
-
-
-
Parameters:
-
value
- The enable value -
Since:
- 2.0
-
See Also:
-
setEnabled(boolean)
setChildrenOrientation
protected void setChildrenOrientation(int orientation)
- Sets the orientation of any
Orientable
children. Allowable values for
orientation are found in
PositionConstants
.
-
-
-
Parameters:
-
orientation
- The Orientation -
Since:
- 2.0
-
See Also:
-
Orientable.setOrientation(int)
setConstraint
public void setConstraint(
IFigure child,
java.lang.Object constraint)
-
Description copied from interface:
IFigure
- Convenience method to set the constraint of the specified child in the current
LayoutManager.
-
-
Specified by:
-
setConstraint
in interface
IFigure
-
-
Parameters:
-
child
- The figure whose constraint is being set -
constraint
- the constraint -
See Also:
-
IFigure.setConstraint(IFigure, Object)
setCursor
public void setCursor(Cursor cursor)
-
Description copied from interface:
IFigure
- Sets the cursor.
-
-
Specified by:
-
setCursor
in interface
IFigure
-
-
Parameters:
-
cursor
- The new cursor -
See Also:
-
IFigure.setCursor(Cursor)
setEnabled
public void setEnabled(boolean value)
-
Description copied from interface:
IFigure
- Sets this IFigure to be enabled.
-
-
Specified by:
-
setEnabled
in interface
IFigure
-
-
Parameters:
-
value
- true
if this IFigure should be enabled -
See Also:
-
IFigure.setEnabled(boolean)
setFlag
protected final void setFlag(int flag,
boolean value)
- Sets the given flag to the given value.
-
-
-
Parameters:
-
flag
- The flag to set -
value
- The value -
Since:
- 2.0
setFocusTraversable
public void setFocusTraversable(boolean focusTraversable)
-
Description copied from interface:
IFigure
- Sets the ability for this IFigure to gain focus on a
TraverseEvent
.
-
-
Specified by:
-
setFocusTraversable
in interface
IFigure
-
-
Parameters:
-
focusTraversable
- true
if this IFigure should gain focus on a TraverseEvent -
See Also:
-
IFigure.setFocusTraversable(boolean)
setFont
public void setFont(Font f)
-
Description copied from interface:
IFigure
- Sets the font.
-
-
Specified by:
-
setFont
in interface
IFigure
-
-
Parameters:
-
f
- The new font -
See Also:
-
IFigure.setFont(Font)
setForegroundColor
public void setForegroundColor(Color fg)
-
Description copied from interface:
IFigure
- Sets the foreground color.
-
-
Specified by:
-
setForegroundColor
in interface
IFigure
-
-
Parameters:
-
fg
- The new foreground color -
See Also:
-
IFigure.setForegroundColor(Color)
setLayoutManager
public void setLayoutManager(
LayoutManager manager)
-
Description copied from interface:
IFigure
- Sets the LayoutManager.
-
-
Specified by:
-
setLayoutManager
in interface
IFigure
-
-
Parameters:
-
manager
- The new layout manager -
See Also:
-
IFigure.setLayoutManager(LayoutManager)
setLocation
public void setLocation(
Point p)
-
Description copied from interface:
IFigure
- Sets the location of this IFigure.
-
-
Specified by:
-
setLocation
in interface
IFigure
-
-
Parameters:
-
p
- The new location -
See Also:
-
IFigure.setLocation(Point)
setMaximumSize
public void setMaximumSize(
Dimension d)
-
Description copied from interface:
IFigure
- Sets the maximum size this IFigure can be.
-
-
Specified by:
-
setMaximumSize
in interface
IFigure
-
-
Parameters:
-
d
- The new maximum size -
See Also:
-
IFigure.setMaximumSize(Dimension)
setMinimumSize
public void setMinimumSize(
Dimension d)
-
Description copied from interface:
IFigure
- Sets the minimum size this IFigure can be.
-
-
Specified by:
-
setMinimumSize
in interface
IFigure
-
-
Parameters:
-
d
- The new minimum size -
See Also:
-
IFigure.setMinimumSize(Dimension)
setOpaque
public void setOpaque(boolean opaque)
-
Description copied from interface:
IFigure
- Sets this IFigure to be opaque if isOpaque is
true
and transparent
if isOpaque is false
.
-
-
Specified by:
-
setOpaque
in interface
IFigure
-
-
Parameters:
-
opaque
- true
is this IFigure should be opaque -
See Also:
-
IFigure.setOpaque(boolean)
setParent
public void setParent(
IFigure p)
-
Description copied from interface:
IFigure
- Sets this IFigure's parent.
-
-
Specified by:
-
setParent
in interface
IFigure
-
-
Parameters:
-
p
- The new parent IFigure -
See Also:
-
IFigure.setParent(IFigure)
setPreferredSize
public void setPreferredSize(
Dimension size)
-
Description copied from interface:
IFigure
- Sets this IFigure's preferred size.
-
-
Specified by:
-
setPreferredSize
in interface
IFigure
-
-
Parameters:
-
size
- The new preferred size -
See Also:
-
IFigure.setPreferredSize(Dimension)
setPreferredSize
public final void setPreferredSize(int w,
int h)
- Sets the preferred size of this figure.
-
-
-
Parameters:
-
w
- The new preferred width -
h
- The new preferred height -
Since:
- 2.0
-
See Also:
-
setPreferredSize(Dimension)
setRequestFocusEnabled
public void setRequestFocusEnabled(boolean requestFocusEnabled)
-
Description copied from interface:
IFigure
- Sets the ability for this Figure to gain focus on a call to
IFigure.requestFocus()
.
-
-
Specified by:
-
setRequestFocusEnabled
in interface
IFigure
-
-
Parameters:
-
requestFocusEnabled
- true
if this IFigure should gain focus on a call
to requestFocus() -
See Also:
-
IFigure.setRequestFocusEnabled(boolean)
setSize
public final void setSize(
Dimension d)
-
Description copied from interface:
IFigure
- Sets this IFigure's size.
-
-
Specified by:
-
setSize
in interface
IFigure
-
-
Parameters:
-
d
- The new size -
See Also:
-
IFigure.setSize(Dimension)
setSize
public void setSize(int w,
int h)
-
Description copied from interface:
IFigure
- Sets this IFigure's size.
-
-
Specified by:
-
setSize
in interface
IFigure
-
-
Parameters:
-
w
- The new width -
h
- The new height -
See Also:
-
IFigure.setSize(int, int)
setToolTip
public void setToolTip(
IFigure f)
-
Description copied from interface:
IFigure
- Sets a tooltip that is displayed when the mouse hovers over this IFigure.
-
-
Specified by:
-
setToolTip
in interface
IFigure
-
-
Parameters:
-
f
- The tooltip IFigure -
See Also:
-
IFigure.setToolTip(IFigure)
setValid
public void setValid(boolean value)
- Sets this figure to be valid if value is
true
and invalid
otherwise.
-
-
-
Parameters:
-
value
- The valid value -
Since:
- 2.0
setVisible
public void setVisible(boolean visible)
-
Description copied from interface:
IFigure
- Sets this IFigure's visibility.
-
-
Specified by:
-
setVisible
in interface
IFigure
-
-
Parameters:
-
visible
- true
if this IFigure should be visible -
See Also:
-
IFigure.setVisible(boolean)
translate
public final void translate(int x,
int y)
-
Description copied from interface:
IFigure
- Moves this IFigure
x
pixels horizontally and y
pixels
vertically.
-
-
Specified by:
-
translate
in interface
IFigure
-
-
Parameters:
-
x
- The amount to move this IFigure horizontally -
y
- The amount to move this IFigure vertically -
See Also:
-
IFigure.translate(int, int)
translateFromParent
public void translateFromParent(
Translatable t)
-
Description copied from interface:
IFigure
- Translates a Translatable from this IFigure's parent's coordinates to this IFigure's
local coordinates.
-
-
Specified by:
-
translateFromParent
in interface
IFigure
-
-
Parameters:
-
t
- The object to translate -
See Also:
-
IFigure.translateFromParent(Translatable)
translateToAbsolute
public final void translateToAbsolute(
Translatable t)
-
Description copied from interface:
IFigure
- Translates a Translatable that is relative to this figure's bounds to absolute.
-
-
Specified by:
-
translateToAbsolute
in interface
IFigure
-
-
Parameters:
-
t
- The object to translate -
See Also:
-
IFigure.translateToAbsolute(Translatable)
translateToParent
public void translateToParent(
Translatable t)
-
Description copied from interface:
IFigure
- Translates a Translatable from this IFigure's coordinates to its parent's coordinates.
-
-
Specified by:
-
translateToParent
in interface
IFigure
-
-
Parameters:
-
t
- The object to translate -
See Also:
-
IFigure.translateToParent(Translatable)
translateToRelative
public final void translateToRelative(
Translatable t)
-
Description copied from interface:
IFigure
- Translates a Translatable in absolute coordinates to be relative to this figure's
bounds.
-
-
Specified by:
-
translateToRelative
in interface
IFigure
-
-
Parameters:
-
t
- The object to translate -
See Also:
-
IFigure.translateToRelative(Translatable)
useLocalCoordinates
protected boolean useLocalCoordinates()
- Returns
true
if this Figure uses local coordinates. This means its
children are placed relative to this Figure's top-left corner.
-
-
-
Returns:
-
true
if this Figure uses local coordinates -
Since:
- 2.0
validate
public void validate()
-
Description copied from interface:
IFigure
- 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.
-
-
Specified by:
-
validate
in interface
IFigure
-
-
See Also:
-
IFigure.validate()
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.