edu.swri.swiftvis.util
Class EditableInt

java.lang.Object
  extended by edu.swri.swiftvis.util.EditableInt
All Implemented Interfaces:
java.io.Serializable

public final class EditableInt
extends java.lang.Object
implements java.io.Serializable

This class can be used to store ints that need to be edited in a GUI. Using this class prevents the programmer from having to write handler code dealing with parsing the number and handling it if it is incorrect. It also makes it so that when the value is changed the GUI component is updates.

Author:
Mark Lewis
See Also:
Serialized Form

Nested Class Summary
static interface EditableInt.Listener
           
 
Field Summary
private  boolean errorHandling
           
private  javax.swing.JTextField field
           
private  EditableInt.Listener listener
           
private static long serialVersionUID
           
private  int value
           
 
Constructor Summary
EditableInt(int val)
           
 
Method Summary
 javax.swing.JTextField getTextField(EditableInt.Listener edl)
           
 int getValue()
           
 void setValue(int val)
           
private  void valueChanged()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

private int value

field

private transient javax.swing.JTextField field

listener

private transient EditableInt.Listener listener

errorHandling

private transient boolean errorHandling

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

EditableInt

public EditableInt(int val)
Method Detail

getValue

public int getValue()

setValue

public void setValue(int val)

getTextField

public javax.swing.JTextField getTextField(EditableInt.Listener edl)

valueChanged

private void valueChanged()