Search in sources :

Example 36 with FieldConfigBase

use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.

the class FieldConfigWKT method populateColour.

/**
 * Populate colour.
 *
 * @param fieldConfigManager the field config manager
 * @param fieldConfig the field config
 * @param expColour the exp colour
 * @param expOpacity the exp opacity
 */
private void populateColour(GraphicPanelFieldManager fieldConfigManager, ColourFieldConfig fieldConfig, Expression expColour, Expression expOpacity) {
    FieldConfigBase field = fieldConfigManager.get(fieldConfig.getColour());
    if (field != null) {
        field.populate(expColour);
    }
    field = fieldConfigManager.get(fieldConfig.getOpacity());
    if (field != null) {
        field.populate(expOpacity);
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase)

Example 37 with FieldConfigBase

use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.

the class FieldConfigMarker method setSolidFill.

/**
 * Sets the solid fill.
 *
 * @param fieldConfigManager the field config manager
 * @param expFillColour the new solid fill
 * @param expFillColourOpacity the expression fill colour opacity
 */
public void setSolidFill(GraphicPanelFieldManager fieldConfigManager, Expression expFillColour, Expression expFillColourOpacity) {
    if (fieldConfigManager != null) {
        FieldConfigBase field = fieldConfigManager.get(fillFieldConfig.getColour());
        if (field != null) {
            field.populate(expFillColour);
        }
        Class<?> panelId = getCommonData().getPanelId();
        GroupConfigInterface fillGroup = fieldConfigManager.getGroup(panelId, GroupIdEnum.FILL);
        if (fillGroup != null) {
            fillGroup.enable(expFillColour != null);
        }
        // Opacity
        field = fieldConfigManager.get(fillFieldConfig.getOpacity());
        if (field != null) {
            field.populate(expFillColourOpacity);
        }
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) GroupConfigInterface(com.sldeditor.ui.detail.config.base.GroupConfigInterface)

Example 38 with FieldConfigBase

use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.

the class FieldConfigMarker method getFill.

/**
 * Gets the fill.
 *
 * @param graphicFill the graphic fill
 * @param fieldConfigManager the field config manager
 * @return the fill
 */
@Override
public Fill getFill(GraphicFill graphicFill, GraphicPanelFieldManager fieldConfigManager) {
    if (fieldConfigManager == null) {
        return null;
    }
    Expression fillColour = null;
    FieldConfigBase field = fieldConfigManager.get(fillFieldConfig.getColour());
    if (field != null) {
        if ((field instanceof FieldConfigColour) && field.isEnabled()) {
            fillColour = ((FieldConfigColour) field).getColourExpression();
        }
    }
    Expression fillColourOpacity = null;
    field = fieldConfigManager.get(fillFieldConfig.getOpacity());
    if (field != null) {
        fillColourOpacity = field.getExpression();
    }
    GraphicFill _graphicFill = null;
    Expression _fillColour = fillColour;
    Expression _fillColourOpacity = fillColourOpacity;
    if (graphicFill != null) {
        List<GraphicalSymbol> symbolList = graphicFill.graphicalSymbols();
        if ((symbolList != null) && (!symbolList.isEmpty())) {
            GraphicalSymbol symbol = symbolList.get(0);
            Mark mark = (Mark) symbol;
            if (mark.getWellKnownName() != null) {
                _graphicFill = graphicFill;
                _fillColour = null;
                _fillColourOpacity = null;
            }
        }
    }
    Fill fill = getStyleFactory().fill(_graphicFill, _fillColour, _fillColourOpacity);
    return fill;
}
Also used : Fill(org.geotools.styling.Fill) GraphicFill(org.opengis.style.GraphicFill) FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) Expression(org.opengis.filter.expression.Expression) GraphicFill(org.opengis.style.GraphicFill) GraphicalSymbol(org.opengis.style.GraphicalSymbol) Mark(org.geotools.styling.Mark) FieldConfigColour(com.sldeditor.ui.detail.config.FieldConfigColour)

Example 39 with FieldConfigBase

use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.

the class SymbolTypeFactory method internal_populate.

/**
 * Internal populate.
 *
 * @param basePanel the base panel
 * @param multiOptionSelected the multi option selected
 * @param updateSymbol the update symbol
 * @param selectionField the selection field
 * @param fieldConfigManager the field config manager
 */
private void internal_populate(BasePanel basePanel, MultiOptionSelectedInterface multiOptionSelected, UpdateSymbolInterface updateSymbol, FieldIdEnum selectionField, GraphicPanelFieldManager fieldConfigManager) {
    List<ValueComboBoxDataGroup> combinedSymbolList = new ArrayList<ValueComboBoxDataGroup>();
    /**
     * Populate symbol type list. Given a panel details class iterate over all the field panels
     * asking them to populate the symbol type list.
     */
    for (FieldState panel : symbolTypeFieldList) {
        panel.populateSymbolList(basePanel.getClass(), combinedSymbolList);
    }
    FieldConfigBase field = fieldConfigManager.get(selectionField);
    this.symbolTypeField = (FieldConfigSymbolType) field;
    symbolTypeField.populate(multiOptionSelected, combinedSymbolList);
    for (FieldState panel : symbolTypeFieldList) {
        panel.setUpdateSymbolListener(updateSymbol);
        classMap.put(panel.getClass(), panel);
        this.symbolTypeField.addField(panel);
        basePanel.updateFieldConfig(panel.getBasePanel());
        // Transfer all the fields in the child panels into this panel
        Map<FieldIdEnum, FieldConfigBase> map = panel.getFieldList(fieldConfigManager);
        if (map != null) {
            for (FieldIdEnum panelField : map.keySet()) {
                fieldConfigManager.add(panelField, map.get(panelField));
            }
        }
    }
}
Also used : ValueComboBoxDataGroup(com.sldeditor.ui.widgets.ValueComboBoxDataGroup) FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) ArrayList(java.util.ArrayList) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum)

Example 40 with FieldConfigBase

use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.

the class ExternalGraphicDetails method createUI.

/**
 * Creates the ui.
 */
private void createUI() {
    readConfigFileNoScrollPane(null, getClass(), this, PANEL_CONFIG);
    registerForTextFieldButton(FieldIdEnum.EXTERNAL_GRAPHIC, this);
    for (FieldConfigBase fieldConfig : this.getFieldConfigList()) {
        CurrentFieldState fieldState = fieldConfig.getFieldState();
        fieldState.setFieldEnabled(true);
        fieldConfig.setFieldState(fieldState);
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) CurrentFieldState(com.sldeditor.ui.detail.config.base.CurrentFieldState)

Aggregations

FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)93 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)43 Test (org.junit.Test)42 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)27 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)22 Expression (org.opengis.filter.expression.Expression)19 Mark (org.geotools.styling.Mark)14 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)13 FieldConfigSlider (com.sldeditor.ui.detail.config.FieldConfigSlider)13 FieldConfigSymbolType (com.sldeditor.ui.detail.config.FieldConfigSymbolType)13 GroupConfigInterface (com.sldeditor.ui.detail.config.base.GroupConfigInterface)13 PointFillDetails (com.sldeditor.ui.detail.PointFillDetails)12 ColourFieldConfig (com.sldeditor.ui.detail.ColourFieldConfig)10 ArrayList (java.util.ArrayList)10 Fill (org.geotools.styling.Fill)10 GraphicFill (org.opengis.style.GraphicFill)10 GraphicalSymbol (org.opengis.style.GraphicalSymbol)10 Geometry (com.vividsolutions.jts.geom.Geometry)9 StyleBuilder (org.geotools.styling.StyleBuilder)8 FieldConfigMarker (com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker)7