Search in sources :

Example 1 with PolygonAlignOptions

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

the class VOGeoServerLabelling method internal_updateSymbolEnumField.

/**
 * Internal_update symbol enum field.
 *
 * @param options the options
 * @param field the field
 * @param key the key
 */
private void internal_updateSymbolEnumField(Map<String, String> options, FieldIdEnum field, String key) {
    ValueComboBoxData value = fieldConfigVisitor.getComboBox(field);
    Object object = getDefaultFieldValue(field);
    String defaultValue = null;
    if (object instanceof TextSymbolizer.PolygonAlignOptions) {
        TextSymbolizer.PolygonAlignOptions option = (PolygonAlignOptions) object;
        defaultValue = option.toString();
    } else {
        defaultValue = (String) object;
    }
    if (defaultValue == null) {
        ConsoleManager.getInstance().error(this, "Failed to find default for field : " + field);
    } else if ((value.getKey().compareToIgnoreCase(defaultValue) != 0) || includeValue(field)) {
        options.put(key, value.getKey());
    }
}
Also used : PolygonAlignOptions(org.geotools.styling.TextSymbolizer.PolygonAlignOptions) TextSymbolizer(org.geotools.styling.TextSymbolizer) PolygonAlignOptions(org.geotools.styling.TextSymbolizer.PolygonAlignOptions) ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Example 2 with PolygonAlignOptions

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

the class VOGeoServerLabellingUnderline method internal_updateSymbolEnumField.

/**
 * Internal_update symbol enum field.
 *
 * @param options the options
 * @param field the field
 * @param key the key
 */
private void internal_updateSymbolEnumField(Map<String, String> options, FieldIdEnum field, String key) {
    ValueComboBoxData value = fieldConfigVisitor.getComboBox(field);
    Object object = getDefaultFieldValue(field);
    String defaultValue = null;
    if (object instanceof TextSymbolizer.PolygonAlignOptions) {
        TextSymbolizer.PolygonAlignOptions option = (PolygonAlignOptions) object;
        defaultValue = option.toString();
    } else {
        defaultValue = (String) object;
    }
    if (defaultValue == null) {
        ConsoleManager.getInstance().error(this, "Failed to find default for field : " + field);
    } else if (value.getKey().compareToIgnoreCase(defaultValue) != 0) {
        options.put(key, value.getKey());
    }
}
Also used : PolygonAlignOptions(org.geotools.styling.TextSymbolizer.PolygonAlignOptions) TextSymbolizer(org.geotools.styling.TextSymbolizer) PolygonAlignOptions(org.geotools.styling.TextSymbolizer.PolygonAlignOptions) ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Example 3 with PolygonAlignOptions

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

the class VOGeoServerRandomFill method internal_updateSymbolEnumField.

/**
 * Internal_update symbol enum field.
 *
 * @param options the options
 * @param field the field
 * @param key the key
 */
private void internal_updateSymbolEnumField(Map<String, String> options, FieldIdEnum field, String key) {
    ValueComboBoxData value = fieldConfigVisitor.getComboBox(field);
    Object object = getDefaultFieldValue(field);
    String defaultValue = null;
    if (object instanceof TextSymbolizer.PolygonAlignOptions) {
        TextSymbolizer.PolygonAlignOptions option = (PolygonAlignOptions) object;
        defaultValue = option.toString();
    } else {
        defaultValue = (String) object;
    }
    if (defaultValue == null) {
        ConsoleManager.getInstance().error(this, "Failed to find default for field : " + field);
    } else if (value.getKey().compareToIgnoreCase(defaultValue) != 0) {
        options.put(key, value.getKey());
    }
}
Also used : PolygonAlignOptions(org.geotools.styling.TextSymbolizer.PolygonAlignOptions) TextSymbolizer(org.geotools.styling.TextSymbolizer) PolygonAlignOptions(org.geotools.styling.TextSymbolizer.PolygonAlignOptions) ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Aggregations

ValueComboBoxData (com.sldeditor.ui.widgets.ValueComboBoxData)3 TextSymbolizer (org.geotools.styling.TextSymbolizer)3 PolygonAlignOptions (org.geotools.styling.TextSymbolizer.PolygonAlignOptions)3