|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--objectdraw.AWTDrawingCanvas
The AWTDrawingCanvas is an implementation of the DrawingCanvas interface whose methods are tailored to provide compabaility with standard AWT libraries. It calls corresponding methods of the CanvasManager in order to actually modify the canvas.
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static java.awt.Dimension |
DEFAULT_PREFERRED_SIZE
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
AWTDrawingCanvas()
Creates a new DrawingCanvas. |
|
AWTDrawingCanvas(java.awt.Dimension size)
Creates a new DrawingCanvas. |
|
AWTDrawingCanvas(int width,
int height)
Creates a new DrawingCanvas. |
Method Summary | |
void |
addToCanvas(Drawable d)
Removes the Drawable d from the AWTDrawingCanvas |
void |
clear()
Clears the canvas. |
void |
componentHidden(java.awt.event.ComponentEvent e)
Invoked when component has been hidden. |
void |
componentMoved(java.awt.event.ComponentEvent e)
Invoked when component has been moved. |
void |
componentResized(java.awt.event.ComponentEvent e)
Invoked when component has been resized. |
void |
componentShown(java.awt.event.ComponentEvent e)
Invoked when component has been shown. |
void |
disableAutoRepaint()
Turns auto repaint off so the programmer must indicate when the canvas should be repainted. |
void |
enableAutoRepaint()
Turns auto repaint on so the programmer does not have to manually repaint after changing the canvas |
CanvasManager |
getCanvasContent()
Returns an instance of the CanvasContainer |
int |
getHeight()
Returns the height of the canvas |
java.awt.Dimension |
getPreferredSize()
Retrieves the object's preferred size. |
int |
getWidth()
Returns the width of the canvas |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
Notifies the CanvasManager of a change in state and calls the native java method imageUpdate. |
void |
paint(java.awt.Graphics g)
Paints the canvas by calling the real paint method of the CanvasContainer |
void |
removeFromCanvas(Drawable d)
Removes the Drawable d from the AWTDrawingCanvas |
void |
repaint()
Change repaint so that it always tries to delay a bit |
void |
update(java.awt.Graphics g)
Updates the screen. |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface objectdraw.DrawingCanvas |
addComponentListener, addKeyListener, addMouseListener, addMouseMotionListener, createImage, getBackground, getForeground, getGraphics, getSize, prepareImage, setBackground, setForeground |
Field Detail |
public static final java.awt.Dimension DEFAULT_PREFERRED_SIZE
Constructor Detail |
public AWTDrawingCanvas()
public AWTDrawingCanvas(int width, int height)
width
- the canvas' preferred widthheight
- the canvas' preferred heightpublic AWTDrawingCanvas(java.awt.Dimension size)
size
- the canvas' preferred dimensionsMethod Detail |
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public void repaint()
repaint
in interface DrawingCanvas
repaint
in class java.awt.Component
public CanvasManager getCanvasContent()
getCanvasContent
in interface DrawingCanvas
public void addToCanvas(Drawable d)
addToCanvas
in interface DrawingCanvas
public void removeFromCanvas(Drawable d)
removeFromCanvas
in interface DrawingCanvas
public void clear()
clear
in interface DrawingCanvas
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- the canvas' graphics context.public void update(java.awt.Graphics g)
update
in class java.awt.Component
g
- the canvas' graphics contextpublic void enableAutoRepaint()
enableAutoRepaint
in interface DrawingCanvas
public void disableAutoRepaint()
disableAutoRepaint
in interface DrawingCanvas
public int getWidth()
getWidth
in interface DrawingCanvas
getWidth
in class java.awt.Component
public int getHeight()
getHeight
in interface DrawingCanvas
getHeight
in class java.awt.Component
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
imageUpdate
in class java.awt.Component
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |