Class Figure
- All Implemented Interfaces:
IFigure
- Direct Known Subclasses:
AbstractImageFigure,Clickable,Container,FlowFigure,GhostImageFigure,Label,LabeledContainer,Layer,LightweightSystem.RootFigure,Panel,ScrollBar,ScrollPane,Shape,Thumbnail,Viewport
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.use ReverseFigureChildrenIterator insteadprotected static final classA search which does not filter any figures. since 3.0static final classFigure children iterator which implements the java iterator interface for more convenient figure iteration.Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
IFigure.NoInsets -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ColorDeprecated.access usinggetLocalBackgroundColor().protected BorderDeprecated.access usinggetBorder()protected RectangleThe rectangular area that this Figure occupies.protected ColorDeprecated.access usinggetLocalForegroundColor().protected intThe flags for this Figure.protected FontDeprecated.access usinggetLocalFont()protected static intThe largest flag defined in this class.protected DimensionThis Figure's maximum size.protected DimensionThis Figure's minimum size.protected static final UpdateManagerAn UpdateManager that does nothing.protected DimensionThis Figure's preferred size.protected IFigureDeprecated.access usinggetToolTip()Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidCallsadd(IFigure, Object, int)withnullas the constraint and -1 as the index.final voidCallsadd(IFigure, Object, int)withnullas the constraint.final voidCallsadd(IFigure, Object, int)with -1 as the index.voidAdds the child with the specified index and constraint.voidaddAncestorListener(AncestorListener ancestorListener) Registers the given listener as an AncestorListener of this figure.voidaddCoordinateListener(CoordinateListener listener) Registers the given listener as a CoordinateListener of this figure.voidaddFigureListener(FigureListener listener) Registers the given listener as a FigureListener of this figure.voidaddFocusListener(FocusListener listener) Registers the given listener as a FocusListener of this figure.voidaddKeyListener(KeyListener listener) Registers the given listener as a KeyListener of this figure.voidaddLayoutListener(LayoutListener listener) Appends the given layout listener to the list of layout listeners.protected <T> voidaddListener(Class<T> clazz, Object listener) Adds a listener of type clazz to this Figure's list of event listeners.voidaddMouseListener(MouseListener listener) Registers the given listener as a MouseListener of this IFigure.voidaddMouseMotionListener(MouseMotionListener listener) Registers the given listener as a MouseMotionListener of this IFigure.voidaddMouseWheelListener(MouseWheelListener listener) Registers the given listener as a MouseWheelListener of this IFigure.voidCalled after the receiver's parent has been set and it has been added to its parent.voidRegisters the given listener as a PropertyChangeListener of this IFigure.voidaddPropertyChangeListener(String property, PropertyChangeListener listener) Registers the given listener as a PropertyChangeListener of this IFigure, interested only in the given property.booleancontainsPoint(int x, int y) Returnstrueif the point(x, y)is contained within this IFigure's bounds.final booleanThis method is final.voiderase()Erases this IFigure.protected IFigurefindDescendantAtExcluding(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.final IFigurefindFigureAt(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.final IFigurefindFigureAt(Point pt) Returns the IFigure at the specified location.final IFigurefindFigureAtExcluding(int x, int y, Collection<IFigure> c) Returns the IFigure at the specified location, excluding any IFigures incollection.findMouseEventTargetAt(int x, int y) protected IFigurefindMouseEventTargetInDescendantsAt(int x, int y) Searches this Figure's children for the deepest descendant for whichisMouseEventTarget()returnstrueand returns that descendant ornullif none found.protected voidNotifies to allCoordinateListeners that this figure's local coordinate system has changed in a way which affects the absolute bounds of figures contained within.protected voidNotifies to allFigureListeners that this figure has moved.protected voidDeprecated.call fireFigureMoved() or fireCoordinateSystemChanged() as appropriateprotected voidfirePropertyChange(String property, boolean old, boolean current) Notifies anyPropertyChangeListenerslistening to this Figure that the boolean property with id property has changed.protected voidfirePropertyChange(String property, int old, int current) Notifies anyPropertyChangeListenerslistening to this figure that the integer property with idpropertyhas changed.protected voidfirePropertyChange(String property, Object old, Object current) Notifies anyPropertyChangeListenerslistening to this figure that the Object property with id property has changed.Returns this Figure's background color.Returns the current border by reference.Returns the smallest rectangle completely enclosing the figure.Returns an unmodifiable list of children by reference.Provide an iterable that will iterate in reverse over all children of this figure.final RectangleReturns 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.protected booleangetFlag(int flag) Returns the value of the given flag.getFont()Returns the current Font by reference.Returns the foreground color.Returns the border's Insets if the border is set.Returns the current LayoutManager by reference.protected <T> Iterator<T> getListeners(Class<T> clazz) Returns an Iterator over the listeners of type clazz that are listening to this Figure.protected <T> Iterable<T> getListenersIterable(Class<T> listenerType) * Returns an Iterator over the listeners of type listenerType that are listening to this Figure.Returnsnullor the local background Color of this Figure.protected FontReturnsnullor the local font setting for this figure.Returnsnullor the local foreground Color of this Figure.final PointReturns the top-left corner of this Figure's bounds.Returns a hint indicating the largest desireable size for the IFigure.final DimensionReturns 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 ornullif there is no parent.final DimensionReturns 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.final DimensiongetSize()Returns the current size.Returns a IFigure that is the tooltip for this IFigure.Returns the UpdateManager for this IFigure by reference.voidhandleFocusGained(FocusEvent event) Called when this IFigure has gained focus.voidhandleFocusLost(FocusEvent event) Called when this IFigure has lost focus.voidhandleKeyPressed(KeyEvent event) Called when a key is pressed while this IFigure has focus.voidhandleKeyReleased(KeyEvent event) Called when a key is released while this IFigure has focus.voidCalled when a mouse button has been double-clicked while within this IFigure's bounds.voidhandleMouseDragged(MouseEvent event) Called when the mouse has been dragged within this IFigure's bounds.voidhandleMouseEntered(MouseEvent event) Called when the mouse has entered this IFigure's bounds.voidhandleMouseExited(MouseEvent event) Called when the mouse has exited this IFigure's bounds.voidhandleMouseHover(MouseEvent event) Called when the mouse has hovered over this IFigure.voidhandleMouseMoved(MouseEvent event) Called when the mouse has moved within this IFigure's bounds.voidhandleMousePressed(MouseEvent event) Called when a mouse button has been pressed while within this IFigure's bounds.voidhandleMouseReleased(MouseEvent event) Called when a mouse button has been released while within this IFigure's bounds.voidCalled when a mouse wheel was scrolled while within this IFigure's bounds.booleanhasFocus()Returnstrueif this IFigure has focus.This method is for internal purposes only and should not be called.booleanintersects(Rectangle rect) Returnstrueif this IFigure's bounds intersect with the given Rectangle.voidInvalidates this IFigure.voidInvalidates this figure as well as all contained within.booleanReturnstrueif this figure is capable of applying a local coordinate system which affects its children.booleanReturnstrueif this IFigure is enabled.booleanReturnstrueif this IFigure can gain focus on aTraverseEvent.booleanprotected booleanReturnstrueif this Figure can receiveMouseEvents.booleanisOpaque()Returnstrueif this IFigure is opaque.booleanReturnstrueif this IFigure can receive focus on a call toIFigure.requestFocus().booleanReturnstrueif this IFigure is showing.protected booleanisValid()Returnstrueif this Figure is valid.protected booleanReturnstrueif revalidating this Figure does not require revalidating its parent.booleanreturnstrueif this figure's visibility flag is set to true.protected voidlayout()Lays out this Figure using itsLayoutManager.protected booleanvoidPaints this Figure and its children.protected voidpaintBorder(Graphics graphics) Paints the border associated with this Figure, if one exists.protected voidpaintChildren(Graphics graphics) Paints this Figure's children.protected voidpaintClientArea(Graphics graphics) Paints this Figure's client area.protected voidpaintFigure(Graphics graphics) Paints this Figure's primary representation, or background.protected voidprimTranslate(int dx, int dy) Translates this Figure's bounds, without firing a move.voidRemoves the given child Figure from this Figure's hierarchy and revalidates this Figure.voidRemoves all children from this Figure.voidremoveAncestorListener(AncestorListener listener) Unregisters the given listener, so that it will no longer receive notification of ancestor events.voidremoveCoordinateListener(CoordinateListener listener) Unregisters the given listener, so that it will no longer receive notification of coordinate changes.voidremoveFigureListener(FigureListener listener) Unregisters the given listener, so that it will no longer receive notification of IFigure events.voidremoveFocusListener(FocusListener listener) Unregisters the given listener, so that it will no longer receive notification of focus events.voidremoveKeyListener(KeyListener listener) Removes the first occurence of the given listener.voidremoveLayoutListener(LayoutListener listener) Removes the first occurence of the given listener.protected <T> voidremoveListener(Class<T> clazz, Object listener) Removes listener of type clazz from this Figure's list of listeners.voidremoveMouseListener(MouseListener listener) Unregisters the given listener, so that it will no longer receive notification of mouse events.voidremoveMouseMotionListener(MouseMotionListener listener) Unregisters the given listener, so that it will no longer receive notification of mouse motion events.voidremoveMouseWheelListener(MouseWheelListener listener) Unregisters the given listener, so that it will no longer receive notification of mouse wheel events.voidCalled prior to this figure's removal from its parentvoidUnregisters the given listener, so that it will no longer receive notification of any property changes.voidremovePropertyChangeListener(String property, PropertyChangeListener listener) Unregisters the given listener, so that it will no longer receive notification of changes in the given property.voidrepaint()Repaints this IFigure.voidrepaint(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 arewandh, respectively.final voidRepaints the rectangular area within this IFigure represented byrect.final voidRequests focus from theEventDispatcher.voidInvalidates this figure and revalidates() its parent.voidSets the background color.voidSets the border.voidSets the bounds of this Figure to the Rectangle rect.protected voidsetChildrenDirection(int direction) Sets the direction of anyOrientablechildren.protected voidsetChildrenEnabled(boolean value) Sets all childrens' enabled property to value.protected voidsetChildrenOrientation(int orientation) Sets the orientation of anyOrientablechildren.voidsetClippingStrategy(IClippingStrategy clippingStrategy) Registers a clipping strategy to specify how clipping is performed for child figures.voidsetConstraint(IFigure child, Object constraint) Convenience method to set the constraint of the specified child in the current LayoutManager.voidSets the cursor.voidsetEnabled(boolean value) Sets this IFigure to be enabled.protected final voidsetFlag(int flag, boolean value) Sets the given flag to the given value.voidsetFocusTraversable(boolean focusTraversable) Sets the ability for this IFigure to gain focus on aTraverseEvent.voidSets the font.voidSets the foreground color.voidsetLayoutManager(LayoutManager manager) Sets the LayoutManager.voidsetLocation(Point p) Sets the location of this IFigure.voidSets the maximum size this IFigure can be.voidSets the minimum size this IFigure can be.voidsetOpaque(boolean opaque) Sets this IFigure to be opaque if isOpaque istrueand transparent if isOpaque isfalse.voidSets this IFigure's parent.final voidsetPreferredSize(int w, int h) Sets the preferred size of this figure.voidsetPreferredSize(Dimension size) Sets this IFigure's preferred size.voidsetRequestFocusEnabled(boolean requestFocusEnabled) Sets the ability for this Figure to gain focus on a call toIFigure.requestFocus().voidsetSize(int w, int h) Sets this IFigure's size.final voidSets this IFigure's size.voidSets a tooltip that is displayed when the mouse hovers over this IFigure.voidsetValid(boolean value) Sets this figure to be valid if value istrueand invalid otherwise.voidsetVisible(boolean visible) Sets this IFigure's visibility.final voidtranslate(int x, int y) Moves this IFigurexpixels horizontally andypixels vertically.voidTranslates a Translatable from this IFigure's parent's coordinates to this IFigure's local coordinates.final voidTranslates a Translatable that is relative to this figure's bounds to absolute.voidTranslates a Translatable from this IFigure's coordinates to its parent's coordinates.final voidTranslates a Translatable in absolute coordinates to be relative to this figure's bounds.protected booleanReturnstrueif this Figure uses local coordinates.voidvalidate()Indicates that this figure should make itself valid.
-
Field Details
-
MAX_FLAG
protected static int MAX_FLAGThe 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
The rectangular area that this Figure occupies. -
flags
protected int flagsThe flags for this Figure. -
prefSize
This Figure's preferred size. -
minSize
This Figure's minimum size. -
maxSize
This Figure's maximum size. -
font
Deprecated.access usinggetLocalFont() -
bgColor
Deprecated.access usinggetLocalBackgroundColor(). -
fgColor
Deprecated.access usinggetLocalForegroundColor(). -
border
Deprecated.access usinggetBorder() -
toolTip
Deprecated.access usinggetToolTip() -
NO_MANAGER
An UpdateManager that does nothing.
-
-
Constructor Details
-
Figure
public Figure()
-
-
Method Details
-
add
Callsadd(IFigure, Object, int)with -1 as the index. -
add
Description copied from interface:IFigureAdds 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. -
add
Callsadd(IFigure, Object, int)withnullas the constraint and -1 as the index. -
add
Callsadd(IFigure, Object, int)withnullas the constraint. -
addAncestorListener
Description copied from interface:IFigureRegisters the given listener as an AncestorListener of this figure.- Specified by:
addAncestorListenerin interfaceIFigure- Parameters:
ancestorListener- The listener to add- See Also:
-
addCoordinateListener
Description copied from interface:IFigureRegisters the given listener as a CoordinateListener of this figure.- Specified by:
addCoordinateListenerin interfaceIFigure- Parameters:
listener- the listener to add- See Also:
-
addFigureListener
Description copied from interface:IFigureRegisters the given listener as a FigureListener of this figure.- Specified by:
addFigureListenerin interfaceIFigure- Parameters:
listener- The listener to add- See Also:
-
addFocusListener
Description copied from interface:IFigureRegisters the given listener as a FocusListener of this figure.- Specified by:
addFocusListenerin interfaceIFigure- Parameters:
listener- The listener to add- See Also:
-
addKeyListener
Description copied from interface:IFigureRegisters the given listener as a KeyListener of this figure.- Specified by:
addKeyListenerin interfaceIFigure- Parameters:
listener- The listener to add- See Also:
-
addLayoutListener
Appends the given layout listener to the list of layout listeners.- Specified by:
addLayoutListenerin interfaceIFigure- Parameters:
listener- the listener being added- Since:
- 3.1
-
addListener
Adds a listener of type clazz to this Figure's list of event listeners.- Parameters:
clazz- The listener typelistener- The listener
-
addMouseListener
Description copied from interface:IFigureRegisters the given listener as a MouseListener of this IFigure.- Specified by:
addMouseListenerin interfaceIFigure- Parameters:
listener- The listener to add- See Also:
-
addMouseMotionListener
Description copied from interface:IFigureRegisters the given listener as a MouseMotionListener of this IFigure.- Specified by:
addMouseMotionListenerin interfaceIFigure- Parameters:
listener- The listener to add- See Also:
-
addMouseWheelListener
Description copied from interface:IFigureRegisters the given listener as a MouseWheelListener of this IFigure.- Specified by:
addMouseWheelListenerin interfaceIFigure- Parameters:
listener- The listener to add- See Also:
-
addNotify
public void addNotify()Called after the receiver's parent has been set and it has been added to its parent. -
addPropertyChangeListener
Description copied from interface:IFigureRegisters the given listener as a PropertyChangeListener of this IFigure, interested only in the given property.- Specified by:
addPropertyChangeListenerin interfaceIFigure- Parameters:
property- The property the listener is interested inlistener- The listener to add- See Also:
-
addPropertyChangeListener
Description copied from interface:IFigureRegisters the given listener as a PropertyChangeListener of this IFigure.- Specified by:
addPropertyChangeListenerin interfaceIFigure- Parameters:
listener- The listener to add- See Also:
-
containsPoint
This method is final. OverridecontainsPoint(int, int)if needed.- Specified by:
containsPointin interfaceIFigure- Parameters:
p- The point- Returns:
trueif the Point p is contained within this IFigure's bounds- Since:
- 2.0
- See Also:
-
containsPoint
public boolean containsPoint(int x, int y) Description copied from interface:IFigureReturnstrueif the point(x, y)is contained within this IFigure's bounds.- Specified by:
containsPointin interfaceIFigure- Parameters:
x- The X coordinatey- The Y coordinate- Returns:
trueif the point (x,y) is contained in this IFigure's bounds- See Also:
-
erase
public void erase()Description copied from interface:IFigureErases this IFigure. -
findDescendantAtExcluding
Returns a descendant of this Figure such that the Figure returned contains the point (x, y), and is accepted by the given TreeSearch. Returnsnullif none found.- Parameters:
x- The X coordinatey- The Y coordinatesearch- the TreeSearch- Returns:
- The descendant Figure at (x,y)
-
findFigureAt
Description copied from interface:IFigureReturns the IFigure at the specified location. May returnthisornull.- Specified by:
findFigureAtin interfaceIFigure- Parameters:
pt- The point- Returns:
- The IFigure at the specified location
- See Also:
-
findFigureAt
Description copied from interface:IFigureReturns the IFigure at the specified location. May returnthisornull.- Specified by:
findFigureAtin interfaceIFigure- Parameters:
x- The X coordinatey- The Y coordinate- Returns:
- The IFigure at the specified location
- See Also:
-
findFigureAt
Description copied from interface:IFigureReturns the IFigure at the specified location based on the conditional TreeSearch. May returnthisornull- Specified by:
findFigureAtin interfaceIFigure- Parameters:
x- the X coordinatey- the Y coordinatesearch- the conditional TreeSearch- Returns:
- the IFigure at the specified location
- See Also:
-
findFigureAtExcluding
Description copied from interface:IFigureReturns the IFigure at the specified location, excluding any IFigures incollection. May returnthisornull.- Specified by:
findFigureAtExcludingin interfaceIFigure- Parameters:
x- The X coordinatey- The Y coordinatec- A collection of IFigures to be excluded- Returns:
- The IFigure at the specified location, excluding any IFigures in collection
- See Also:
-
findMouseEventTargetAt
Returns the deepest descendant for whichisMouseEventTarget()returnstrueornullif none found. The Parameters x and y are absolute locations. Any Graphics transformations applied by this Figure to its children duringpaintChildren(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:
findMouseEventTargetAtin interfaceIFigure- Parameters:
x- The X coordinatey- The Y coordinate- Returns:
- The deepest descendant for which isMouseEventTarget() returns true
-
findMouseEventTargetInDescendantsAt
Searches this Figure's children for the deepest descendant for whichisMouseEventTarget()returnstrueand returns that descendant ornullif none found.- Parameters:
x- The X coordinatey- The Y coordinate- Returns:
- The deepest descendant for which isMouseEventTarget() returns true
- See Also:
-
fireCoordinateSystemChanged
protected void fireCoordinateSystemChanged()Notifies to allCoordinateListeners 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 allFigureListeners that this figure has moved. Moved means that the bounds have changed in some way, location and/or size.- Since:
- 3.1
-
fireMoved
Deprecated.call fireFigureMoved() or fireCoordinateSystemChanged() as appropriateFires 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
Notifies anyPropertyChangeListenerslistening to this Figure that the boolean property with id property has changed.- Parameters:
property- The id of the property that changedold- The old value of the changed propertycurrent- The current value of the changed property- Since:
- 2.0
-
firePropertyChange
Notifies anyPropertyChangeListenerslistening to this figure that the Object property with id property has changed.- Parameters:
property- The id of the property that changedold- The old value of the changed propertycurrent- The current value of the changed property- Since:
- 2.0
-
firePropertyChange
Notifies anyPropertyChangeListenerslistening to this figure that the integer property with idpropertyhas changed.- Parameters:
property- The id of the property that changedold- The old value of the changed propertycurrent- The current value of the changed property- Since:
- 2.0
-
getBackgroundColor
Returns this Figure's background color. If this Figure's background color isnulland its parent is notnull, the background color is inherited from the parent.- Specified by:
getBackgroundColorin interfaceIFigure- Returns:
- The background color
- See Also:
-
getBorder
Description copied from interface:IFigureReturns the current border by reference. -
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. -
getChildren
Description copied from interface:IFigureReturns an unmodifiable list of children by reference.- Specified by:
getChildrenin interfaceIFigure- Returns:
- An unmodifiable list of children by reference
- See Also:
-
getChildrenRevIterable
Provide an iterable that will iterate in reverse over all children of this figure.- Since:
- 3.13
-
getClientArea
Description copied from interface:IFigureCopies the client area into the specificied Recangle, and returns that rectangle for convenience.- Specified by:
getClientAreain interfaceIFigure- 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:
-
getClientArea
Description copied from interface:IFigureReturns the rectangular area within this Figure's bounds in which children will be placed (viaLayoutManagers) and the painting of children will be clipped.- Specified by:
getClientAreain interfaceIFigure- Returns:
- The client area
- See Also:
-
getClippingStrategy
Returns the IClippingStrategy used by this figure to clip its children- Specified by:
getClippingStrategyin interfaceIFigure- Returns:
- the IClipppingStrategy used to clip this figure's children.
- Since:
- 3.6
-
getCursor
Description copied from interface:IFigureReturns the Cursor used when the mouse is over this IFigure. -
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
Description copied from interface:IFigureReturns the current Font by reference. -
getForegroundColor
Description copied from interface:IFigureReturns the foreground color.- Specified by:
getForegroundColorin interfaceIFigure- Returns:
- The foreground color
- See Also:
-
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. -
getLayoutManager
Description copied from interface:IFigureReturns the current LayoutManager by reference.- Specified by:
getLayoutManagerin interfaceIFigure- Returns:
- The current LayoutManager by reference
- See Also:
-
getListeners
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
-
getListenersIterable
* Returns an Iterator over the listeners of type listenerType that are listening to this Figure. If there are no listeners of type listenerType, an empty iterator is returned.- Parameters:
listenerType- The type of listeners to get- Returns:
- an Iterable over the requested listeners c
- Since:
- 3.13
-
getLocalBackgroundColor
Returnsnullor the local background Color of this Figure. Does not inherit this Color from the parent.- Specified by:
getLocalBackgroundColorin interfaceIFigure- Returns:
- bgColor
nullor the local background Color
-
getLocalFont
Returnsnullor the local font setting for this figure. Does not return values inherited from the parent figure.- Returns:
nullor the local font- Since:
- 3.1
-
getLocalForegroundColor
Returnsnullor the local foreground Color of this Figure. Does not inherit this Color from the parent.- Specified by:
getLocalForegroundColorin interfaceIFigure- Returns:
- fgColor
nullor the local foreground Color
-
getLocation
Returns the top-left corner of this Figure's bounds.- Specified by:
getLocationin interfaceIFigure- Returns:
- The top-left corner of this Figure's bounds
- Since:
- 2.0
-
getMaximumSize
Description copied from interface:IFigureReturns a hint indicating the largest desireable size for the IFigure. Returned Dimension is by value.- Specified by:
getMaximumSizein interfaceIFigure- Returns:
- The maximum size
- See Also:
-
getMinimumSize
Description copied from interface:IFigureReturns 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:
getMinimumSizein interfaceIFigure- Returns:
- The minimum size
- See Also:
-
getMinimumSize
Description copied from interface:IFigureReturns 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:
getMinimumSizein interfaceIFigure- Parameters:
wHint- the width hinthHint- the height hint- Returns:
- The minimum size
- See Also:
-
getParent
Description copied from interface:IFigureReturns the IFigure that is the current parent of this IFigure ornullif there is no parent. -
getPreferredSize
Description copied from interface:IFigureReturns 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).- Specified by:
getPreferredSizein interfaceIFigure- Returns:
- The preferred size
- See Also:
-
getPreferredSize
Description copied from interface:IFigureReturns 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-1indicates that there is no constraint in that direction.- Specified by:
getPreferredSizein interfaceIFigure- Parameters:
wHint- a width hinthHint- a height hint- Returns:
- The preferred size
- See Also:
-
getSize
Description copied from interface:IFigureReturns the current size. Returned Dimension is by value. -
getToolTip
Description copied from interface:IFigureReturns a IFigure that is the tooltip for this IFigure.- Specified by:
getToolTipin interfaceIFigure- Returns:
- This IFigure's tooltip
- See Also:
-
getUpdateManager
Description copied from interface:IFigureReturns the UpdateManager for this IFigure by reference.- Specified by:
getUpdateManagerin interfaceIFigure- Returns:
- The update manager
- See Also:
-
handleFocusGained
Description copied from interface:IFigureCalled 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
FocusListenerwith this IFigure.- Specified by:
handleFocusGainedin interfaceIFigure- Parameters:
event- The focus event- See Also:
-
handleFocusLost
Description copied from interface:IFigureCalled 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
FocusListenerwith this IFigure.- Specified by:
handleFocusLostin interfaceIFigure- Parameters:
event- The focus event- See Also:
-
handleKeyPressed
Description copied from interface:IFigureCalled 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
KeyListenerwith this IFigure.- Specified by:
handleKeyPressedin interfaceIFigure- Parameters:
event- The key event- See Also:
-
handleKeyReleased
Description copied from interface:IFigureCalled 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
KeyListenerwith this IFigure.- Specified by:
handleKeyReleasedin interfaceIFigure- Parameters:
event- The key event- See Also:
-
handleMouseDoubleClicked
Description copied from interface:IFigureCalled 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
MouseListenerwith this IFigure.- Specified by:
handleMouseDoubleClickedin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMouseDragged
Description copied from interface:IFigureCalled 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
MouseMotionListenerwith this IFigure.- Specified by:
handleMouseDraggedin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMouseEntered
Description copied from interface:IFigureCalled 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
MouseMotionListenerwith this IFigure.- Specified by:
handleMouseEnteredin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMouseExited
Description copied from interface:IFigureCalled 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
MouseMotionListenerwith this IFigure.- Specified by:
handleMouseExitedin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMouseHover
Description copied from interface:IFigureCalled 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
MouseMotionListenerwith this IFigure.- Specified by:
handleMouseHoverin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMouseMoved
Description copied from interface:IFigureCalled 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
MouseMotionListenerwith this IFigure.- Specified by:
handleMouseMovedin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMousePressed
Description copied from interface:IFigureCalled 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
MouseListenerwith this IFigure.- Specified by:
handleMousePressedin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMouseReleased
Description copied from interface:IFigureCalled 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
MouseListenerwith this IFigure.- Specified by:
handleMouseReleasedin interfaceIFigure- Parameters:
event- The mouse event- See Also:
-
handleMouseWheelScrolled
Description copied from interface:IFigureCalled when a mouse wheel was scrolled 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
MouseWheelListenerwith this IFigure.- Specified by:
handleMouseWheelScrolledin interfaceIFigure- Parameters:
event- The mouse event.- See Also:
-
hasFocus
public boolean hasFocus()Description copied from interface:IFigureReturnstrueif this IFigure has focus. -
internalGetEventDispatcher
Description copied from interface:IFigureThis method is for internal purposes only and should not be called.- Specified by:
internalGetEventDispatcherin interfaceIFigure- Returns:
- The event dispatcher
- See Also:
-
intersects
Description copied from interface:IFigureReturnstrueif 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:
intersectsin interfaceIFigure- Parameters:
rect- The rectangle to check for intersection- Returns:
trueif this IFigure's bounds intersect with the given Rectangle- See Also:
-
invalidate
public void invalidate()Description copied from interface:IFigureInvalidates this IFigure. If this figure has a LayoutManager, thenLayoutManager.invalidate()should be called on that layout.- Specified by:
invalidatein interfaceIFigure- See Also:
-
invalidateTree
public void invalidateTree()Description copied from interface:IFigureInvalidates this figure as well as all contained within.- Specified by:
invalidateTreein interfaceIFigure- See Also:
-
isCoordinateSystem
public boolean isCoordinateSystem()Description copied from interface:IFigureReturnstrueif this figure is capable of applying a local coordinate system which affects its children.- Specified by:
isCoordinateSystemin interfaceIFigure- Returns:
trueif this figure provides local coordinates to children- See Also:
-
isEnabled
public boolean isEnabled()Description copied from interface:IFigureReturnstrueif this IFigure is enabled. -
isFocusTraversable
public boolean isFocusTraversable()Description copied from interface:IFigureReturnstrueif this IFigure can gain focus on aTraverseEvent.- Specified by:
isFocusTraversablein interfaceIFigure- Returns:
trueif this IFigure can gain focus on a TraverseEvent- See Also:
-
isMouseEventTarget
protected boolean isMouseEventTarget()Returnstrueif this Figure can receiveMouseEvents.- Returns:
trueif this Figure can receiveMouseEvents- Since:
- 2.0
-
isMirrored
public boolean isMirrored()- Specified by:
isMirroredin interfaceIFigure- Returns:
trueif this figure is hosted in a Control that is mirrored- See Also:
-
isOpaque
public boolean isOpaque()Description copied from interface:IFigureReturnstrueif this IFigure is opaque. -
isRequestFocusEnabled
public boolean isRequestFocusEnabled()Description copied from interface:IFigureReturnstrueif this IFigure can receive focus on a call toIFigure.requestFocus().- Specified by:
isRequestFocusEnabledin interfaceIFigure- Returns:
trueif this IFigure can receive focus on a call to requestFocus()- See Also:
-
isShowing
public boolean isShowing()Description copied from interface:IFigureReturnstrueif this IFigure is showing. This figure is only showing if it is visible and its parent is showing, or it has no parent. -
isValid
protected boolean isValid()Returnstrueif this Figure is valid.- Returns:
trueif this Figure is valid- Since:
- 2.0
-
isValidationRoot
protected boolean isValidationRoot()Returnstrueif revalidating this Figure does not require revalidating its parent.- Returns:
trueif revalidating this Figure doesn't require revalidating its parent.- Since:
- 2.0
-
isVisible
public boolean isVisible()Description copied from interface:IFigurereturnstrueif this figure's visibility flag is set to true. Does not walk up the parent chain. -
layout
protected void layout()Lays out this Figure using itsLayoutManager.- Since:
- 2.0
-
paint
Paints this Figure and its children. -
paintBorder
Paints the border associated with this Figure, if one exists.- Parameters:
graphics- The Graphics used to paint- Since:
- 2.0
- See Also:
-
paintChildren
Paints this Figure's children. The caller must save the state of the graphics prior to calling this method, such thatgraphics.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
Paints this Figure's client area. The client area is typically defined as the anything inside the Figure'sBorderorInsets, 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
-
optimizeClip
protected boolean optimizeClip()- Since:
- 3.13
-
paintFigure
Paints this Figure's primary representation, or background. Changes made to the graphics to the graphics current state will not affect the subsequent calls topaintClientArea(Graphics)andpaintBorder(Graphics). Furthermore, it is safe to callgraphics.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 horizontallydy- The amount to translate vertically- Since:
- 2.0
- See Also:
-
remove
Removes the given child Figure from this Figure's hierarchy and revalidates this Figure. The child Figure'sremoveNotify()method is also called. -
removeAll
public void removeAll()Removes all children from this Figure.- Since:
- 2.0
- See Also:
-
removeAncestorListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of ancestor events.- Specified by:
removeAncestorListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removeCoordinateListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of coordinate changes.- Specified by:
removeCoordinateListenerin interfaceIFigure- Parameters:
listener- the listener to remove- See Also:
-
removeFigureListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of IFigure events.- Specified by:
removeFigureListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removeFocusListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of focus events.- Specified by:
removeFocusListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removeKeyListener
Description copied from interface:IFigureRemoves the first occurence of the given listener.- Specified by:
removeKeyListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removeLayoutListener
Removes the first occurence of the given listener.- Specified by:
removeLayoutListenerin interfaceIFigure- Parameters:
listener- the listener being removed- Since:
- 3.1
-
removeListener
Removes listener of type clazz from this Figure's list of listeners.- Parameters:
clazz- The type of listenerlistener- The listener to remove- Since:
- 2.0
-
removeMouseListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of mouse events.- Specified by:
removeMouseListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removeMouseMotionListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of mouse motion events.- Specified by:
removeMouseMotionListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removeMouseWheelListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of mouse wheel events.- Specified by:
removeMouseWheelListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removeNotify
public void removeNotify()Called prior to this figure's removal from its parent- Specified by:
removeNotifyin interfaceIFigure
-
removePropertyChangeListener
Description copied from interface:IFigureUnregisters the given listener, so that it will no longer receive notification of any property changes.- Specified by:
removePropertyChangeListenerin interfaceIFigure- Parameters:
listener- The listener to remove- See Also:
-
removePropertyChangeListener
Description copied from interface:IFigureUnregisters 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:
removePropertyChangeListenerin interfaceIFigure- Parameters:
property- The property that the listener is no longer interested inlistener- The listener no longer interested in the property- See Also:
-
repaint
Description copied from interface:IFigureRepaints the rectangular area within this IFigure represented byrect. -
repaint
public void repaint(int x, int y, int w, int h) Description copied from interface:IFigureRepaints the rectangular area within this IFigure whose upper-left corner is located at the point(x,y)and whose width and height arewandh, respectively. -
repaint
public void repaint()Description copied from interface:IFigureRepaints this IFigure. -
requestFocus
public final void requestFocus()Description copied from interface:IFigureRequests focus from theEventDispatcher.- Specified by:
requestFocusin interfaceIFigure- See Also:
-
revalidate
public void revalidate()Description copied from interface:IFigureInvalidates 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:
revalidatein interfaceIFigure- See Also:
-
setBackgroundColor
Description copied from interface:IFigureSets the background color.- Specified by:
setBackgroundColorin interfaceIFigure- Parameters:
bg- The new background color- See Also:
-
setBorder
Description copied from interface:IFigureSets the border. -
setBounds
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. SincegetBounds()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. -
setChildrenDirection
protected void setChildrenDirection(int direction) Sets the direction of anyOrientablechildren. Allowable values fordirare found inPositionConstants.- Parameters:
direction- The direction- Since:
- 2.0
- See Also:
-
setChildrenEnabled
protected void setChildrenEnabled(boolean value) Sets all childrens' enabled property to value.- Parameters:
value- The enable value- Since:
- 2.0
- See Also:
-
setChildrenOrientation
protected void setChildrenOrientation(int orientation) Sets the orientation of anyOrientablechildren. Allowable values for orientation are found inPositionConstants.- Parameters:
orientation- The Orientation- Since:
- 2.0
- See Also:
-
setConstraint
Description copied from interface:IFigureConvenience method to set the constraint of the specified child in the current LayoutManager.- Specified by:
setConstraintin interfaceIFigure- Parameters:
child- The figure whose constraint is being setconstraint- the constraint- See Also:
-
setClippingStrategy
Registers a clipping strategy to specify how clipping is performed for child figures.- Specified by:
setClippingStrategyin interfaceIFigure- Parameters:
clippingStrategy-- Since:
- 3.6
-
setCursor
Description copied from interface:IFigureSets the cursor. -
setEnabled
public void setEnabled(boolean value) Description copied from interface:IFigureSets this IFigure to be enabled.- Specified by:
setEnabledin interfaceIFigure- Parameters:
value-trueif this IFigure should be enabled- See Also:
-
setFlag
protected final void setFlag(int flag, boolean value) Sets the given flag to the given value.- Parameters:
flag- The flag to setvalue- The value- Since:
- 2.0
-
setFocusTraversable
public void setFocusTraversable(boolean focusTraversable) Description copied from interface:IFigureSets the ability for this IFigure to gain focus on aTraverseEvent.- Specified by:
setFocusTraversablein interfaceIFigure- Parameters:
focusTraversable-trueif this IFigure should gain focus on a TraverseEvent- See Also:
-
setFont
Description copied from interface:IFigureSets the font. -
setForegroundColor
Description copied from interface:IFigureSets the foreground color.- Specified by:
setForegroundColorin interfaceIFigure- Parameters:
fg- The new foreground color- See Also:
-
setLayoutManager
Description copied from interface:IFigureSets the LayoutManager.- Specified by:
setLayoutManagerin interfaceIFigure- Parameters:
manager- The new layout manager- See Also:
-
setLocation
Description copied from interface:IFigureSets the location of this IFigure.- Specified by:
setLocationin interfaceIFigure- Parameters:
p- The new location- See Also:
-
setMaximumSize
Description copied from interface:IFigureSets the maximum size this IFigure can be.- Specified by:
setMaximumSizein interfaceIFigure- Parameters:
d- The new maximum size- See Also:
-
setMinimumSize
Description copied from interface:IFigureSets the minimum size this IFigure can be.- Specified by:
setMinimumSizein interfaceIFigure- Parameters:
d- The new minimum size- See Also:
-
setOpaque
public void setOpaque(boolean opaque) Description copied from interface:IFigureSets this IFigure to be opaque if isOpaque istrueand transparent if isOpaque isfalse. -
setParent
Description copied from interface:IFigureSets this IFigure's parent. -
setPreferredSize
Description copied from interface:IFigureSets this IFigure's preferred size.- Specified by:
setPreferredSizein interfaceIFigure- Parameters:
size- The new preferred size- See Also:
-
setPreferredSize
public final void setPreferredSize(int w, int h) Sets the preferred size of this figure.- Parameters:
w- The new preferred widthh- The new preferred height- Since:
- 2.0
- See Also:
-
setRequestFocusEnabled
public void setRequestFocusEnabled(boolean requestFocusEnabled) Description copied from interface:IFigureSets the ability for this Figure to gain focus on a call toIFigure.requestFocus().- Specified by:
setRequestFocusEnabledin interfaceIFigure- Parameters:
requestFocusEnabled-trueif this IFigure should gain focus on a call to requestFocus()- See Also:
-
setSize
Description copied from interface:IFigureSets this IFigure's size. -
setSize
public void setSize(int w, int h) Description copied from interface:IFigureSets this IFigure's size. -
setToolTip
Description copied from interface:IFigureSets a tooltip that is displayed when the mouse hovers over this IFigure.- Specified by:
setToolTipin interfaceIFigure- Parameters:
f- The tooltip IFigure- See Also:
-
setValid
public void setValid(boolean value) Sets this figure to be valid if value istrueand invalid otherwise.- Parameters:
value- The valid value- Since:
- 2.0
-
setVisible
public void setVisible(boolean visible) Description copied from interface:IFigureSets this IFigure's visibility.- Specified by:
setVisiblein interfaceIFigure- Parameters:
visible-trueif this IFigure should be visible- See Also:
-
translate
public final void translate(int x, int y) Description copied from interface:IFigureMoves this IFigurexpixels horizontally andypixels vertically. -
translateFromParent
Description copied from interface:IFigureTranslates a Translatable from this IFigure's parent's coordinates to this IFigure's local coordinates.- Specified by:
translateFromParentin interfaceIFigure- Parameters:
t- The object to translate- See Also:
-
translateToAbsolute
Description copied from interface:IFigureTranslates a Translatable that is relative to this figure's bounds to absolute.- Specified by:
translateToAbsolutein interfaceIFigure- Parameters:
t- The object to translate- See Also:
-
translateToParent
Description copied from interface:IFigureTranslates a Translatable from this IFigure's coordinates to its parent's coordinates.- Specified by:
translateToParentin interfaceIFigure- Parameters:
t- The object to translate- See Also:
-
translateToRelative
Description copied from interface:IFigureTranslates a Translatable in absolute coordinates to be relative to this figure's bounds.- Specified by:
translateToRelativein interfaceIFigure- Parameters:
t- The object to translate- See Also:
-
useLocalCoordinates
protected boolean useLocalCoordinates()Returnstrueif this Figure uses local coordinates. This means its children are placed relative to this Figure's top-left corner.- Returns:
trueif this Figure uses local coordinates- Since:
- 2.0
-
validate
public void validate()Description copied from interface:IFigureIndicates 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.
-