Search in sources :

Example 36 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class VOGeoServerTextSpacing method getMinimumVersion.

/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.iface.PopulateDetailsInterface#getMinimumVersion(java.lang.Object, java.util.List)
     */
@Override
public void getMinimumVersion(Object parentObj, Object sldObj, List<VendorOptionPresent> vendorOptionsPresentList) {
    if (sldObj instanceof TextSymbolizer) {
        TextSymbolizer textSymbolizer = (TextSymbolizer) sldObj;
        Map<String, String> options = textSymbolizer.getOptions();
        for (FieldIdEnum key : fieldMap.keySet()) {
            String vendorOptionAttributeKey = fieldMap.get(key);
            if (options.containsKey(vendorOptionAttributeKey)) {
                VendorOptionPresent voPresent = new VendorOptionPresent(sldObj, getVendorOptionInfo());
                vendorOptionsPresentList.add(voPresent);
            }
        }
    }
}
Also used : VendorOptionPresent(com.sldeditor.common.vendoroption.minversion.VendorOptionPresent) TextSymbolizer(org.geotools.styling.TextSymbolizer) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum)

Example 37 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class VOGeoServerRandomFill method populate.

/**
 * Populate.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
@Override
public void populate(PolygonSymbolizer polygonSymbolizer) {
    Map<String, String> options = null;
    if (polygonSymbolizer != null) {
        options = polygonSymbolizer.getOptions();
    }
    for (FieldIdEnum key : fieldMap.keySet()) {
        internalPopulate(options, key, fieldMap.get(key));
    }
    handleFieldState();
}
Also used : FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum)

Example 38 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class VOGeoServerRandomFill method getMinimumVersion.

/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.iface.PopulateDetailsInterface#getMinimumVersion(java.lang.Object,
     * java.util.List)
     */
@Override
public void getMinimumVersion(Object parentObj, Object sldObj, List<VendorOptionPresent> vendorOptionsPresentList) {
    if (parentObj instanceof PolygonSymbolizer) {
        PolygonSymbolizer polygon = (PolygonSymbolizer) parentObj;
        Map<String, String> options = polygon.getOptions();
        for (FieldIdEnum key : fieldMap.keySet()) {
            String vendorOptionAttributeKey = fieldMap.get(key);
            if (options.containsKey(vendorOptionAttributeKey)) {
                VendorOptionPresent voPresent = new VendorOptionPresent(sldObj, getVendorOptionInfo());
                vendorOptionsPresentList.add(voPresent);
            }
        }
    }
}
Also used : VendorOptionPresent(com.sldeditor.common.vendoroption.minversion.VendorOptionPresent) PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum)

Example 39 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class LiteralPanel method displayLiteral.

/**
 * Display literal value.
 *
 * @param node the node
 */
private void displayLiteral(ExpressionNode node) {
    if (node == null) {
        return;
    }
    if (fieldConfig != null) {
        remove(fieldConfig.getPanel());
    }
    fieldConfig = PanelField.getField(ExpressionPanelv2.class, "LiteralPanel.value", node.getType());
    if (fieldConfig != null) {
        fieldConfig.createUI();
        fieldConfig.addDataChangedListener(new UpdateSymbolInterface() {

            @Override
            public void dataChanged(FieldIdEnum changedField) {
                updateButtonState(true);
            }
        });
        add(fieldConfig.getPanel(), BorderLayout.NORTH);
        fieldConfig.populate(node.getExpression());
    }
    revalidate();
}
Also used : UpdateSymbolInterface(com.sldeditor.ui.iface.UpdateSymbolInterface) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum)

Example 40 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class PanelField method getField.

/**
 * Gets the field.
 *
 * @param classType the class type
 * @param valueTextLocalisation the value text localisation
 * @param nodeType the node type
 * @return the field
 */
public static FieldConfigBase getField(Class<?> classType, String valueTextLocalisation, Class<?> nodeType) {
    FieldConfigBase fieldConfig = null;
    RenderTransformValueInterface value = RenderTransformValueFactory.getInstance().getValue(nodeType);
    if (value != null) {
        String valueText = Localisation.getString(classType, valueTextLocalisation);
        FieldIdEnum fieldId = FieldIdEnum.FUNCTION;
        FieldConfigCommonData commonData = new FieldConfigCommonData(null, fieldId, valueText, true);
        fieldConfig = value.getField(commonData);
    } else {
        System.err.println("Unknown field type : " + nodeType);
    }
    return fieldConfig;
}
Also used : RenderTransformValueInterface(com.sldeditor.rendertransformation.types.RenderTransformValueInterface) FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum)

Aggregations

FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)83 Test (org.junit.Test)55 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)54 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)33 FieldConfigString (com.sldeditor.ui.detail.config.FieldConfigString)28 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)27 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)17 PointFillDetails (com.sldeditor.ui.detail.PointFillDetails)16 StyleBuilder (org.geotools.styling.StyleBuilder)14 ColourFieldConfig (com.sldeditor.ui.detail.ColourFieldConfig)13 FieldConfigPopulation (com.sldeditor.ui.detail.config.FieldConfigPopulation)13 Geometry (com.vividsolutions.jts.geom.Geometry)13 Expression (org.opengis.filter.expression.Expression)13 FieldConfigSlider (com.sldeditor.ui.detail.config.FieldConfigSlider)12 FieldConfigSymbolType (com.sldeditor.ui.detail.config.FieldConfigSymbolType)12 GroupIdEnum (com.sldeditor.common.xml.ui.GroupIdEnum)10 GroupConfigInterface (com.sldeditor.ui.detail.config.base.GroupConfigInterface)8 ArrayList (java.util.ArrayList)8 Mark (org.geotools.styling.Mark)7 StrokeDetails (com.sldeditor.ui.detail.StrokeDetails)6