|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.kbna.dioscuri.module.Module
nl.kbna.dioscuri.module.ModuleDevice
nl.kbna.dioscuri.module.ModuleMouse
nl.kbna.dioscuri.module.mouse.Mouse
public class Mouse
An implementation of a mouse module.
Metadata module
********************************************
general.type : mouse
general.name : PS/2 compatible Mouse
general.architecture : Von Neumann
general.description : Models a PS2 compatible mouse
general.creator : Koninklijke Bibliotheek, Nationaal Archief of the Netherlands
general.version : 1.0
general.keywords : Mouse, Keyboard, PS/2
general.relations : Motherboard, Keyboard
general.yearOfIntroduction : 1987
general.yearOfEnding :
general.ancestor : DE-9 RS-232 serial mouse
general.successor : USB mouse
Notes:
- mouse uses keyboard controller. Therefore, a keyboard controller is always required when using this mouse.
- all controller aspects are implemented in keyboard: (mouse is only pointing device but not controller)
+ I/O ports
+ IRQ handling| Field Summary | |
|---|---|
private MouseBuffer |
buffer
|
(package private) byte |
buttonStatus
|
private boolean |
debugMode
|
(package private) int |
delayed_dx
|
(package private) int |
delayed_dy
|
(package private) int |
delayed_dz
|
private Emulator |
emu
|
(package private) boolean |
expectingMouseParameter
|
(package private) boolean |
imMode
|
(package private) int |
imRequest
|
private boolean |
isObserved
|
private ModuleKeyboard |
keyboard
|
(package private) byte |
lastMouseCommand
|
private static java.util.logging.Logger |
logger
|
static int |
MODULE_ID
|
static java.lang.String |
MODULE_NAME
|
static java.lang.String |
MODULE_TYPE
|
private java.lang.String[] |
moduleConnections
|
private ModuleMotherboard |
motherboard
|
private static int |
MOUSE_BUFFER_INITSIZE
|
private static byte |
MOUSE_CMD_ACK
|
private static byte |
MOUSE_CMD_COMPLETION
|
private static byte |
MOUSE_CMD_ID
|
private static byte |
MOUSE_CMD_RESEND
|
private static int |
MOUSE_MODE_REMOTE
|
private static int |
MOUSE_MODE_RESET
|
private static int |
MOUSE_MODE_STREAM
|
private static int |
MOUSE_MODE_WRAP
|
private static int |
MOUSE_TYPE_IMPS2
|
private static int |
MOUSE_TYPE_PS2
|
(package private) boolean |
mouseEnabled
|
(package private) int |
mouseMode
|
(package private) int |
mousePreviousMode
|
(package private) int |
mouseType
|
(package private) int |
resolutionCpmm
|
(package private) byte |
sampleRate
|
(package private) int |
scaling
|
private int |
updateInterval
|
| Constructor Summary | |
|---|---|
Mouse(Emulator owner)
Class constructor |
|
| Method Summary | |
|---|---|
void |
controlMouse(byte value)
|
private boolean |
enqueueData(byte b1,
byte b2,
byte b3,
byte b4)
|
java.lang.String[] |
getConnection()
Returns a String[] with all names of modules it needs to be connected to |
byte[] |
getData(Module requester)
Returns data from this module |
byte |
getDataFromBuffer()
|
boolean |
getDebugMode()
Returns the status of the debug mode toggle |
java.lang.String |
getDump()
Returns a dump of this module |
int |
getID()
Returns the ID of the module |
byte |
getIOPortByte(int portAddress)
Return a byte from I/O address space at given I/O port |
byte[] |
getIOPortDoubleWord(int portAddress)
Return a double word from I/O address space at given port |
byte[] |
getIOPortWord(int portAddress)
Return a word from I/O address space at given port |
java.lang.String |
getName()
Returns the name of the module |
private byte |
getResolutionByte()
|
private byte |
getStatusByte()
|
java.lang.String |
getType()
Returns the type of the module |
int |
getUpdateInterval()
Retrieve the interval between subsequent updates |
boolean |
isBufferEmpty()
|
boolean |
isConnected()
Checks if this module is connected to operate normally |
boolean |
isObserved()
Returns the status of observed toggle |
void |
mouseMotion(int delta_x,
int delta_y,
int delta_z,
byte buttonState)
|
boolean |
reset()
Default inherited reset. |
boolean |
setConnection(Module mod)
Sets up a connection with another module |
boolean |
setData(byte[] data,
Module sender)
Set data for this module |
boolean |
setData(java.lang.String[] data,
Module sender)
Set String[] data for this module |
void |
setDebugMode(boolean status)
Sets the debug mode toggle |
void |
setIOPortByte(int portAddress,
byte data)
Set a byte in I/O address space at given port |
void |
setIOPortDoubleWord(int portAddress,
byte[] dataDoubleWord)
Set a double word in I/O address space at given port |
void |
setIOPortWord(int portAddress,
byte[] dataWord)
Set a word in I/O address space at given port |
void |
setObserved(boolean status)
Sets the observed toggle |
void |
setUpdateInterval(int interval)
Defines the interval between subsequent updates |
void |
start()
Starts the module |
void |
stop()
Stops the module |
void |
storeBufferData(boolean forceEnqueue)
|
void |
update()
Update device |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Emulator emu
private java.lang.String[] moduleConnections
private ModuleMotherboard motherboard
private ModuleKeyboard keyboard
private MouseBuffer buffer
private boolean isObserved
private boolean debugMode
private int updateInterval
boolean mouseEnabled
int mouseType
int mouseMode
int mousePreviousMode
byte lastMouseCommand
boolean expectingMouseParameter
int imRequest
boolean imMode
byte sampleRate
int resolutionCpmm
int scaling
int delayed_dx
int delayed_dy
int delayed_dz
byte buttonStatus
private static java.util.logging.Logger logger
public static final int MODULE_ID
public static final java.lang.String MODULE_TYPE
public static final java.lang.String MODULE_NAME
private static final int MOUSE_TYPE_PS2
private static final int MOUSE_TYPE_IMPS2
private static final int MOUSE_MODE_WRAP
private static final int MOUSE_MODE_STREAM
private static final int MOUSE_MODE_REMOTE
private static final int MOUSE_MODE_RESET
private static final byte MOUSE_CMD_ACK
private static final byte MOUSE_CMD_COMPLETION
private static final byte MOUSE_CMD_ID
private static final byte MOUSE_CMD_RESEND
private static final int MOUSE_BUFFER_INITSIZE
| Constructor Detail |
|---|
public Mouse(Emulator owner)
| Method Detail |
|---|
public int getID()
getID in class ModuleModulepublic java.lang.String getType()
getType in class ModuleModulepublic java.lang.String getName()
getName in class ModuleModulepublic java.lang.String[] getConnection()
getConnection in class Modulepublic boolean setConnection(Module mod)
setConnection in class Modulemod - Module that is to be connected to this class
Modulepublic boolean isConnected()
isConnected in class Modulepublic boolean reset()
reset in class Modulepublic void start()
start in class ModuleModulepublic void stop()
stop in class ModuleModulepublic boolean isObserved()
isObserved in class ModuleModulepublic void setObserved(boolean status)
setObserved in class Modulestatus - Modulepublic boolean getDebugMode()
getDebugMode in class ModuleModulepublic void setDebugMode(boolean status)
setDebugMode in class Modulestatus - Modulepublic byte[] getData(Module requester)
getData in class ModuleModule - requester, the requester of the data
Module
public boolean setData(byte[] data,
Module sender)
setData in class Modulebyte[] - containing dataModule - sender, the sender of the data
Module
public boolean setData(java.lang.String[] data,
Module sender)
setData in class ModuleString[] - dataModule - sender, the sender of the data
Modulepublic java.lang.String getDump()
getDump in class ModuleModulepublic int getUpdateInterval()
getUpdateInterval in class ModuleDevicepublic void setUpdateInterval(int interval)
setUpdateInterval in class ModuleDeviceint - interval in microsecondspublic void update()
update in class ModuleDevice
public byte getIOPortByte(int portAddress)
throws ModuleException,
ModuleUnknownPort,
ModuleWriteOnlyPortException
ModuleDevice
getIOPortByte in class ModuleDeviceModuleException
ModuleUnknownPort
ModuleWriteOnlyPortException
public void setIOPortByte(int portAddress,
byte data)
throws ModuleException,
ModuleUnknownPort
ModuleDevice
setIOPortByte in class ModuleDeviceModuleException
ModuleUnknownPort
public byte[] getIOPortWord(int portAddress)
throws ModuleException,
ModuleUnknownPort,
ModuleWriteOnlyPortException
ModuleDevice
getIOPortWord in class ModuleDeviceModuleException
ModuleUnknownPort
ModuleWriteOnlyPortException
public void setIOPortWord(int portAddress,
byte[] dataWord)
throws ModuleException,
ModuleUnknownPort
ModuleDevice
setIOPortWord in class ModuleDeviceModuleException
ModuleUnknownPort
public byte[] getIOPortDoubleWord(int portAddress)
throws ModuleException,
ModuleUnknownPort,
ModuleWriteOnlyPortException
ModuleDevice
getIOPortDoubleWord in class ModuleDeviceModuleException
ModuleUnknownPort
ModuleWriteOnlyPortException
public void setIOPortDoubleWord(int portAddress,
byte[] dataDoubleWord)
throws ModuleException,
ModuleUnknownPort
ModuleDevice
setIOPortDoubleWord in class ModuleDeviceModuleException
ModuleUnknownPortpublic boolean isBufferEmpty()
isBufferEmpty in class ModuleMousepublic void storeBufferData(boolean forceEnqueue)
storeBufferData in class ModuleMousepublic byte getDataFromBuffer()
getDataFromBuffer in class ModuleMousepublic void controlMouse(byte value)
controlMouse in class ModuleMouse
public void mouseMotion(int delta_x,
int delta_y,
int delta_z,
byte buttonState)
private byte getStatusByte()
private byte getResolutionByte()
private boolean enqueueData(byte b1,
byte b2,
byte b3,
byte b4)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||