Search in sources :

Example 1 with StrokeImpl

use of org.geotools.styling.StrokeImpl in project sldeditor by robward-scisys.

the class FieldConfigWKT 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) && (fieldConfigManager != null)) {
        if (symbol instanceof Mark) {
            MarkImpl markerSymbol = (MarkImpl) symbol;
            // Fill
            FillImpl fill = markerSymbol.getFill();
            if (fill != null) {
                populateColour(fieldConfigManager, fillFieldConfig, fill.getColor(), fill.getOpacity());
            }
            GroupConfigInterface fillGroup = fieldConfigManager.getGroup(fieldConfigManager.getComponentId(), fillFieldConfig.getGroup());
            if (fillGroup != null) {
                fillGroup.enable(fill != null);
            }
            // Stroke
            StrokeImpl stroke = markerSymbol.getStroke();
            if (stroke != null) {
                populateColour(fieldConfigManager, strokeFieldConfig, stroke.getColor(), stroke.getOpacity());
            }
            GroupConfigInterface strokeGroup = fieldConfigManager.getGroup(fieldConfigManager.getComponentId(), strokeFieldConfig.getGroup());
            if (strokeGroup != null) {
                strokeGroup.enable(stroke != null);
            }
            if (wktPanel != null) {
                wktPanel.populateExpression(markerSymbol.getWellKnownName().toString());
            }
            if (multiOptionPanel != null) {
                multiOptionPanel.setSelectedItem(WKT_SYMBOL_KEY);
            }
        }
    }
}
Also used : FillImpl(org.geotools.styling.FillImpl) Mark(org.geotools.styling.Mark) MarkImpl(org.geotools.styling.MarkImpl) GroupConfigInterface(com.sldeditor.ui.detail.config.base.GroupConfigInterface) StrokeImpl(org.geotools.styling.StrokeImpl)

Aggregations

GroupConfigInterface (com.sldeditor.ui.detail.config.base.GroupConfigInterface)1 FillImpl (org.geotools.styling.FillImpl)1 Mark (org.geotools.styling.Mark)1 MarkImpl (org.geotools.styling.MarkImpl)1 StrokeImpl (org.geotools.styling.StrokeImpl)1