use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class GroupConfig method setValueGroupState.
/**
* Sets the value group state.
*/
private void setValueGroupState() {
boolean isSelected = true;
if (isShowLabel()) {
if (isOptional()) {
groupCheckbox.setEnabled(groupEnabled);
isSelected = groupCheckbox.isSelected();
} else {
groupTitle.setEnabled(groupEnabled);
}
}
for (FieldConfigBase field : getFieldConfigList()) {
CurrentFieldState fieldState = field.getFieldState();
fieldState.setGroupSelected(isSelected);
field.setFieldState(fieldState);
}
// for(GroupConfigInterface subGroup : subGroupList)
// {
// subGroup.setValueGroupState();
// }
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class MultiOptionGroup method populateOptionGroup.
/**
* Populate option group.
*
* @param fieldConfigManager the field config manager
* @param optionBox the option box
* @param groupConfigList the group config list
*/
private void populateOptionGroup(GraphicPanelFieldManager fieldConfigManager, Box optionBox, List<GroupConfigInterface> groupConfigList) {
for (GroupConfigInterface groupConfigI : groupConfigList) {
groupConfigI.createTitle(optionBox, null);
if (groupConfigI instanceof GroupConfig) {
GroupConfig groupConfig = (GroupConfig) groupConfigI;
for (FieldConfigBase field : groupConfig.getFieldConfigList()) {
field.createUI();
field.revertToDefaultValue();
FieldPanel component = field.getPanel();
optionBox.add(component);
fieldConfigManager.addField(field);
optionFieldList.add(field);
if (field instanceof FieldConfigVendorOption) {
((FieldConfigVendorOption) field).addToOptionBox(optionBox);
}
}
populateOptionGroup(fieldConfigManager, optionBox, groupConfig.getSubGroupList());
} else if (groupConfigI instanceof MultiOptionGroup) {
MultiOptionGroup multiOptionGroupConfig = (MultiOptionGroup) groupConfigI;
fieldConfigManager.addMultiOptionGroup(multiOptionGroupConfig);
multiOptionGroupConfig.createUI(fieldConfigManager, optionBox, parent, this.panelId);
}
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class ColourMapEntryPanel method setSelectedEntry.
/**
* Sets the selected entry.
*
* @param entries the new selected entry
*/
public void setSelectedEntry(List<ColorMapEntry> entries) {
if (entries == null) {
setVisible(false);
} else if (entries.size() == 1) {
setVisible(true);
ColorMapEntry entry = entries.get(0);
label.populateField(entry.getLabel());
opacity.populate(entry.getOpacity());
colour.populate(entry.getColor());
quantity.populate(entry.getQuantity());
for (FieldConfigBase field : fieldList) {
field.showOptionField(false);
}
applyButton.setEnabled(false);
} else if (entries.size() > 1) {
setVisible(true);
MultipleColourMapEntry multipleValues = new MultipleColourMapEntry();
multipleValues.parseList(entries);
ColorMapEntry entry = multipleValues.getColourMapEntry();
// Label
String labelValue = "";
if (entry.getLabel() != null) {
labelValue = entry.getLabel();
}
label.populateField(labelValue);
label.setOptionFieldValue(entry.getLabel() != null);
// Opacity
opacity.populate(entry.getOpacity());
opacity.setOptionFieldValue(entry.getOpacity() != null);
// Colour
colour.populate(entry.getColor());
colour.setOptionFieldValue(entry.getColor() != null);
// Quantity
quantity.populate(entry.getQuantity());
quantity.setOptionFieldValue(entry.getQuantity() != null);
for (FieldConfigBase field : fieldList) {
field.showOptionField(true);
}
applyButton.setEnabled(false);
} else {
setVisible(false);
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigWKT method wktValueUpdated.
/**
* Wkt value updated.
*/
@Override
public void wktValueUpdated() {
setCachedExpression(generateExpression());
checkSymbolIsValid();
FieldConfigBase parent = getParent();
if (parent != null) {
parent.valueUpdated();
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class VOGeoServerTextSymbolizer2 method setSymbolTypeVisibility.
/**
* Sets the symbol type visibility.
*
* @param panelId the panel id
* @param selectedItem the selected item
*/
private void setSymbolTypeVisibility(Class<?> panelId, String selectedItem) {
Map<GroupIdEnum, Boolean> groupList = fieldEnableState.getGroupIdList(panelId.getName(), selectedItem);
for (GroupIdEnum groupId : groupList.keySet()) {
boolean groupEnabled = groupList.get(groupId);
GroupConfigInterface groupConfig = fieldConfigManager.getGroup(getPanelId(), groupId);
if (groupConfig != null) {
groupConfig.setGroupStateOverride(groupEnabled);
} else {
ConsoleManager.getInstance().error(this, "Failed to find group : " + groupId.toString());
}
}
Map<FieldIdEnum, Boolean> fieldList = fieldEnableState.getFieldIdList(panelId.getName(), selectedItem);
for (FieldIdEnum fieldId : fieldList.keySet()) {
boolean fieldEnabled = fieldList.get(fieldId);
FieldConfigBase fieldConfig = fieldConfigManager.get(fieldId);
if (fieldConfig != null) {
CurrentFieldState fieldState = fieldConfig.getFieldState();
fieldState.setFieldEnabled(fieldEnabled);
fieldConfig.setFieldState(fieldState);
} else {
ConsoleManager.getInstance().error(this, "Failed to find field : " + fieldId.toString());
}
}
}
Aggregations