Package gov.nasa.arc.mct.fastplot.utils

Examples of gov.nasa.arc.mct.fastplot.utils.MenuItemSpinner


        final JMenuItem regressionLineCheckBox = new JCheckBoxMenuItem(BUNDLE.getString("RegressionLineLabel"),false);
        final JMenu regressionMenu = new JMenu(subMenuText2);

        SpinnerModel pointsModel = new SpinnerNumberModel(legendEntry.getNumberRegressionPoints(), 2,
            PlotConstants.MAX_NUMBER_REGRESSION_POINTS, 1);
        final JSpinner spinner = new MenuItemSpinner(pointsModel, regressionMenu);
        spinner.setPreferredSize(new Dimension(50, 20));
        spinner.addChangeListener(new ChangeListener() {

          @Override
          public void stateChanged(ChangeEvent e) {
            legendEntry.setNumberRegressionPoints(Integer.parseInt(((JSpinner)e.getSource()).getValue().toString()));
          }

        })
       
        addPopupMenuListener(new PopupMenuListener() {

          @Override
          public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
            // TODO Auto-generated method stub
          }

          @Override
          public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
            if (spinnerValue != Integer.parseInt(spinner.getValue().toString())) {
              manifestation.persistPlotLineSettings();
            }
           
          }
View Full Code Here


     
    SwingUtilities.invokeAndWait(new Runnable() {
      public void run() {
        menu = new JPopupMenu();
        spinnerMenu = new JMenu("Test");
        spinner = new MenuItemSpinner(new SpinnerNumberModel(5,1,10,1), spinnerMenu);
        spinnerField = ((NumberEditor)spinner.getEditor()).getTextField();
        spinnerMenu.add(spinner);
        menu.add(spinnerMenu);

        JLabel label = new JLabel("label");
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.fastplot.utils.MenuItemSpinner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.