Examples of NumberField


Examples of simtools.ui.NumberField

            hbox.add(Box.createHorizontalGlue());
            box.add(hbox);
            hbox = Box.createHorizontalBox();
            hbox.add(lsubsample = new JLabel(resources.getStringValue("asciiOptionSubSamplingText")));
            hbox.add(Box.createHorizontalGlue());
            hbox.add(nfsubsample = new NumberField(1, 5));
            box.add(hbox);
            cbsubsample.apply();
            hbox = Box.createHorizontalBox();
            hbox.add(cbdynamic = new ActionCheckBox(resources.getStringValue("asciiOptionDynamic"), false) {
                public void actionPerformed(ActionEvent e) {
                    nfdelay.setEnabled(isSelected());
                    ldynamic.setEnabled(isSelected());
                    nfbuffersize.setEnabled(isSelected());
                    ldynamicbuffersize.setEnabled(isSelected());
                    if (!isSelected()) {
                        nfdelay.setValue(1000);
                    }
                    if (!isSelected()) {
                        nfbuffersize.setValue(100);
                    }
                }
            });
            hbox.add(Box.createHorizontalGlue());
            box.add(hbox);
            hbox = Box.createHorizontalBox();
            hbox.add(ldynamic = new JLabel(resources.getStringValue("asciiOptionDynamicPeriod")));
            hbox.add(Box.createHorizontalGlue());
            hbox.add(nfdelay = new NumberField(1000, 5));
            box.add(hbox);
            hbox = Box.createHorizontalBox();
            hbox.add(ldynamicbuffersize = new JLabel(resources.getStringValue("asciiOptionDynamicBufferSize")));
            hbox.add(Box.createHorizontalGlue());
            hbox.add(nfbuffersize = new NumberField(100, 5));
            box.add(hbox);
            cbdynamic.apply();
            hbox = Box.createHorizontalBox();
            hbox.add(new JLabel(resources.getStringValue("asciiOptionCharset")));
            hbox.add(Box.createHorizontalGlue());
View Full Code Here

Examples of simtools.ui.NumberField

      panel.add(pcbfixedautox = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
        public void actionPerformed(ActionEvent e) {
          pnffixedautox.setEnabled(isSelected() && isEnabled());
        }
      });
      panel.add(pnffixedautox = new NumberField(autorange,10));
      section.add(panel);
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(plpxmin = new JLabel(resources.getString("minLabel")));
      panel.add(ptfpxmin = new NumberField(10));
      ptfpxmin.setValue(plot.getDomainAxis().getLowerBound());
      panel.add(plpxmax = new JLabel(resources.getString("maxLabel")));
      panel.add(ptfpxmax = new NumberField(10));
      ptfpxmax.setValue(plot.getDomainAxis().getUpperBound());
      section.add(panel);
      pcbautox.apply();

      content.add(section);

