org.razvan.jzx
Class ScreenJava2

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

public class ScreenJava2
extends BaseScreen

Screen implementation that is optimized for running in a JDK1.2 VM.

This implementation makes use of a BufferedImage object, whose setRGB() method is very fast for updating a large array of new RGB values.

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
ScreenJava2()
           
 
Method Summary
protected  java.awt.Image createCompatibleImage(int width, int height)
          Create an Image that is compatible with the screen type and color depth.
protected  void draw8(int x, int y, int pix8, int attr8)
          Draw a given byte onto the screen using the given attribute, at the given location.
 void dumpScreenshot()
           
 void init(BaseSpectrum spectrum, ILogger logger)
          Compute the size of the segment that will be drawn into the BufferedImage, and allocate it.
protected  void setScale(int scale)
          Update the segment size and re-allocate it for the new scale value.
 
Methods inherited from class org.razvan.jzx.BaseScreen
attrTouch, clear, clear, endRender, flash, getCursorX, getCursorY, getInstance, getMinimumSize, getPage, getPreferredSize, load, paint, 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

ScreenJava2

public ScreenJava2()
Method Detail

init

public void init(BaseSpectrum spectrum,
                 ILogger logger)
Compute the size of the segment that will be drawn into the BufferedImage, and allocate it.

Overrides:
init in class BaseScreen

setScale

protected void setScale(int scale)
Update the segment size and re-allocate it for the new scale value.

Overrides:
setScale in class BaseScreen

createCompatibleImage

protected java.awt.Image createCompatibleImage(int width,
                                               int height)
Create an Image that is compatible with the screen type and color depth.

Overrides:
createCompatibleImage in class BaseScreen

draw8

protected void draw8(int x,
                     int y,
                     int pix8,
                     int attr8)
Draw a given byte onto the screen 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.

dumpScreenshot

public void dumpScreenshot()
Overrides:
dumpScreenshot in class BaseScreen