use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class FieldConfigFont method populateFontFamilyList.
/**
* Populate font family list.
*/
private synchronized void populateFontFamilyList() {
if (fontFamilyList == null) {
fontFamilyList = new ArrayList<ValueComboBoxData>();
String[] families = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
for (String fontFamily : families) {
fontFamilyList.add(new ValueComboBoxData(fontFamily, fontFamily, getPanelId()));
}
}
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class FieldState method populateSymbolList.
/**
* Populate symbol list.
*
* @param panelDetails the panel details the configuration is for
* @param symbolList the symbol list
*/
public void populateSymbolList(Class<?> panelDetails, List<ValueComboBoxDataGroup> symbolList) {
List<SymbolTypeConfig> configList = getFieldMap().get(panelDetails);
if (configList == null) {
ConsoleManager.getInstance().error(this, "No config for panel details class : " + panelDetails.getName());
} else {
if (localSymbolList == null) {
localSymbolList = new ArrayList<ValueComboBoxData>();
} else {
localSymbolList.clear();
}
for (SymbolTypeConfig config : configList) {
List<ValueComboBoxData> groupSymbolList = new ArrayList<ValueComboBoxData>();
for (String key : config.getKeyOrderList()) {
ValueComboBoxData data = new ValueComboBoxData(key, config.getTitle(key), this.getVendorOption(), config.getPanelId());
groupSymbolList.add(data);
}
symbolList.add(new ValueComboBoxDataGroup(config.getGroupName(), groupSymbolList, config.isSeparateGroup()));
localSymbolList.addAll(groupSymbolList);
}
}
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class SymbolTypeFactory method getFill.
/**
* Gets the fill for the selected value.
*
* @param graphicFill the graphic fill
* @param fieldConfigManager the field config manager
* @return the fill
*/
public Fill getFill(GraphicFill graphicFill, GraphicPanelFieldManager fieldConfigManager) {
Fill fill = null;
ValueComboBoxData obj = symbolTypeField.getSelectedValueObj();
if (obj != null) {
if (!isNone(obj.getKey())) {
FieldState panel = classMap.get(obj.getPanelId());
if (panel != null) {
fill = panel.getFill(graphicFill, fieldConfigManager);
}
}
}
return fill;
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class MultiOptionGroup method getSelectedOptionGroup.
/**
* Gets the selected option group.
*
* @return the selected option group
*/
public OptionGroup getSelectedOptionGroup() {
if (comboBox == null) {
return null;
}
ValueComboBoxData selectedItem = comboBox.getSelectedValue();
String key = selectedItem.getKey();
return optionMap.get(key);
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class FieldConfigEnum method redoAction.
/**
* Redo action.
*
* @param undoRedoObject the undo redo object
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.undo.UndoActionInterface#redoAction(com.sldeditor.undo.UndoInterface)
*/
@Override
public void redoAction(UndoInterface undoRedoObject) {
if ((comboBox != null) && (undoRedoObject != null)) {
if (undoRedoObject.getNewValue() instanceof String) {
String oldValue = (String) undoRedoObject.getNewValue();
ValueComboBoxData valueComboBoxData = comboDataMap.get(oldValue);
if (valueComboBoxData != null) {
comboBox.setSelectedItem(valueComboBoxData);
}
}
}
}
Aggregations