org.processmining.framework.util
Class GUIPropertyDoubleTextField

java.lang.Object
  extended by org.processmining.framework.util.GUIPropertyDoubleTextField
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener

public class GUIPropertyDoubleTextField
extends java.lang.Object
implements java.awt.event.KeyListener

A double property that can be readily displayed as it maintains its own GUI panel. The property will be graphically represented as a label containing the name of the property and a textfield. If a description has been provided, it will be displayed as a tool tip.
Changes performed via the GUI will be immedeately propagated to the internally held property value. Furthermore, a notification target may be specified in order to be informed as soon as the value has been changed.

A typical usage scenario looks as follows:

JPanel testPanel = new Panel(); // create parent panel
testPanel.setLayout(new BoxLayout(testPanel, BoxLayout.PAGE_AXIS));
GUIPropertyDouble width = new GUIPropertyDoubleTextField("Width", 0.0, 0.0, 10.0, 0.1);
testPanel.add(width.getPropertyPanel()); // add one property
GUIPropertyDouble height = new GUIPropertyDouble("Height", "Height in cm", 0.0, 0.0, 20.0, 0.1);
testPanel.add(height.getPropertyPanel()); // add another property
return testPanel;

See Also:
getValue, getPropertyPanel

Constructor Summary
GUIPropertyDoubleTextField(java.lang.String name, double defaultValue)
          Creates an integer property without no minimal and no maximal value.
GUIPropertyDoubleTextField(java.lang.String name, double defaultValue, double value, boolean minOrMax)
          Creates an integer property without no minimal or maximal value.
GUIPropertyDoubleTextField(java.lang.String name, double defaultValue, double minValue, double maxValue)
          Creates a double property without a discription and notification.
GUIPropertyDoubleTextField(java.lang.String name, double defaultValue, double minValue, double maxValue, GuiNotificationTarget target)
          Creates a double property without a discription.
GUIPropertyDoubleTextField(java.lang.String name, double defaultValue, GuiNotificationTarget target)
          Creates an integer property without no minimal and no maximal value and a GuiNotificationTarget.
GUIPropertyDoubleTextField(java.lang.String name, java.lang.String description, double defaultValue, double minValue, double maxValue)
          Creates a double property without notification.
GUIPropertyDoubleTextField(java.lang.String name, java.lang.String description, double defaultValue, double minValue, double maxValue, GuiNotificationTarget target)
          Creates a double property.
GUIPropertyDoubleTextField(java.lang.String name, java.lang.String description, double defaultValue, GuiNotificationTarget target)
          Creates a double property.
 
Method Summary
 javax.swing.JPanel getPropertyPanel()
          Creates GUI panel containg this property, ready to display in some settings dialog.
 double getValue()
          The method to be invoked when the value of this property is to be used.
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
          The method automatically invoked when changing the text field status.
 void setValue(double value)
          Sets the value of this property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  double defaultValue,
                                  double minValue,
                                  double maxValue)
Creates a double property without a discription and notification.

Parameters:
name - the name of this property
defaultValue - the default value of this property
minValue - the minimal value that can be assigned to this property
maxValue - the maximal value that can be assigned to this property
stepSize - the distance between two adjacent values

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  java.lang.String description,
                                  double defaultValue,
                                  double minValue,
                                  double maxValue)
Creates a double property without notification.

Parameters:
name - the name of this property
description - of this property (to be displayed as a tool tip)
defaultValue - the default value of this property
minValue - the minimal value that can be assigned to this property
maxValue - the maximal value that can be assigned to this property
stepSize - the distance between two adjacent values

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  double defaultValue,
                                  double minValue,
                                  double maxValue,
                                  GuiNotificationTarget target)
Creates a double property without a discription.

Parameters:
name - the name of this property
defaultValue - the default value of this property
minValue - the minimal value that can be assigned to this property
maxValue - the maximal value that can be assigned to this property
stepSize - the distance between two adjacent values
target - the object to be notified as soon the state of this property changes

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  java.lang.String description,
                                  double defaultValue,
                                  double minValue,
                                  double maxValue,
                                  GuiNotificationTarget target)
Creates a double property.

Parameters:
name - the name of this property
description - of this property (to be displayed as a tool tip)
defaultValue - the default value of this property
minValue - the minimal value that can be assigned to this property
maxValue - the maximal value that can be assigned to this property
stepSize - the distance between two adjacent values
target - the object to be notified as soon the state of this property changes

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  java.lang.String description,
                                  double defaultValue,
                                  GuiNotificationTarget target)
Creates a double property.

Parameters:
name - the name of this property
description - of this property (to be displayed as a tool tip)
defaultValue - the default value of this property
target - the object to be notified as soon the state of this property changes

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  double defaultValue)
Creates an integer property without no minimal and no maximal value.

Parameters:
name - the name of this property
defaultValue - the default value of this property

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  double defaultValue,
                                  GuiNotificationTarget target)
Creates an integer property without no minimal and no maximal value and a GuiNotificationTarget.

Parameters:
name - the name of this property
defaultValue - the default value of this property

GUIPropertyDoubleTextField

public GUIPropertyDoubleTextField(java.lang.String name,
                                  double defaultValue,
                                  double value,
                                  boolean minOrMax)
Creates an integer property without no minimal or maximal value.

Parameters:
name - the name of this property
defaultValue - the default value of this property
value - the minimal or maximal value of this property, based on the value set for minOrMax
minOrMax - if true then with value the minimal value will be specified, otherwise the maximal value will be specified
Method Detail

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
The method automatically invoked when changing the text field status.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - the passed action event (not used)

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

getValue

public double getValue()
The method to be invoked when the value of this property is to be used.

Returns:
the current value of this property

setValue

public void setValue(double value)
Sets the value of this property

Parameters:
value - double

getPropertyPanel

public javax.swing.JPanel getPropertyPanel()
Creates GUI panel containg this property, ready to display in some settings dialog.

Returns:
the graphical panel representing this property