junit.extensions.jfcunit.keyboard
Class JFCKeyStroke

java.lang.Object
  extended byjunit.extensions.jfcunit.keyboard.JFCKeyStroke

public class JFCKeyStroke
extends java.lang.Object

The JFCKeyStroke class holds all of the data pertaining to a keystroke to be pressed/released by the TestHelper.

Author:
Kevin Wilson

Field Summary
private  boolean m_isTyped
          isTyped true if the key stroke is to emit a typed event.
private  char m_keyChar
          Key Character.
private  int m_keyCode
          Key Code.
private  int m_modifiers
          Modifiers to be pressed for this event.
 
Constructor Summary
JFCKeyStroke(char c, int code, int modifiers, boolean typed)
          Constructor.
JFCKeyStroke(JFCKeyStroke stroke)
          Copy Constructor.
JFCKeyStroke(java.lang.String keyDesc)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Test for equality.
 char getKeyChar()
          Get the key character.
 int getKeyCode()
          Get the key code.
 int getModifiers()
          Get the modifiers.
 int hashCode()
          Get hashCode.
 boolean isTyped()
          Is the keystroke to emit a typed event.
private  void setKeyChar(char c)
          Set the key character.
private  void setKeyCode(int code)
          Set the key code.
 void setModifiers(int modifiers)
          Set the modifiers.
private  void setTyped(boolean typed)
          Set the typed state.
 java.lang.String toString()
          Create a string representation of the keystroke.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_isTyped

private boolean m_isTyped
isTyped true if the key stroke is to emit a typed event.


m_keyChar

private char m_keyChar
Key Character.


m_keyCode

private int m_keyCode
Key Code.


m_modifiers

private int m_modifiers
Modifiers to be pressed for this event.

Constructor Detail

JFCKeyStroke

public JFCKeyStroke(char c,
                    int code,
                    int modifiers,
                    boolean typed)
Constructor.

Parameters:
c - Character.
code - Key code.
modifiers - Modifiers to be pressed when sending the keystroke.
typed - true if a typed event should be emitted.

JFCKeyStroke

public JFCKeyStroke(java.lang.String keyDesc)

JFCKeyStroke

public JFCKeyStroke(JFCKeyStroke stroke)
Copy Constructor.

Parameters:
stroke - Keystroke to be copied.
Method Detail

getKeyChar

public final char getKeyChar()
Get the key character.

Returns:
char key character.

getKeyCode

public final int getKeyCode()
Get the key code.

Returns:
int key code

setModifiers

public void setModifiers(int modifiers)
Set the modifiers.

Parameters:
modifiers - Modifiers to be pressed for this keystroke.

getModifiers

public final int getModifiers()
Get the modifiers.

Returns:
int modifiers.

isTyped

public final boolean isTyped()
Is the keystroke to emit a typed event.

Returns:
true if the typed event is to be emitted.

equals

public boolean equals(java.lang.Object o)
Test for equality.

Parameters:
o - Object to be tested for equality.
Returns:
true if the object is equal to this object.

hashCode

public int hashCode()
Get hashCode.

Returns:
int hashCode.

toString

public java.lang.String toString()
Create a string representation of the keystroke.

Returns:
String representation of the keystroke.

setKeyChar

private void setKeyChar(char c)
Set the key character.

Parameters:
c - Character.

setKeyCode

private void setKeyCode(int code)
Set the key code.

Parameters:
code - Key code

setTyped

private void setTyped(boolean typed)
Set the typed state.

Parameters:
typed - true if the keystroke is to emit a typed event.


Licensed under: GNU Lesser General Public License, Ver 2.1, February 1999