Search in sources :

Example 26 with FieldPanel

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

the class FieldConfigDouble method createUI.

/**
 * Creates the ui.
 */
/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
     */
@Override
public void createUI() {
    if (spinner == null) {
        final UndoActionInterface parentObj = this;
        int xPos = getXPos();
        FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
        if (configurationSet) {
            spinner = new DecimalSpinner(minValue, maxValue, stepSize, noOfDecimalPlaces);
        } else {
            spinner = new DecimalSpinner();
        }
        spinner.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
        fieldPanel.add(spinner);
        if (!isValueOnly()) {
            setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(Double.class, this, isRasterSymbol()));
        }
        spinner.registerObserver(new SpinnerNotifyInterface() {

            @Override
            public void notify(double oldValue, double newValue) {
                Double oldValueObj = Double.valueOf(oldValue);
                Double newValueObj = Double.valueOf(newValue);
                UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, getFieldId(), oldValueObj, newValueObj));
                valueUpdated();
            }
        });
    }
}
Also used : UndoEvent(com.sldeditor.common.undo.UndoEvent) SpinnerNotifyInterface(com.sldeditor.ui.iface.SpinnerNotifyInterface) DecimalSpinner(com.sldeditor.ui.widgets.DecimalSpinner) FieldPanel(com.sldeditor.ui.widgets.FieldPanel) UndoActionInterface(com.sldeditor.common.undo.UndoActionInterface)

Example 27 with FieldPanel

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

the class FieldConfigGeometryField method createUI.

/**
 * Creates the ui.
 */
/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
     */
@Override
public void createUI() {
    if (attributeComboBox == null) {
        final UndoActionInterface parentObj = this;
        int xPos = getXPos();
        FieldPanel fieldPanel = createFieldPanel(xPos, getLabel());
        attributeComboBox = new JComboBox<String>();
        attributeComboBox.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT);
        fieldPanel.add(attributeComboBox);
        populateAttributeComboBox();
        if (!isValueOnly()) {
            setAttributeSelectionPanel(fieldPanel.internalCreateAttrButton(Geometry.class, this, true));
        }
        attributeComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (isAttributeComboBoxPopulated()) {
                    String newValueObj = (String) attributeComboBox.getSelectedItem();
                    UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, "DataSourceAttribute", oldValueObj, newValueObj));
                    valueUpdated();
                }
            }
        });
    }
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) UndoEvent(com.sldeditor.common.undo.UndoEvent) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) FieldPanel(com.sldeditor.ui.widgets.FieldPanel) UndoActionInterface(com.sldeditor.common.undo.UndoActionInterface)

Example 28 with FieldPanel

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

the class FieldConfigFeatureTypeConstraint method createUI.

/**
 * Creates the ui.
 */
@Override
public void createUI() {
    if (extentTable == null) {
        int xPos = getXPos();
        int maxNoOfFilterRows = 6;
        int maxNoOfExtentRows = 6;
        int maxY = getRowY(maxNoOfFilterRows + maxNoOfExtentRows);
        FieldPanel fieldPanel = createFieldPanel(xPos, maxY, getLabel());
        createFilterTable(xPos, maxNoOfFilterRows, fieldPanel);
        createExtentTable(xPos, maxNoOfFilterRows, maxNoOfExtentRows, fieldPanel);
    }
}
Also used : FieldPanel(com.sldeditor.ui.widgets.FieldPanel) FeatureTypeConstraint(org.geotools.styling.FeatureTypeConstraint)

Example 29 with FieldPanel

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

the class FieldConfigSortBy method createUI.

/**
 * Creates the ui.
 */
/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
     */
@Override
public void createUI() {
    if (sortbyPanel == null) {
        sortbyPanel = new SortByPanel(this, NO_OF_ROWS);
        int xPos = getXPos();
        FieldPanel fieldPanel = createFieldPanel(xPos, BasePanel.WIDGET_HEIGHT * NO_OF_ROWS, getLabel());
        fieldPanel.add(sortbyPanel);
    }
}
Also used : FieldPanel(com.sldeditor.ui.widgets.FieldPanel)

Example 30 with FieldPanel

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

the class FieldConfigWindBarbs method createUI.

/**
 * Creates the ui.
 */
/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
     */
@Override
public void createUI() {
    FieldPanel fieldPanel = createFieldPanel(0, "");
    fieldPanel.setLayout(new BorderLayout());
    windBarbsPanel = new WindBarbDetails(this);
    fieldPanel.add(windBarbsPanel, BorderLayout.CENTER);
    Dimension panelSize = windBarbsPanel.getPanelSize();
    fieldPanel.setPreferredSize(panelSize);
}
Also used : BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) FieldPanel(com.sldeditor.ui.widgets.FieldPanel)

Aggregations

FieldPanel (com.sldeditor.ui.widgets.FieldPanel)31 UndoActionInterface (com.sldeditor.common.undo.UndoActionInterface)13 UndoEvent (com.sldeditor.common.undo.UndoEvent)12 ActionEvent (java.awt.event.ActionEvent)12 ActionListener (java.awt.event.ActionListener)12 Dimension (java.awt.Dimension)9 BorderLayout (java.awt.BorderLayout)6 JButton (javax.swing.JButton)6 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)3 ValueComboBox (com.sldeditor.ui.widgets.ValueComboBox)3 ValueComboBoxData (com.sldeditor.ui.widgets.ValueComboBoxData)3 ArrayList (java.util.ArrayList)3 JScrollPane (javax.swing.JScrollPane)3 ColourRampConfigPanel (com.sldeditor.colourramp.ColourRampConfigPanel)2 SpinnerNotifyInterface (com.sldeditor.ui.iface.SpinnerNotifyInterface)2 Geometry (com.vividsolutions.jts.geom.Geometry)2 JCheckBox (javax.swing.JCheckBox)2 JPanel (javax.swing.JPanel)2 JTextArea (javax.swing.JTextArea)2 ChangeEvent (javax.swing.event.ChangeEvent)2