org.razvan.jzx
Class ScreenBoth

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by org.razvan.jzx.BaseScreen
              extended by org.razvan.jzx.ScreenBoth
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ScreenBoth
extends BaseScreen

Screen implementation that runs in both JDK1.1 and JDK1.2 VMs, but is optimized for neither.

This implementation uses a MemoryImageSource, and calls the method newPixels() to indicate that new data is available for drawing into the image.

Author:
Razvan Surdulescu (c) 2001 - 2006, Erik Kunze (c) 1995, 1996, 1997, Des Herriott (c) 1993, 1994
You may use and distribute this software for free provided you include this copyright notice. You may not sell this software, use my name for publicity reasons or modify the code without permission from me.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class org.razvan.jzx.BaseScreen
ATTR_LENGTH, ATTR_START, BLACK, BLUE, BORDER_PIXELS, BRIGHT, BRIGHT_BLACK, BRIGHT_BLUE, BRIGHT_CYAN, BRIGHT_GREEN, BRIGHT_MAGENTA, BRIGHT_RED, BRIGHT_WHITE, BRIGHT_YELLOW, COLS, CYAN, FLASH, GREEN, INK, m_borderColor, m_borderDirty, m_flashPhase, m_inkTable, m_logger, m_offscreenBorder, m_offscreenBorderGraphics, m_offscreenImage, m_offscreenImageGraphics, m_paperTable, m_scale, m_screenChanged, m_screenDirty, m_screenHeight, m_screenWidth, m_spectrum, MAGENTA, PAPER, PIXEL_LENGTH, PIXEL_START, RED, ROWS, s_colorPalette, s_rgbPalette, WHITE, X_PIXELS, Y_PIXELS, YELLOW
 
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
ScreenBoth()
           
 
Method Summary
protected  void draw8(int x, int y, int pix8, int attr8)
          Draw a given byte into the RGB array using the given attribute, at the given location.
protected  void endRender()
          Call newPixels() on the MemoryImageSource object at the end of a frame.
 void init(BaseSpectrum spectrum, ILogger logger)
          Allocate the RGB data array and the MemoryImageSource object that Decorates the data.
 void paint(java.awt.Graphics g)
          Create the MemoryImageSource object from the given Graphics object.
protected  void setScale(int scale)
          Update the RGB data array and the MemoryImageSource for the new scale value.
 
Methods inherited from class org.razvan.jzx.BaseScreen
attrTouch, clear, clear, createCompatibleImage, dumpScreenshot, flash, getCursorX, getCursorY, getInstance, getMinimumSize, getPage, getPreferredSize, load, print, print, println, println, reset, screenTouch, setBorderColor, setCursor, setPage, startRender, terminate, update
 
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, 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, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, 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
 

Constructor Detail

ScreenBoth

public ScreenBoth()
Method Detail

init

public void init(BaseSpectrum spectrum,
                 ILogger logger)
Allocate the RGB data array and the MemoryImageSource object that Decorates the data.

Overrides:
init in class BaseScreen

setScale

protected void setScale(int scale)
Update the RGB data array and the MemoryImageSource for the new scale value.

Overrides:
setScale in class BaseScreen

paint

public void paint(java.awt.Graphics g)
Create the MemoryImageSource object from the given Graphics object.

Overrides:
paint in class BaseScreen
See Also:
BaseScreen.draw8(int, int, int, int)

draw8

protected void draw8(int x,
                     int y,
                     int pix8,
                     int attr8)
Draw a given byte into the RGB array using the given attribute, at the given location.

Specified by:
draw8 in class BaseScreen
Parameters:
x - The X coordinate where the pixels should be drawn onto the Canvas object.
y - The Y coordinat where the pixels should be drawn onto the Canvas object.
pix8 - The 8 bits to draw starting at (X,Y) ending at (X+8,Y).
attr8 - The attributes used to draw the 8 bits.

endRender

protected void endRender()
Call newPixels() on the MemoryImageSource object at the end of a frame.

Overrides:
endRender in class BaseScreen