FileDocCategorySizeDatePackage
MapComboBoxModel.javaAPI DocExample1063Mon Jan 09 11:01:58 GMT 2006None

MapComboBoxModel

public class MapComboBoxModel extends ListComboBoxModel

Fields Summary
protected Map
map_data
protected List
index
Constructors Summary
public MapComboBoxModel()

        this.map_data = new HashMap();
        index = new ArrayList();
    
public MapComboBoxModel(Map map)

        this.map_data = map;
        buildIndex();
        if(index.size() > 0) {
            selected = index.get(0);
        }
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent evt)

        if(evt.getActionCommand().equals("update")) {
            buildIndex();
            fireUpdate();
        }
    
protected voidbuildIndex()

        index = new ArrayList(map_data.keySet());
    
public java.lang.ObjectgetElementAt(int i)

        return index.get(i);
    
public intgetSize()

        return map_data.size();
    
public java.lang.ObjectgetValue(java.lang.Object selectedItem)

        return map_data.get(selectedItem);
    
public java.lang.ObjectgetValue(int selectedItem)

        return getValue(index.get(selectedItem));