|
Eclipse Draw2d 3.3 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.draw2d.Figure
The base implementation for graphical figures.
| Nested Class Summary | |
static class |
Figure.FigureIterator
Iterates over a Figure's children. |
protected static class |
Figure.IdentitySearch
A search which does not filter any figures. |
| Nested classes inherited from class org.eclipse.draw2d.IFigure |
IFigure.NoInsets |
| Field Summary | |
protected Color |
bgColor
Deprecated. access using getLocalBackgroundColor(). |
protected Border |
border
Deprecated. access using getBorder() |
protected Rectangle |
bounds
The rectangular area that this Figure occupies. |
protected Color |
fgColor
Deprecated. access using getLocalForegroundColor(). |
protected int |
flags
The flags for this Figure. |
protected Font |
font
Deprecated. access using getLocalFont() |
protected static int |
MAX_FLAG
The largest flag defined in this class. |
protected Dimension |
maxSize
This Figure's maximum size. |
protected Dimension |
minSize
This Figure's minimum size. |
protected static UpdateManager |
NO_MANAGER
An UpdateManager that does nothing. |
protected Dimension |
prefSize
This Figure's preferred size. |
protected IFigure |
toolTip
Deprecated. access using getToolTip() |
| Fields inherited from interface org.eclipse.draw2d.IFigure |
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS |
| Constructor Summary | |
Figure()
|
|
| 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,
Object constraint)
Calls add(IFigure, Object, int) with -1 as the index. |
void |
add(IFigure figure,
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(Class clazz,
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(PropertyChangeListener listener)
Registers the given listener as a PropertyChangeListener of this IFigure. |
void |
addPropertyChangeListener(String property,
PropertyChangeListener listener)
Registers the given listener as a PropertyChangeListener of this IFigure, interested only in the given property. |
boolean |
containsPoint(int x,
int y)
Returns true if the point (x, y) is contained within this
IFigure's bounds. |
boolean |
containsPoint(Point p)
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,
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 CoordinateListeners 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 FigureListeners that this figure has moved. |
protected void |
fireMoved()
Deprecated. call fireFigureMoved() or fireCoordinateSystemChanged() as appropriate |
protected void |
firePropertyChange(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(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(String property,
Object old,
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. |
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 Iterator |
getListeners(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(Class clazz,
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(PropertyChangeListener listener)
Unregisters the given listener, so that it will no longer receive notification of any property changes. |
void |
removePropertyChangeListener(String property,
PropertyChangeListener listener)
Unregisters the given listener, so that it will no longer receive notification of changes in the given property. |
void |
repaint()
Repaints this IFigure. |
void |
repaint(int x,
int y,
int w,
int h)
Repaints the rectangular area within this IFigure whose upper-left corner is located at the point (x,y) and whose width and height are w and
h, respectively. |
void |
repaint(Rectangle rect)
Repaints the rectangular area within this IFigure represented by rect. |
void |
requestFocus()
Requests focus from the EventDispatcher. |
void |
revalidate()
Invalidates this figure and revalidates() its parent. |
void |
setBackgroundColor(Color 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,
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 |
| Field Detail |
protected static int MAX_FLAG
This constant is evaluated at runtime and will not be inlined by the compiler.
protected Rectangle bounds
protected int flags
protected Dimension prefSize
protected Dimension minSize
protected Dimension maxSize
protected Font font
getLocalFont()
protected Color bgColor
getLocalBackgroundColor().
protected Color fgColor
getLocalForegroundColor().
protected Border border
getBorder()
protected IFigure toolTip
getToolTip()
protected static final UpdateManager NO_MANAGER
| Constructor Detail |
public Figure()
| Method Detail |
public final void add(IFigure figure,
Object constraint)
add(IFigure, Object, int) with -1 as the index.
add in interface IFigurefigure - The IFigure to addconstraint - The newly added IFigure's constraintIFigure.add(IFigure, Object)
public void add(IFigure figure,
Object constraint,
int index)
IFigureLayoutManager.setConstraint(IFigure, Object) shall be called on the layout.
add in interface IFigurefigure - The IFigure to addconstraint - The newly added IFigure's constraintindex - The index where the IFigure should be addedIFigure.add(IFigure, Object, int)public final void add(IFigure figure)
add(IFigure, Object, int) with null as the constraint and
-1 as the index.
add in interface IFigurefigure - The IFigure to addIFigure.add(IFigure)
public final void add(IFigure figure,
int index)
add(IFigure, Object, int) with null as the constraint.
add in interface IFigurefigure - The IFigure to addindex - The index where the IFigure should be addedIFigure.add(IFigure, int)public void addAncestorListener(AncestorListener ancestorListener)
IFigure
addAncestorListener in interface IFigureancestorListener - The listener to addIFigure.addAncestorListener(AncestorListener)public void addCoordinateListener(CoordinateListener listener)
IFigure
addCoordinateListener in interface IFigurelistener - the listener to addIFigure.addCoordinateListener(CoordinateListener)public void addFigureListener(FigureListener listener)
IFigure
addFigureListener in interface IFigurelistener - The listener to addIFigure.addFigureListener(FigureListener)public void addFocusListener(FocusListener listener)
IFigure
addFocusListener in interface IFigurelistener - The listener to addIFigure.addFocusListener(FocusListener)public void addKeyListener(KeyListener listener)
IFigure
addKeyListener in interface IFigurelistener - The listener to addIFigure.addKeyListener(KeyListener)public void addLayoutListener(LayoutListener listener)
addLayoutListener in interface IFigurelistener - the listener being added
protected void addListener(Class clazz,
Object listener)
clazz - The listener typelistener - The listenerpublic void addMouseListener(MouseListener listener)
IFigure
addMouseListener in interface IFigurelistener - The listener to addIFigure.addMouseListener(MouseListener)public void addMouseMotionListener(MouseMotionListener listener)
IFigure
addMouseMotionListener in interface IFigurelistener - The listener to addIFigure.addMouseMotionListener(MouseMotionListener)public void addNotify()
addNotify in interface IFigure
public void addPropertyChangeListener(String property,
PropertyChangeListener listener)
IFigure
addPropertyChangeListener in interface IFigureproperty - The property the listener is interested inlistener - The listener to addIFigure.addPropertyChangeListener(String,
PropertyChangeListener)public void addPropertyChangeListener(PropertyChangeListener listener)
IFigure
addPropertyChangeListener in interface IFigurelistener - The listener to addIFigure.addPropertyChangeListener(PropertyChangeListener)public final boolean containsPoint(Point p)
containsPoint(int, int) if needed.
containsPoint in interface IFigurep - The point
true if the Point p is contained within this IFigure's boundsIFigure.containsPoint(Point)
public boolean containsPoint(int x,
int y)
IFiguretrue if the point (x, y) is contained within this
IFigure's bounds.
containsPoint in interface IFigurex - The X coordinatey - The Y coordinate
true if the point (x,y) is contained in this IFigure's boundsIFigure.containsPoint(int, int)public void erase()
IFigure
erase in interface IFigureIFigure.erase()
protected IFigure findDescendantAtExcluding(int x,
int y,
TreeSearch search)
null if none
found.
x - The X coordinatey - The Y coordinatesearch - the TreeSearch
public final IFigure findFigureAt(Point pt)
IFigurethis or
null.
findFigureAt in interface IFigurept - The point
IFigure.findFigureAt(Point)
public final IFigure findFigureAt(int x,
int y)
IFigurethis or
null.
findFigureAt in interface IFigurex - The X coordinatey - The Y coordinate
IFigure.findFigureAt(int, int)
public IFigure findFigureAt(int x,
int y,
TreeSearch search)
IFigurethis or null
findFigureAt in interface IFigurex - the X coordinatey - the Y coordinatesearch - the conditional TreeSearch
IFigure.findFigureAt(int, int, TreeSearch)
public final IFigure findFigureAtExcluding(int x,
int y,
Collection c)
IFigurecollection. May return this or null.
findFigureAtExcluding in interface IFigurex - The X coordinatey - The Y coordinatec - A collection of IFigures to be excluded
IFigure.findFigureAtExcluding(int, int, Collection)
public IFigure findMouseEventTargetAt(int x,
int y)
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.
findMouseEventTargetAt in interface IFigurex - The X coordinatey - The Y coordinate
protected IFigure findMouseEventTargetInDescendantsAt(int x,
int y)
isMouseEventTarget() returns true and returns that descendant or
null if none found.
x - The X coordinatey - The Y coordinate
findMouseEventTargetAt(int, int)protected void fireCoordinateSystemChanged()
CoordinateListeners that this figure's local coordinate system
has changed in a way which affects the absolute bounds of figures contained within.
protected void fireFigureMoved()
FigureListeners that this figure has moved. Moved means
that the bounds have changed in some way, location and/or size.
protected void fireMoved()
protected void firePropertyChange(String property,
boolean old,
boolean current)
PropertyChangeListeners listening to this
Figure that the boolean property with id property has changed.
property - The id of the property that changedold - The old value of the changed propertycurrent - The current value of the changed property
protected void firePropertyChange(String property,
Object old,
Object current)
PropertyChangeListeners listening to this
figure that the Object property with id property has changed.
property - The id of the property that changedold - The old value of the changed propertycurrent - The current value of the changed property
protected void firePropertyChange(String property,
int old,
int current)
PropertyChangeListeners listening to this
figure that the integer property with id property has changed.
property - The id of the property that changedold - The old value of the changed propertycurrent - The current value of the changed propertypublic Color getBackgroundColor()
null and its parent is not null, the background color is
inherited from the parent.
getBackgroundColor in interface IFigureIFigure.getBackgroundColor()public Border getBorder()
IFigure
getBorder in interface IFigureIFigure.getBorder()public Rectangle getBounds()
getBounds in interface IFigurepublic List getChildren()
IFigure
getChildren in interface IFigureIFigure.getChildren()public Rectangle getClientArea(Rectangle rect)
IFigure
getClientArea in interface IFigurerect - The destination rectangle for the client area
IFigure.getClientArea(Rectangle)public final Rectangle getClientArea()
IFigureLayoutManagers) and the painting of children will be
clipped.
getClientArea in interface IFigureIFigure.getClientArea()public Cursor getCursor()
IFigure
getCursor in interface IFigureIFigure.getCursor()protected boolean getFlag(int flag)
flag - The flag to get
public Font getFont()
IFigure
getFont in interface IFigureIFigure.getFont()public Color getForegroundColor()
IFigure
getForegroundColor in interface IFigureIFigure.getForegroundColor()public Insets getInsets()
getInsets in interface IFigurepublic LayoutManager getLayoutManager()
IFigure
getLayoutManager in interface IFigureIFigure.getLayoutManager()protected Iterator getListeners(Class clazz)
clazz - The type of listeners to get
public Color getLocalBackgroundColor()
null or the local background Color of this Figure. Does not
inherit this Color from the parent.
getLocalBackgroundColor in interface IFigurenull or the local background Colorprotected Font getLocalFont()
null or the local font setting for this figure. Does not return
values inherited from the parent figure.
null or the local fontpublic Color getLocalForegroundColor()
null or the local foreground Color of this Figure. Does not
inherit this Color from the parent.
getLocalForegroundColor in interface IFigurenull or the local foreground Colorpublic final Point getLocation()
public Dimension getMaximumSize()
IFigure
getMaximumSize in interface IFigureIFigure.getMaximumSize()public final Dimension getMinimumSize()
IFigure
getMinimumSize in interface IFigureIFigure.getMinimumSize()
public Dimension getMinimumSize(int wHint,
int hHint)
IFigure
getMinimumSize in interface IFigurewHint - the width hinthHint - the height hint
IFigure.getMinimumSize(int, int)public IFigure getParent()
IFigurenull if
there is no parent.
getParent in interface IFigurenull or the parent figureIFigure.getParent()public final Dimension getPreferredSize()
IFiguregetPreferredSize(-1, -1).
getPreferredSize in interface IFigureIFigure.getPreferredSize()
public Dimension getPreferredSize(int wHint,
int hHint)
IFigure-1 indicates that there is no constraint in that
direction.
getPreferredSize in interface IFigurewHint - a width hinthHint - a height hint
IFigure.getPreferredSize(int, int)public final Dimension getSize()
IFigure
getSize in interface IFigureIFigure.getSize()public IFigure getToolTip()
IFigure
getToolTip in interface IFigureIFigure.getToolTip()public UpdateManager getUpdateManager()
IFigure
getUpdateManager in interface IFigureIFigure.getUpdateManager()public void handleFocusGained(FocusEvent event)
IFigureNOTE: 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.
handleFocusGained in interface IFigureevent - The focus eventIFigure.handleFocusGained(FocusEvent)public void handleFocusLost(FocusEvent event)
IFigureNOTE: 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.
handleFocusLost in interface IFigureevent - The focus eventIFigure.handleFocusLost(FocusEvent)public void handleKeyPressed(KeyEvent event)
IFigureNOTE: 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.
handleKeyPressed in interface IFigureevent - The key eventIFigure.handleKeyPressed(KeyEvent)public void handleKeyReleased(KeyEvent event)
IFigureNOTE: 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.
handleKeyReleased in interface IFigureevent - The key eventIFigure.handleKeyReleased(KeyEvent)public void handleMouseDoubleClicked(MouseEvent event)
IFigureNOTE: 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.
handleMouseDoubleClicked in interface IFigureevent - The mouse eventIFigure.handleMouseDoubleClicked(MouseEvent)public void handleMouseDragged(MouseEvent event)
IFigureNOTE: 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.
handleMouseDragged in interface IFigureevent - The mouse eventIFigure.handleMouseDragged(MouseEvent)public void handleMouseEntered(MouseEvent event)
IFigureNOTE: 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.
handleMouseEntered in interface IFigureevent - The mouse eventIFigure.handleMouseEntered(MouseEvent)public void handleMouseExited(MouseEvent event)
IFigureNOTE: 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.
handleMouseExited in interface IFigureevent - The mouse eventIFigure.handleMouseExited(MouseEvent)public void handleMouseHover(MouseEvent event)
IFigureNOTE: 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.
handleMouseHover in interface IFigureevent - The mouse eventIFigure.handleMouseHover(MouseEvent)public void handleMouseMoved(MouseEvent event)
IFigureNOTE: 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.
handleMouseMoved in interface IFigureevent - The mouse eventIFigure.handleMouseMoved(MouseEvent)public void handleMousePressed(MouseEvent event)
IFigureNOTE: 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.
handleMousePressed in interface IFigureevent - The mouse eventIFigure.handleMousePressed(MouseEvent)public void handleMouseReleased(MouseEvent event)
IFigureNOTE: 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.
handleMouseReleased in interface IFigureevent - The mouse eventIFigure.handleMouseReleased(MouseEvent)public boolean hasFocus()
IFiguretrue if this IFigure has focus.
hasFocus in interface IFiguretrue if this IFigure has focusIFigure.hasFocus()public EventDispatcher internalGetEventDispatcher()
IFigure
internalGetEventDispatcher in interface IFigureIFigure.internalGetEventDispatcher()public boolean intersects(Rectangle rect)
IFiguretrue if this IFigure's bounds intersect with the given Rectangle.
Figure is asked so that non-rectangular IFigures can reduce the frequency of paints.
intersects in interface IFigurerect - The rectangle to check for intersection
true if this IFigure's bounds intersect with the given RectangleIFigure.intersects(Rectangle)public void invalidate()
IFigureLayoutManager.invalidate() should be called on that layout.
invalidate in interface IFigureIFigure.invalidate()public void invalidateTree()
IFigure
invalidateTree in interface IFigureIFigure.invalidateTree()public boolean isCoordinateSystem()
IFiguretrue if this figure is capable of applying a local coordinate
system which affects its children.
isCoordinateSystem in interface IFiguretrue if this figure provides local coordinates to childrenIFigure.isCoordinateSystem()public boolean isEnabled()
IFiguretrue if this IFigure is enabled.
isEnabled in interface IFiguretrue if this IFigure is enabledIFigure.isEnabled()public boolean isFocusTraversable()
IFiguretrue if this IFigure can gain focus on a
TraverseEvent.
isFocusTraversable in interface IFiguretrue if this IFigure can gain focus on a TraverseEventIFigure.isFocusTraversable()protected boolean isMouseEventTarget()
true if this Figure can receive MouseEvents.
true if this Figure can receive MouseEventspublic boolean isMirrored()
isMirrored in interface IFiguretrue if this figure is hosted in a Control that is mirroredIFigure.isMirrored()public boolean isOpaque()
IFiguretrue if this IFigure is opaque.
isOpaque in interface IFiguretrue if this IFigure is opaqueIFigure.isOpaque()public boolean isRequestFocusEnabled()
IFiguretrue if this IFigure can receive focus on a call to
IFigure.requestFocus().
isRequestFocusEnabled in interface IFiguretrue if this IFigure can receive focus on a call to requestFocus()IFigure.isRequestFocusEnabled()public boolean isShowing()
IFiguretrue if this IFigure is showing. This figure is only showing if
it is visible and its parent is showing, or it has no parent.
isShowing in interface IFiguretrue if this IFigure is showingIFigure.isShowing()protected boolean isValid()
true if this Figure is valid.
true if this Figure is validprotected boolean isValidationRoot()
true if revalidating this Figure does not require revalidating its
parent.
true if revalidating this Figure doesn't require revalidating its
parent.public boolean isVisible()
IFiguretrue if this figure's visibility flag is set to true. Does not
walk up the parent chain.
isVisible in interface IFiguretrue if the figure's visibility flag is setIFigure.isVisible()protected void layout()
LayoutManager.
public void paint(Graphics graphics)
paint in interface IFiguregraphics - The Graphics object used for paintingpaintFigure(Graphics),
paintClientArea(Graphics),
paintBorder(Graphics)protected void paintBorder(Graphics graphics)
graphics - The Graphics used to paintBorder.paint(IFigure, Graphics, Insets)protected void paintChildren(Graphics graphics)
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.
graphics - the graphics used to paintprotected void paintClientArea(Graphics graphics)
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.
graphics - The Graphics used to paintprotected void paintFigure(Graphics graphics)
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.
graphics - The Graphics used to paint
protected void primTranslate(int dx,
int dy)
dx - The amount to translate horizontallydy - The amount to translate verticallytranslate(int, int)public void remove(IFigure figure)
removeNotify() method is also called.
remove in interface IFigurefigure - The Figure to removepublic void removeAll()
remove(IFigure)public void removeAncestorListener(AncestorListener listener)
IFigure
removeAncestorListener in interface IFigurelistener - The listener to removeIFigure.removeAncestorListener(AncestorListener)public void removeCoordinateListener(CoordinateListener listener)
IFigure
removeCoordinateListener in interface IFigurelistener - the listener to removeIFigure.removeCoordinateListener(CoordinateListener)public void removeFigureListener(FigureListener listener)
IFigure
removeFigureListener in interface IFigurelistener - The listener to removeIFigure.removeFigureListener(FigureListener)public void removeFocusListener(FocusListener listener)
IFigure
removeFocusListener in interface IFigurelistener - The listener to removeIFigure.removeFocusListener(FocusListener)public void removeKeyListener(KeyListener listener)
IFigure
removeKeyListener in interface IFigurelistener - The listener to removeIFigure.removeKeyListener(KeyListener)public void removeLayoutListener(LayoutListener listener)
removeLayoutListener in interface IFigurelistener - the listener being removed
protected void removeListener(Class clazz,
Object listener)
clazz - The type of listenerlistener - The listener to removepublic void removeMouseListener(MouseListener listener)
IFigure
removeMouseListener in interface IFigurelistener - The listener to removeIFigure.removeMouseListener(MouseListener)public void removeMouseMotionListener(MouseMotionListener listener)
IFigure
removeMouseMotionListener in interface IFigurelistener - The listener to removeIFigure.removeMouseMotionListener(MouseMotionListener)public void removeNotify()
removeNotify in interface IFigurepublic void removePropertyChangeListener(PropertyChangeListener listener)
IFigure
removePropertyChangeListener in interface IFigurelistener - The listener to removeIFigure.removePropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(String property,
PropertyChangeListener listener)
IFigure
removePropertyChangeListener in interface IFigureproperty - The property that the listener is no longer interested inlistener - The listener no longer interested in the propertyIFigure.removePropertyChangeListener(String, PropertyChangeListener)public final void repaint(Rectangle rect)
IFigurerect.
repaint in interface IFigurerect - The rectangular area to be repaintedIFigure.repaint(Rectangle)
public void repaint(int x,
int y,
int w,
int h)
IFigure(x,y) and whose width and height are w and
h, respectively.
repaint in interface IFigurex - 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 repaintIFigure.repaint(int, int, int, int)public void repaint()
IFigure
repaint in interface IFigureIFigure.repaint()public final void requestFocus()
IFigureEventDispatcher.
requestFocus in interface IFigureIFigure.requestFocus()public void revalidate()
IFigure
revalidate in interface IFigureIFigure.revalidate()public void setBackgroundColor(Color bg)
IFigure
setBackgroundColor in interface IFigurebg - The new background colorIFigure.setBackgroundColor(Color)public void setBorder(Border border)
IFigure
setBorder in interface IFigureborder - The new borderIFigure.setBorder(Border)public void setBounds(Rectangle rect)
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.
setBounds in interface IFigurerect - The new boundsprotected void setChildrenDirection(int direction)
Orientable children. Allowable values for
dir are found in PositionConstants.
direction - The directionOrientable.setDirection(int)protected void setChildrenEnabled(boolean value)
value - The enable valuesetEnabled(boolean)protected void setChildrenOrientation(int orientation)
Orientable children. Allowable values for
orientation are found in PositionConstants.
orientation - The OrientationOrientable.setOrientation(int)
public void setConstraint(IFigure child,
Object constraint)
IFigure
setConstraint in interface IFigurechild - The figure whose constraint is being setconstraint - the constraintIFigure.setConstraint(IFigure, Object)public void setCursor(Cursor cursor)
IFigure
setCursor in interface IFigurecursor - The new cursorIFigure.setCursor(Cursor)public void setEnabled(boolean value)
IFigure
setEnabled in interface IFigurevalue - true if this IFigure should be enabledIFigure.setEnabled(boolean)
protected final void setFlag(int flag,
boolean value)
flag - The flag to setvalue - The valuepublic void setFocusTraversable(boolean focusTraversable)
IFigureTraverseEvent.
setFocusTraversable in interface IFigurefocusTraversable - true if this IFigure should gain focus on a TraverseEventIFigure.setFocusTraversable(boolean)public void setFont(Font f)
IFigure
setFont in interface IFiguref - The new fontIFigure.setFont(Font)public void setForegroundColor(Color fg)
IFigure
setForegroundColor in interface IFigurefg - The new foreground colorIFigure.setForegroundColor(Color)public void setLayoutManager(LayoutManager manager)
IFigure
setLayoutManager in interface IFiguremanager - The new layout managerIFigure.setLayoutManager(LayoutManager)public void setLocation(Point p)
IFigure
setLocation in interface IFigurep - The new locationIFigure.setLocation(Point)public void setMaximumSize(Dimension d)
IFigure
setMaximumSize in interface IFigured - The new maximum sizeIFigure.setMaximumSize(Dimension)public void setMinimumSize(Dimension d)
IFigure
setMinimumSize in interface IFigured - The new minimum sizeIFigure.setMinimumSize(Dimension)public void setOpaque(boolean opaque)
IFiguretrue and transparent
if isOpaque is false.
setOpaque in interface IFigureopaque - true is this IFigure should be opaqueIFigure.setOpaque(boolean)public void setParent(IFigure p)
IFigure
setParent in interface IFigurep - The new parent IFigureIFigure.setParent(IFigure)public void setPreferredSize(Dimension size)
IFigure
setPreferredSize in interface IFiguresize - The new preferred sizeIFigure.setPreferredSize(Dimension)
public final void setPreferredSize(int w,
int h)
w - The new preferred widthh - The new preferred heightsetPreferredSize(Dimension)public void setRequestFocusEnabled(boolean requestFocusEnabled)
IFigureIFigure.requestFocus().
setRequestFocusEnabled in interface IFigurerequestFocusEnabled - true if this IFigure should gain focus on a call
to requestFocus()IFigure.setRequestFocusEnabled(boolean)public final void setSize(Dimension d)
IFigure
setSize in interface IFigured - The new sizeIFigure.setSize(Dimension)
public void setSize(int w,
int h)
IFigure
setSize in interface IFigurew - The new widthh - The new heightIFigure.setSize(int, int)public void setToolTip(IFigure f)
IFigure
setToolTip in interface IFiguref - The tooltip IFigureIFigure.setToolTip(IFigure)public void setValid(boolean value)
true and invalid
otherwise.
value - The valid valuepublic void setVisible(boolean visible)
IFigure
setVisible in interface IFigurevisible - true if this IFigure should be visibleIFigure.setVisible(boolean)
public final void translate(int x,
int y)
IFigurex pixels horizontally and y pixels
vertically.
translate in interface IFigurex - The amount to move this IFigure horizontallyy - The amount to move this IFigure verticallyIFigure.translate(int, int)public void translateFromParent(Translatable t)
IFigure
translateFromParent in interface IFiguret - The object to translateIFigure.translateFromParent(Translatable)public final void translateToAbsolute(Translatable t)
IFigure
translateToAbsolute in interface IFiguret - The object to translateIFigure.translateToAbsolute(Translatable)public void translateToParent(Translatable t)
IFigure
translateToParent in interface IFiguret - The object to translateIFigure.translateToParent(Translatable)public final void translateToRelative(Translatable t)
IFigure
translateToRelative in interface IFiguret - The object to translateIFigure.translateToRelative(Translatable)protected boolean useLocalCoordinates()
true if this Figure uses local coordinates. This means its
children are placed relative to this Figure's top-left corner.
true if this Figure uses local coordinatespublic void validate()
IFigure
validate in interface IFigureIFigure.validate()
|
Eclipse Draw2d 3.3 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||