com.swfm.mica.core
Class MiAWTCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bycom.swfm.mica.core.MiAWTCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, MiiCanvas, java.io.Serializable

public class MiAWTCanvas
extends java.awt.Canvas
implements MiiCanvas

This class serves as the interface (driver/wrapper) to the modern (post 1.0.2 AWT) graphics routines, specifically the AWT Canvas widget.

Version:
%I% %G%
Author:
Michael L. Davis
See Also:
Serialized Form

Field Summary
     
Constructor Summary
MiAWTCanvas()
          Constructs a new MiAWTCanvas.
 
Method Summary
 java.awt.Rectangle getCanvasBounds()
          Get the bounds of the canvas in pixels.
 java.awt.Insets getContainerInsets()
           
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of this canvas.
 int getMouseAppearance()
          Returns the appearance of the mouse cursor in this canvas.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size of this canvas.
 boolean isFocusTraversable()
           
 void paint(java.awt.Graphics g)
          Causes the canvas to be redrawn as per the awt.Component API.
 void requestRepaint()
          Causes the canvas to be redrawn as per the awt.Component API.
 void setBounds(int x, int y, int width, int height)
          Causes the canvas to be reshaped as per the awt.Component API.
 void setCanvas(MiCanvas canvas)
           
 void setCanvasBounds(MiBounds deviceBounds)
          Sets the bounds of the canvas, in pixels.
 void setMouseAppearance(int appearance)
          Sets the appearance of the mouse cursor within the bounds of this canvas.
 void update(java.awt.Graphics g)
          Causes the canvas to be redrawn as per the awt.Component API.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFontSet, isForegroundSet, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.swfm.mica.core.MiiCanvas
createImage, getGraphics, handleEvent
 

Constructor Detail

MiAWTCanvas

public MiAWTCanvas()
Constructs a new MiAWTCanvas.

Method Detail

setCanvas

public void setCanvas(MiCanvas canvas)
Specified by:
setCanvas in interface MiiCanvas

isFocusTraversable

public boolean isFocusTraversable()

setMouseAppearance

public void setMouseAppearance(int appearance)
Sets the appearance of the mouse cursor within the bounds of this canvas.

Specified by:
setMouseAppearance in interface MiiCanvas
Parameters:
appearance - the cursor appearance

getMouseAppearance

public int getMouseAppearance()
Returns the appearance of the mouse cursor in this canvas.

Specified by:
getMouseAppearance in interface MiiCanvas
Returns:
the animation manager
See Also:
MiAnimationManager

setCanvasBounds

public void setCanvasBounds(MiBounds deviceBounds)
Sets the bounds of the canvas, in pixels.

Specified by:
setCanvasBounds in interface MiiCanvas
Parameters:
deviceBounds - the bounds of this canvas

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size of this canvas. This routine is in support of the Component API.

Specified by:
getPreferredSize in interface MiiCanvas
Returns:
the preferred size

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum size of this canvas. This routine is in support of the Component API.

Specified by:
getMinimumSize in interface MiiCanvas
Returns:
the minimum size

requestRepaint

public void requestRepaint()
Causes the canvas to be redrawn as per the awt.Component API.

Specified by:
requestRepaint in interface MiiCanvas

update

public void update(java.awt.Graphics g)
Causes the canvas to be redrawn as per the awt.Component API.

Specified by:
update in interface MiiCanvas
Parameters:
g - the awt.graphics renderer

paint

public void paint(java.awt.Graphics g)
Causes the canvas to be redrawn as per the awt.Component API.

Specified by:
paint in interface MiiCanvas
Parameters:
g - the awt.graphics renderer

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Causes the canvas to be reshaped as per the awt.Component API.

Specified by:
setBounds in interface MiiCanvas
Parameters:
x - the x coordinate
y - the y coordinate
width - the width
height - the height

getCanvasBounds

public java.awt.Rectangle getCanvasBounds()
Description copied from interface: MiiCanvas
Get the bounds of the canvas in pixels.

Specified by:
getCanvasBounds in interface MiiCanvas
Returns:
the bounds of this canvas

getContainerInsets

public java.awt.Insets getContainerInsets()
Specified by:
getContainerInsets in interface MiiCanvas