org.processmining.framework.util
Class GuiPropertyStringList

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

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

A string 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 string values.
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 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"); GUIPropertyStringList names = new GUIPropertyStringList("Names", values);
testPanel.add(names.getPropertyPanel()); // add property
return testPanel;

See Also:
getAllValues, getPropertyPanel

Constructor Summary
GuiPropertyStringList(java.lang.String name, java.util.List<java.lang.String> values)
          Creates a string list property without a discription and notification.
GuiPropertyStringList(java.lang.String name, java.util.List<java.lang.String> values, GuiNotificationTarget target)
          Creates a string list without a discription.
GuiPropertyStringList(java.lang.String name, java.lang.String description, java.util.List<java.lang.String> values)
          Creates a string list property without notification.
GuiPropertyStringList(java.lang.String name, java.lang.String description, java.util.List<java.lang.String> values, GuiNotificationTarget target)
          Creates a string list property.
GuiPropertyStringList(java.lang.String name, java.lang.String description, java.util.List<java.lang.String> values, GuiNotificationTarget target, int height)
          Creates a string list property.
 
Method Summary
 java.util.List<java.lang.String> 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 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

GuiPropertyStringList

public GuiPropertyStringList(java.lang.String name,
                             java.util.List<java.lang.String> values)
Creates a string list property without a discription and notification.

Parameters:
name - the name of this property
values - the initial string values of this property

GuiPropertyStringList

public GuiPropertyStringList(java.lang.String name,
                             java.lang.String description,
                             java.util.List<java.lang.String> values)
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)
values - the initial string values of this property

GuiPropertyStringList

public GuiPropertyStringList(java.lang.String name,
                             java.util.List<java.lang.String> values,
                             GuiNotificationTarget target)
Creates a string list without a discription.

Parameters:
name - the name of this property
values - the initial string values of this property
target - the object to be notified as soon the state of this property changes

GuiPropertyStringList

public GuiPropertyStringList(java.lang.String name,
                             java.lang.String description,
                             java.util.List<java.lang.String> values,
                             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)
values - the initial string values of this property
target - the object to be notified as soon the state of this property changes

GuiPropertyStringList

public GuiPropertyStringList(java.lang.String name,
                             java.lang.String description,
                             java.util.List<java.lang.String> values,
                             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)
values - the initial string values of this property
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 50)
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<java.lang.String> 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