use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigFilename method setValue.
/**
* Sets the value.
*
* @param symbolizerType the symbolizer type
* @param fieldConfigManager the field config manager
* @param multiOptionPanel the multi option panel
* @param graphic the graphic
* @param symbol the symbol
*/
@Override
public void setValue(Class<?> symbolizerType, GraphicPanelFieldManager fieldConfigManager, FieldConfigSymbolType multiOptionPanel, Graphic graphic, GraphicalSymbol symbol) {
if (symbol instanceof ExternalGraphicImpl) {
ExternalGraphicImpl markerSymbol = (ExternalGraphicImpl) symbol;
if (externalGraphicPanel != null) {
externalGraphicPanel.setValue(markerSymbol);
}
if (multiOptionPanel != null) {
multiOptionPanel.setSelectedItem(EXTERNAL_SYMBOL_KEY);
}
FieldConfigBase opacity = fieldConfigManager.get(FieldIdEnum.OVERALL_OPACITY);
if (opacity != null) {
opacity.populate(graphic.getOpacity());
}
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class VOGeoServerLabelling method includeValue.
/**
* Find out whether to include value based on the value of another field.
*
* @param field the field
* @return true, if successful
*/
private boolean includeValue(FieldIdEnum field) {
DefaultOverride override = overrideMap.get(field);
if (override != null) {
String value = null;
FieldConfigBase fieldConfig = fieldConfigManager.get(override.getField());
if (fieldConfig instanceof FieldConfigBoolean) {
value = String.valueOf(fieldConfigVisitor.getBoolean(override.getField()));
} else if (fieldConfig instanceof FieldConfigInteger) {
value = String.valueOf(fieldConfigVisitor.getInteger(override.getField()));
} else if (fieldConfig instanceof FieldConfigDouble) {
value = String.valueOf(fieldConfigVisitor.getDouble(override.getField()));
} else if (fieldConfig instanceof FieldConfigEnum) {
value = String.valueOf(fieldConfigVisitor.getComboBox(override.getField()));
} else {
ConsoleManager.getInstance().error(this, "Unsupported field type : " + field + " " + fieldConfig.getClass().getName());
}
if (value != null) {
for (String legalValue : override.getLegalValues()) {
if (value.compareToIgnoreCase(legalValue) == 0) {
return true;
}
}
}
}
return false;
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigArrow method arrowValueUpdated.
/**
* Arrow value updated.
*/
@Override
public void arrowValueUpdated() {
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 FieldConfigTTF method setValue.
/**
* Sets the value.
*
* @param symbolizerType the symbolizer type
* @param fieldConfigManager the field config manager
* @param multiOptionPanel the multi option panel
* @param graphic the graphic
* @param symbol the symbol
*/
@Override
public void setValue(Class<?> symbolizerType, GraphicPanelFieldManager fieldConfigManager, FieldConfigSymbolType multiOptionPanel, Graphic graphic, GraphicalSymbol symbol) {
if (symbol == null) {
return;
}
if (fieldConfigManager == null) {
return;
}
MarkImpl markerSymbol = (MarkImpl) symbol;
FillImpl fill = markerSymbol.getFill();
Expression expFillColour = null;
Expression expFillOpacity = null;
if (fill != null) {
expFillColour = fill.getColor();
if (!isOverallOpacity(symbolizerType)) {
expFillOpacity = fill.getOpacity();
}
}
FieldConfigBase field = fieldConfigManager.get(fillFieldConfig.getColour());
if (field != null) {
field.populate(expFillColour);
}
// Opacity
if (isOverallOpacity(symbolizerType)) {
FieldConfigBase opacity = fieldConfigManager.get(FieldIdEnum.OVERALL_OPACITY);
if (opacity != null) {
opacity.populate(graphic.getOpacity());
}
}
field = fieldConfigManager.get(fillFieldConfig.getOpacity());
if (field != null) {
field.populate(expFillOpacity);
}
Class<?> panelId = getCommonData().getPanelId();
GroupConfigInterface fillGroup = fieldConfigManager.getGroup(panelId, fillFieldConfig.getGroup());
if (fillGroup != null) {
fillGroup.enable(expFillColour != null);
}
if (ttfPanel != null) {
Expression wellKnownNameExpression = markerSymbol.getWellKnownName();
String wellKnownName = null;
if (wellKnownNameExpression != null) {
wellKnownName = wellKnownNameExpression.toString();
}
ttfPanel.populateExpression(wellKnownName);
}
if (multiOptionPanel != null) {
multiOptionPanel.setSelectedItem(TTF_SYMBOL_KEY);
}
}
use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigTTF method ttfValueUpdated.
/**
* TTF field value updated.
*/
@Override
public void ttfValueUpdated() {
setCachedExpression(generateExpression());
checkSymbolIsValid();
FieldConfigBase parent = getParent();
if (parent != null) {
parent.valueUpdated();
}
}
Aggregations