|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DrawingCanvas
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 | |
---|---|
abstract void |
addComponentListener(ComponentListener l)
Requests that the specified ComponentListener be notified when the DrawingCanvas is hidden, shown, resized or moved. |
abstract void |
addKeyListener(KeyListener l)
Requests that the specified KeyListener be notified when keystokes occur. |
abstract void |
addMouseListener(MouseListener l)
Requests that the specified MouseListener be notified when the mouse is clicked, pressed, or released. |
abstract void |
addMouseMotionListener(MouseMotionListener l)
Requests that the specified MouseMotionListener be notified when the mouse is moved or dragged in the DrawingCanvas. |
abstract void |
clear()
Removes all objects from the DrawingCanvas. |
abstract Image |
createImage(int width,
int height)
Creates an off-screen drawable image to be used for double buffering. |
abstract void |
disableAutoRepaint()
Requests that the DrawingCanvas not be automatically repainted after every change. |
abstract void |
enableAutoRepaint()
Requests that the DrawingCanvas to be automatically repainted after every change without specifically calling repaint() . |
abstract CanvasManager |
getCanvasContent()
Retrieves the CanvasManager that keeps track of all of the Drawable objects currently associated with this DrawingCanvas. |
abstract DrawableIterator |
getDrawableIterator()
Creates and returns an iterator of all the objects on the DrawingCanvas |
abstract Graphics |
getGraphics()
Get a Graphic object associated with this DrawingCanvas. |
abstract int |
getHeight()
Determine the current height of a DrawingCanvas. |
abstract Dimension |
getSize()
Determine the current size of a DrawingCanvas. |
abstract int |
getWidth()
Determine the current width of a DrawingCanvas. |
abstract boolean |
prepareImage(Image im,
ImageObserver observer)
Prepares an image for rendering on the DrawingCanvas. |
abstract void |
repaint()
Requests that the contents of the canvas be redrawn. |
abstract void |
requestFocus()
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window. |
abstract boolean |
requestFocusInWindow()
Requests that this Component get the input focus. |
abstract void |
setBackground(Color backgroundColor)
Sets the background color of the canvas. |
abstract void |
setForeground(Color foregroundColor)
Sets the foreground color of the canvas |
Methods inherited from interface java.awt.image.ImageObserver |
---|
imageUpdate |
Methods inherited from interface java.awt.event.ComponentListener |
---|
componentHidden, componentMoved, componentResized, componentShown |
Method Detail |
---|
void addComponentListener(ComponentListener l)
l
- the listener object to be notifiedvoid addKeyListener(KeyListener l)
l
- the listener object to be notifiedvoid addMouseListener(MouseListener l)
l
- the listener object to be notifiedvoid addMouseMotionListener(MouseMotionListener l)
l
- the listener object to be notifiedvoid clear()
Image createImage(int width, int height)
width
- - the specified widthheight
- - the specified height
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.
void enableAutoRepaint()
repaint()
. This is
the default setting.
CanvasManager getCanvasContent()
DrawableIterator getDrawableIterator()
Graphics getGraphics()
int getHeight()
Dimension getSize()
int getWidth()
boolean prepareImage(Image im, ImageObserver observer)
im
- the Image to be preparedobserver
- the ImageObserver to be notified when Image is ready
void repaint()
disableAutoRepaint()
has been invoked.
In its default state, a DrawingCanvas redraws the display
automatically after any change occurs.
void requestFocus()
boolean requestFocusInWindow()
void setBackground(Color backgroundColor)
backgroundColor
- -- new background colorvoid setForeground(Color foregroundColor)
foregroundColor
- - new foreground color
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |