use of com.sldeditor.common.xml.ui.GroupIdEnum in project sldeditor by robward-scisys.
the class SymbolTypeConfig method updateFieldState.
/**
* Gets the optimised field map, contains only the fields that
* should be enabled when the option is selected.
*
* @param fieldEnableState the field enable state
* @param panelName the panel name
*/
public void updateFieldState(FieldEnableState fieldEnableState, String panelName) {
for (String menuOption : keyOrderList) {
Map<FieldIdEnum, Boolean> fieldList = new HashMap<FieldIdEnum, Boolean>();
for (FieldIdEnum fieldKey : fieldMap.keySet()) {
boolean value = fieldMap.get(fieldKey);
fieldList.put(fieldKey, value);
}
Map<GroupIdEnum, Boolean> groupList = new HashMap<GroupIdEnum, Boolean>();
for (GroupIdEnum groupKey : groupMap.keySet()) {
boolean value = groupMap.get(groupKey);
groupList.put(groupKey, value);
}
if (fieldEnableState != null) {
fieldEnableState.add(panelName, menuOption, fieldList, groupList);
}
}
}
use of com.sldeditor.common.xml.ui.GroupIdEnum 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());
}
}
}
use of com.sldeditor.common.xml.ui.GroupIdEnum in project sldeditor by robward-scisys.
the class PolygonFillDetails 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(this.getClass(), 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());
}
}
}
use of com.sldeditor.common.xml.ui.GroupIdEnum in project sldeditor by robward-scisys.
the class RasterSymbolizerDetails method populateContrastMethod.
/**
* Populate contrast method.
*
* @param contrastEnhancement the contrast enhancement
* @param contrastMethodGroup the contrast method group
*/
private void populateContrastMethod(ContrastEnhancement contrastEnhancement, GroupIdEnum contrastMethodGroup) {
GroupConfigInterface group = getGroup(contrastMethodGroup);
if (group != null) {
GroupIdEnum selectedNormalizeMethod = GroupIdEnum.UNKNOWN;
MultiOptionGroup contrastNormalizeMethodGroup = (MultiOptionGroup) group;
if (contrastEnhancement != null) {
ContrastMethod contrastMethod = contrastEnhancement.getMethod();
if (contrastMethod != null) {
String contrastMethodString = contrastMethod.name();
for (OptionGroup option : contrastNormalizeMethodGroup.getGroupList()) {
if (option.getLabel().compareToIgnoreCase(contrastMethodString) == 0) {
selectedNormalizeMethod = option.getId();
}
}
}
}
contrastNormalizeMethodGroup.setOption(selectedNormalizeMethod);
}
}
use of com.sldeditor.common.xml.ui.GroupIdEnum in project sldeditor by robward-scisys.
the class ColourFieldConfigTest method testColourFieldConfig.
/**
* Test method for {@link com.sldeditor.ui.detail.ColourFieldConfig#ColourFieldConfig(com.sldeditor.common.xml.ui.FieldIdEnum, com.sldeditor.common.xml.ui.FieldIdEnum, com.sldeditor.common.xml.ui.FieldIdEnum)}.
* Test method for {@link com.sldeditor.ui.detail.ColourFieldConfig#getColour()}.
* Test method for {@link com.sldeditor.ui.detail.ColourFieldConfig#getOpacity()}.
* Test method for {@link com.sldeditor.ui.detail.ColourFieldConfig#getWidth()}.
*/
@Test
public void testColourFieldConfig() {
GroupIdEnum groupId = GroupIdEnum.FILLCOLOUR;
FieldIdEnum strokeFillColour = FieldIdEnum.STROKE_FILL_COLOUR;
FieldIdEnum strokeFillOpacity = FieldIdEnum.OVERALL_OPACITY;
FieldIdEnum strokeFillWidth = FieldIdEnum.STROKE_FILL_WIDTH;
ColourFieldConfig config = new ColourFieldConfig(groupId, strokeFillColour, strokeFillOpacity, strokeFillWidth);
assertEquals(groupId, config.getGroup());
assertEquals(strokeFillColour, config.getColour());
assertEquals(strokeFillOpacity, config.getOpacity());
assertEquals(strokeFillWidth, config.getWidth());
}
Aggregations