Example usage for javax.swing JSpinner equals

List of usage examples for javax.swing JSpinner equals

Introduction

In this page you can find the example usage for javax.swing JSpinner equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:de.dmarcini.submatix.pclogger.gui.MainCommGUI.java

@Override
public void stateChanged(ChangeEvent ev) {
    JSpinner currSpinner = null;
    int currValue;
    if (ignoreAction)
        return;/*ww  w . j av a2  s  .c  om*/
    // //////////////////////////////////////////////////////////////////////
    // war es ein spinner?
    if (ev.getSource() instanceof JSpinner) {
        currSpinner = (JSpinner) ev.getSource();
        // //////////////////////////////////////////////////////////////////////
        // Deco gradient Hith
        if (currSpinner.equals(configPanel.getDecoGradientenHighSpinner())) {
            // wert fr High ndern
            currValue = (Integer) currSpinner.getValue();
            lg.debug(String.format("change decoGradientHighSpinner <%d/%x>...", currValue, currValue));
            currentConfig.setDecoGfHigh(currValue);
            setDecoComboAfterSpinnerChange();
        }
        // //////////////////////////////////////////////////////////////////////
        // Deco gradient Low
        else if (currSpinner.equals(configPanel.getDecoGradientenLowSpinner())) {
            // Wert fr LOW ndern
            currValue = (Integer) currSpinner.getValue();
            lg.debug(String.format("change decoGradientLowSpinner <%d/%x>...", currValue, currValue));
            currentConfig.setDecoGfLow(currValue);
            setDecoComboAfterSpinnerChange();
        } else {
            lg.warn("unknown spinner recived!");
        }
    }
    // //////////////////////////////////////////////////////////////////////
    // war es ein tabbedPane
    // //////////////////////////////////////////////////////////////////////
    else if (ev.getSource() instanceof JTabbedPane) {
        if (tabbedPane.equals(ev.getSource())) {
            int tabIdx = tabbedPane.getSelectedIndex();
            lg.debug(String.format("tabbedPane changed to %02d!", tabIdx));
            //
            // ist es das Grafikpanel?
            //
            if (tabIdx == programTabs.TAB_LOGGRAPH.ordinal()) {
                lg.debug("graph tab select, init grapic...");
                String connDev = null;
                if (btComm != null) {
                    connDev = btComm.getConnectedDevice();
                }
                // Grafiksachen initialisieren
                try {
                    logGraphPanel.initGraph(connDev);
                } catch (Exception ex) {
                    lg.error("initGraph Exception: <" + ex.getLocalizedMessage() + ">");
                    showErrorDialog(LangStrings.getString("MainCommGUI.errorDialog.openGraphWindow"));
                    return;
                }
            } else {
                // grafiksachen freigeben
                logGraphPanel.releaseGraph();
            }
            //
            // ist es das Exportpanel zum exportieren der Daten (importieren fr Service)
            //
            if (tabIdx == programTabs.TAB_FILEMANAGER.ordinal()) {
                lg.debug("export/import tab select, init db...");
                String connDev = null;
                if (btComm != null) {
                    connDev = btComm.getConnectedDevice();
                }
                // Panel initialisieren
                try {
                    fileManagerPanel.initData(connDev);
                } catch (Exception ex) {
                    lg.error("initData Exception: <" + ex.getLocalizedMessage() + ">");
                    showErrorDialog(LangStrings.getString("MainCommGUI.errorDialog.openExportWindow"));
                    return;
                }
            }
            //
            // ist es das Config Panel?
            //
            if (tabIdx == programTabs.TAB_CONFIG.ordinal()) {
                lg.debug("config tab select, init gui...");
                configPanel.prepareConfigPanel(currentConfig);
            } else {
                // Daten freigeben
                configPanel.releaseConfig();
            }
            //
            // ist es das Loglistpanel
            //
            if (tabIdx == programTabs.TAB_LOGREAD.ordinal()) {
                // Panel initialisieren
                lg.debug("logreader tab select, init gui...");
                String connDev = null;
                if (btComm != null) {
                    connDev = btComm.getConnectedDevice();
                }
                logListPanel.prepareLogListPanel(connDev);
            } else {
                logListPanel.releasePanel();
            }
            //
            // ist es das Gaspanel?
            //
            if (tabIdx == programTabs.TAB_GASLIST.ordinal()) {
                // Panel initialisieren
                lg.debug("gaslist tab select, init gui...");
                gasConfigPanel.prepareGasslistPanel();
            } else {
                // Panel Daten freigeben
                gasConfigPanel.releasePanel();
            }
        }
    } else {
        lg.warn("unknown source type recived!");
    }
}