//       X secondary axis section
      if (plot.getSecondaryDomainAxis(0) != null) {
        section = new Box(BoxLayout.Y_AXIS);
        section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("SecondaryXAxis")));
        panel = new JPanel();
        panel.setLayout(new FlowLayout(FlowLayout.LEFT));
        panel.add(scbautox = new ActionCheckBox(resources.getString("Auto-update"), plot.getSecondaryDomainAxis(0).isAutoRange()) {
          public void actionPerformed(ActionEvent e) {
            scbfixedautox.setEnabled(isSelected());
            scbfixedautox.apply();
            slpxmin.setEnabled(!isSelected());
            slpxmax.setEnabled(!isSelected());
            stfpxmin.setEnabled(!isSelected());
            stfpxmax.setEnabled(!isSelected());
          }
      });
      autorange = plot.getSecondaryDomainAxis(0).getFixedAutoRange();
      panel.add(scbfixedautox = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
        public void actionPerformed(ActionEvent e) {
          snffixedautox.setEnabled(isSelected() && isEnabled());
        }
      });
      panel.add(snffixedautox = new NumberField(autorange,10));
      section.add(panel);
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(slpxmin = new JLabel(resources.getString("minLabel")));
      panel.add(stfpxmin = new NumberField(10));
      stfpxmin.setValue(plot.getSecondaryDomainAxis(0).getLowerBound());
      panel.add(slpxmax = new JLabel(resources.getString("maxLabel")));
      panel.add(stfpxmax = new NumberField(10));
      stfpxmax.setValue(plot.getSecondaryDomainAxis(0).getUpperBound());
      section.add(panel);
      scbautox.apply();

      content.add(section);
      }
      // Now handle Y axis
      section = new Box(BoxLayout.Y_AXIS);
      section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("YAxis")));
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(pcbautoy = new ActionCheckBox(resources.getString("Auto-update"), plot.getRangeAxis().isAutoRange()) {
        public void actionPerformed(ActionEvent e) {
          pcbfixedautoy.setEnabled(isSelected());
          pcbfixedautoy.apply();
          plpymin.setEnabled(!isSelected());
          plpymax.setEnabled(!isSelected());
          ptfpymin.setEnabled(!isSelected());
          ptfpymax.setEnabled(!isSelected());
        }
      });
      autorange = plot.getRangeAxis().getFixedAutoRange();
      panel.add(pcbfixedautoy = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
        public void actionPerformed(ActionEvent e) {
          pnffixedautoy.setEnabled(isSelected() && isEnabled());
        }
      });
      panel.add(pnffixedautoy = new NumberField(autorange,8));
      panel.add(plpymin = new JLabel(resources.getString("minLabel")));
      panel.add(ptfpymin = new NumberField(8));
      ptfpymin.setValue(plot.getRangeAxis().getLowerBound());
      panel.add(plpymax = new JLabel(resources.getString("maxLabel")));
      panel.add(ptfpymax = new NumberField(8));
      ptfpymax.setValue(plot.getRangeAxis().getUpperBound());
      section.add(panel);
      pcbautoy.apply();

      section.add(panel);

      Box box = Box.createHorizontalBox();

      box.add(new JLabel(resources.getString("Curves:")));
      box.add(pcbxcurves = new JComboBox());
      box.add(pcurvecolor = new JButton("    "));
      box.add(pcurvedelete = new JButton(resources.getString("Delete")));
      section.add(box);
      content.add(section);

      pcbxcurves.setEditable(true);
      noCurveColor = pcurvecolor.getBackground();
      pcurvecolor.setFocusPainted(false);
      SourceXYDataset dst = (SourceXYDataset)plot.getDataset();
      int n = dst.getSeriesCount();
      JSynopticXYItemRenderer renderer = (JSynopticXYItemRenderer)plot.getRenderer();
      for (int i=0; i<n; ++i) {
        DataSource ds = renderer.getDataSource(i);
        if (ds==null) {
          ds = dst.getYSource(i); // take the datasource associated with this curve by default
          DataSource linked = DataInfo.getLinkedSource(ds); // and follow link if necessary
          if (linked!=null) ds = linked;
        }
        pcbxcurves.addItem(new CbxEntry(i,dst.getSeriesName(i),(Color)renderer.getSeriesPaint(i),ds,renderer.getColorMapper(i)));
      }
      pcbxeditortf = (JTextField)pcbxcurves.getEditor().getEditorComponent();
      pupdateForEntry(pcbxcurves.getSelectedItem());
     
      pcbxcurves.addPopupMenuListener(new PopupMenuListener() {
        public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
          peditLocked = true;
        }
        public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
          peditLocked = false;
        }
        public void popupMenuCanceled(PopupMenuEvent e) {
          peditLocked = false;
        }
      });

      pcbxcurves.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange()==ItemEvent.DESELECTED) pactiveEntry = null;
          else pupdateForEntry(e.getItem());
        }
      });

      pcbxeditortf.getDocument().addDocumentListener(new DocumentListener() {
        public void insertUpdate(DocumentEvent e) {
          updateName();
        }
        public void removeUpdate(DocumentEvent e) {
          updateName();
        }
        public void changedUpdate(DocumentEvent e) {
          updateName();
        }
        public void updateName() {
          if ((peditLocked) || (pactiveEntry == null)) return;
          pactiveEntry.name = pcbxeditortf.getText();
        }
      });

      pcurvecolor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (pactiveEntry==null) return;
         
           DynamicColorChooser dialog = new DynamicColorChooser(
                              null, resources.getString("ChooseAColor"),null ,pactiveEntry.color,pactiveEntry.source,pactiveEntry.mapper);


                      dialog.pack();
                      dialog.setVisible(true);

                      if (dialog.isOk()){
                          pactiveEntry.color = dialog.getColor();
                          pactiveEntry.source = dialog.getSource();
                          pactiveEntry.mapper = dialog.getMapper();
                          pupdateForEntry(pactiveEntry);
                      }
        }
      });

      pcurvedelete.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (pactiveEntry==null) return;
          pcbxcurves.removeItem(pactiveEntry);
        }
      });

      // Now handle Secondary Y axis
      if (plot.getSecondaryRangeAxis(0) != null) {
        section = new Box(BoxLayout.Y_AXIS);
        section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("SecondaryYAxis")));
        panel = new JPanel();
        panel.setLayout(new FlowLayout(FlowLayout.LEFT));
        panel.add(scbautoy = new ActionCheckBox(resources.getString("Auto-update"), plot.getSecondaryRangeAxis(0).isAutoRange()) {
          public void actionPerformed(ActionEvent e) {
            scbfixedautoy.setEnabled(isSelected());
            scbfixedautoy.apply();
            slpymin.setEnabled(!isSelected());
            slpymax.setEnabled(!isSelected());
            stfpymin.setEnabled(!isSelected());
            stfpymax.setEnabled(!isSelected());
          }
        });
        autorange = plot.getSecondaryRangeAxis(0).getFixedAutoRange();
        panel.add(scbfixedautoy = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
          public void actionPerformed(ActionEvent e) {
            snffixedautoy.setEnabled(isSelected() && isEnabled());
          }
        });
        panel.add(snffixedautoy = new NumberField(autorange,8));
        panel.add(slpymin = new JLabel(resources.getString("minLabel")));
        panel.add(stfpymin = new NumberField(8));
        stfpymin.setValue(plot.getSecondaryRangeAxis(0).getLowerBound());
        panel.add(slpymax = new JLabel(resources.getString("maxLabel")));
        panel.add(stfpymax = new NumberField(8));
        stfpymax.setValue(plot.getSecondaryRangeAxis(0).getUpperBound());
        section.add(panel);
        scbautoy.apply();
 
        section.add(panel);
