jmce - 1_02

jmce.sim.terminal
Class AbstractCRT

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.terminal.AbstractCRT
All Implemented Interfaces:
Hardware, MemoryWriteListener, CRT
Direct Known Subclasses:
SwingCRT, ttyCRT

public abstract class AbstractCRT
extends AbstractHardware
implements CRT

Abstract implementation of CRT.

Version:
1.00
Author:
Mario Viara

Field Summary
protected  Memory attMemory
           
protected  Memory charMemory
           
protected  boolean[] lineChanged
           
protected  int numCol
           
protected  int numRow
           
protected  boolean screenChanged
           
protected  Terminal terminal
           
 
Constructor Summary
AbstractCRT()
           
AbstractCRT(java.lang.String name)
           
 
Method Summary
 void changedLine(int n)
          Called when the memory is changed
 int getAtt(int r, int c)
           
 int getChar(int r, int c)
           
 void init(Hardware parent)
          Initialize the hardware.
 void writeMemory(Memory m, int address, int value, int oldValue)
          Called when a memory write event occours.
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 

Field Detail

terminal

protected Terminal terminal

lineChanged

protected boolean[] lineChanged

screenChanged

protected boolean screenChanged

numCol

protected int numCol

numRow

protected int numRow

charMemory

protected Memory charMemory

attMemory

protected Memory attMemory
Constructor Detail

AbstractCRT

public AbstractCRT(java.lang.String name)

AbstractCRT

public AbstractCRT()
Method Detail

init

public void init(Hardware parent)
          throws SIMException
Description copied from interface: Hardware
Initialize the hardware. This method must be called before any use of the interface. Only set ... / get ... method are allowed to be called before the intialization.

Specified by:
init in interface Hardware
Overrides:
init in class AbstractHardware
Parameters:
parent - Parent of this hardware.
Throws:
SIMException

writeMemory

public void writeMemory(Memory m,
                        int address,
                        int value,
                        int oldValue)
Description copied from interface: MemoryWriteListener
Called when a memory write event occours.

This method is called when a memory write operation occours in the specified memory.

Specified by:
writeMemory in interface MemoryWriteListener
Parameters:
m - - Memory involved in the write operation.
address - - Address written.
value - - Value written.
oldValue - - Old value of this memory location.

changedLine

public void changedLine(int n)
Description copied from interface: CRT
Called when the memory is changed

Specified by:
changedLine in interface CRT

getChar

public int getChar(int r,
                   int c)
            throws SIMException
Throws:
SIMException

getAtt

public int getAtt(int r,
                  int c)
           throws SIMException
Throws:
SIMException

jmce - 1_02