org.processmining.framework.util
Class GuiPropertyObjectSet

java.lang.Object
  extended by org.processmining.framework.util.GuiPropertyObjectSet
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener, GuiNotificationTarget

public class GuiPropertyObjectSet
extends java.lang.Object
implements javax.swing.event.ListSelectionListener, GuiNotificationTarget

An object set property that can be readily displayed as it maintains its own GUI panel. The property will be graphically represented as a list including buttons to add or remove values available in the initially provided object set.
Changes performed via the GUI will be immedeately propagated to the internally held property values. Furthermore, a notification target may be specified in order to be informed as soon as the list of values 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));
HashSet values = new HashSet(); values.add("Anne"); values.add("Maria"); GuiPropertyObjectSet names = new GuiPropertyObjectSet("Names", values);
testPanel.add(names.getPropertyPanel()); // add property
return testPanel;

See Also:
getAllValues, getPropertyPanel

Constructor Summary
GuiPropertyObjectSet(java.lang.String name, java.util.List initialValues, java.util.Set availableValues)
          Creates a string list property without a discription and notification.
GuiPropertyObjectSet(java.lang.String name, java.util.List initialValues, java.util.Set availableValues, GuiNotificationTarget target)
          Creates a string list without a discription.
GuiPropertyObjectSet(java.lang.String name, java.lang.String description, java.util.List initialValues, java.util.Set availableValues)
          Creates a string list property without notification.
GuiPropertyObjectSet(java.lang.String name, java.lang.String description, java.util.List initialValues, java.util.Set availableValues, GuiNotificationTarget target)
          Creates a string list property.
GuiPropertyObjectSet(java.lang.String name, java.lang.String description, java.util.List initialValues, java.util.Set availableValues, GuiNotificationTarget target, int height)
          Creates a string list property.
GuiPropertyObjectSet(java.lang.String name, java.lang.String description, java.util.List initialValues, java.util.Set availableValues, java.util.List propertyInitialValues, java.util.HashMap initialValuesAndInitValProp, GuiNotificationTarget target)
          Creates a string list property.
 
Method Summary
 java.util.List getAllValues()
          Retrieves all the possible values specified for this property.
 java.util.HashMap getAllValuesWithProperty()
          Retrieves all the possible values specified for this property together with the property that is specified for each possible value
 javax.swing.JPanel getPropertyPanel()
          Creates GUI panel containg this property, ready to display in some settings dialog.
 void updateGUI()
          This method will be called as soon as the associated GUI property has changed.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Method to be automatically invoked as soon as the selection of the list changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiPropertyObjectSet

public GuiPropertyObjectSet(java.lang.String name,
                            java.util.List initialValues,
                            java.util.Set availableValues)
Creates a string list property without a discription and notification.

Parameters:
name - the name of this property
initialValues - the initial values of this property. The objects in this list should either be simple strings or override the toString() method, which is then displayed as the name of this value in the ComboBox
availableValues - the available values of this property. The objects in this list should be of the same type as the initial values. Furthermore they should contain the initial values

GuiPropertyObjectSet

public GuiPropertyObjectSet(java.lang.String name,
                            java.lang.String description,
                            java.util.List initialValues,
                            java.util.Set availableValues)
Creates a string list property without notification.

Parameters:
name - the name of this property
description - of this property (to be displayed as a tool tip)
initialValues - the initial values of this property. The objects in this list should either be simple strings or override the toString() method, which is then displayed as the name of this value in the ComboBox
availableValues - the available values of this property. The objects in this list should be of the same type as the initial values. Furthermore they should contain the initial values

GuiPropertyObjectSet

public GuiPropertyObjectSet(java.lang.String name,
                            java.util.List initialValues,
                            java.util.Set availableValues,
                            GuiNotificationTarget target)
Creates a string list without a discription.

Parameters:
name - the name of this property
initialValues - the initial values of this property. The objects in this list should either be simple strings or override the toString() method, which is then displayed as the name of this value in the ComboBox
availableValues - the available values of this property. The objects in this list should be of the same type as the initial values. Furthermore they should contain the initial values
target - the object to be notified as soon the state of this property changes

GuiPropertyObjectSet

public GuiPropertyObjectSet(java.lang.String name,
                            java.lang.String description,
                            java.util.List initialValues,
                            java.util.Set availableValues,
                            GuiNotificationTarget target)
Creates a string list property.

Parameters:
name - the name of this property
description - of this property (to be displayed as a tool tip)
initialValues - the initial values of this property. The objects in this list should either be simple strings or override the toString() method, which is then displayed as the name of this value in the ComboBox
availableValues - the available values of this property. The objects in this list should be of the same type as the initial values. Furthermore they should contain the initial values
target - the object to be notified as soon the state of this property changes

GuiPropertyObjectSet

public GuiPropertyObjectSet(java.lang.String name,
                            java.lang.String description,
                            java.util.List initialValues,
                            java.util.Set availableValues,
                            java.util.List propertyInitialValues,
                            java.util.HashMap initialValuesAndInitValProp,
                            GuiNotificationTarget target)
Creates a string list property. Furthermore, for each value in the string list it is also possible to select between a set of different values that belongs to each value in the string list and which is presented as a separate combobox in the GUI. So for each value in the string list there exists one additional property for which one value can be chosen.

Parameters:
name - String the name of this property
description - String the description of this property (to be displayed as a tool tip)
initialValues - List the initial values of this property. The objects in this list should either be simple strings or override the toString() method, which is then displayed as the name of this value in the ComboBox
availableValues - Set the available values of this property. The objects in this list should be of the same type as the initial values. Furthermore they should contain the initial values
propertyInitialValues - List a list of different values that belongs to each value in the string list and from which one can be selected
initialValuesAndInitValProp - HashMap for each value in the string list a default value needs to be defined for the set of different values that belongs to each value in the string list (for the property that belongs to each value in the string list).
target - GuiNotificationTarget the object to be notified as soon the state of this property changes

GuiPropertyObjectSet

public GuiPropertyObjectSet(java.lang.String name,
                            java.lang.String description,
                            java.util.List initialValues,
                            java.util.Set availableValues,
                            GuiNotificationTarget target,
                            int height)
Creates a string list property.

Parameters:
name - the name of this property
description - of this property (to be displayed as a tool tip)
initialValues - the initial values of this property. The objects in this list should either be simple strings or override the toString() method, which is then displayed as the name of this value in the ComboBox
availableValues - the available values of this property. The objects in this list should be of the same type as the initial values. Furthermore they should contain the initial values
target - the object to be notified as soon the state of this property changes
height - the preferred height for the list property (default value is 70)
Method Detail

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Method to be automatically invoked as soon as the selection of the list changes.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

getAllValues

public java.util.List getAllValues()
Retrieves all the possible values specified for this property.

Returns:
all possible values

getAllValuesWithProperty

public java.util.HashMap getAllValuesWithProperty()
Retrieves all the possible values specified for this property together with the property that is specified for each possible value

Returns:
TreeMap

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

updateGUI

public void updateGUI()
Description copied from interface: GuiNotificationTarget
This method will be called as soon as the associated GUI property has changed.
Using this callback technique the reaction to changes of the GUI property becomes possible in a decoupled way.

Specified by:
updateGUI in interface GuiNotificationTarget