Class PaintBugWindow.WindowCanvas

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

 class PaintBugWindow.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 BI_COMPRESSED_RLE4
           
(package private) static int BI_COMPRESSED_RLE8
           
(package private) static int BI_RGB
           
(package private)  Color[] bugColor
           
(package private)  double[] bugDirection
           
(package private)  String[] bugLabel
           
(package private)  FontMetrics bugLabelFM
           
(package private)  Font bugLabelFont
           
(package private)  PaintBug[] bugs
           
(package private)  double[] bugX
           
(package private)  double[] bugY
           
(package private)  int canvasHeight
           
(package private)  int canvasWidth
           
(package private)  boolean drawGrid
           
(package private)  FontMetrics gridLabelFM
           
(package private)  Font gridLabelFont
           
(package private)  int labelHeight
           
(package private)  int labelWidth
           
(package private)  int left
           
(package private) static int LEFT_TOP_MARGIN
           
(package private)  int numBugs
           
(package private)  Image offscreen
           
(package private)  Image offscreenTrails
           
(package private)  DataOutputStream out
           
(package private) static int RIGHT_BOTTOM_MARGIN
           
(package private) static int ROWS_GRABBED_AT_A_TIME
           
(package private)  SavePrint savePrint
           
(package private)  Status status
           
(package private) static int TEXT_MARGIN
           
(package private)  int textHeight
           
(package private)  int textLeft
           
(package private)  int textTop
           
(package private)  int textWidth
           
(package private)  int top
           
(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
PaintBugWindow.WindowCanvas(int xSize, int ySize, boolean drawGrid)
           
 
Method Summary
 void addNotify()
           
 void drawBugTrail(double xPos, double yPos, int trailWidth, Color color)
           
 void drawWindowToGraphics(Graphics g)
           
 void drawWindowToGraphics(Graphics g, int width, int height)
           
 int getMargin()
           
 void hideBug(PaintBug bug, double xPos, double yPos, double direction, Color color, String label)
           
 void moveBug(PaintBug bug, double xPos, double yPos, double direction)
           
 void paint(Graphics g)
           
 void showBug(PaintBug bug, double xPos, double yPos, double direction, Color color, String label)
           
 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

BI_COMPRESSED_RLE4

static final int BI_COMPRESSED_RLE4
See Also:
Constant Field Values

BI_COMPRESSED_RLE8

static final int BI_COMPRESSED_RLE8
See Also:
Constant Field Values

BI_RGB

static final int BI_RGB
See Also:
Constant Field Values

bugColor

Color[] bugColor

bugDirection

double[] bugDirection

bugLabel

String[] bugLabel

bugLabelFM

FontMetrics bugLabelFM

bugLabelFont

Font bugLabelFont

bugs

PaintBug[] bugs

bugX

double[] bugX

bugY

double[] bugY

canvasHeight

int canvasHeight

canvasWidth

int canvasWidth

drawGrid

boolean drawGrid

gridLabelFM

FontMetrics gridLabelFM

gridLabelFont

Font gridLabelFont

labelHeight

int labelHeight

labelWidth

int labelWidth

left

int left

LEFT_TOP_MARGIN

static final int LEFT_TOP_MARGIN
See Also:
Constant Field Values

numBugs

int numBugs

offscreen

Image offscreen

offscreenTrails

Image offscreenTrails

out

DataOutputStream out

RIGHT_BOTTOM_MARGIN

static final int RIGHT_BOTTOM_MARGIN
See Also:
Constant Field Values

ROWS_GRABBED_AT_A_TIME

static final int ROWS_GRABBED_AT_A_TIME
See Also:
Constant Field Values

savePrint

SavePrint savePrint

status

Status status

TEXT_MARGIN

static final int TEXT_MARGIN
See Also:
Constant Field Values

textHeight

int textHeight

textLeft

int textLeft

textTop

int textTop

textWidth

int textWidth

top

int top

xSize

int xSize

ySize

int ySize
Constructor Detail

PaintBugWindow.WindowCanvas

public PaintBugWindow.WindowCanvas(int xSize,
                                   int ySize,
                                   boolean drawGrid)
Method Detail

addNotify

public void addNotify()
Overrides:
addNotify in class Canvas

drawBugTrail

public void drawBugTrail(double xPos,
                         double yPos,
                         int trailWidth,
                         Color color)

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

hideBug

public void hideBug(PaintBug bug,
                    double xPos,
                    double yPos,
                    double direction,
                    Color color,
                    String label)

moveBug

public void moveBug(PaintBug bug,
                    double xPos,
                    double yPos,
                    double direction)

paint

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

showBug

public void showBug(PaintBug bug,
                    double xPos,
                    double yPos,
                    double direction,
                    Color color,
                    String label)

update

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