Interface IFigure
- All Known Subinterfaces:
Connection
,FreeformFigure
,IImageFigure
,IScalablePane
,IScrollableFigure
,Orientable
,RotatableDecoration
,ScalableFigure
- All Known Implementing Classes:
AbstractImageFigure
,AbstractPointListShape
,ArrowButton
,BlockFlow
,Button
,CheckBox
,Clickable
,ConnectionLayer
,Ellipse
,Figure
,FlowAdapter
,FlowFigure
,FlowPage
,FreeformLayer
,FreeformLayeredPane
,FreeformViewport
,GhostImageFigure
,ImageFigure
,InlineFlow
,Label
,LabeledContainer
,Layer
,LayeredPane
,LightweightSystem.RootFigure
,Panel
,Polygon
,PolygonDecoration
,PolygonShape
,Polyline
,PolylineConnection
,PolylineDecoration
,PolylineShape
,PuristicScrollPane
,PuristicScrollPane.PuristicScrollBar
,RectangleFigure
,RoundedRectangle
,ScalableFreeformLayeredPane
,ScalableLayeredPane
,ScalablePolygonShape
,ScrollableThumbnail
,ScrollBar
,ScrollPane
,Shape
,TextFlow
,Thumbnail
,Toggle
,ToggleButton
,Triangle
,Viewport
Graphics
object. Figures can be composed to create complex graphics.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given IFigure as a child of this IFigure.void
Adds the given IFigure as a child of this IFigure at the given index.void
Adds the given IFigure as a child of this IFigure with the given constraint.void
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
Called after this IFigure is added to its parent.void
Registers the given listener as a PropertyChangeListener of this IFigure.void
addPropertyChangeListener
(String property, PropertyChangeListener listener) Registers the given listener as a PropertyChangeListener of this IFigure, interested only in the given property.boolean
containsPoint
(int x, int y) Returnstrue
if the point(x, y)
is contained within this IFigure's bounds.boolean
Returnstrue
if the Point p is contained within this IFigure's bounds.void
erase()
Erases this IFigure.findFigureAt
(int x, int y) Returns the IFigure at the specified location.findFigureAt
(int x, int y, TreeSearch search) Returns the IFigure at the specified location based on the conditional TreeSearch.Returns the IFigure at the specified location.findFigureAtExcluding
(int x, int y, Collection<IFigure> collection) Returns the IFigure at the specified location, excluding any IFigures incollection
.findMouseEventTargetAt
(int x, int y) Returns the IFigure located at the given location which will accept mouse events.Returns the background color.Returns the current border by reference.Returns the smallest rectangle completely enclosing the IFigure.Returns an unmodifiable list of children by reference.Returns the rectangular area within this Figure's bounds in which children will be placed (viaLayoutManagers
) and the painting of children will be clipped.getClientArea
(Rectangle rect) Copies the client area into the specificied Recangle, and returns that rectangle for convenience.Returns the IClippingStrategy used by this figure to clip its childrenReturns the Cursor used when the mouse is over this IFigure.getFont()
Returns the current Font by reference.Returns the foreground color.Returns the current Insets.Returns the current LayoutManager by reference.Returns the background Color of this Figure.Returns the local foreground Color of this Figure.default Point
Returns the top-left corner of this Figure's bounds.Returns a hint indicating the largest desireable size for the IFigure.Returns a hint indicating the smallest desireable size for the IFigure.getMinimumSize
(int wHint, int hHint) Returns a hint indicating the smallest desireable size for the IFigure.Returns the IFigure that is the current parent of this IFigure ornull
if there is no parent.Returns the preferred size for this IFigure.getPreferredSize
(int wHint, int hHint) Returns the preferred size for this IFigure using the provided width and height hints.getSize()
Returns the current size.Returns a IFigure that is the tooltip for this IFigure.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
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()
Returnstrue
if this IFigure has focus.This method is for internal purposes only and should not be called.boolean
intersects
(Rectangle rect) Returnstrue
if this IFigure's bounds intersect with the given Rectangle.void
Invalidates this IFigure.void
Invalidates this figure as well as all contained within.boolean
Returnstrue
if this figure is capable of applying a local coordinate system which affects its children.boolean
Returnstrue
if this IFigure is enabled.boolean
Returnstrue
if this IFigure can gain focus on aTraverseEvent
.boolean
boolean
isOpaque()
Returnstrue
if this IFigure is opaque.boolean
Returnstrue
if this IFigure can receive focus on a call torequestFocus()
.boolean
Returnstrue
if this IFigure is showing.boolean
returnstrue
if this figure's visibility flag is set to true.void
Paints this IFigure and its children.void
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
Called before this IFigure is removed from its parent.void
Unregisters the given listener, so that it will no longer receive notification of any property changes.void
removePropertyChangeListener
(String property, PropertyChangeListener listener) Unregisters the given listener, so that it will no longer receive notification of changes in the given property.void
repaint()
Repaints this IFigure.void
repaint
(int x, int y, int w, int h) Repaints the rectangular area within this IFigure whose upper-left corner is located at the point(x,y)
and whose width and height arew
andh
, respectively.void
Repaints the rectangular area within this IFigure represented byrect
.void
Requests focus from theEventDispatcher
.void
Invalidates this figure and revalidates() its parent.void
Sets the background color.void
Sets the border.void
Sets the bounds to the bounds of the specifiedRectangle
.void
setClippingStrategy
(IClippingStrategy clippingStrategy) Registers a clipping strategy to specify how clipping is performed for child figures.void
setConstraint
(IFigure child, Object constraint) Convenience method to set the constraint of the specified child in the current LayoutManager.void
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 aTraverseEvent
.void
Sets the font.void
Sets the foreground color.void
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 istrue
and transparent if isOpaque isfalse
.void
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 torequestFocus()
.void
setSize
(int w, int h) Sets this IFigure's size.void
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 IFigurex
pixels horizontally andy
pixels vertically.void
Translates a Translatable from this IFigure's parent's coordinates to this IFigure's local coordinates.void
Translates a Translatable that is relative to this figure's bounds to absolute.void
Translates a Translatable from this IFigure's coordinates to its parent's coordinates.void
Translates a Translatable in absolute coordinates to be relative to this figure's bounds.void
validate()
Indicates that this figure should make itself valid.
-
Field Details
-
MAX_DIMENSION
The maximum allowable dimension. (Integer.MAX_VALUE
,Integer.MAX_VALUE
) -
MIN_DIMENSION
The minimum allowable dimension. (5,5) -
NO_INSETS
Empty Insets.
-
-
Method Details
-
add
Adds the given IFigure as a child of this IFigure. The same as callingadd(figure, null, -1)
.- Parameters:
figure
- The IFigure to add
-
add
Adds the given IFigure as a child of this IFigure at the given index. The same as callingadd(figure, null, index)
.- Parameters:
figure
- The IFigure to addindex
- The index where the IFigure should be added
-
add
Adds the given IFigure as a child of this IFigure with the given constraint. The same as callingadd(figure, constraint, -1)
.- Parameters:
figure
- The IFigure to addconstraint
- The newly added IFigure's constraint
-
add
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, thenLayoutManager.setConstraint(IFigure, Object)
shall be called on the layout.- Parameters:
figure
- The IFigure to addconstraint
- The newly added IFigure's constraintindex
- The index where the IFigure should be added- Throws:
IndexOutOfBoundsException
- if the index is out of rangeIllegalArgumentException
- if adding the child creates a cycle
-
addAncestorListener
Registers the given listener as an AncestorListener of this figure.- Parameters:
listener
- The listener to add
-
addCoordinateListener
Registers the given listener as a CoordinateListener of this figure.- Parameters:
listener
- the listener to add- Since:
- 3.1
-
addFigureListener
Registers the given listener as a FigureListener of this figure.- Parameters:
listener
- The listener to add
-
addFocusListener
Registers the given listener as a FocusListener of this figure.- Parameters:
listener
- The listener to add
-
addKeyListener
Registers the given listener as a KeyListener of this figure.- Parameters:
listener
- The listener to add
-
addLayoutListener
Registers the given listener on this figure.- Parameters:
listener
- The listener to add- Since:
- 3.1
-
addMouseListener
Registers the given listener as a MouseListener of this IFigure.- Parameters:
listener
- The listener to add
-
addMouseMotionListener
Registers the given listener as a MouseMotionListener of this IFigure.- Parameters:
listener
- The listener to add
-
addNotify
void addNotify()Called after this IFigure is added to its parent. -
addPropertyChangeListener
Registers the given listener as a PropertyChangeListener of this IFigure.- Parameters:
listener
- The listener to add
-
addPropertyChangeListener
Registers the given listener as a PropertyChangeListener of this IFigure, interested only in the given property.- Parameters:
property
- The property the listener is interested inlistener
- The listener to add
-
containsPoint
boolean containsPoint(int x, int y) Returnstrue
if the point(x, y)
is contained within this IFigure's bounds.- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
true
if the point (x,y) is contained in this IFigure's bounds
-
containsPoint
Returnstrue
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
void erase()Erases this IFigure. -
findFigureAt
Returns the IFigure at the specified location. May returnthis
ornull
.- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
- The IFigure at the specified location
-
findFigureAt
Returns the IFigure at the specified location based on the conditional TreeSearch. May returnthis
ornull
- Parameters:
x
- the X coordinatey
- the Y coordinatesearch
- the conditional TreeSearch- Returns:
- the IFigure at the specified location
-
findFigureAt
Returns the IFigure at the specified location. May returnthis
ornull
.- Parameters:
p
- The point- Returns:
- The IFigure at the specified location
-
findFigureAtExcluding
Returns the IFigure at the specified location, excluding any IFigures incollection
. May returnthis
ornull
.- Parameters:
x
- The X coordinatey
- The Y coordinatecollection
- A collection of IFigures to be excluded- Returns:
- The IFigure at the specified location, excluding any IFigures in collection
-
findMouseEventTargetAt
Returns the IFigure located at the given location which will accept mouse events.- Parameters:
x
- The X coordinatey
- The Y coordinate- Returns:
- The IFigure located at the given location which will accept mouse events
-
getBackgroundColor
Color getBackgroundColor()Returns the background color. Background color can be inherited from the parent.- Returns:
- The background color
-
getBorder
Border getBorder()Returns the current border by reference.- Returns:
- The current border
-
getBounds
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
Returns an unmodifiable list of children by reference.- Returns:
- An unmodifiable list of children by reference
-
getClientArea
Rectangle getClientArea()Returns the rectangular area within this Figure's bounds in which children will be placed (viaLayoutManagers
) and the painting of children will be clipped.- Returns:
- The client area
-
getClientArea
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
-
getClippingStrategy
IClippingStrategy getClippingStrategy()Returns the IClippingStrategy used by this figure to clip its children- Returns:
- the IClipppingStrategy used to clip this figure's children.
- Since:
- 3.6
-
getCursor
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
Font getFont()Returns the current Font by reference.- Returns:
- The current Font
-
getForegroundColor
Color getForegroundColor()Returns the foreground color.- Returns:
- The foreground color
-
getInsets
Insets getInsets()Returns the current Insets. May be returned by reference. The returned value should not be modified.- Returns:
- The current Insets.
-
getLayoutManager
LayoutManager getLayoutManager()Returns the current LayoutManager by reference.- Returns:
- The current LayoutManager by reference
-
getLocalBackgroundColor
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
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
-
getLocation
Returns the top-left corner of this Figure's bounds.- Returns:
- The top-left corner of this Figure's bounds
- Since:
- 3.14
-
getMaximumSize
Dimension getMaximumSize()Returns a hint indicating the largest desireable size for the IFigure. Returned Dimension is by value.- Returns:
- The maximum size
-
getMinimumSize
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
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 hinthHint
- the height hint- Returns:
- The minimum size
-
getParent
IFigure getParent()Returns the IFigure that is the current parent of this IFigure ornull
if there is no parent.- Returns:
null
or the parent figure
-
getPreferredSize
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 callinggetPreferredSize(-1, -1)
.- Returns:
- The preferred size
-
getPreferredSize
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 hinthHint
- a height hint- Returns:
- The preferred size
-
getSize
Dimension getSize()Returns the current size. Returned Dimension is by value.- Returns:
- The current size
-
getToolTip
IFigure getToolTip()Returns a IFigure that is the tooltip for this IFigure.- Returns:
- This IFigure's tooltip
-
getUpdateManager
UpdateManager getUpdateManager()Returns the UpdateManager for this IFigure by reference.- Returns:
- The update manager
-
handleFocusGained
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
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
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
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
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
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
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
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
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
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
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
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
boolean hasFocus()Returnstrue
if this IFigure has focus.- Returns:
true
if this IFigure has focus
-
internalGetEventDispatcher
EventDispatcher internalGetEventDispatcher()This method is for internal purposes only and should not be called.- Returns:
- The event dispatcher
-
intersects
Returnstrue
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
void invalidate()Invalidates this IFigure. If this figure has a LayoutManager, thenLayoutManager.invalidate()
should be called on that layout. -
invalidateTree
void invalidateTree()Invalidates this figure as well as all contained within. -
isCoordinateSystem
boolean isCoordinateSystem()Returnstrue
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
boolean isEnabled()Returnstrue
if this IFigure is enabled.- Returns:
true
if this IFigure is enabled
-
isFocusTraversable
boolean isFocusTraversable()Returnstrue
if this IFigure can gain focus on aTraverseEvent
.- Returns:
true
if this IFigure can gain focus on a TraverseEvent
-
isMirrored
boolean isMirrored()- Returns:
true
if this figure is hosted in a Control that is mirrored- Since:
- 3.1
-
isOpaque
boolean isOpaque()Returnstrue
if this IFigure is opaque.- Returns:
true
if this IFigure is opaque
-
isRequestFocusEnabled
boolean isRequestFocusEnabled()Returnstrue
if this IFigure can receive focus on a call torequestFocus()
.- Returns:
true
if this IFigure can receive focus on a call to requestFocus()
-
isShowing
boolean isShowing()Returnstrue
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
boolean isVisible()returnstrue
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
Paints this IFigure and its children.- Parameters:
graphics
- The Graphics object used for painting
-
remove
Removes the given child from this figure's children. If this figure has a LayoutManager, thenLayoutManager.remove(IFigure)
shall be called on that layout with the child.- Parameters:
figure
- The IFigure to remove
-
removeAncestorListener
Unregisters the given listener, so that it will no longer receive notification of ancestor events.- Parameters:
listener
- The listener to remove
-
removeCoordinateListener
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
Unregisters the given listener, so that it will no longer receive notification of IFigure events.- Parameters:
listener
- The listener to remove
-
removeFocusListener
Unregisters the given listener, so that it will no longer receive notification of focus events.- Parameters:
listener
- The listener to remove
-
removeKeyListener
Removes the first occurence of the given listener.- Parameters:
listener
- The listener to remove
-
removeLayoutListener
Removes the most recent occurence of the given listener.- Parameters:
listener
- the listener to remove- Since:
- 3.1
-
removeMouseListener
Unregisters the given listener, so that it will no longer receive notification of mouse events.- Parameters:
listener
- The listener to remove
-
removeMouseMotionListener
Unregisters the given listener, so that it will no longer receive notification of mouse motion events.- Parameters:
listener
- The listener to remove
-
removeNotify
void removeNotify()Called before this IFigure is removed from its parent. -
removePropertyChangeListener
Unregisters the given listener, so that it will no longer receive notification of any property changes.- Parameters:
listener
- The listener to remove
-
removePropertyChangeListener
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 inlistener
- The listener no longer interested in the property
-
repaint
void repaint()Repaints this IFigure. -
repaint
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 arew
andh
, respectively.- Parameters:
x
- The X coordinate of the area to repainty
- The Y coordinate of the area to repaintw
- The width of the area to repainth
- The height of the area to repaint
-
repaint
Repaints the rectangular area within this IFigure represented byrect
.- Parameters:
rect
- The rectangular area to be repainted
-
requestFocus
void requestFocus()Requests focus from theEventDispatcher
. -
revalidate
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
Sets the background color.- Parameters:
c
- The new background color
-
setBorder
Sets the border.- Parameters:
b
- The new border
-
setBounds
Sets the bounds to the bounds of the specifiedRectangle
.- Parameters:
rect
- The new bounds
-
setClippingStrategy
Registers a clipping strategy to specify how clipping is performed for child figures.- Parameters:
clippingStrategy
-- Since:
- 3.6
-
setConstraint
Convenience method to set the constraint of the specified child in the current LayoutManager.- Parameters:
child
- The figure whose constraint is being setconstraint
- the constraint- Throws:
IllegalArgumentException
- if the child is not contained by this Figure
-
setCursor
Sets the cursor.- Parameters:
cursor
- The new cursor
-
setEnabled
void setEnabled(boolean value) Sets this IFigure to be enabled.- Parameters:
value
-true
if this IFigure should be enabled
-
setFocusTraversable
void setFocusTraversable(boolean value) Sets the ability for this IFigure to gain focus on aTraverseEvent
.- Parameters:
value
-true
if this IFigure should gain focus on a TraverseEvent
-
setFont
Sets the font.- Parameters:
f
- The new font
-
setForegroundColor
Sets the foreground color.- Parameters:
c
- The new foreground color
-
setLayoutManager
Sets the LayoutManager.- Parameters:
lm
- The new layout manager
-
setLocation
Sets the location of this IFigure.- Parameters:
p
- The new location
-
setMaximumSize
Sets the maximum size this IFigure can be.- Parameters:
size
- The new maximum size
-
setMinimumSize
Sets the minimum size this IFigure can be.- Parameters:
size
- The new minimum size
-
setOpaque
void setOpaque(boolean isOpaque) Sets this IFigure to be opaque if isOpaque istrue
and transparent if isOpaque isfalse
.- Parameters:
isOpaque
-true
is this IFigure should be opaque
-
setParent
Sets this IFigure's parent.- Parameters:
parent
- The new parent IFigure
-
setPreferredSize
Sets this IFigure's preferred size.- Parameters:
size
- The new preferred size
-
setRequestFocusEnabled
void setRequestFocusEnabled(boolean requestFocusEnabled) Sets the ability for this Figure to gain focus on a call torequestFocus()
.- Parameters:
requestFocusEnabled
-true
if this IFigure should gain focus on a call to requestFocus()
-
setSize
Sets this IFigure's size.- Parameters:
d
- The new size
-
setSize
void setSize(int w, int h) Sets this IFigure's size.- Parameters:
w
- The new widthh
- The new height
-
setToolTip
Sets a tooltip that is displayed when the mouse hovers over this IFigure.- Parameters:
figure
- The tooltip IFigure
-
setVisible
void setVisible(boolean visible) Sets this IFigure's visibility.- Parameters:
visible
-true
if this IFigure should be visible
-
translate
void translate(int x, int y) Moves this IFigurex
pixels horizontally andy
pixels vertically.- Parameters:
x
- The amount to move this IFigure horizontallyy
- The amount to move this IFigure vertically
-
translateFromParent
Translates a Translatable from this IFigure's parent's coordinates to this IFigure's local coordinates.- Parameters:
t
- The object to translate
-
translateToAbsolute
Translates a Translatable that is relative to this figure's bounds to absolute.- Parameters:
t
- The object to translate
-
translateToParent
Translates a Translatable from this IFigure's coordinates to its parent's coordinates.- Parameters:
t
- The object to translate
-
translateToRelative
Translates a Translatable in absolute coordinates to be relative to this figure's bounds.- Parameters:
t
- The object to translate
-
validate
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.
-