Search in sources :

Example 1 with MenuComboBox

use of com.sldeditor.ui.menucombobox.MenuComboBox in project sldeditor by robward-scisys.

the class FieldConfigSymbolType method createUI.

/**
 * Creates the ui.
 */
@Override
public void createUI() {
    if (comboBox == null) {
        int xPos = getXPos();
        comboBox = new MenuComboBox(this);
        comboBox.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
        // Register for changes in vendor option selections
        VendorOptionManager.getInstance().addVendorOptionListener(comboBox);
        FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
        fieldPanel.add(comboBox);
        if (!isValueOnly()) {
            setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(String.class, this, isRasterSymbol()));
        }
        // Create
        containingPanel = new JPanel();
        containingPanel.setLayout(new CardLayout());
        containingPanel.setBounds(0, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT * 3);
        addCustomPanel(containingPanel);
    }
}
Also used : JPanel(javax.swing.JPanel) CardLayout(java.awt.CardLayout) MenuComboBox(com.sldeditor.ui.menucombobox.MenuComboBox) FieldPanel(com.sldeditor.ui.widgets.FieldPanel)

Example 2 with MenuComboBox

use of com.sldeditor.ui.menucombobox.MenuComboBox in project sldeditor by robward-scisys.

the class VersionCellEditor method getTableCellEditorComponent.

/*
     * (non-Javadoc)
     * 
     * @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable,
     * java.lang.Object, boolean, int, int)
     */
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    selectedRowIndex = row;
    if (value instanceof VersionData) {
        this.versionData = (VersionData) value;
    }
    listVersionData = model.getVendorOption(row);
    MenuComboBox comboVersionData = new MenuComboBox(this);
    List<ValueComboBoxDataGroup> dataSelectionList = VendorOptionMenuUtils.createMenu(listVersionData);
    comboVersionData.vendorOptionsUpdated(listVersionData);
    comboVersionData.initialiseMenu(dataSelectionList);
    VendorOptionMenuUtils.setSelected(comboVersionData, this.versionData);
    if (isSelected) {
        comboVersionData.setBackground(table.getSelectionBackground());
    } else {
        comboVersionData.setBackground(table.getSelectionForeground());
    }
    return comboVersionData;
}
Also used : ValueComboBoxDataGroup(com.sldeditor.ui.widgets.ValueComboBoxDataGroup) MenuComboBox(com.sldeditor.ui.menucombobox.MenuComboBox) VersionData(com.sldeditor.common.vendoroption.VersionData)

Aggregations

MenuComboBox (com.sldeditor.ui.menucombobox.MenuComboBox)2 VersionData (com.sldeditor.common.vendoroption.VersionData)1 FieldPanel (com.sldeditor.ui.widgets.FieldPanel)1 ValueComboBoxDataGroup (com.sldeditor.ui.widgets.ValueComboBoxDataGroup)1 CardLayout (java.awt.CardLayout)1 JPanel (javax.swing.JPanel)1