|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.Figure
The base implementation for graphical figures.
Nested Class Summary | |
static class |
Figure.FigureIterator
Iterates over a Figure's children. |
Nested classes inherited from class org.eclipse.draw2d.IFigure |
IFigure.NoInsets |
Field Summary | |
protected Color |
bgColor
This Figure's background color. |
protected Border |
border
This Figure's border. |
protected Rectangle |
bounds
The rectangular area that this Figure occupies. |
protected Color |
fgColor
This Figure's foreground color. |
protected int |
flags
The flags for this Figure. |
protected Font |
font
This Figure's font. |
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
This Figure's tooltip. |
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 IFigure using the specified index and constraint. |
void |
addAncestorListener(AncestorListener ancestorListener)
Registers the given listener as an AncestorListener of this IFigure. |
void |
addFigureListener(FigureListener listener)
Registers the given listener as a FigureListener of this IFigure. |
void |
addFocusListener(FocusListener listener)
Registers the given listener as a FocusListener of this IFigure. |
void |
addKeyListener(KeyListener listener)
Registers the given listener as a KeyListner of this IFigure. |
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 |
fireMoved()
Notifies any FigureListeners listening to this Figure that it
has moved. |
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 containing the listeners of type clazz that are listening to this Figure. |
Color |
getLocalBackgroundColor()
Returns the local background Color of this Figure. |
Color |
getLocalForegroundColor()
Returns 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 desireable size for this IFigure. |
Dimension |
getPreferredSize(int wHint,
int hHint)
Returns the desireable 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 |
isEnabled()
Returns true if this IFigure is enabled. |
boolean |
isFocusTraversable()
Returns true if this IFigure can gain focus on a
TraverseEvent . |
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 |
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. |
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()
Revalidates this IFigure. |
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()
Causes this IFigure to layout itself, as well as its children. |
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
protected Rectangle bounds
protected int flags
protected Dimension prefSize
protected Dimension minSize
protected Dimension maxSize
protected Font font
protected Color bgColor
protected Color fgColor
protected Border border
protected IFigure toolTip
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 IFigure
figure
- The IFigure to addconstraint
- The newly added IFigure's constraintIFigure.add(IFigure, Object)
public void add(IFigure figure, Object constraint, int index)
IFigure
add
in interface IFigure
figure
- 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 IFigure
figure
- 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 IFigure
figure
- The IFigure to addindex
- The index where the IFigure should be addedIFigure.add(IFigure, int)
public void addAncestorListener(AncestorListener ancestorListener)
IFigure
addAncestorListener
in interface IFigure
ancestorListener
- The listener to addIFigure.addAncestorListener(AncestorListener)
public void addFigureListener(FigureListener listener)
IFigure
addFigureListener
in interface IFigure
listener
- The listener to addIFigure.addFigureListener(FigureListener)
public void addFocusListener(FocusListener listener)
IFigure
addFocusListener
in interface IFigure
listener
- The listener to addIFigure.addFocusListener(FocusListener)
public void addKeyListener(KeyListener listener)
IFigure
addKeyListener
in interface IFigure
listener
- The listener to addIFigure.addKeyListener(KeyListener)
protected void addListener(Class clazz, Object listener)
clazz
- The listener typelistener
- The listenerpublic void addMouseListener(MouseListener listener)
IFigure
addMouseListener
in interface IFigure
listener
- The listener to addIFigure.addMouseListener(MouseListener)
public void addMouseMotionListener(MouseMotionListener listener)
IFigure
addMouseMotionListener
in interface IFigure
listener
- The listener to addIFigure.addMouseMotionListener(MouseMotionListener)
public void addNotify()
addNotify
in interface IFigure
public void addPropertyChangeListener(String property, PropertyChangeListener listener)
IFigure
addPropertyChangeListener
in interface IFigure
property
- The property the listener is interested inlistener
- The listener to addIFigure.addPropertyChangeListener(String,
PropertyChangeListener)
public void addPropertyChangeListener(PropertyChangeListener listener)
IFigure
addPropertyChangeListener
in interface IFigure
listener
- The listener to addIFigure.addPropertyChangeListener(PropertyChangeListener)
public final boolean containsPoint(Point p)
containsPoint(int, int)
if needed.
containsPoint
in interface IFigure
p
- The point
true
if the Point p is contained within this IFigure's boundsIFigure.containsPoint(Point)
public boolean containsPoint(int x, int y)
IFigure
true
if the point (x, y)
is contained within this
IFigure's bounds.
containsPoint
in interface IFigure
x
- 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 IFigure
IFigure.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)
IFigure
this
or
null
.
findFigureAt
in interface IFigure
pt
- The point
IFigure.findFigureAt(Point)
public final IFigure findFigureAt(int x, int y)
IFigure
this
or
null
.
findFigureAt
in interface IFigure
x
- The X coordinatey
- The Y coordinate
IFigure.findFigureAt(int, int)
public IFigure findFigureAt(int x, int y, TreeSearch search)
IFigure
this
or null
findFigureAt
in interface IFigure
x
- the X coordinatey
- the Y coordinatesearch
- the conditional TreeSearch
IFigure.findFigureAt(int, int, org.eclipse.draw2d.TreeSearch)
public final IFigure findFigureAtExcluding(int x, int y, Collection c)
IFigure
collection
. May return this
or null
.
findFigureAtExcluding
in interface IFigure
x
- 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 IFigure
x
- 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 coordiante
findMouseEventTargetAt(int, int)
protected void fireMoved()
FigureListeners
listening to this Figure that it
has moved.
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 propertyprotected 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 propertyprotected 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 IFigure
IFigure.getBackgroundColor()
public Border getBorder()
IFigure
getBorder
in interface IFigure
IFigure.getBorder()
public Rectangle getBounds()
getBounds
in interface IFigure
public List getChildren()
IFigure
getChildren
in interface IFigure
IFigure.getChildren()
public Rectangle getClientArea(Rectangle rect)
IFigure
getClientArea
in interface IFigure
rect
- The destination rectangle for the client area
IFigure.getClientArea(Rectangle)
public final Rectangle getClientArea()
IFigure
LayoutManagers
) and the painting of children will be
clipped.
getClientArea
in interface IFigure
IFigure.getClientArea()
public Cursor getCursor()
IFigure
getCursor
in interface IFigure
IFigure.getCursor()
protected boolean getFlag(int flag)
flag
- The flag to get
public Font getFont()
IFigure
getFont
in interface IFigure
IFigure.getFont()
public Color getForegroundColor()
IFigure
getForegroundColor
in interface IFigure
IFigure.getForegroundColor()
public Insets getInsets()
getInsets
in interface IFigure
public LayoutManager getLayoutManager()
IFigure
getLayoutManager
in interface IFigure
IFigure.getLayoutManager()
protected Iterator getListeners(Class clazz)
clazz
- The type of listeners to get
public Color getLocalBackgroundColor()
getLocalBackgroundColor
in interface IFigure
public Color getLocalForegroundColor()
getLocalForegroundColor
in interface IFigure
public final Point getLocation()
public Dimension getMaximumSize()
IFigure
getMaximumSize
in interface IFigure
IFigure.getMaximumSize()
public final Dimension getMinimumSize()
IFigure
getMinimumSize
in interface IFigure
IFigure.getMinimumSize()
public Dimension getMinimumSize(int wHint, int hHint)
IFigure
getMinimumSize
in interface IFigure
wHint
- the width hinthHint
- the height hint
IFigure.getMinimumSize(int, int)
public IFigure getParent()
IFigure
null
if
there is no parent.
getParent
in interface IFigure
IFigure.getParent()
public final Dimension getPreferredSize()
IFigure
getPreferredSize
in interface IFigure
IFigure.getPreferredSize()
public Dimension getPreferredSize(int wHint, int hHint)
IFigure
getPreferredSize
in interface IFigure
wHint
- The width hinthHint
- The height hint
IFigure.getPreferredSize(int, int)
public final Dimension getSize()
IFigure
getSize
in interface IFigure
IFigure.getSize()
public IFigure getToolTip()
IFigure
getToolTip
in interface IFigure
IFigure.getToolTip()
public UpdateManager getUpdateManager()
IFigure
getUpdateManager
in interface IFigure
IFigure.getUpdateManager()
public void handleFocusGained(FocusEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a FocusListener
with
this IFigure.
handleFocusGained
in interface IFigure
event
- The focus eventIFigure.handleFocusGained(FocusEvent)
public void handleFocusLost(FocusEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a FocusListener
with
this IFigure.
handleFocusLost
in interface IFigure
event
- The focus eventIFigure.handleFocusLost(FocusEvent)
public void handleKeyPressed(KeyEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a KeyListener
with
this IFigure.
handleKeyPressed
in interface IFigure
event
- The key eventIFigure.handleKeyPressed(KeyEvent)
public void handleKeyReleased(KeyEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a KeyListener
with
this IFigure.
handleKeyReleased
in interface IFigure
event
- The key eventIFigure.handleKeyReleased(KeyEvent)
public void handleMouseDoubleClicked(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseListener
with
this IFigure.
handleMouseDoubleClicked
in interface IFigure
event
- The mouse eventIFigure.handleMouseDoubleClicked(MouseEvent)
public void handleMouseDragged(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseMotionListener
with this IFigure.
handleMouseDragged
in interface IFigure
event
- The mouse eventIFigure.handleMouseDragged(MouseEvent)
public void handleMouseEntered(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseMotionListener
with this IFigure.
handleMouseEntered
in interface IFigure
event
- The mouse eventIFigure.handleMouseEntered(MouseEvent)
public void handleMouseExited(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseMotionListener
with this IFigure.
handleMouseExited
in interface IFigure
event
- The mouse eventIFigure.handleMouseExited(MouseEvent)
public void handleMouseHover(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseMotionListener
with this IFigure.
handleMouseHover
in interface IFigure
event
- The mouse eventIFigure.handleMouseHover(MouseEvent)
public void handleMouseMoved(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseMotionListener
with this IFigure.
handleMouseMoved
in interface IFigure
event
- The mouse eventIFigure.handleMouseMoved(MouseEvent)
public void handleMousePressed(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseListener
with
this IFigure.
handleMousePressed
in interface IFigure
event
- The mouse eventIFigure.handleMousePressed(MouseEvent)
public void handleMouseReleased(MouseEvent event)
IFigure
NOTE: You should not override this method. If you are interested in receiving
notification of this type of event, you should register a MouseListener
with
this IFigure.
handleMouseReleased
in interface IFigure
event
- The mouse eventIFigure.handleMouseReleased(MouseEvent)
public boolean hasFocus()
IFigure
true
if this IFigure has focus.
hasFocus
in interface IFigure
true
if this IFigure has focusIFigure.hasFocus()
public EventDispatcher internalGetEventDispatcher()
IFigure
internalGetEventDispatcher
in interface IFigure
IFigure.internalGetEventDispatcher()
public boolean intersects(Rectangle rect)
IFigure
true
if this IFigure's bounds intersect with the given Rectangle.
Figure is asked so that non-rectangular IFigures can reduce the frequency of paints.
intersects
in interface IFigure
rect
- The rectangle to check for intersection
true
if this IFigure's bounds intersect with the given RectangleIFigure.intersects(Rectangle)
public void invalidate()
IFigure
invalidate
in interface IFigure
IFigure.invalidate()
public void invalidateTree()
IFigure
invalidateTree
in interface IFigure
IFigure.invalidateTree()
public boolean isEnabled()
IFigure
true
if this IFigure is enabled.
isEnabled
in interface IFigure
true
if this IFigure is enabledIFigure.isEnabled()
public boolean isFocusTraversable()
IFigure
true
if this IFigure can gain focus on a
TraverseEvent
.
isFocusTraversable
in interface IFigure
true
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 MouseEvents
public boolean isOpaque()
IFigure
true
if this IFigure is opaque.
isOpaque
in interface IFigure
true
if this IFigure is opaqueIFigure.isOpaque()
public boolean isRequestFocusEnabled()
IFigure
true
if this IFigure can receive focus on a call to
IFigure.requestFocus()
.
isRequestFocusEnabled
in interface IFigure
true
if this IFigure can receive focus on a call to requestFocus()IFigure.isRequestFocusEnabled()
public boolean isShowing()
IFigure
true
if this IFigure is showing. This figure is only showing if
it is visible and its parent is showing, or it has no parent.
isShowing
in interface IFigure
true
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()
IFigure
true
if this figure's visibility flag is set to true. Does not
walk up the parent chain.
isVisible
in interface IFigure
true
if the figure's visibility flag is setIFigure.isVisible()
protected void layout()
LayoutManager
.
public void paint(Graphics graphics)
paint
in interface IFigure
graphics
- 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 paintprotected 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 IFigure
figure
- The Figure to removepublic void removeAll()
remove(IFigure)
public void removeAncestorListener(AncestorListener listener)
IFigure
removeAncestorListener
in interface IFigure
listener
- The listener to removeIFigure.removeAncestorListener(AncestorListener)
public void removeFigureListener(FigureListener listener)
IFigure
removeFigureListener
in interface IFigure
listener
- The listener to removeIFigure.removeFigureListener(FigureListener)
public void removeFocusListener(FocusListener listener)
IFigure
removeFocusListener
in interface IFigure
listener
- The listener to removeIFigure.removeFocusListener(FocusListener)
public void removeKeyListener(KeyListener listener)
IFigure
removeKeyListener
in interface IFigure
listener
- The listener to removeIFigure.removeKeyListener(org.eclipse.draw2d.KeyListener)
protected void removeListener(Class clazz, Object listener)
clazz
- The type of listenerlistener
- The listener to removepublic void removeMouseListener(MouseListener listener)
IFigure
removeMouseListener
in interface IFigure
listener
- The listener to removeIFigure.removeMouseListener(MouseListener)
public void removeMouseMotionListener(MouseMotionListener listener)
IFigure
removeMouseMotionListener
in interface IFigure
listener
- The listener to removeIFigure.removeMouseMotionListener(MouseMotionListener)
public void removeNotify()
removeNotify
in interface IFigure
public void removePropertyChangeListener(PropertyChangeListener listener)
IFigure
removePropertyChangeListener
in interface IFigure
listener
- The listener to removeIFigure.removePropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(String property, PropertyChangeListener listener)
IFigure
removePropertyChangeListener
in interface IFigure
property
- 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)
IFigure
rect
.
repaint
in interface IFigure
rect
- 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 IFigure
x
- The X coordinate of the area to repainty
- The Y coordinate of the area to repaintw
- The width of the area to repainth
- The height of the area to repaintIFigure.repaint(int, int, int, int)
public void repaint()
IFigure
repaint
in interface IFigure
IFigure.repaint()
public final void requestFocus()
IFigure
EventDispatcher
.
requestFocus
in interface IFigure
IFigure.requestFocus()
public void revalidate()
IFigure
revalidate
in interface IFigure
IFigure.revalidate()
public void setBackgroundColor(Color bg)
IFigure
setBackgroundColor
in interface IFigure
bg
- The new background colorIFigure.setBackgroundColor(Color)
public void setBorder(Border border)
IFigure
setBorder
in interface IFigure
border
- 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 IFigure
rect
- 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 IFigure
child
- The figure whose constraint is being setconstraint
- the constraintIFigure.setConstraint(IFigure, Object)
public void setCursor(Cursor cursor)
IFigure
setCursor
in interface IFigure
cursor
- The new cursorIFigure.setCursor(Cursor)
public void setEnabled(boolean value)
IFigure
setEnabled
in interface IFigure
value
- 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)
IFigure
TraverseEvent
.
setFocusTraversable
in interface IFigure
focusTraversable
- true
if this IFigure should gain focus on a TraverseEventIFigure.setFocusTraversable(boolean)
public void setFont(Font f)
IFigure
setFont
in interface IFigure
f
- The new fontIFigure.setFont(Font)
public void setForegroundColor(Color fg)
IFigure
setForegroundColor
in interface IFigure
fg
- The new foreground colorIFigure.setForegroundColor(Color)
public void setLayoutManager(LayoutManager manager)
IFigure
setLayoutManager
in interface IFigure
manager
- The new layout managerIFigure.setLayoutManager(LayoutManager)
public void setLocation(Point p)
IFigure
setLocation
in interface IFigure
p
- The new locationIFigure.setLocation(Point)
public void setMaximumSize(Dimension d)
IFigure
setMaximumSize
in interface IFigure
d
- The new maximum sizeIFigure.setMaximumSize(Dimension)
public void setMinimumSize(Dimension d)
IFigure
setMinimumSize
in interface IFigure
d
- The new minimum sizeIFigure.setMinimumSize(Dimension)
public void setOpaque(boolean opaque)
IFigure
true
and transparent
if isOpaque is false
.
setOpaque
in interface IFigure
opaque
- true
is this IFigure should be opaqueIFigure.setOpaque(boolean)
public void setParent(IFigure p)
IFigure
setParent
in interface IFigure
p
- The new parent IFigureIFigure.setParent(IFigure)
public void setPreferredSize(Dimension size)
IFigure
setPreferredSize
in interface IFigure
size
- 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)
IFigure
IFigure.requestFocus()
.
setRequestFocusEnabled
in interface IFigure
requestFocusEnabled
- 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 IFigure
d
- The new sizeIFigure.setSize(Dimension)
public void setSize(int w, int h)
IFigure
setSize
in interface IFigure
w
- The new widthh
- The new heightIFigure.setSize(int, int)
public void setToolTip(IFigure f)
IFigure
setToolTip
in interface IFigure
f
- 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 IFigure
visible
- true
if this IFigure should be visibleIFigure.setVisible(boolean)
public final void translate(int x, int y)
IFigure
x
pixels horizontally and y
pixels
vertically.
translate
in interface IFigure
x
- 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 IFigure
t
- The object to translateIFigure.translateFromParent(Translatable)
public final void translateToAbsolute(Translatable t)
IFigure
translateToAbsolute
in interface IFigure
t
- The object to translateIFigure.translateToAbsolute(Translatable)
public void translateToParent(Translatable t)
IFigure
translateToParent
in interface IFigure
t
- The object to translateIFigure.translateToParent(Translatable)
public final void translateToRelative(Translatable t)
IFigure
translateToRelative
in interface IFigure
t
- 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 IFigure
IFigure.validate()
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |