Example usage for javax.swing JSpinner getName

List of usage examples for javax.swing JSpinner getName

Introduction

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

Prototype

public String getName() 

Source Link

Document

Gets the name of the component.

Usage

From source file:configuration.Util.java

public static void buttonEventSpinner(workflow_properties properties, javax.swing.JRadioButton b,
        javax.swing.JSpinner s) {
    if (b == null) {
        properties.put(s.getName(), s.getValue());
    } else {/*www.  j  a va2 s .c  o  m*/
        if (b.isSelected() == true) {
            if (s == null) {
                properties.put(b.getName(), b.isSelected());
            } else {
                s.setEnabled(true);
                properties.put(s.getName(), s.getValue());
                properties.put(b.getName(), s.getValue());
            }
        }
    }
}

From source file:configuration.Util.java

public static void boxEventSpinner(workflow_properties properties, javax.swing.JCheckBox b,
        javax.swing.JSpinner s) {
    if (b == null) {
        properties.put(s.getName(), s.getValue());
    } else {//  w  w w. j  a  v a 2  s.co  m
        if (b.isSelected() == true) {
            if (s == null) {
                properties.put(b.getName(), b.isSelected());
            } else {
                s.setEnabled(true);
                properties.put(s.getName(), s.getValue());
                properties.put(b.getName(), s.getValue());
            }
        } else {
            properties.remove(b.getName());
            if (s != null) {
                s.setEnabled(false);
            }
        }
    }
}

From source file:uk.nhs.cfh.dsp.srth.desktop.modules.querycreationtreepanel.ConstraintPanel.java

/**
 * Populate fields for facet./* w  w w . j av a 2  s  .  c  om*/
 * 
 * @param dfc the dfc
 * @param spinner the spinner
 */
private void populateFieldsForFacet(DataRangeFacetConstraint dfc, JSpinner spinner) {

    if (spinner.getName().equals("valueSpinner1")) {
        valueSpinner1.setValue(dfc.asDouble());
        // set selected operator based on facet value
        if (dfc.getFacet() == RangeFacetVocabulary.MAX_EXCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.LESS_THAN);
            valueSpinnerCheckBox1.setSelected(false);
        } else if (dfc.getFacet() == RangeFacetVocabulary.MAX_INCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.LESS_THAN);
            valueSpinnerCheckBox1.setSelected(true);
        } else if (dfc.getFacet() == RangeFacetVocabulary.MIN_EXCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.GREATER_THAN);
            valueSpinnerCheckBox1.setSelected(false);
        } else if (dfc.getFacet() == RangeFacetVocabulary.MIN_INCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.GREATER_THAN);
            valueSpinnerCheckBox1.setSelected(true);
        }
    } else {
        valueSpinner2.setValue(dfc.asDouble());
        // set selected operator based on facet value
        if (dfc.getFacet() == RangeFacetVocabulary.MAX_EXCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.LESS_THAN);
            valueSpinnerCheckBox2.setSelected(false);
        } else if (dfc.getFacet() == RangeFacetVocabulary.MAX_INCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.LESS_THAN);
            valueSpinnerCheckBox2.setSelected(true);
        } else if (dfc.getFacet() == RangeFacetVocabulary.MIN_EXCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.GREATER_THAN);
            valueSpinnerCheckBox2.setSelected(false);
        } else if (dfc.getFacet() == RangeFacetVocabulary.MIN_INCLUSIVE) {
            operatorsBox.setSelectedItem(Operator.GREATER_THAN);
            valueSpinnerCheckBox2.setSelected(true);
        }
    }
}