|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DrawingCanvas is an interface which defines which methods must be included in an actual DrawingCanvas object. With this interface the other classes of the objectdraw package do not need to know what type of DrawingCanvas is being used, either an AWT or J DrawingCanvas.
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)
Enables the DrawingCanvas to be able to listen to the component, and react to its movement and other actions. |
void |
addKeyListener(java.awt.event.KeyListener l)
Enables the DrawingCanvas to be able to listen to the keyboard. |
void |
addMouseListener(java.awt.event.MouseListener l)
Enables the DrawingCanvas to be able to listen for mouse clicks, presses, and releases. |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener one)
Enables the DrawingCanvas to be able to listen for mouse motion. |
void |
addToCanvas(Drawable d)
Add the Drawable d to the canvas |
void |
clear()
Clears the DrawingCanvas of all objects. |
java.awt.Image |
createImage(int width,
int height)
Creates an off-screen drawable image to be used for double buffering. |
void |
disableAutoRepaint()
Disables the auto-mechanism of the DrawingCanvas so that an explicit call to repaint() must be made in order to see the changes. |
void |
enableAutoRepaint()
Enables the DrawingCanvas to be automatically repainted after every change without specifically calling repaint(). |
java.awt.Color |
getBackground()
Returns the color of the background of the DrawingCanvas. |
CanvasManager |
getCanvasContent()
Retrieves an instance of the CanvasContainer class so that the methods of it can be used without the student/package user accessing that class directly. |
java.awt.Color |
getForeground()
Returns the color of the foreground of the DrawingCanvas. |
java.awt.Graphics |
getGraphics()
Returns a Graphics object representing the graphics currently on the DrawingCanvas. |
int |
getHeight()
Returns an int referring to the height of the Drawingcanvas. |
java.awt.Dimension |
getSize()
Returns a Dimension referring to the size of the DrawingCanvas. |
int |
getWidth()
Returns an int referring to the width of the Drawingcanvas. |
boolean |
prepareImage(java.awt.Image i,
java.awt.image.ImageObserver observer)
Prepares an image for rendering on the DrawingCanvas. |
void |
removeFromCanvas(Drawable d)
Remove the Drawable d from the canvas |
void |
repaint()
Calls the system repaint() method which in turn schedules a call to paint. |
void |
setBackground(java.awt.Color c)
Sets the background of the DrawingCanvas to Color c. |
void |
setForeground(java.awt.Color c)
Sets the foreground of the DrawingCanvas to Color c. |
Methods inherited from interface java.awt.image.ImageObserver |
imageUpdate |
Methods inherited from interface java.awt.event.ComponentListener |
componentHidden, componentMoved, componentResized, componentShown |
Method Detail |
public CanvasManager getCanvasContent()
public void addToCanvas(Drawable d)
public void removeFromCanvas(Drawable d)
public void clear()
public void repaint()
public void enableAutoRepaint()
public void disableAutoRepaint()
public java.awt.Graphics getGraphics()
public boolean prepareImage(java.awt.Image i, java.awt.image.ImageObserver observer)
i
- the Image to be preparedobserver
- the ImageObserver to be notified when Image is readypublic java.awt.Color getBackground()
public java.awt.Color getForeground()
public void setBackground(java.awt.Color c)
public void setForeground(java.awt.Color c)
public java.awt.Dimension getSize()
public int getWidth()
public int getHeight()
public java.awt.Image createImage(int width, int height)
public void addMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener one)
public void addComponentListener(java.awt.event.ComponentListener l)
public void addKeyListener(java.awt.event.KeyListener l)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |