Search in sources :

Example 26 with ValueComboBoxData

use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.

the class FieldConfigFont method populateFontFamilyList.

/**
 * Populate font family list.
 */
private synchronized void populateFontFamilyList() {
    if (fontFamilyList == null) {
        fontFamilyList = new ArrayList<ValueComboBoxData>();
        String[] families = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
        for (String fontFamily : families) {
            fontFamilyList.add(new ValueComboBoxData(fontFamily, fontFamily, getPanelId()));
        }
    }
}
Also used : ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Example 27 with ValueComboBoxData

use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.

the class FieldState method populateSymbolList.

/**
 * Populate symbol list.
 *
 * @param panelDetails the panel details the configuration is for
 * @param symbolList the symbol list
 */
public void populateSymbolList(Class<?> panelDetails, List<ValueComboBoxDataGroup> symbolList) {
    List<SymbolTypeConfig> configList = getFieldMap().get(panelDetails);
    if (configList == null) {
        ConsoleManager.getInstance().error(this, "No config for panel details class : " + panelDetails.getName());
    } else {
        if (localSymbolList == null) {
            localSymbolList = new ArrayList<ValueComboBoxData>();
        } else {
            localSymbolList.clear();
        }
        for (SymbolTypeConfig config : configList) {
            List<ValueComboBoxData> groupSymbolList = new ArrayList<ValueComboBoxData>();
            for (String key : config.getKeyOrderList()) {
                ValueComboBoxData data = new ValueComboBoxData(key, config.getTitle(key), this.getVendorOption(), config.getPanelId());
                groupSymbolList.add(data);
            }
            symbolList.add(new ValueComboBoxDataGroup(config.getGroupName(), groupSymbolList, config.isSeparateGroup()));
            localSymbolList.addAll(groupSymbolList);
        }
    }
}
Also used : ValueComboBoxDataGroup(com.sldeditor.ui.widgets.ValueComboBoxDataGroup) ArrayList(java.util.ArrayList) ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Example 28 with ValueComboBoxData

use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.

the class SymbolTypeFactory method getFill.

/**
 * Gets the fill for the selected value.
 *
 * @param graphicFill the graphic fill
 * @param fieldConfigManager the field config manager
 * @return the fill
 */
public Fill getFill(GraphicFill graphicFill, GraphicPanelFieldManager fieldConfigManager) {
    Fill fill = null;
    ValueComboBoxData obj = symbolTypeField.getSelectedValueObj();
    if (obj != null) {
        if (!isNone(obj.getKey())) {
            FieldState panel = classMap.get(obj.getPanelId());
            if (panel != null) {
                fill = panel.getFill(graphicFill, fieldConfigManager);
            }
        }
    }
    return fill;
}
Also used : Fill(org.geotools.styling.Fill) GraphicFill(org.opengis.style.GraphicFill) ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Example 29 with ValueComboBoxData

use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.

the class MultiOptionGroup method getSelectedOptionGroup.

/**
 * Gets the selected option group.
 *
 * @return the selected option group
 */
public OptionGroup getSelectedOptionGroup() {
    if (comboBox == null) {
        return null;
    }
    ValueComboBoxData selectedItem = comboBox.getSelectedValue();
    String key = selectedItem.getKey();
    return optionMap.get(key);
}
Also used : ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Example 30 with ValueComboBoxData

use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.

the class FieldConfigEnum method redoAction.

/**
 * Redo action.
 *
 * @param undoRedoObject the undo redo object
 */
/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.undo.UndoActionInterface#redoAction(com.sldeditor.undo.UndoInterface)
     */
@Override
public void redoAction(UndoInterface undoRedoObject) {
    if ((comboBox != null) && (undoRedoObject != null)) {
        if (undoRedoObject.getNewValue() instanceof String) {
            String oldValue = (String) undoRedoObject.getNewValue();
            ValueComboBoxData valueComboBoxData = comboDataMap.get(oldValue);
            if (valueComboBoxData != null) {
                comboBox.setSelectedItem(valueComboBoxData);
            }
        }
    }
}
Also used : ValueComboBoxData(com.sldeditor.ui.widgets.ValueComboBoxData)

Aggregations

ValueComboBoxData (com.sldeditor.ui.widgets.ValueComboBoxData)39 ArrayList (java.util.ArrayList)13 ValueComboBox (com.sldeditor.ui.widgets.ValueComboBox)8 ActionEvent (java.awt.event.ActionEvent)8 ActionListener (java.awt.event.ActionListener)8 ValueComboBoxDataGroup (com.sldeditor.ui.widgets.ValueComboBoxDataGroup)7 Test (org.junit.Test)7 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)6 JPanel (javax.swing.JPanel)6 UndoEvent (com.sldeditor.common.undo.UndoEvent)5 Dimension (java.awt.Dimension)4 JLabel (javax.swing.JLabel)4 UndoActionInterface (com.sldeditor.common.undo.UndoActionInterface)3 GroupConfigInterface (com.sldeditor.ui.detail.config.base.GroupConfigInterface)3 FieldConfigMarker (com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker)3 FieldPanel (com.sldeditor.ui.widgets.FieldPanel)3 BorderLayout (java.awt.BorderLayout)3 JCheckBox (javax.swing.JCheckBox)3 Expression (org.opengis.filter.expression.Expression)3 ColourRamp (com.sldeditor.colourramp.ColourRamp)2