|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.domains.ptera.kernel.Event.RefiringData ptolemy.domains.ptera.lib.ReceiveInput.InputListener
private class ReceiveInput.InputListener
The input listener to listen to the key and mouse input.
Red (tfeng) |
Yellow (tfeng) |
Field Summary | |
---|---|
private java.lang.Class<?> |
_acceptableComponentType
The class of components that can accept input. |
private java.lang.Class<?> |
_componentType
Class of the component that actually receives the user input, which is automatically updated after the input is received. |
private boolean |
_finished
Whether input listening is finished. |
private javax.swing.JFrame |
_frame
The frame to be used. |
private java.util.regex.Pattern |
_keyPattern
The key pattern. |
private java.lang.String |
_keyPressText
The text of the key input, which is automatically updated after the input is received. |
private java.awt.Point |
_mousePressLocation
Screen location of the mouse press, which is automatically updated after the input is received. |
private boolean |
_receiveKeyPress
Whether key presses are acceptable. |
private boolean |
_receiveMousePress
Whether mouse presses are acceptable. |
Constructor Summary | |
---|---|
ReceiveInput.InputListener(double timeAdvance,
javax.swing.JFrame frame,
java.lang.Class<?> acceptableComponentType,
boolean receiveKeyPress,
java.util.regex.Pattern keyPattern,
boolean receiveMousePress)
Construct an input listener. |
Method Summary | |
---|---|
private void |
_finish()
End the input listening. |
void |
keyPressed(java.awt.event.KeyEvent e)
React to a key press event. |
void |
keyReleased(java.awt.event.KeyEvent e)
Do nothing. |
void |
keyTyped(java.awt.event.KeyEvent e)
Do nothing. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Do nothing. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Do nothing. |
void |
mouseExited(java.awt.event.MouseEvent e)
Do nothing. |
void |
mousePressed(java.awt.event.MouseEvent e)
React to a mouse press event. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Do nothing. |
void |
windowActivated(java.awt.event.WindowEvent e)
Do nothing. |
void |
windowClosed(java.awt.event.WindowEvent e)
Do nothing. |
void |
windowClosing(java.awt.event.WindowEvent e)
End the input listening. |
void |
windowDeactivated(java.awt.event.WindowEvent e)
Do nothing. |
void |
windowDeiconified(java.awt.event.WindowEvent e)
Do nothing. |
void |
windowIconified(java.awt.event.WindowEvent e)
Do nothing. |
void |
windowOpened(java.awt.event.WindowEvent e)
Do nothing. |
Methods inherited from class ptolemy.domains.ptera.kernel.Event.RefiringData |
---|
getTimeAdvance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.Class<?> _acceptableComponentType
private java.lang.Class<?> _componentType
private boolean _finished
private javax.swing.JFrame _frame
private java.util.regex.Pattern _keyPattern
private java.lang.String _keyPressText
private java.awt.Point _mousePressLocation
private boolean _receiveKeyPress
private boolean _receiveMousePress
Constructor Detail |
---|
ReceiveInput.InputListener(double timeAdvance, javax.swing.JFrame frame, java.lang.Class<?> acceptableComponentType, boolean receiveKeyPress, java.util.regex.Pattern keyPattern, boolean receiveMousePress)
timeAdvance
- The amount of time advancement.frame
- The frame to be used.acceptableComponentType
- The class of components that can
accept input.receiveKeyPress
- Whether key presses are acceptable.keyPattern
- The key pattern.receiveMousePress
- Whether mouse presses are acceptable.Method Detail |
---|
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
e
- The key press event.public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
e
- The key release event.public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
e
- The key type event.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- The mouse click event.public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- The mouse enter event.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- The mouse exit event.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- The mouse press event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- The mouse release event.public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
e
- The window activation event.public void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
e
- The window close event.public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
e
- The window closing event.public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
e
- The window deactivation event.public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
e
- The window deiconification event.public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
e
- The window iconification event.public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
e
- The window open event.private void _finish()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |