org.mdanderson.biostat.util
Class NumericFilter
java.lang.Object
org.mdanderson.biostat.util.FilterAdapter
org.mdanderson.biostat.util.Filter
org.mdanderson.biostat.util.NumericFilter
- All Implemented Interfaces:
- EventListener, KeyListener
- public class NumericFilter
- extends Filter
NumericFilter - Implements numeric keyboard filtering.
Method Summary |
boolean |
isKeyValid(KeyEvent event)
Determines if the key is valid in this context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NumericFilter
public NumericFilter(Component component)
- Class constructor specifying component
- Parameters:
component
- component which would receive the keystrokes
isKeyValid
public boolean isKeyValid(KeyEvent event)
- Determines if the key is valid in this context. This implementation
allows digits, negative sign, decimal point. The backspace and delete
keys cannot be consumed and are allowed here to prevent
Filter
from beeping when they are typed. Note that this
does not prevent an invalid format of acceptable characters.
- Specified by:
isKeyValid
in class FilterAdapter
- Parameters:
event
- low-level event generated by a component when a key is
pressed, released, or typed
- Returns:
- true if key is valid for this filter; otherwise, false
- See Also:
Filter
Copyright © 2002 M.D. Anderson Cancer Center. All Rights Reserved.