|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DrawingCanvas interface describes the methods that are available on a drawing canvas.
Field Summary |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
void |
addComponentListener(java.awt.event.ComponentListener l)
Requests that the specified ComponentListener be notified when the DrawingCanvas is hidden, shown, resized or moved. |
void |
addKeyListener(java.awt.event.KeyListener l)
Requests that the specified KeyListener be notified when keystokes occur. |
void |
addMouseListener(java.awt.event.MouseListener l)
Requests that the specified MouseListener be notified when the mouse is clicked, pressed, or released. |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener l)
Requests that the specified MouseMotionListener be notified when the mouse is moved or dragged in the DrawingCanvas. |
void |
clear()
Removes all objects from the DrawingCanvas. |
java.awt.Image |
createImage(int width,
int height)
Creates an off-screen drawable image to be used for double buffering. |
void |
disableAutoRepaint()
Requests that the DrawingCanvas not be automatically repainted after every change. |
void |
enableAutoRepaint()
Requests that the DrawingCanvas to be automatically repainted after every change without specifically calling repaint() . |
objectdraw.CanvasManager |
getCanvasContent()
Retrieves the CanvasManager that keeps track of all of the Drawable objects currently associated with this DrawingCanvas. |
DrawableIterator |
getDrawableIterator()
Creates and returns an iterator of all the objects on the DrawingCanvas |
java.awt.Graphics |
getGraphics()
Get a Graphic object associated with this DrawingCanvas. |
int |
getHeight()
Determine the current height of a DrawingCanvas. |
java.awt.Dimension |
getSize()
Determine the current size of a DrawingCanvas. |
int |
getWidth()
Determine the current width of a DrawingCanvas. |
boolean |
prepareImage(java.awt.Image im,
java.awt.image.ImageObserver observer)
Prepares an image for rendering on the DrawingCanvas. |
void |
repaint()
Requests that the contents of the canvas be redrawn. |
void |
requestFocus()
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window. |
boolean |
requestFocusInWindow()
Requests that this Component get the input focus. |
Methods inherited from interface java.awt.image.ImageObserver |
imageUpdate |
Methods inherited from interface java.awt.event.ComponentListener |
componentHidden, componentMoved, componentResized, componentShown |
Method Detail |
public objectdraw.CanvasManager getCanvasContent()
public void clear()
public void repaint()
disableAutoRepaint()
has been invoked.
In its default state, a DrawingCanvas redraws the display
automatically after any change occurs.
public void enableAutoRepaint()
repaint()
. This is
the default setting.
public void disableAutoRepaint()
repaint()
must be made in order to see changes made to
the objects displayed on the DrawingCanvas. By default, auto-repaint is enabled
in a newly constructed DrawingCanvas.
public java.awt.Graphics getGraphics()
public boolean prepareImage(java.awt.Image im, java.awt.image.ImageObserver observer)
im
- the Image to be preparedobserver
- the ImageObserver to be notified when Image is ready
public java.awt.Dimension getSize()
public int getWidth()
public int getHeight()
public java.awt.Image createImage(int width, int height)
width
- - the specified widthheight
- - the specified height
public void addMouseListener(java.awt.event.MouseListener l)
l
- the listener object to be notifiedpublic void addMouseMotionListener(java.awt.event.MouseMotionListener l)
l
- the listener object to be notifiedpublic void addComponentListener(java.awt.event.ComponentListener l)
l
- the listener object to be notifiedpublic void addKeyListener(java.awt.event.KeyListener l)
l
- the listener object to be notifiedpublic boolean requestFocusInWindow()
public void requestFocus()
public DrawableIterator getDrawableIterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |