Search in sources :

Example 16 with FieldPanel

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

the class FieldConfigArrow method createUI.

/**
 * Creates the ui.
 */
@Override
public void createUI() {
    FieldPanel fieldPanel = createFieldPanel(0, "");
    fieldPanel.setLayout(new BorderLayout());
    arrowPanel = new ArrowDetails(this);
    fieldPanel.add(arrowPanel, BorderLayout.CENTER);
    Dimension panelSize = arrowPanel.getPanelSize();
    fieldPanel.setPreferredSize(panelSize);
}
Also used : BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) FieldPanel(com.sldeditor.ui.widgets.FieldPanel)

Example 17 with FieldPanel

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

the class FieldConfigTTF method createUI.

/**
 * Creates the ui.
 */
@Override
public void createUI() {
    if (ttfPanel == null) {
        FieldPanel fieldPanel = createFieldPanel(0, "");
        fieldPanel.setLayout(new BorderLayout());
        ttfPanel = new TTFDetails(this);
        fieldPanel.add(ttfPanel, BorderLayout.CENTER);
        Dimension panelSize = ttfPanel.getPanelSize();
        fieldPanel.setPreferredSize(panelSize);
    }
}
Also used : BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) FieldPanel(com.sldeditor.ui.widgets.FieldPanel)

Example 18 with FieldPanel

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

the class FieldConfigTransformation method createUI.

/**
 * Creates the ui.
 */
/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
     */
@Override
public void createUI() {
    if (textField == null) {
        final UndoActionInterface parentObj = this;
        int xPos = getXPos();
        int width = BasePanel.FIELD_PANEL_WIDTH - xPos - 20;
        int height = BasePanel.WIDGET_HEIGHT * (NO_OF_ROWS - 1);
        textField = new JTextArea();
        textField.setBounds(xPos, BasePanel.WIDGET_HEIGHT, width, height);
        textField.setEditable(false);
        JScrollPane scroll = new JScrollPane(textField);
        scroll.setBounds(xPos, BasePanel.WIDGET_HEIGHT, width, height);
        scroll.setAutoscrolls(true);
        FieldPanel fieldPanel = createFieldPanel(xPos, BasePanel.WIDGET_HEIGHT * NO_OF_ROWS, getLabel());
        fieldPanel.add(scroll);
        // 
        // Edit button
        // 
        final JButton buttonEdit = new JButton(editButtonText);
        buttonEdit.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                ProcessFunction expression = showTransformationDialog(processFunction);
                if (expression != null) {
                    ProcessFunction newValueObj = processFunction;
                    processFunction = expression;
                    textField.setText(ParameterFunctionUtils.getString(processFunction));
                    UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, getFieldId(), oldValueObj, newValueObj));
                    valueUpdated();
                }
            }
        });
        buttonEdit.setBounds(xPos + BasePanel.WIDGET_X_START, 0, BasePanel.WIDGET_BUTTON_WIDTH, BasePanel.WIDGET_HEIGHT);
        fieldPanel.add(buttonEdit);
        // 
        // Clear button
        // 
        final JButton buttonClear = new JButton(clearButtonText);
        buttonClear.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                processFunction = null;
                textField.setText("");
                UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, getFieldId(), oldValueObj, null));
                valueUpdated();
            }
        });
        buttonClear.setBounds((int) buttonEdit.getBounds().getMaxX() + 5, 0, BasePanel.WIDGET_BUTTON_WIDTH, BasePanel.WIDGET_HEIGHT);
        fieldPanel.add(buttonClear);
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) ProcessFunction(org.geotools.process.function.ProcessFunction) UndoEvent(com.sldeditor.common.undo.UndoEvent) JTextArea(javax.swing.JTextArea) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) FieldPanel(com.sldeditor.ui.widgets.FieldPanel) UndoActionInterface(com.sldeditor.common.undo.UndoActionInterface)

Example 19 with FieldPanel

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

the class FieldConfigColour method createUI.

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

            @Override
            public void notify(String colourString, double opacity) {
                Color newValueObj = colourButton.getColour();
                UndoManager.getInstance().addUndoEvent(new UndoEvent(parentObj, getFieldId(), oldValueObj, newValueObj));
                oldValueObj = newValueObj;
                valueUpdated();
            }
        });
    }
}
Also used : UndoEvent(com.sldeditor.common.undo.UndoEvent) Color(java.awt.Color) ColourButton(com.sldeditor.ui.widgets.ColourButton) FieldPanel(com.sldeditor.ui.widgets.FieldPanel) UndoActionInterface(com.sldeditor.common.undo.UndoActionInterface) ColourNotifyInterface(com.sldeditor.ui.iface.ColourNotifyInterface)

Example 20 with FieldPanel

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

the class FieldConfigInlineFeature method createUI.

/**
 * Creates the ui.
 */
/*
     * (non-Javadoc)
     * 
     * @see com.sldeditor.ui.detail.config.FieldConfigBase#createUI()
     */
@Override
public void createUI() {
    if (inlineGML == null) {
        inlineGML = new InlineGMLPreviewPanel(this, NO_OF_ROWS);
        inlineFeature = new InlineFeaturePanel(this, NO_OF_ROWS);
        tabbedPane = new JTabbedPane(JTabbedPane.TOP);
        tabbedPane.addTab(Localisation.getString(FieldConfigBase.class, "FieldConfigInlineFeature.feature"), null, inlineFeature, Localisation.getString(FieldConfigBase.class, "FieldConfigInlineFeature.feature.tooltip"));
        tabbedPane.addTab(Localisation.getString(FieldConfigBase.class, "FieldConfigInlineFeature.gml"), null, inlineGML, Localisation.getString(FieldConfigBase.class, "FieldConfigInlineFeature.gml.tooltip"));
        tabbedPane.setBounds(0, 0, inlineGML.getWidth(), inlineGML.getHeight());
        int xPos = getXPos();
        FieldPanel fieldPanel = createFieldPanel(xPos, BasePanel.WIDGET_HEIGHT * NO_OF_ROWS, getLabel());
        fieldPanel.add(tabbedPane);
    }
}
Also used : FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) JTabbedPane(javax.swing.JTabbedPane) 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