View Full Code Here

Examples of simtools.ui.NumberField

     * @return
     */
    protected void setSizePanel(boolean showResize, boolean showTransform) {
        // Rezise properties
        lwidth = new JLabel(resources.getString("Width"));
        nfWidth = new NumberField(5);
        nfWidth.setHorizontalAlignment(SwingConstants.RIGHT);
        lheight = new JLabel(resources.getString("Height"));
        nfHeight = new NumberField(5);
        nfHeight.setHorizontalAlignment(SwingConstants.RIGHT);
        cbResize = new JCheckBox(resources.getString("AllowResize"), false);
        cbRatio = new JCheckBox(resources.getString("FixedRatio"), false);
        // Transform properties
        lTransformation = new JLabel(resources.getString("transformation"));
View Full Code Here

Examples of simtools.ui.NumberField

            setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
           
            Box box = Box.createHorizontalBox();
            box.add(new JLabel(param1Name()));
            box.add(Box.createHorizontalGlue());
            box.add(nfParam1 = new NumberField(0.0));
            add(box);
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(param2Name()));
            box.add(Box.createHorizontalGlue());
            box.add(nfParam2 = new NumberField(1.0));
            add(box);
           
            box = Box.createHorizontalBox();
            box.add(rbStatic = new JRadioButton(resources.getString("static"),true));
            box.add(Box.createHorizontalGlue());
            add(box);
           
            box = Box.createHorizontalBox();
            box.add(rbDynamic = new JRadioButton(resources.getString("dynamic"),false));
            box.add(Box.createHorizontalGlue());
            add(box);
           
            ButtonGroup bg = new ButtonGroup();
            bg.add(rbStatic);
            bg.add(rbDynamic);
           
            final JPanel cardPane = new JPanel(new CardLayout());
           
            box = Box.createHorizontalBox();
            box.add(bufferLabel = new JLabel(resources.getString("staticBufferLabel")));
            box.add(Box.createHorizontalGlue());
            box.add(nfSize = new NumberField(100,5));
            cardPane.add(box,"s");
           
            Box vbox = Box.createVerticalBox();
            box = Box.createHorizontalBox();
            box.add(bufferLabel = new JLabel(resources.getString("dynamicBufferLabel")));
            box.add(Box.createHorizontalGlue());
            box.add(nfDynamicSize = new NumberField(100,5));
            vbox.add(box);
            box = Box.createHorizontalBox();
            box.add(bufferLabel = new JLabel(resources.getString("period")));
            box.add(Box.createHorizontalGlue());
            box.add(tfPeriod = new JTextField("1000"));
View Full Code Here

