|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
An interface for graphical figures.
| Inner Class Summary | |
static class |
IFigure.NoInsets
|
| Field Summary | |
static Dimension |
MAX_DIMENSION
|
static Dimension |
MIN_DIMENSION
|
static Insets |
NO_INSETS
|
| Method Summary | |
void |
add(IFigure figure)
Adds the given IFigure as a child of this IFigure. |
void |
add(IFigure figure,
int index)
Adds the given IFigure as a child of this IFigure at the given index. |
void |
add(IFigure figure,
Object constraint)
Adds the given IFigure as a child of this IFigure with the given constraint. |
void |
add(IFigure figure,
Object constraint,
int index)
Adds the given IFigure as a child of this IFigure at the given index with the given constraint. |
void |
addAncestorListener(AncestorListener ancestorListener)
Registers the given listener as an AncestorListener of this IFigure. |
void |
addFigureListener(FigureListener fListener)
Registers the given listener as a FigureListener of this IFigure. |
void |
addFocusListener(FocusListener fl)
Registers the given listener as a FocusListener of this IFigure. |
void |
addKeyListener(KeyListener keyListner)
Registers the given listener as a KeyListner of this IFigure. |
void |
addMouseListener(MouseListener mListener)
Registers the given listener as a MouseListener of this IFigure. |
void |
addMouseMotionListener(MouseMotionListener mListener)
Registers the given listener as a MouseMotionListener of this IFigure. |
void |
addNotify()
Called after this figure is added to its parent. |
void |
addPropertyChangeListener(PropertyChangeListener pListener)
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 IFigures bounds. |
boolean |
containsPoint(Point p)
Returns true if the Point p is contained within this IFigures bounds. |
void |
erase()
Erases this IFigure. |
IFigure |
findFigureAt(int x,
int y)
Returns the figure at the specified location. |
IFigure |
findFigureAt(Point pt)
Returns the figure at the specified location. |
IFigure |
findFigureAtExcluding(int x,
int y,
Collection collection)
Returns the figure at the specified location, excluding any figures in collection. |
IFigure |
findMouseEventTargetAt(int x,
int y)
Returns the figure located at the given location which will accept mouse events. |
Color |
getBackgroundColor()
Returns the 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 collection 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. |
Cursor |
getCursor()
Returns the cursor used when the mouse is over this figure. |
Font |
getFont()
Returns the current font by reference. |
Color |
getForegroundColor()
Returns the foreground color. |
Insets |
getInsets()
Returns the current Insets. |
LayoutManager |
getLayoutManager()
Returns the current LayoutManager by reference. |
Dimension |
getMaximumSize()
Returns a hint indicating the largest desireable size for the figure. |
Dimension |
getMinimumSize()
Returns a hint indicating the smallest desireable size for the figure. |
IFigure |
getParent()
Returns the current Parent. |
Dimension |
getPreferredSize()
Returns the desireable size for this figure. |
Dimension |
getPreferredSize(int wHint,
int hHint)
Returns the desireable size for this figure using the provided width and height hints. |
Dimension |
getSize()
Returns the current size. |
IFigure |
getToolTip()
Returns an IFigure that is the tooltip for this Figure. |
UpdateManager |
getUpdateManager()
Returns the UpdateManager for this figure by reference. |
void |
handleFocusGained(FocusEvent fe)
Called when this figure has gained focus. |
void |
handleFocusLost(FocusEvent fe)
Called when this figure has lost focus. |
void |
handleKeyPressed(KeyEvent ke)
|
void |
handleKeyReleased(KeyEvent ke)
|
void |
handleMouseDoubleClicked(MouseEvent me)
Called when a mouse button has been double-clicked while within this figure's bounds. |
void |
handleMouseDragged(MouseEvent me)
Called when the mouse has been dragged within this figure's bounds. |
void |
handleMouseEntered(MouseEvent me)
Called when the mouse has entered this figure's bounds. |
void |
handleMouseExited(MouseEvent me)
Called when the mouse has exited this figure's bounds. |
void |
handleMouseHover(MouseEvent me)
Called when called when the mouse has hovered over this figure. |
void |
handleMouseMoved(MouseEvent me)
Called when the mouse has moved within this figure's bounds. |
void |
handleMousePressed(MouseEvent me)
Called when a mouse button has been pressed while within this figure's bounds. |
void |
handleMouseReleased(MouseEvent me)
Called when a mouse button has been released while within this figure's bounds. |
boolean |
hasFocus()
Returns true if this figure has focus. |
EventDispatcher |
internalGetEventDispatcher()
This method is for internal purposes only and should not be called. |
boolean |
intersects(Rectangle r)
Returns true if this figure needs to paint anywhere inside r. |
void |
invalidate()
Invalidates this figure. |
boolean |
isEnabled()
Returns true if this figure is enabled. |
boolean |
isFocusTraversable()
Returns true if this figure can gain focus on a TraverseEvent. |
boolean |
isOpaque()
Returns true if this figure is opaque. |
boolean |
isRequestFocusEnabled()
Returns true if this figure can receive focus
on a call to requestFocus(). |
boolean |
isVisible()
Returns true if this figure is visible. |
void |
paint(Graphics graphics)
Paints this figure and its children. |
void |
remove(IFigure figure)
Removes the given figure from this figure's list of children. |
void |
removeAncestorListener(AncestorListener ancestorListener)
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 figure events. |
void |
removeFocusListener(FocusListener listener)
Unregisters the given listener, so that it will no longer receive notification of focus events. |
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 before this figure is removed 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 figure. |
void |
repaint(int x,
int y,
int w,
int h)
Repaints the rectangular area within this figure 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 figure represented by rect. |
void |
requestFocus()
Requests focus from the EventDispatcher. |
void |
revalidate()
Revalidates this figure. |
void |
setBackgroundColor(Color c)
Sets the background color. |
void |
setBorder(Border b)
Sets the border. |
void |
setBounds(Rectangle r)
Sets the bounds to the given rectangle. |
void |
setConstraint(IFigure child,
Object constraint)
|
void |
setCursor(Cursor cursor)
Sets the cursor. |
void |
setEnabled(boolean value)
Sets this figure to be enabled. |
void |
setFocusTraversable(boolean value)
Sets the ability for this figure to gain focus on a TraverseEvent. |
void |
setFont(Font f)
Sets the font. |
void |
setForegroundColor(Color c)
Sets the foreground color. |
void |
setLayoutManager(LayoutManager lm)
Sets the LayoutManager. |
void |
setLocation(Point p)
Sets the location of this figure. |
void |
setMaximumSize(Dimension size)
Sets the maximum size this figure can be. |
void |
setMinimumSize(Dimension size)
Sets the minimum size this figure can be. |
void |
setOpaque(boolean isOpaque)
Sets this figure to be opaque if isOpaque is
true and transparent if isOpaque is false. |
void |
setParent(IFigure parent)
Sets this figure's parent. |
void |
setPreferredSize(Dimension size)
Sets this figure's preferred size. |
void |
setRequestFocusEnabled(boolean requestFocusEnabled)
Sets the ability for this Figure to gain focus on a call to requestFocus(). |
void |
setSize(Dimension d)
Sets this figure's size. |
void |
setSize(int w,
int h)
Sets this figure's size. |
void |
setToolTip(IFigure figure)
Sets a tooltip that is displayed when the mouse hovers over this figure. |
void |
setUpdateManager(UpdateManager updateManager)
Sets the UpdateManager. |
void |
setVisible(boolean visible)
Sets this figure's visibility. |
void |
translate(int x,
int y)
Moves this figure x pixels horizontally and
y pixels vertically. |
void |
translateFromParent(Translatable t)
Translates a Translatable from this figure's parent's coordinates to this figure's local coordinates. |
void |
translateToAbsolute(Translatable t)
Translates a Translatable from this figure's coordinates to the top-most parent's coordinates. |
void |
translateToParent(Translatable t)
Translates a Translatable from this figure's coordinates to its parent's coordinates. |
void |
translateToRelative(Translatable t)
Translates a Translatable from the top-most parent's coordinates to local coordinates. |
void |
validate()
Causes this figure to layout itself, as well as its children. |
| Field Detail |
public static final Insets NO_INSETS
public static final Dimension MAX_DIMENSION
public static final Dimension MIN_DIMENSION
| Method Detail |
public void add(IFigure figure)
public void add(IFigure figure,
int index)
public void add(IFigure figure,
Object constraint)
public void add(IFigure figure,
Object constraint,
int index)
public void addAncestorListener(AncestorListener ancestorListener)
public void addFigureListener(FigureListener fListener)
public void addFocusListener(FocusListener fl)
public void addKeyListener(KeyListener keyListner)
public void addMouseListener(MouseListener mListener)
public void addMouseMotionListener(MouseMotionListener mListener)
public void addNotify()
public void addPropertyChangeListener(PropertyChangeListener pListener)
public void addPropertyChangeListener(String property,
PropertyChangeListener listener)
public boolean containsPoint(int x,
int y)
(x, y) is contained
within this IFigures bounds.public boolean containsPoint(Point p)
public void erase()
public IFigure findFigureAt(int x,
int y)
public IFigure findFigureAt(Point pt)
public IFigure findFigureAtExcluding(int x,
int y,
Collection collection)
collection. May return this
or null.
public IFigure findMouseEventTargetAt(int x,
int y)
public Color getBackgroundColor()
public Border getBorder()
public Rectangle getBounds()
public Rectangle getClientArea()
LayoutManagers) and
the painting of children will be clipped.public List getChildren()
public Cursor getCursor()
public Font getFont()
public Color getForegroundColor()
public Insets getInsets()
public LayoutManager getLayoutManager()
public Dimension getMaximumSize()
public Dimension getMinimumSize()
public IFigure getParent()
public Dimension getPreferredSize()
public Dimension getPreferredSize(int wHint,
int hHint)
public Dimension getSize()
public IFigure getToolTip()
public UpdateManager getUpdateManager()
public void handleFocusGained(FocusEvent fe)
public void handleFocusLost(FocusEvent fe)
public void handleKeyPressed(KeyEvent ke)
public void handleKeyReleased(KeyEvent ke)
public void handleMouseDoubleClicked(MouseEvent me)
public void handleMouseDragged(MouseEvent me)
public void handleMouseEntered(MouseEvent me)
public void handleMouseExited(MouseEvent me)
public void handleMouseHover(MouseEvent me)
public void handleMouseMoved(MouseEvent me)
public void handleMousePressed(MouseEvent me)
public void handleMouseReleased(MouseEvent me)
public boolean hasFocus()
public EventDispatcher internalGetEventDispatcher()
public boolean intersects(Rectangle r)
public void invalidate()
public boolean isEnabled()
public boolean isFocusTraversable()
public boolean isOpaque()
public boolean isRequestFocusEnabled()
true if this figure can receive focus
on a call to requestFocus().public boolean isVisible()
public void paint(Graphics graphics)
public void remove(IFigure figure)
public void removeAncestorListener(AncestorListener ancestorListener)
public void removeFigureListener(FigureListener listener)
public void removeFocusListener(FocusListener listener)
public void removeMouseListener(MouseListener listener)
public void removeMouseMotionListener(MouseMotionListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String property,
PropertyChangeListener listener)
public void removeNotify()
public void repaint()
public void repaint(int x,
int y,
int w,
int h)
(x,y) and whose width
and height are w and h, respectively.public void repaint(Rectangle rect)
rect.public void requestFocus()
EventDispatcher.public void revalidate()
public void setBackgroundColor(Color c)
public void setBorder(Border b)
public void setBounds(Rectangle r)
public void setConstraint(IFigure child,
Object constraint)
public void setCursor(Cursor cursor)
public void setEnabled(boolean value)
public void setFocusTraversable(boolean value)
public void setFont(Font f)
public void setForegroundColor(Color c)
public void setLayoutManager(LayoutManager lm)
public void setLocation(Point p)
public void setMaximumSize(Dimension size)
public void setMinimumSize(Dimension size)
public void setOpaque(boolean isOpaque)
isOpaque is
true and transparent if isOpaque is false.public void setParent(IFigure parent)
public void setPreferredSize(Dimension size)
public void setRequestFocusEnabled(boolean requestFocusEnabled)
public void setSize(Dimension d)
public void setSize(int w,
int h)
public void setToolTip(IFigure figure)
public void setUpdateManager(UpdateManager updateManager)
public void setVisible(boolean visible)
public void translate(int x,
int y)
x pixels horizontally and
y pixels vertically.public void translateFromParent(Translatable t)
public void translateToAbsolute(Translatable t)
public void translateToParent(Translatable t)
public void translateToRelative(Translatable t)
public void validate()
|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||