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);
}
}
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;
}
Aggregations