edu.swri.swiftvis.util
Class EditableDouble

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

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

This class can be used to store doubles 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 EditableDouble.Listener
           
 
Field Summary
private  boolean errorHandling
           
private  javax.swing.JTextField field
           
private  EditableDouble.Listener listener
           
private static long serialVersionUID
           
private  double value
           
 
Constructor Summary
EditableDouble(double val)
           
 
Method Summary
 javax.swing.JTextField getTextField(EditableDouble.Listener edl)
           
 double getValue()
           
 void setValue(double 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 double value

field

private transient javax.swing.JTextField field

listener

private transient EditableDouble.Listener listener

errorHandling

private transient boolean errorHandling

serialVersionUID

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

EditableDouble

public EditableDouble(double val)
Method Detail

getValue

public double getValue()

setValue

public void setValue(double val)

getTextField

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

valueChanged

private void valueChanged()