Examples of SpinnerModel


Examples of javax.swing.SpinnerModel

   *   and the underlying table
   */
  public TableSettingsControlPanel(TableSettingsController panelController) {
    controller = panelController;

    SpinnerModel rowDimensionModel = new SpinnerNumberModel(12, 5, 100, 1);
    rowHeightSpinner = new JSpinner(rowDimensionModel);
    setAccessibleName(rowHeightSpinner, "ROW_HEIGHT");
    rowHeightSpinner.addChangeListener(rowHeightListener = new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent e) {
        controller.setRowHeight(Integer.class.cast(rowHeightSpinner.getValue()).intValue());
      }
    });

    SpinnerModel columnDimensionModel = new SpinnerNumberModel(12, 5, 3000, 1);
    columnWidthSpinner = new JSpinner(columnDimensionModel);
    setAccessibleName(columnWidthSpinner, "COLUMN_WIDTH");
    columnWidthSpinner.addChangeListener(columnWidthListener = new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent e) {
        controller.setColumnWidth(Integer.class.cast(columnWidthSpinner.getValue()).intValue());
      }
    });

    tableRowOrientation = new JRadioButton(bundle.getString("ROW_MAJOR"));
    setAccessibleName(tableRowOrientation, "ROW_MAJOR");
    tableRowOrientation.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        controller.setTableOrientation(TableOrientation.ROW_MAJOR);
        settingsChanged();
      }
    });
    tableColOrientation = new JRadioButton(bundle.getString("COLUMN_MAJOR"));
    setAccessibleName(tableColOrientation, "COLUMN_MAJOR");
    tableColOrientation.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        controller.setTableOrientation(TableOrientation.COLUMN_MAJOR);
        settingsChanged();
      }
    });
    tableRowOrientation.setSelected(true);
    groupButtons(tableRowOrientation, tableColOrientation);

    transposeTableButton = new JButton(bundle.getString("TRANSPOSE_TABLE"));
    setAccessibleName(transposeTableButton, "TRANSPOSE_TABLE");
    transposeTableButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        controller.transposeTable();
      }
    });
   
    rowHeaderFontName = setUpFontControl();
    setAccessibleName(rowHeaderFontName, "ROW_FONT");
    rowHeaderFontName.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        controller.setRowHeaderFontName((rowHeaderFontName.getModel()));
      }
    });
   
    columnHeaderFontName = setUpFontControl();
    setAccessibleName(columnHeaderFontName, "COL_FONT");
    columnHeaderFontName.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        controller.setColumnHeaderFontName((columnHeaderFontName.getModel()));
      }
    });
   
    SpinnerModel rowFontSizeModel = new SpinnerNumberModel(12, 8, 36, 1);
    rowHeaderFontSize = new JSpinner(rowFontSizeModel);
    setAccessibleName(rowHeaderFontSize, "ROW_FONT_SIZE");
    rowHeaderFontSize.addChangeListener(rowHeaderFontSizeListener = new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent e) {
        controller.setRowHeaderFontSize(Integer.class.cast(rowHeaderFontSize.getValue()).intValue());
       
      }
    });
   
   
    SpinnerModel columnFontSizeModel = new SpinnerNumberModel(12, 8, 36, 1);
    columnHeaderFontSize = new JSpinner(columnFontSizeModel);
    setAccessibleName(columnHeaderFontSize, "COL_FONT_SIZE");
    columnHeaderFontSize.addChangeListener(columnHeaderFontSizeListener = new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent e) {
        controller.setColumnHeaderFontSize(Integer.class.cast(columnHeaderFontSize.getValue()).intValue());
       
      }
    });
   
    SpinnerModel cellFontSizeModel = new SpinnerNumberModel(12, 8, 36, 1);
    cellFontSize = new JSpinner(cellFontSizeModel);
    setAccessibleName(cellFontSize, "CELL_FONT_SIZE");
    cellFontSize.addChangeListener(cellFontSizeListener = new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent e) {
View Full Code Here

Examples of javax.swing.SpinnerModel

        // スライダー
        final JSlider slider = new JSlider(min, max, initValue);
        slider.setFont(new Font("SansSerif", Font.PLAIN, 9));

        // スピナー
        SpinnerModel fetchModel = new SpinnerNumberModel(initValue, min, max, 1);
        final JSpinner spinner = new JSpinner(fetchModel);
        spinner.setEditor(new JSpinner.NumberEditor(spinner, "#"));

        // お互いにリスン
        slider.addChangeListener(new ChangeListener() {
View Full Code Here

Examples of javax.swing.SpinnerModel

    initGui();
  }

  private void initGui() {
    setLayout(new GridLayout(1, 1));
    SpinnerModel model = null;
    if (value.getClass() == Integer.class
        || value.getClass() == Integer.TYPE) {
      model = new SpinnerNumberModel(Integer.valueOf("" + value)
          .intValue(), Integer.MIN_VALUE, Integer.MAX_VALUE, 1);
    } else if (value.getClass() == Long.class
View Full Code Here

Examples of javax.swing.SpinnerModel

   * @return Le <code>JSpinner</code> crée
   */
  private JSpinner createSpinner(boolean modifiable, int min,
      int max, int initValue, int step) {

    SpinnerModel model = new SpinnerNumberModel(initValue, min, max, step);
    JSpinner spinner = new JSpinner(model);
    // Disable keyboard edits in the spinner
    JFormattedTextField tf = ((JSpinner.DefaultEditor) spinner.getEditor())
        .getTextField();
    tf.setEditable(modifiable);
View Full Code Here

Examples of javax.swing.SpinnerModel

    */
    if (a != null)
      max = a.getNbPlaces() * 2;
    int step = 1;
    int initValue = 1;
    SpinnerModel model = new SpinnerNumberModel(initValue, min, max, step);
    JSpinner spinner = new JSpinner(model);
    // Disable keyboard edits in the spinner
    JFormattedTextField tf = ((JSpinner.DefaultEditor) spinner.getEditor())
        .getTextField();
    tf.setEditable(false);
View Full Code Here

Examples of javax.swing.SpinnerModel

     * <code>javax.swing.SpinnerNumberModel</code>.
     * Also, returns null if the model does not have a minimal value.
     * @return a minimal value.
     */
    public Object getMinimum() {
        SpinnerModel model = getModel();
        if       (model instanceof SpinnerNumberModel) {
            return(((SpinnerNumberModel)model).getMinimum());
        } else if(model instanceof SpinnerDateModel) {
            return(((SpinnerDateModel)model).getEnd());
        } else if(model instanceof SpinnerListModel) {
View Full Code Here

Examples of javax.swing.SpinnerModel

     * <code>javax.swing.SpinnerNumberModel</code>.
     * Also, returns null if the model does not have a maximal value.
     * @return a maximal value.
     */
    public Object getMaximum() {
        SpinnerModel model = getModel();
        if       (model instanceof SpinnerNumberModel) {
            return(((SpinnerNumberModel)model).getMaximum());
        } else if(model instanceof SpinnerDateModel) {
            return(((SpinnerDateModel)model).getEnd());
        } else if(model instanceof SpinnerListModel) {
View Full Code Here

Examples of javax.swing.SpinnerModel

                            + "\"</u>?"
                            + "</html>");

                    amountLbl.setText("Предложить сумму ($):");

                    SpinnerModel sprModel = new SpinnerNumberModel(
                            companyCell.cost(), companyCell.cost(),
                            companyCell.cost() * 10, 1000);
                    amountSpr.setModel(sprModel);

                    ybttn.setActionCommand("P1");
View Full Code Here

Examples of javax.swing.SpinnerModel

     
      // Create a panel and add the button, status label and the SVG canvas.
      final JPanel bigpanel = new JPanel(new BorderLayout());

      // set up spinner
      SpinnerModel model = new SpinnerNumberModel(k, 1, 1000, 1);
      spinner = new JSpinner(model);
      JPanel spinnerPanel = new JPanel(new BorderLayout());
      spinnerPanel.add(BorderLayout.WEST, new JLabel("k"));
      spinnerPanel.add(BorderLayout.EAST, spinner);
View Full Code Here

Examples of javax.swing.SpinnerModel

     
      // Create a panel and add the button, status label and the SVG canvas.
      final JPanel bigpanel = new JPanel(new BorderLayout());

      // set up spinner
      SpinnerModel model = new SpinnerNumberModel(k, 1, 1000, 1);
      spinner = new JSpinner(model);
      JPanel spinnerPanel = new JPanel(new BorderLayout());
      spinnerPanel.add(BorderLayout.WEST, new JLabel("k"));
      spinnerPanel.add(BorderLayout.EAST, spinner);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.