com.jstatcom.ts
Class DefaultTSKeyListener

java.lang.Object
  extended by java.awt.event.KeyAdapter
      extended by com.jstatcom.ts.DefaultTSKeyListener
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener

public class DefaultTSKeyListener
extends java.awt.event.KeyAdapter

A KeyListener that is especially designed to be used with the TSList. It is meant to be shared between TSList instances, but can also be created and subclassed if necessary.

Author:
Markus Kraetzig

Constructor Summary
DefaultTSKeyListener(java.lang.String name)
          Creates a DefaultTSKeyListener with a descriptive name.
 
Method Summary
static DefaultTSKeyListener getSharedInstance()
          Returns an instance of the DefaultTSKeyListener, that can be shared across all TSList instances.
 void keyPressed(java.awt.event.KeyEvent keyEvent)
          The following keys are recognized:
KeyEvent.VK_DELETE- all selected series are deleted
 java.lang.String toString()
          Returns a string representation of DefaultTSKeyListener.
 
Methods inherited from class java.awt.event.KeyAdapter
keyReleased, keyTyped
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTSKeyListener

public DefaultTSKeyListener(java.lang.String name)
Creates a DefaultTSKeyListener with a descriptive name. Use the constructor only, if you need a instance that should be different from getSharedInstance via subclassing.

Method Detail

getSharedInstance

public static DefaultTSKeyListener getSharedInstance()
Returns an instance of the DefaultTSKeyListener, that can be shared across all TSList instances. It is also possible to create subclasses that can be individually configured and set to a TSList that should have a different KeyListener.

Returns:
an instance of this class that can be shared

keyPressed

public void keyPressed(java.awt.event.KeyEvent keyEvent)
The following keys are recognized:
KeyEvent.VK_DELETE- all selected series are deleted

Specified by:
keyPressed in interface java.awt.event.KeyListener
Overrides:
keyPressed in class java.awt.event.KeyAdapter
Parameters:
keyEvent - a key event

toString

public java.lang.String toString()
Returns a string representation of DefaultTSKeyListener.

Overrides:
toString in class java.lang.Object
Returns:
string representation