MDACC
Biostatistics

org.mdanderson.biostat.util
Class NumericFilter

java.lang.Object
  extended byorg.mdanderson.biostat.util.FilterAdapter
      extended byorg.mdanderson.biostat.util.Filter
          extended byorg.mdanderson.biostat.util.NumericFilter
All Implemented Interfaces:
EventListener, KeyListener

public class NumericFilter
extends Filter

NumericFilter - Implements numeric keyboard filtering.


Constructor Summary
NumericFilter(Component component)
          Class constructor specifying component
 
Method Summary
 boolean isKeyValid(KeyEvent event)
          Determines if the key is valid in this context.
 
Methods inherited from class org.mdanderson.biostat.util.FilterAdapter
disableAudio, enableAudio, keyPressed, keyReleased, keyTyped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericFilter

public NumericFilter(Component component)
Class constructor specifying component

Parameters:
component - component which would receive the keystrokes
Method Detail

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

MDACC
Biostatistics

Copyright © 2002 M.D. Anderson Cancer Center. All Rights Reserved.