use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class GroupConfig method setGroupStateOverride.
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.base.GroupConfigInterface#setGroupStateOverride(boolean)
*/
@Override
public void setGroupStateOverride(boolean enabled) {
groupEnabled = enabled;
for (FieldConfigBase field : getFieldConfigList()) {
CurrentFieldState fieldState = field.getFieldState();
fieldState.setGroupEnabled(groupEnabled);
fieldState.setFieldEnabled(groupEnabled);
field.setFieldState(fieldState);
}
setValueGroupState();
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class MultiOptionGroup method removeOptionFields.
/**
* Removes the option fields from the previous selection.
*
* @param box the box
* @param fieldConfigManager the field config manager
*/
private void removeOptionFields(Box box, GraphicPanelFieldManager fieldConfigManager) {
if (optionPanel != null) {
box.remove(optionPanel);
for (FieldConfigBase field : optionFieldList) {
fieldConfigManager.removeField(field);
}
optionFieldList.clear();
optionPanel = null;
box.revalidate();
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class StrokeDetails 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.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigWindBarbs method windBarbValueUpdated.
/**
* Wind barb value updated.
*/
@Override
public void windBarbValueUpdated() {
setCachedExpression(generateExpression());
FieldConfigBase parent = getParent();
if (parent != null) {
parent.valueUpdated();
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigWKT method getValue.
/**
* Gets the value.
*
* @param fieldConfigManager the field config manager
* @param symbolType the symbol type
* @param fillEnabled the fill enabled
* @param strokeEnabled the stroke enabled
* @return the value
*/
@Override
public List<GraphicalSymbol> getValue(GraphicPanelFieldManager fieldConfigManager, Expression symbolType, boolean fillEnabled, boolean strokeEnabled) {
List<GraphicalSymbol> symbolList = new ArrayList<GraphicalSymbol>();
if (fieldConfigManager != null) {
Expression wellKnownName = null;
if (getConfigField() != null) {
wellKnownName = getConfigField().getExpression();
if (wellKnownName != null) {
Stroke stroke = null;
Fill fill = null;
// Stroke colour
FieldConfigBase field = null;
if (strokeEnabled) {
Expression expStrokeColour = null;
Expression expStrokeColourOpacity = null;
field = fieldConfigManager.get(this.strokeFieldConfig.getColour());
if (field != null) {
if (field instanceof FieldConfigColour) {
FieldConfigColour colourField = (FieldConfigColour) field;
expStrokeColour = colourField.getColourExpression();
}
}
// Stroke width
Expression strokeWidth = null;
field = fieldConfigManager.get(this.strokeFieldConfig.getWidth());
if (field != null) {
strokeWidth = field.getExpression();
}
// Opacity
field = fieldConfigManager.get(this.strokeFieldConfig.getOpacity());
if (field != null) {
expStrokeColourOpacity = field.getExpression();
}
stroke = getStyleFactory().createStroke(expStrokeColour, strokeWidth, expStrokeColourOpacity);
}
// Fill colour
if (fillEnabled) {
Expression expFillColour = null;
Expression expFillColourOpacity = null;
field = fieldConfigManager.get(this.fillFieldConfig.getColour());
if (field != null) {
if (field instanceof FieldConfigColour) {
FieldConfigColour colourField = (FieldConfigColour) field;
expFillColour = colourField.getColourExpression();
}
}
// Opacity
field = fieldConfigManager.get(this.fillFieldConfig.getOpacity());
if (field != null) {
expFillColourOpacity = field.getExpression();
}
fill = getStyleFactory().createFill(expFillColour, expFillColourOpacity);
}
Expression symbolSize = null;
field = fieldConfigManager.get(FieldIdEnum.STROKE_SYMBOL_SIZE);
if (field != null) {
symbolSize = field.getExpression();
}
Expression rotation = null;
Mark mark = getStyleFactory().createMark(wellKnownName, stroke, fill, symbolSize, rotation);
symbolList.add(mark);
}
}
}
return symbolList;
}
Aggregations