org.processmining.framework.util
Class GuiPropertyObjectList

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

public class GuiPropertyObjectList
extends java.lang.Object
implements javax.swing.event.ListSelectionListener

An object list 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 list.
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));
ArrayList values = new ArrayList(); values.add("Anne"); values.add("Maria"); GuiPropertyObjectList names = new GuiPropertyObjectList("Names", values);
testPanel.add(names.getPropertyPanel()); // add property
return testPanel;

See Also:
getAllValues, getPropertyPanel

Constructor Summary
GuiPropertyObjectList(java.lang.String name, java.util.List initialValues, java.util.List availableValues)
          Creates a string list property without a discription and notification.
GuiPropertyObjectList(java.lang.String name, java.util.List initialValues, java.util.List availableValues, GuiNotificationTarget target)
          Creates a string list without a discription.
GuiPropertyObjectList(java.lang.String name, java.lang.String description, java.util.List initialValues, java.util.List availableValues)
          Creates a string list property without notification.
GuiPropertyObjectList(java.lang.String name, java.lang.String description, java.util.List initialValues, java.util.List availableValues, GuiNotificationTarget target)
          Creates a string list property.
GuiPropertyObjectList(java.lang.String name, java.lang.String description, java.util.List initialValues, java.util.List availableValues, GuiNotificationTarget target, int height)
          Creates a string list property.
 
Method Summary
 java.util.List getAllValues()
          Retrieves all the possible values specified for this property.
 javax.swing.JPanel getPropertyPanel()
          Creates GUI panel containg this property, ready to display in some settings dialog.
 void updateGUI()
           
 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

GuiPropertyObjectList

public GuiPropertyObjectList(java.lang.String name,
                             java.util.List initialValues,
                             java.util.List 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

GuiPropertyObjectList

public GuiPropertyObjectList(java.lang.String name,
                             java.lang.String description,
                             java.util.List initialValues,
                             java.util.List 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

GuiPropertyObjectList

public GuiPropertyObjectList(java.lang.String name,
                             java.util.List initialValues,
                             java.util.List 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

GuiPropertyObjectList

public GuiPropertyObjectList(java.lang.String name,
                             java.lang.String description,
                             java.util.List initialValues,
                             java.util.List 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

GuiPropertyObjectList

public GuiPropertyObjectList(java.lang.String name,
                             java.lang.String description,
                             java.util.List initialValues,
                             java.util.List 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

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()