Class AttributeValueChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class AttributeValueChooser extends JPanel

The AttributeValueChooser provides two components: one that can be used to select a feature attribute, and a second that can be used to select a value for that feature attribute. The value component automatically reconfigures based on the attribute type.

The chooser signals a change by firing one or more PropertyChangeEvent objects with property name as follows:

  • ATTRIBUTE_PROPERTY if the attribute name is changed -- new value is attribute.
  • VALUE_PROPERTY if the attribute value is changed -- new value is attribute value.
  • STATE_PROPERTY if the attribute name, value, or type is changed -- new value is Object array containing attribute and value.
Since:
3.3.2
Author:
Peter Hollemans
See Also:
  • Field Details

    • ATTRIBUTE_PROPERTY

      public static final String ATTRIBUTE_PROPERTY
      The name for attribute property change events.
      See Also:
    • VALUE_PROPERTY

      public static final String VALUE_PROPERTY
      The name for value property change events.
      See Also:
    • STATE_PROPERTY

      public static final String STATE_PROPERTY
      The name for state property change events.
      See Also:
  • Constructor Details

    • AttributeValueChooser

      public AttributeValueChooser(List<Attribute> attributeList, TimeWindow defaultTimeWindow)
      Creates a new chooser.
      Parameters:
      attributeList - the list of attributes to choose from.
      defaultTimeWindow - the default time window to use for Date attributes.
    • AttributeValueChooser

      public AttributeValueChooser(List<Attribute> attributeList, Date defaultDate)
      Creates a new chooser.
      Parameters:
      attributeList - the list of attributes to choose from.
      defaultDate - the default date to use for date attributes.
  • Method Details

    • setAttributeAndValue

      public void setAttributeAndValue(Attribute att, Object value)
      Sets the attribute and value displayed by the chooser. No property change events are fired during this operation.
      Parameters:
      att - the attribute to set.
      value - the value to set for the attribute.
    • getAttribute

      public Attribute getAttribute()
      Gets the current attribute in the chooser.
      Returns:
      the attribute selected.
    • getValue

      public Object getValue()
      Gets the current attribute value.
      Returns:
      the value selected.
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • main

      public static void main(String[] argv)
      Tests this class.
      Parameters:
      argv - the array of command line parameters.