Class VisibleHanoi.WindowCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by VisibleHanoi.WindowCanvas
All Implemented Interfaces:
DrawGraphics, ImageObserver, MenuContainer, Serializable, Accessible
Enclosing class:
VisibleHanoi

 class VisibleHanoi.WindowCanvas
extends Canvas
implements DrawGraphics


Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private) static int BASE_MARGIN
           
(package private) static int BASE_THICKNESS
           
(package private) static int DISK_MOVE_TOP
           
(package private) static int DISK_THICKNESS
           
(package private)  FontMetrics diskLabelFM
           
(package private)  Font diskLabelFont
           
(package private)  int diskLabelHeight
           
(package private)  String[] diskLabels
           
(package private)  int diskLabelWidth
           
(package private)  int[] diskRadius
           
(package private)  int[] diskY
           
(package private) static int MIN_DISK_WIDTH
           
(package private)  Image offscreen
           
(package private) static int POLE_THICKNESS
           
(package private) static int POLE_TOP
           
(package private)  FontMetrics poleLabelFM
           
(package private)  Font poleLabelFont
           
(package private)  int poleLabelHeight
           
(package private)  String[] poleLabels
           
(package private)  int poleLabelWidth
           
(package private)  int[] poleX
           
(package private)  int[][] posts
           
(package private)  SavePrint savePrint
           
(package private)  int xSize
           
(package private)  int ySize
           
 
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
VisibleHanoi.WindowCanvas(int xSize, int ySize, int disks)
           
 
Method Summary
 void addNotify()
           
 void drawWindowToGraphics(Graphics g)
           
 void drawWindowToGraphics(Graphics g, int width, int height)
           
 int getMargin()
           
 void moveTop(int fromPost, int toPost)
           
 void paint(Graphics g)
           
 void update(Graphics g)
           
 
Methods inherited from class java.awt.Canvas
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, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_MARGIN

static final int BASE_MARGIN
See Also:
Constant Field Values

BASE_THICKNESS

static final int BASE_THICKNESS
See Also:
Constant Field Values

DISK_MOVE_TOP

static final int DISK_MOVE_TOP
See Also:
Constant Field Values

DISK_THICKNESS

static final int DISK_THICKNESS
See Also:
Constant Field Values

diskLabelFM

FontMetrics diskLabelFM

diskLabelFont

Font diskLabelFont

diskLabelHeight

int diskLabelHeight

diskLabels

String[] diskLabels

diskLabelWidth

int diskLabelWidth

diskRadius

int[] diskRadius

diskY

int[] diskY

MIN_DISK_WIDTH

static final int MIN_DISK_WIDTH
See Also:
Constant Field Values

offscreen

Image offscreen

POLE_THICKNESS

static final int POLE_THICKNESS
See Also:
Constant Field Values

POLE_TOP

static final int POLE_TOP
See Also:
Constant Field Values

poleLabelFM

FontMetrics poleLabelFM

poleLabelFont

Font poleLabelFont

poleLabelHeight

int poleLabelHeight

poleLabels

String[] poleLabels

poleLabelWidth

int poleLabelWidth

poleX

int[] poleX

posts

int[][] posts

savePrint

SavePrint savePrint

xSize

int xSize

ySize

int ySize
Constructor Detail

VisibleHanoi.WindowCanvas

public VisibleHanoi.WindowCanvas(int xSize,
                                 int ySize,
                                 int disks)
Method Detail

addNotify

public void addNotify()
Overrides:
addNotify in class Canvas

drawWindowToGraphics

public void drawWindowToGraphics(Graphics g)
Specified by:
drawWindowToGraphics in interface DrawGraphics

drawWindowToGraphics

public void drawWindowToGraphics(Graphics g,
                                 int width,
                                 int height)
Specified by:
drawWindowToGraphics in interface DrawGraphics

getMargin

public int getMargin()
Specified by:
getMargin in interface DrawGraphics

moveTop

public void moveTop(int fromPost,
                    int toPost)

paint

public void paint(Graphics g)
Overrides:
paint in class Canvas

update

public void update(Graphics g)
Overrides:
update in class Canvas