Search in sources :

Example 56 with FieldConfigBase

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

the class GroupConfig method setValueGroupState.

/**
 * Sets the value group state.
 */
private void setValueGroupState() {
    boolean isSelected = true;
    if (isShowLabel()) {
        if (isOptional()) {
            groupCheckbox.setEnabled(groupEnabled);
            isSelected = groupCheckbox.isSelected();
        } else {
            groupTitle.setEnabled(groupEnabled);
        }
    }
    for (FieldConfigBase field : getFieldConfigList()) {
        CurrentFieldState fieldState = field.getFieldState();
        fieldState.setGroupSelected(isSelected);
        field.setFieldState(fieldState);
    }
// for(GroupConfigInterface subGroup : subGroupList)
// {
// subGroup.setValueGroupState();
// }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase)

Example 57 with FieldConfigBase

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

the class MultiOptionGroup method populateOptionGroup.

/**
 * Populate option group.
 *
 * @param fieldConfigManager the field config manager
 * @param optionBox the option box
 * @param groupConfigList the group config list
 */
private void populateOptionGroup(GraphicPanelFieldManager fieldConfigManager, Box optionBox, List<GroupConfigInterface> groupConfigList) {
    for (GroupConfigInterface groupConfigI : groupConfigList) {
        groupConfigI.createTitle(optionBox, null);
        if (groupConfigI instanceof GroupConfig) {
            GroupConfig groupConfig = (GroupConfig) groupConfigI;
            for (FieldConfigBase field : groupConfig.getFieldConfigList()) {
                field.createUI();
                field.revertToDefaultValue();
                FieldPanel component = field.getPanel();
                optionBox.add(component);
                fieldConfigManager.addField(field);
                optionFieldList.add(field);
                if (field instanceof FieldConfigVendorOption) {
                    ((FieldConfigVendorOption) field).addToOptionBox(optionBox);
                }
            }
            populateOptionGroup(fieldConfigManager, optionBox, groupConfig.getSubGroupList());
        } else if (groupConfigI instanceof MultiOptionGroup) {
            MultiOptionGroup multiOptionGroupConfig = (MultiOptionGroup) groupConfigI;
            fieldConfigManager.addMultiOptionGroup(multiOptionGroupConfig);
            multiOptionGroupConfig.createUI(fieldConfigManager, optionBox, parent, this.panelId);
        }
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) FieldConfigVendorOption(com.sldeditor.ui.detail.config.FieldConfigVendorOption) FieldPanel(com.sldeditor.ui.widgets.FieldPanel)

Example 58 with FieldConfigBase

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

the class ColourMapEntryPanel method setSelectedEntry.

/**
 * Sets the selected entry.
 *
 * @param entries the new selected entry
 */
public void setSelectedEntry(List<ColorMapEntry> entries) {
    if (entries == null) {
        setVisible(false);
    } else if (entries.size() == 1) {
        setVisible(true);
        ColorMapEntry entry = entries.get(0);
        label.populateField(entry.getLabel());
        opacity.populate(entry.getOpacity());
        colour.populate(entry.getColor());
        quantity.populate(entry.getQuantity());
        for (FieldConfigBase field : fieldList) {
            field.showOptionField(false);
        }
        applyButton.setEnabled(false);
    } else if (entries.size() > 1) {
        setVisible(true);
        MultipleColourMapEntry multipleValues = new MultipleColourMapEntry();
        multipleValues.parseList(entries);
        ColorMapEntry entry = multipleValues.getColourMapEntry();
        // Label
        String labelValue = "";
        if (entry.getLabel() != null) {
            labelValue = entry.getLabel();
        }
        label.populateField(labelValue);
        label.setOptionFieldValue(entry.getLabel() != null);
        // Opacity
        opacity.populate(entry.getOpacity());
        opacity.setOptionFieldValue(entry.getOpacity() != null);
        // Colour
        colour.populate(entry.getColor());
        colour.setOptionFieldValue(entry.getColor() != null);
        // Quantity
        quantity.populate(entry.getQuantity());
        quantity.setOptionFieldValue(entry.getQuantity() != null);
        for (FieldConfigBase field : fieldList) {
            field.showOptionField(true);
        }
        applyButton.setEnabled(false);
    } else {
        setVisible(false);
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) ColorMapEntry(org.geotools.styling.ColorMapEntry)

Example 59 with FieldConfigBase

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

the class FieldConfigWKT method wktValueUpdated.

/**
 * Wkt value updated.
 */
@Override
public void wktValueUpdated() {
    setCachedExpression(generateExpression());
    checkSymbolIsValid();
    FieldConfigBase parent = getParent();
    if (parent != null) {
        parent.valueUpdated();
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase)

Example 60 with FieldConfigBase

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

the class VOGeoServerTextSymbolizer2 method setSymbolTypeVisibility.

/**
 * Sets the symbol type visibility.
 *
 * @param panelId the panel id
 * @param selectedItem the selected item
 */
private void setSymbolTypeVisibility(Class<?> panelId, String selectedItem) {
    Map<GroupIdEnum, Boolean> groupList = fieldEnableState.getGroupIdList(panelId.getName(), selectedItem);
    for (GroupIdEnum groupId : groupList.keySet()) {
        boolean groupEnabled = groupList.get(groupId);
        GroupConfigInterface groupConfig = fieldConfigManager.getGroup(getPanelId(), groupId);
        if (groupConfig != null) {
            groupConfig.setGroupStateOverride(groupEnabled);
        } else {
            ConsoleManager.getInstance().error(this, "Failed to find group : " + groupId.toString());
        }
    }
    Map<FieldIdEnum, Boolean> fieldList = fieldEnableState.getFieldIdList(panelId.getName(), selectedItem);
    for (FieldIdEnum fieldId : fieldList.keySet()) {
        boolean fieldEnabled = fieldList.get(fieldId);
        FieldConfigBase fieldConfig = fieldConfigManager.get(fieldId);
        if (fieldConfig != null) {
            CurrentFieldState fieldState = fieldConfig.getFieldState();
            fieldState.setFieldEnabled(fieldEnabled);
            fieldConfig.setFieldState(fieldState);
        } else {
            ConsoleManager.getInstance().error(this, "Failed to find field : " + fieldId.toString());
        }
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) CurrentFieldState(com.sldeditor.ui.detail.config.base.CurrentFieldState) GroupConfigInterface(com.sldeditor.ui.detail.config.base.GroupConfigInterface) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) GroupIdEnum(com.sldeditor.common.xml.ui.GroupIdEnum)

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