Examples of simtools.ui.NumberField

        bg.add(rbUseSource);

        box = Box.createHorizontalBox();
        box.add(lformatdigits = new JLabel(resources.getString("DecimalDigits")));
        box.add(Box.createHorizontalGlue());
        box.add(nfformat = new NumberField(3,3));
        nfformat.setColumns(3);
        nfformat.setHorizontalAlignment(JTextField.RIGHT);

        cbxformat.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
View Full Code Here

Examples of simtools.ui.NumberField

          XYPlot plot = (XYPlot)chart.getXYPlot();
          PlotPanel plotPanel = new PlotPanel();
          Container c = (Container)plotPanel.getComponent(0);
          Box b = Box.createHorizontalBox();
          b.add(new JLabel(resources.getString("TransparencyCoefficient")));
          NumberField nfalpha;
          b.add(Box.createHorizontalGlue());
          b.add(nfalpha = new NumberField(plot.getForegroundAlpha()));
          c.add(b);
          b = Box.createHorizontalBox();
          JCheckBox cbDrawContour;
          b.add(cbDrawContour = new JCheckBox(resources.getString("OutlineEachSegment"), ((JSynopticAreaXYItemRenderer)plot.getRenderer()).isOutline()));
          b.add(Box.createHorizontalGlue());
          c.add(b);
          if (tab!=null) tab.add(plotPanel,0);
          int result = JOptionPane.showConfirmDialog(null, panel,
            resources.getString("ChartProperties"), JOptionPane.OK_CANCEL_OPTION,
            JOptionPane.PLAIN_MESSAGE);
          if (result == JOptionPane.OK_OPTION) {
            panel.updateChartProperties(chart);
            if (plotPanel!=null) {
              plotPanel.updateChartProperties();
              plot.setForegroundAlpha((float)nfalpha.getDoubleValue());
              ((JSynopticAreaXYItemRenderer)plot.getRenderer()).setOutline(cbDrawContour.isSelected());
            }
          }
          notifyChange();
        }
View Full Code Here

Examples of simtools.ui.NumberField

                lcharNumber.setEnabled(cbFrameLocked.isSelected());
                nfCharNumber.setEnabled(cbFrameLocked.isSelected());
            }
        };
        lcharNumber = new JLabel(resources.getString("CharNumber"));
        nfCharNumber = new NumberField(0, 5);
        cbFrameLocked = new ActionCheckBox(resources.getString("FixedFrame"), false) {
            public void actionPerformed(ActionEvent e) {
                if (isSelected()) {
                    cbFontLocked.setSelected(false);
                }
View Full Code Here

Examples of simtools.ui.NumberField

        // CARD PANEL
        cards = new JPanel();
        cards.setLayout(new CardLayout());
        // JSYnoptic formater
        lformatdigits = new JLabel(resources.getString("DecimalDigits:"));
        nfformat = new NumberField(0, 3);
        nfformat.setColumns(10);
        nfformat.setHorizontalAlignment(SwingConstants.RIGHT);
        GridBagPanel digitsPanel = new GridBagPanel();
        digitsPanel.addOnCurrentRow(lformatdigits);
        digitsPanel.addOnCurrentRow(nfformat);
View Full Code Here

Examples of simtools.ui.NumberField

      isComplete = iDate.get(Calendar.MONTH) == Calendar.DECEMBER;
    }
    _monthField = new JComboBox(months);
    add(_monthField);
    _monthField.setSelectedIndex(date.get(Calendar.MONTH));
    add(_yearField = new NumberField(date.get(Calendar.YEAR), 4));
    add(new Label(""));
    add(_hourField = new DatePartField(date.get(Calendar.HOUR_OF_DAY), 0, 23, 2));
    add(_minuteField = new DatePartField(date.get(Calendar.MINUTE), 0, 59, 2));
    add(_secondField = new DatePartField(date.get(Calendar.SECOND), 0, 59, 2));
    add(_millisecondField = new DatePartField(date.get(Calendar.MILLISECOND), 0, 999, 3));
View Full Code Here

Examples of simtools.ui.NumberField

    lmin = new JLabel(resources.getStringValue("minLabel"));
    panel.add(lmin);
    addMinMaxComponent(true,panel);
    lmax = new JLabel(resources.getStringValue("maxLabel"));
    panel.add(lmax);
    tfmax = new NumberField(0, 10);
    addMinMaxComponent(false,panel);
    addStepComponent(panel);
    add(panel);
  }
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.