org.processmining.framework.util
Class GUIPropertyLong
java.lang.Object
org.processmining.framework.util.GUIPropertyLong
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.event.ChangeListener
public class GUIPropertyLong
- extends java.lang.Object
- implements javax.swing.event.ChangeListener
A long 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 spinner according to the provided value range.
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));
GUIPropertyLong age = new GUIPropertyLong("Age", 0, 0, 100);
testPanel.add(age.getPropertyPanel()); // add one property
GUIPropertyLong height = new GUIPropertyLong("Height", "Height in cm", 0, 50, 250);
testPanel.add(height.getPropertyPanel()); // add another property
return testPanel;
- See Also:
getValue
,
getPropertyPanel
Constructor Summary |
GUIPropertyLong(java.lang.String name,
long defaultValue,
long minValue,
long maxValue)
Creates a long property without a description and notification. |
GUIPropertyLong(java.lang.String name,
long defaultValue,
long minValue,
long maxValue,
GuiNotificationTarget target)
Creates a long property without a description. |
GUIPropertyLong(java.lang.String name,
java.lang.String description,
long defaultValue,
long minValue,
long maxValue)
Creates a long property without notification. |
GUIPropertyLong(java.lang.String name,
java.lang.String description,
long defaultValue,
long minValue,
long maxValue,
GuiNotificationTarget target)
Creates a long property. |
Method Summary |
javax.swing.JPanel |
getPropertyPanel()
Creates GUI panel containg this property, ready to display in
some settings dialog. |
long |
getValue()
The method to be invoked when the value of this property is
to be used. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
The method automatically invoked when changing the spinner status. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GUIPropertyLong
public GUIPropertyLong(java.lang.String name,
long defaultValue,
long minValue,
long maxValue)
- Creates a long property without a description and notification.
- Parameters:
name
- the name of this propertydefaultValue
- the default value of this propertyminValue
- the minimal value that can be assigned to this propertymaxValue
- the maximal value that can be assigned to this property
GUIPropertyLong
public GUIPropertyLong(java.lang.String name,
java.lang.String description,
long defaultValue,
long minValue,
long maxValue)
- Creates a long property without notification.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this propertyminValue
- the minimal value that can be assigned to this propertymaxValue
- the maximal value that can be assigned to this property
GUIPropertyLong
public GUIPropertyLong(java.lang.String name,
long defaultValue,
long minValue,
long maxValue,
GuiNotificationTarget target)
- Creates a long property without a description.
- Parameters:
name
- the name of this propertydefaultValue
- the default value of this propertyminValue
- the minimal value that can be assigned to this propertymaxValue
- the maximal value that can be assigned to this propertytarget
- the object to be notified as soon the state of this property changes
GUIPropertyLong
public GUIPropertyLong(java.lang.String name,
java.lang.String description,
long defaultValue,
long minValue,
long maxValue,
GuiNotificationTarget target)
- Creates a long property.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this propertyminValue
- the minimal value that can be assigned to this propertymaxValue
- the maximal value that can be assigned to this propertytarget
- the object to be notified as soon the state of this property changes
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent e)
- The method automatically invoked when changing the spinner status.
- Specified by:
stateChanged
in interface javax.swing.event.ChangeListener
- Parameters:
e
- The passed change event (not used).
getValue
public long 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