Class JComboBoxUnits

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
org.gvsig.utils.swing.JComboBox
org.gvsig.app.gui.JComboBoxUnits
All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class JComboBoxUnits extends org.gvsig.utils.swing.JComboBox

Class representing a JComboBox with the measure units handled by the application. It takes values from Attributes.NAMES and Attributes.CHANGE static fields. So, to add more measure units, you must edit Attributes class and change will be automatically reflected in the combo box.

The internatiolanization of the field is automatically handled by the system

Author:
jaume dominguez faus - jaume.dominguez@iver.es
See Also:
  • Constructor Details

    • JComboBoxUnits

      public JComboBoxUnits()
      Creates a new instance of JUnitComboBox including "pixel" units and setting them as automatically pre-selected.
    • JComboBoxUnits

      public JComboBoxUnits(boolean includePixel)
      Creates a new instance of JUnitComboBox. If includePixel is true then pixel units are included in the list and they are automatically pre-selected. Otherwise, meters are preselected.
  • Method Details

    • getUnitConversionFactor

      public double getUnitConversionFactor()
      Returns the conversion factor from the unit selected in the combo box to meters or 0 if pixels have been selected as the size unit.
      Returns:
    • addItem

      public void addItem(Object anObject)
      the use of this method is not allowed in this combo box.
      Overrides:
      addItem in class JComboBox
    • removeAllItems

      public void removeAllItems()
      the use of this method is not allowed for this combo box.
      Overrides:
      removeAllItems in class JComboBox
    • getSelectedUnitIndex

      public int getSelectedUnitIndex()
    • setSelectedUnitIndex

      public void setSelectedUnitIndex(int unitIndex)