jET
1.0alpha4


org.jet.tracks
Class AbstractTrackProp.Colorizer

java.lang.Object
  |
  +--org.jet.tracks.AbstractTrackProp.AbstractTextAction
        |
        +--org.jet.tracks.AbstractTrackProp.Colorizer
All Implemented Interfaces:
javax.swing.event.DocumentListener, java.util.EventListener
Enclosing class:
AbstractTrackProp

protected class AbstractTrackProp.Colorizer
extends AbstractTrackProp.AbstractTextAction

Colorizes target formatted text field when its values exceed number formatter ranges.


Constructor Summary
AbstractTrackProp.Colorizer()
          Creates dummy colorizer object.
AbstractTrackProp.Colorizer(javax.swing.JFormattedTextField ftf)
          Created colorizer with target ftf.
 
Method Summary
protected  void act(javax.swing.event.DocumentEvent de)
          Acts with document event.
 javax.swing.text.InternationalFormatter getFormatter()
          Returns international formatter associated with target formatted text field.
 javax.swing.JFormattedTextField getTextField()
          Gets a target of this colorizer.
 void setTextField(javax.swing.JFormattedTextField ftf)
          Sets a target for this colorizer.
 
Methods inherited from class org.jet.tracks.AbstractTrackProp.AbstractTextAction
changedUpdate, insertUpdate, removeUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTrackProp.Colorizer

public AbstractTrackProp.Colorizer()
Creates dummy colorizer object.


AbstractTrackProp.Colorizer

public AbstractTrackProp.Colorizer(javax.swing.JFormattedTextField ftf)
Created colorizer with target ftf.

Parameters:
ftf - This is a target for this document listener.
Method Detail

setTextField

public void setTextField(javax.swing.JFormattedTextField ftf)
Sets a target for this colorizer.


getTextField

public javax.swing.JFormattedTextField getTextField()
Gets a target of this colorizer.

Returns:
Target formatted text field.

getFormatter

public javax.swing.text.InternationalFormatter getFormatter()
Returns international formatter associated with target formatted text field.

International formatter supports maximum and minimum values.

Returns:
International formatter associated with target formatted text field.

act

protected void act(javax.swing.event.DocumentEvent de)
Acts with document event.

Checks if the target current value is in acceptable range set by minimum and maximum value of international formatter. If it is not, value displayed in target formatted text field will be red.

Specified by:
act in class AbstractTrackProp.AbstractTextAction
Parameters:
de - Document event.

jET
1.0alpha4