Class JComboBoxWithImageIconItems

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

public class JComboBoxWithImageIconItems extends JComboBox implements Serializable
A JComboBox which items are ImageIcons.
Author:
Pablo Piqueras Bartolomé (p_queras@hotmail.com)
See Also:
  • Field Details

  • Constructor Details

    • JComboBoxWithImageIconItems

      public JComboBoxWithImageIconItems()
      Default constructor
    • JComboBoxWithImageIconItems

      public JComboBoxWithImageIconItems(ComboBoxImageIconModel aModel)
      Default constructor with a 'ComboBoxImageIconModel' as parameter
      Parameters:
      aModel - org.gvsig.gui.beans.swing.jComboBoxWithImageIconItems.JComboBoxWithImageIconItems.ComboBoxImageIconModel
    • JComboBoxWithImageIconItems

      public JComboBoxWithImageIconItems(Object[] items)
      Default constructor with an array of 'ImageIconItemInfo' as parameters
      Parameters:
      items - Each item must be an 'ImageIconItemInfo' object
    • JComboBoxWithImageIconItems

      public JComboBoxWithImageIconItems(Vector items)
      Default constructor with a Vector of 'ImageIconItemInfo' as parameter
      Parameters:
      items - Each item must be an 'ImageIconItemInfo' object
  • Method Details

    • addImageIconItem

      public void addImageIconItem(String imageIconPath, ImageIcon imageIcon, String imageIconToolTipText, Object item_Value)
      Adds an image icon URL path, image icon loaded (or null if not), tool tip text (tool tip text could be "") and if it's neccessary (it's optional) another associated value to this item (if there is no associated value, the 'item_Value' param should be null)
      Parameters:
      imageIconPath - A path
      imageIcon - An image icon loaded or null if haven't been loaded
      imageIconToolTipText - Text
      item_Value - Another extra value associated to the item added (null if no extra value)
    • addImageIconItem

      public void addImageIconItem(ImageIconItemInfo imageIconItem)
      Adds an image icon URL path, image icon loaded (or null if not), and tool tip text (tool tip text could be "")
      Parameters:
      imageIconItem - Information for load an image icon and set its tool tip text
    • removeImageIconItem

      public void removeImageIconItem(String imageIconPath, String imageIconToolTipText, String item_Value)
      Adds an image icon URL path, tool tip text (tool tip text could be "") and the item value If no item matches, does nothing (The image icon parameter is ignored)
      Parameters:
      imageIconPath - A path
      imageIconToolTipText - Text
      item_Value - An extra value
    • removeImageIconItem

      public void removeImageIconItem(ImageIconItemInfo imageIconItem)
      Removes an image icon URL path, tool tip text (tool tip text could be "") and the item value If no item matches, does nothing (The image icon parameter is ignored)
      Parameters:
      imageIconPath - Information for remove the item
    • removeAllImageIconItems

      public void removeAllImageIconItems()
      Removes all image icons
    • addImageIconItems

      public void addImageIconItems(ImageIconItemInfo[] imageIconItems)
      Sets some image icons that their information to load is stored in an array of ImageIconItemInfo
      Parameters:
      imagePaths - An array of ImageIconItemInfo with the URL path, image icon loaded (or null if not), and tool tip text to each image
    • addImageIconItems

      public void addImageIconItems(Vector imageIconItems)
      Sets some image icons that their information to load is stored in a Vector of ImageIconItemInfo
      Parameters:
      imagePaths - A Vector of ImageIconItemInfo with the URL path, image icon loaded (or null if not), and tool tip text to each image
    • removeImageIconItems

      public void removeImageIconItems(ImageIconItemInfo[] imageIconItems)
      Removes some image icons that their path, tool tip text and item value are stored in an array If no item matches, does nothing (The image icon parameter is ignored)
      Parameters:
      imageIconPaths - An array with the ImageIconItemInfo
    • removeImageIconItems

      public void removeImageIconItems(Vector imageIconItems)
      Removes some image icons that their paths, tool tip text and item value are stored in a Vector (The image icon parameter is ignored)
      Parameters:
      imageIconPaths - A Vector with the ImageIconItemInfo
    • setShowImageIconAndTextProperty

      public void setShowImageIconAndTextProperty(boolean b)
      See Also:
    • getShowImageIconAndTextProperty

      public boolean getShowImageIconAndTextProperty()
      See Also:
    • setJComboBoxRendererPreferredSize

      public void setJComboBoxRendererPreferredSize(Dimension d)
      See Also:
      • invalid reference
        ComboBoxRenderer#setPreferredSize(Dimension)
    • getJComboBoxRendererPreferredSize

      public Dimension getJComboBoxRendererPreferredSize()
      See Also:
      • invalid reference
        ComboBoxRenderer#getPreferredSize()