jfrace.device
Class ThomsonGDP

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--jfrace.device.ThomsonGDP
All Implemented Interfaces:
javax.accessibility.Accessible, Device, Hardware, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class ThomsonGDP
extends java.awt.Canvas
implements java.lang.Runnable, Device

Simulates a graphic display with the Thomson Graphic Display Processor (GDP) EF9365. The reserved registers with the addresses 14 and 15 are used to read the screen memory and the light pen switch, respectively.

Author:
Franz-Josef
See Also:
Serialized Form

Inner classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int ADR_CMD
          Address of CMD register.
static int ADR_CSIZE
          Address of CSIZE register.
static int ADR_CTRL1
          Address of CTRL1 register.
static int ADR_CTRL2
          Address of CTRL2 register.
static int ADR_DELTAX
          Address of DELTAX register.
static int ADR_DELTAY
          Address of DELTAY register.
static int ADR_LSWITCH
          Address of LSWITCH (light pen switch) register.
static int ADR_MEM
          Address of MEM (memory) register.
static int ADR_STATUS
          Address of STATUS register.
static int ADR_X_LSB
          Address of X register (LSB).
static int ADR_X_MSB
          Address of X register (MSB).
static int ADR_XLP
          Address of XLP (light pen) register.
static int ADR_Y_LSB
          Address of Y register (LSB).
static int ADR_Y_MSB
          Address of Y register (MSB).
static int ADR_YLP
          Address of YLP (light pen) register.
static byte BLOCK44
          Command: 4x4 block.
static byte BLOCK58
          Command: 5x8 block.
static byte CLEAR
          Command: Clear screen.
static byte DOWN
          Command: Pen/eraser down.
static byte ERASER
          Command: Select eraser.
static byte LPEN_PRESSED
          Light pen pressed.
static byte LPEN_RELEASED
          Light pen released.
static byte PEN
          Command: Select pen.
static byte RESET
          Command: Reset everything.
static byte UP
          Command: Pen/eraser up.
 
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
ThomsonGDP()
          Default constructor.
 
Method Summary
 byte getByte(int address)
          Get the byte of a register
 int getNumberOfBits()
          Return 8.
 int getNumberOfUnits()
          Return 16.
 int getValue(int address)
          Get the value of a register of ThomsonGDP.
 boolean isFocusTraversable()
          Return true because focus should be traversable with TAB key.
 void paint(java.awt.Graphics g)
          Paint the screen memory.
 java.awt.Dimension preferredSize()
           
 void reset()
          Reset.
 void run()
          Run repaint thread.
 void setByte(int address, byte value)
          Set the byte of a register.
 void setValue(int address, int value)
          Set the value of a register of ThomsonGDP.
 void update(java.awt.Graphics g)
          Directly calls paint.
 
Methods inherited from class java.awt.Canvas
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, 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, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADR_STATUS

public static final int ADR_STATUS
Address of STATUS register.

ADR_CMD

public static final int ADR_CMD
Address of CMD register.

ADR_CTRL1

public static final int ADR_CTRL1
Address of CTRL1 register.

ADR_CTRL2

public static final int ADR_CTRL2
Address of CTRL2 register.

ADR_CSIZE

public static final int ADR_CSIZE
Address of CSIZE register.

ADR_DELTAX

public static final int ADR_DELTAX
Address of DELTAX register.

ADR_DELTAY

public static final int ADR_DELTAY
Address of DELTAY register.

ADR_X_MSB

public static final int ADR_X_MSB
Address of X register (MSB).

ADR_X_LSB

public static final int ADR_X_LSB
Address of X register (LSB).

ADR_Y_MSB

public static final int ADR_Y_MSB
Address of Y register (MSB).

ADR_Y_LSB

public static final int ADR_Y_LSB
Address of Y register (LSB).

ADR_XLP

public static final int ADR_XLP
Address of XLP (light pen) register.

ADR_YLP

public static final int ADR_YLP
Address of YLP (light pen) register.

ADR_MEM

public static final int ADR_MEM
Address of MEM (memory) register.

ADR_LSWITCH

public static final int ADR_LSWITCH
Address of LSWITCH (light pen switch) register.

PEN

public static final byte PEN
Command: Select pen.

ERASER

public static final byte ERASER
Command: Select eraser.

DOWN

public static final byte DOWN
Command: Pen/eraser down.

UP

public static final byte UP
Command: Pen/eraser up.

CLEAR

public static final byte CLEAR
Command: Clear screen.

RESET

public static final byte RESET
Command: Reset everything.

LPEN_PRESSED

public static final byte LPEN_PRESSED
Light pen pressed.

LPEN_RELEASED

public static final byte LPEN_RELEASED
Light pen released.

BLOCK58

public static final byte BLOCK58
Command: 5x8 block.

BLOCK44

public static final byte BLOCK44
Command: 4x4 block.
Constructor Detail

ThomsonGDP

public ThomsonGDP()
Default constructor. Sets the background to black and the foreground to orange.
Method Detail

preferredSize

public java.awt.Dimension preferredSize()
Overrides:
preferredSize in class java.awt.Component

isFocusTraversable

public boolean isFocusTraversable()
Return true because focus should be traversable with TAB key.
Overrides:
isFocusTraversable in class java.awt.Component

update

public void update(java.awt.Graphics g)
Directly calls paint.
Overrides:
update in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Paint the screen memory.
Overrides:
paint in class java.awt.Canvas

run

public void run()
Run repaint thread. Polling for repaint requests.
Specified by:
run in interface java.lang.Runnable

reset

public void reset()
Reset.
Specified by:
reset in interface Hardware

getNumberOfBits

public int getNumberOfBits()
Return 8.
Specified by:
getNumberOfBits in interface Hardware

getNumberOfUnits

public int getNumberOfUnits()
Return 16.
Specified by:
getNumberOfUnits in interface Device

getValue

public int getValue(int address)
Get the value of a register of ThomsonGDP.
Specified by:
getValue in interface Device
Parameters:
address - register address.
Returns:
the value.
See Also:
getByte

setValue

public void setValue(int address,
                     int value)
Set the value of a register of ThomsonGDP.
Specified by:
setValue in interface Device
Parameters:
address - register address.
value - the new value.
See Also:
setByte

getByte

public byte getByte(int address)
Get the byte of a register
Specified by:
getByte in interface Device
Parameters:
address - register address.
Returns:
the value of the byte at address.
See Also:
getValue

setByte

public void setByte(int address,
                    byte value)
Set the byte of a register.
Specified by:
setByte in interface Device
Parameters:
address - register address.
value - new value of the byte at address.
See Also:
setValue