org.processmining.framework.util
Class GUIPropertyStringArea

java.lang.Object
  extended by org.processmining.framework.util.GUIPropertyStringArea
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.DocumentListener

public class GUIPropertyStringArea
extends java.lang.Object
implements javax.swing.event.DocumentListener

A string property that can be readily displayed as it maintains its own GUI panel. The property will be graphically represented as a (single line) text field that can be edited. 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));
GUIPropertyString name = new GUIPropertyString("Name", "Anne");
testPanel.add(name.getPropertyPanel()); // add one property
GUIPropertyString city = new GUIPropertyString("City", "Eindhoven");
testPanel.add(city.getPropertyPanel()); // add another property
return testPanel;

See Also:
getValue, getPropertyPanel

Field Summary
protected  java.lang.String myDescription
           
protected  java.lang.String myName
           
protected  GuiNotificationTarget myTarget
           
protected  javax.swing.JTextArea myTextField
           
protected  java.lang.String myValue
           
protected  int myWidth
           
 
Constructor Summary
GUIPropertyStringArea(java.lang.String name, java.lang.String defaultValue)
          Creates a boolean property without a discription and notification.
GUIPropertyStringArea(java.lang.String name, java.lang.String defaultValue, GuiNotificationTarget target)
          Creates a boolean property without a discription.
GUIPropertyStringArea(java.lang.String name, java.lang.String description, java.lang.String defaultValue)
          Creates a boolean property without notification.
GUIPropertyStringArea(java.lang.String name, java.lang.String description, java.lang.String defaultValue, GuiNotificationTarget target)
          Creates a boolean property.
GUIPropertyStringArea(java.lang.String name, java.lang.String description, java.lang.String defaultValue, GuiNotificationTarget target, int width)
          Creates a boolean property.
 
Method Summary
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
 javax.swing.JPanel getPropertyPanel()
          Creates GUI panel containg this property, ready to display in some settings dialog.
 java.lang.String getValue()
          The method to be invoked when the value of this property is to be used.
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myName

protected java.lang.String myName

myDescription

protected java.lang.String myDescription

myValue

protected java.lang.String myValue

myWidth

protected int myWidth

myTarget

protected GuiNotificationTarget myTarget

myTextField

protected javax.swing.JTextArea myTextField
Constructor Detail

GUIPropertyStringArea

public GUIPropertyStringArea(java.lang.String name,
                             java.lang.String defaultValue)
Creates a boolean property without a discription and notification.

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

GUIPropertyStringArea

public GUIPropertyStringArea(java.lang.String name,
                             java.lang.String description,
                             java.lang.String defaultValue)
Creates a boolean 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

GUIPropertyStringArea

public GUIPropertyStringArea(java.lang.String name,
                             java.lang.String defaultValue,
                             GuiNotificationTarget target)
Creates a boolean property without a discription.

Parameters:
name - the name of this property
defaultValue - the default value of this property
target - the object to be notified as soon the state of this property changes

GUIPropertyStringArea

public GUIPropertyStringArea(java.lang.String name,
                             java.lang.String description,
                             java.lang.String defaultValue,
                             GuiNotificationTarget target)
Creates a boolean 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

GUIPropertyStringArea

public GUIPropertyStringArea(java.lang.String name,
                             java.lang.String description,
                             java.lang.String defaultValue,
                             GuiNotificationTarget target,
                             int width)
Creates a boolean 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
width - a custom width may be specified (default value is 100 otherwise)
Method Detail

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

getValue

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

Returns:
the current value of this property

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