use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class BasePanel method handleFieldState.
/**
* Handle field state for all combo box fields.
*/
protected void handleFieldState() {
List<FieldConfigBase> fieldList = fieldConfigManager.getFields(FieldConfigEnum.class);
for (FieldConfigBase field : fieldList) {
FieldConfigEnum fieldEnum = (FieldConfigEnum) field;
Map<FieldIdEnum, Boolean> stateMap = fieldEnum.getFieldEnableState();
if (stateMap != null) {
for (FieldIdEnum fieldKey : stateMap.keySet()) {
enableField(fieldKey, stateMap.get(fieldKey));
}
}
}
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class GraphicPanelFieldManager method add.
/**
* Adds an existing GraphicPanelFieldManager to this one.
*
* @param fieldConfigManager the field config manager
*/
public void add(GraphicPanelFieldManager fieldConfigManager) {
if (fieldConfigManager != null) {
Map<FieldIdEnum, FieldConfigBase> componentMapToAdd = fieldConfigManager.fieldConfigMap.get(fieldConfigManager.panelId);
Map<FieldIdEnum, FieldConfigBase> componentMap = this.fieldConfigMap.get(fieldConfigManager.panelId);
if (componentMap == null) {
Map<FieldIdEnum, FieldConfigBase> value = fieldConfigManager.fieldConfigMap.get(fieldConfigManager.panelId);
this.fieldConfigMap.put(fieldConfigManager.panelId, value);
} else {
for (FieldIdEnum fieldId : componentMapToAdd.keySet()) {
FieldConfigBase dataToAdd = componentMapToAdd.get(fieldId);
componentMap.put(fieldId, dataToAdd);
}
}
// Add groups
Map<GroupIdEnum, GroupConfigInterface> groupMapToAdd = fieldConfigManager.groupMap.get(fieldConfigManager.panelId);
Map<GroupIdEnum, GroupConfigInterface> thisGroupMap = this.groupMap.get(fieldConfigManager.panelId);
if (thisGroupMap == null) {
Map<GroupIdEnum, GroupConfigInterface> value = fieldConfigManager.groupMap.get(fieldConfigManager.panelId);
this.groupMap.put(fieldConfigManager.panelId, value);
} else {
for (GroupIdEnum groupId : groupMapToAdd.keySet()) {
GroupConfigInterface dataToAdd = groupMapToAdd.get(groupId);
thisGroupMap.put(groupId, dataToAdd);
}
}
}
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class GraphicPanelFieldManager method getFields.
/**
* Gets the fields for the given class type, if class type is null then all are returned.
*
* @param fieldType the field type
* @return the fields
*/
public List<FieldConfigBase> getFields(Class<?> fieldType) {
List<FieldConfigBase> fieldList = new ArrayList<FieldConfigBase>();
Map<FieldIdEnum, FieldConfigBase> panelMap = fieldConfigMap.get(panelId);
if (panelMap != null) {
for (FieldConfigBase field : panelMap.values()) {
if ((fieldType == null) || field.getClass() == fieldType) {
fieldList.add(field);
}
}
}
return fieldList;
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class GraphicPanelFieldManager method getData.
/**
* Gets the data.
*
* @param requestedPanelId the requested panel id
* @param requestedField the requested field
* @return the data
*/
public FieldConfigBase getData(Class<?> requestedPanelId, FieldIdEnum requestedField) {
FieldConfigBase retVal = null;
Map<FieldIdEnum, FieldConfigBase> panelMap = fieldConfigMap.get(requestedPanelId);
if (panelMap != null) {
retVal = panelMap.get(requestedField);
}
return retVal;
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class PointFillDetails 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());
}
}
}
Aggregations