Examples of Box


Examples of javax.swing.Box

        if (palette == null) {
            if (Debug.debugging("dted"))
                Debug.output("DTEDLayer: creating DTED Palette.");

            palette = Box.createVerticalBox();
            Box subbox1 = Box.createHorizontalBox();
            Box subbox2 = Box.createVerticalBox();
            Box subbox3 = Box.createHorizontalBox();

            //          palette = new JPanel();
            //          palette.setLayout(new GridLayout(0, 1));

            // The DTED Level selector
            JPanel levelPanel = PaletteHelper.createPaletteJPanel("DTED Level");
            ButtonGroup levels = new ButtonGroup();

            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (cache != null) {
                        String ac = e.getActionCommand();
                        int newLevel;
                        if (ac.equalsIgnoreCase(level2Command))
                            newLevel = DTEDFrameSubframe.LEVEL_2;
                        else if (ac.equalsIgnoreCase(level1Command))
                            newLevel = DTEDFrameSubframe.LEVEL_1;
                        else
                            newLevel = DTEDFrameSubframe.LEVEL_0;
                        DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
                        dfsi.dtedLevel = newLevel;
                        //                      cache.setSubframeInfo(dfsi);
                    }
                }
            };

            JRadioButton level0 = new JRadioButton("Level 0");
            level0.addActionListener(al);
            level0.setActionCommand(level0Command);
            JRadioButton level1 = new JRadioButton("Level 1");
            level1.addActionListener(al);
            level1.setActionCommand(level1Command);
            JRadioButton level2 = new JRadioButton("Level 2");
            level2.addActionListener(al);
            level2.setActionCommand(level2Command);

            levels.add(level0);
            levels.add(level1);
            levels.add(level2);

            switch (dtedLevel) {
            case 2:
                level2.setSelected(true);
                break;
            case 1:
                level1.setSelected(true);
                break;
            case 0:
            default:
                level0.setSelected(true);
            }

            levelPanel.add(level0);
            levelPanel.add(level1);
            levelPanel.add(level2);

            // The DTED view selector
            JPanel viewPanel = PaletteHelper.createPaletteJPanel("View Type");
            String[] viewStrings = { "None", "Shading", "Elevation Shading",
                    "Elevation Bands (Meters)", "Elevation Bands (Feet)" };

            JComboBox viewList = new JComboBox(viewStrings);
            viewList.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JComboBox jcb = (JComboBox) e.getSource();
                    int newView = jcb.getSelectedIndex();
                    switch (newView) {
                    case 0:
                        viewType = DTEDFrameSubframe.NOSHADING;
                        break;
                    case 1:
                        viewType = DTEDFrameSubframe.SLOPESHADING;
                        break;
                    case 2:
                        viewType = DTEDFrameSubframe.COLOREDSHADING;
                        break;
                    case 3:
                        viewType = DTEDFrameSubframe.METERSHADING;
                        break;
                    case 4:
                        viewType = DTEDFrameSubframe.FEETSHADING;
                        break;
                    default:
                        viewType = DTEDFrameSubframe.NOSHADING;
                    }
                    if (cache != null) {
                        DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
                        dfsi.viewType = viewType;
                        //                      cache.setSubframeInfo(dfsi);
                    }

                }
            });
            int selectedView;
            switch (viewType) {
            case 0:
            case 1:
                selectedView = viewType;
                break;
            case 2:
            case 3:
                selectedView = viewType + 1;
                break;
            case 4:
                // This puts the layer in testing mode, and the menu
                // changes.
                String[] viewStrings2 = { "None", "Shading",
                        "Elevation Bands (Meters)", "Elevation Bands (Feet)",
                        "Subframe Testing", "Elevation Shading" };
                viewList = new JComboBox(viewStrings2);
                viewList.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        JComboBox jcb = (JComboBox) e.getSource();
                        int newView = jcb.getSelectedIndex();
                        if (cache != null) {
                            DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
                            dfsi.viewType = newView;
                            //                          cache.setSubframeInfo(dfsi);
                        }
                    }
                });
                selectedView = viewType;
                break;
            case 5:
                selectedView = 2; //DTEDFrameSubframe.COLOREDSHADING
                break;
            default:
                selectedView = DTEDFrameSubframe.NOSHADING;
            }

            viewList.setSelectedIndex(selectedView);
            viewPanel.add(viewList);

            // The DTED Contrast Adjuster
            JPanel contrastPanel = PaletteHelper.createPaletteJPanel("Contrast Adjustment");
            JSlider contrastSlide = new JSlider(JSlider.HORIZONTAL, 1/* min */, 5/* max */, slopeAdjust/* inital */);
            java.util.Hashtable dict = new java.util.Hashtable();
            dict.put(new Integer(1), new JLabel("min"));
            dict.put(new Integer(5), new JLabel("max"));
            contrastSlide.setLabelTable(dict);
            contrastSlide.setPaintLabels(true);
            contrastSlide.setMajorTickSpacing(1);
            contrastSlide.setPaintTicks(true);
            contrastSlide.setSnapToTicks(true);
            contrastSlide.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent ce) {
                    JSlider slider = (JSlider) ce.getSource();
                    if (slider.getValueIsAdjusting()) {
                        fireRequestInfoLine(getName()
                                + " - Contrast Slider value = "
                                + slider.getValue());
                        slopeAdjust = slider.getValue();
                        if (cache != null) {
                            DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
                            dfsi.slopeAdjust = slopeAdjust;
                            //                          cache.setSubframeInfo(dfsi);
                        }
                    }
                }
            });
            contrastPanel.add(contrastSlide);

            // The DTED Band Height Adjuster
            JPanel bandPanel = PaletteHelper.createPaletteJPanel("Band Elevation Spacing");
            JSlider bandSlide = new JSlider(JSlider.HORIZONTAL, 0/* min */, 1000/* max */, bandHeight/* inital */);
            bandSlide.setLabelTable(bandSlide.createStandardLabels(250));
            bandSlide.setPaintLabels(true);
            bandSlide.setMajorTickSpacing(250);
            bandSlide.setMinorTickSpacing(50);
            bandSlide.setPaintTicks(true);
            bandSlide.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent ce) {
                    JSlider slider = (JSlider) ce.getSource();
                    if (slider.getValueIsAdjusting()) {
                        fireRequestInfoLine(getName()
                                + " - Band Slider value = " + slider.getValue());
                        bandHeight = slider.getValue();
                        if (cache != null) {
                            DTEDFrameSubframeInfo dfsi = cache.getSubframeInfo();
                            dfsi.bandHeight = bandHeight;
                            //                          cache.setSubframeInfo(dfsi);
                        }
                    }
                }
            });

            bandPanel.add(bandSlide);

            JButton redraw = new JButton("Redraw DTED Layer");
            redraw.setActionCommand(RedrawCmd);
            redraw.addActionListener(this);

            subbox1.add(levelPanel);
            subbox1.add(viewPanel);
            palette.add(subbox1);
            subbox2.add(contrastPanel);
            subbox2.add(bandPanel);
            palette.add(subbox2);
            subbox3.add(redraw);
            palette.add(subbox3);
        }

        return palette;
    }
View Full Code Here

Examples of javax.swing.Box

        protected JTextField tfDynaStop;
       
        public OptionPanel() {
            setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
           
            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 vbox = Box.createVerticalBox();
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(" "));
            vbox.add(box);
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(resources.getString("min")));
            box.add(Box.createHorizontalGlue());
            box.add(tfMin = new JTextField());
            vbox.add(box);
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(resources.getString("max")));
            box.add(Box.createHorizontalGlue());
            box.add(tfMax = new JTextField());
            vbox.add(box);
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(resources.getString("step")));
            box.add(Box.createHorizontalGlue());
            box.add(tfStep = new JTextField());
            vbox.add(box);
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(" "));
            vbox.add(box);
           
            cardPane.add(vbox,"s");
           
            vbox = Box.createVerticalBox();
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(resources.getString("initValue")));
            box.add(Box.createHorizontalGlue());
            box.add(tfInit = new JTextField());
            vbox.add(box);
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(resources.getString("step")));
            box.add(Box.createHorizontalGlue());
            box.add(tfDynaStep = new JTextField());
            vbox.add(box);
           
            box = Box.createHorizontalBox();
            box.add(cbDynaEnd = new ActionCheckBox(resources.getString("stopValue"), false) {
                public void actionPerformed(ActionEvent e) {
                    tfDynaStop.setEnabled(cbDynaEnd.isSelected());
                    tfDynaStop.setEditable(cbDynaEnd.isSelected());
                }
            });
            box.add(Box.createHorizontalGlue());
            box.add(tfDynaStop = new JTextField());
            vbox.add(box);
            cbDynaEnd.apply();
           
            box = Box.createHorizontalBox();
            box.add(bufferLabel = new JLabel(resources.getString("dynamicBufferLabel")));
            box.add(Box.createHorizontalGlue());
            box.add(tfSize = new JTextField());
            tfSize.setText("100");
            vbox.add(box);
           
            box = Box.createHorizontalBox();
            box.add(bufferLabel = new JLabel(resources.getString("period")));
            box.add(Box.createHorizontalGlue());
            box.add(tfPeriod = new JTextField());
            tfPeriod.setText("1000");
            vbox.add(box);
           
            cardPane.add(vbox,"d");
           
            add(cardPane);
           
View Full Code Here

Examples of javax.swing.Box

    public PlotPanel() {
     
      setLayout(new BorderLayout());

      JPanel panel;
      Box section;
     
      Box content = Box.createVerticalBox();
     
      setName(resources.getString("PlotProperties"));

      CategoryPlot plot = chart.getCategoryPlot();
      SourceCategoryDataset dst = (SourceCategoryDataset)plot.getDataset();

      // Create the title section
      section=Box.createHorizontalBox();
      section.add(new JLabel(resources.getString("PlotTitle:")));
      section.add(tfTitle = new JTextField());
      tfTitle.setText(chart.getTitle().getText());
      content.add(section);

      section=Box.createVerticalBox();
      section.setBorder(BorderFactory.createTitledBorder(resources.getString("Series")));

      Box box = Box.createHorizontalBox();
      box.add(pcbxcurves = new JComboBox());
      box.add(pcurvecolor = new JButton("    "));
      box.add(pcurvedelete = new JButton(resources.getString("Delete")));
      section.add(box);
     
      box = Box.createHorizontalBox();
      box.add(new JLabel(resources.getString("Orientation")));
      box.add(Box.createHorizontalGlue());
      box.add(hSeriesOrientation = new JRadioButton(resources.getString("Horizontal")));
      box.add(vSeriesOrientation = new JRadioButton(resources.getString("Vertical")));
      hSeriesOrientation.setSelected(plot.getOrientation() == PlotOrientation.HORIZONTAL);
      vSeriesOrientation.setSelected(plot.getOrientation() == PlotOrientation.VERTICAL);
      ButtonGroup bg = new ButtonGroup();
      bg.add(hSeriesOrientation);
      bg.add(vSeriesOrientation);
      section.add(box);
     
      content.add(section);

      pcbxcurves.setEditable(true);
      Color noCurveColor = pcurvecolor.getBackground();
      pcurvecolor.setFocusPainted(false);

      CategoryItemRenderer renderer = plot.getRenderer();
      int n = dst.getRowCount();
      for (int i=0; i<n; ++i) {
        DataSource ds = (DataSource)mapperSources.get(i);
        if (ds==null) ds = dst.getSource(i); // take the datasource associated with this series by default
        pcbxcurves.addItem(new CbxEntry(i,dst.getName(i),(Color)renderer.getSeriesPaint(i),ds,(ColorMapper)mappers.get(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);
        }
      });

     
      section=Box.createVerticalBox();
      section.setBorder(BorderFactory.createTitledBorder(resources.getString("Categories")));

      box = Box.createHorizontalBox();
      box.add(new JLabel(resources.getString("LabelsOrientation")));
      box.add(Box.createHorizontalGlue());
      box.add(hLabelOrientation = new JRadioButton(resources.getString("Horizontal")));
      box.add(vLabelOrientation = new JRadioButton(resources.getString("Vertical")));
      CategoryLabelPosition clp = vSeriesOrientation.isSelected() ? plot.getDomainAxis().getCategoryLabelPositions().getLabelPosition(RectangleEdge.BOTTOM) : plot.getDomainAxis().getCategoryLabelPositions().getLabelPosition(RectangleEdge.LEFT);
      boolean vertical = clp.getAngle() != 0;
      hLabelOrientation.setSelected(!vertical);
      vLabelOrientation.setSelected(vertical);
      bg = new ButtonGroup();
      bg.add(hLabelOrientation);
      bg.add(vLabelOrientation);
      section.add(box);

      mapper = (dst.getClassifier()==null) ? null : dst.getClassifier().getMapper();
     
      box = Box.createHorizontalBox();
      box.add(new JLabel(resources.getString("Mapper")));
      box.add(Box.createHorizontalGlue());
      box.add(cbxmapper = new JComboBox());
      cbxmapper.addItem(resources.getString("=======NONE======="));
      int idx = 0;
      if (TextMapper.textMappers!=null) for (int i =0; i<TextMapper.textMappers.size(); ++i) {
        TextMapper tm = (TextMapper)TextMapper.textMappers.get(i);
        if (tm.equals(mapper)) idx = i +1;
        cbxmapper.addItem(tm);
      }
      cbxmapper.setEditable(false);
      cbxmapper.setSelectedIndex(idx);
      box.add(cbxmapper);
      box.add(beditmapper = new JButton(resources.getString("Edit")));
      box.add(bnewmapper = new JButton(resources.getString("New")));
      box.add(bdelmapper = new JButton(resources.getString("Delete")));
      if (idx==0) {
        beditmapper.setEnabled(false);
        bdelmapper.setEnabled(false);
      }
     
View Full Code Here

Examples of javax.swing.Box

    }
    // reset to default locale, just in case
    CustomizedLocale.set(defaultLocale);

    ButtonGroup bg = new ButtonGroup();
    Box vbox = Box.createVerticalBox();
    vbox.add(Box.createVerticalGlue());
    // Add UI elements in localisation order
    for (int i=0; i<numLocales; ++i) {
      final ResourceBundle res = (ResourceBundle)resList.get(i);
      final int counter = i;
      // first one is true as this is the default locale
      ActionRadioButton arb = new ActionRadioButton(res.getString("chooseThisLanguage"),i==0) {
        public void stateChanged(ChangeEvent e) {
          if (isSelected()) {
            Installer.resources = res;
            Locale l = (Locale)locList.get(counter);
            CustomizedLocale.set(l);
            LangPanel.this.update();
          }
        }
      };
      bg.add(arb);
      Box hbox = Box.createHorizontalBox();
      hbox.add(arb);
      hbox.add(Box.createHorizontalGlue());
      vbox.add(hbox);
      arb.apply();
    }
    vbox.add(Box.createVerticalGlue());
View Full Code Here

Examples of javax.swing.Box

    setTitle(resources.getString("title"));

    panels = new InstallerPanel[panelClasses.length];
    currentPanel = 0;
   
    Box buttonZone = Box.createHorizontalBox();
    buttonZone.add(Box.createHorizontalGlue());
    buttonZone.add(previous);
    buttonZone.add(cancel);
    buttonZone.add(next);
       
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(getPanel(),BorderLayout.CENTER);
    getContentPane().add(buttonZone,BorderLayout.SOUTH);
View Full Code Here

Examples of javax.swing.Box

    public PlotPanel() {
//      setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
      setLayout(new BorderLayout());

      JPanel panel;
      Box section;
     
      Box content = Box.createVerticalBox();
     
      setName(resources.getString("PlotProperties"));

      XYPlot plot = chart.getXYPlot();

      // Create the title section
      section=Box.createHorizontalBox();
      section.add(new JLabel(resources.getString("PlotTitle:")));
      section.add(tfTitle = new JTextField());
      tfTitle.setText(chart.getTitle().getText());
      content.add(section);


      // X axis section
      section = new Box(BoxLayout.Y_AXIS);
      section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("XAxis")));
     
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
     
      CyclicNumberAxis cna = null;
      if (plot.getDomainAxis() instanceof CyclicNumberAxis) cna = (CyclicNumberAxis)plot.getDomainAxis();
     
      panel.add(cbcyclex = new ActionCheckBox(resources.getString("CyclicAxis"), cna!=null) {
        public void actionPerformed(ActionEvent e) {
          CardLayout cl = (CardLayout)(xcards.getLayout());
          if (isSelected()) cl.show(xcards, "cyclic");
          else cl.show(xcards, "normal");
        }
      });
      panel.add(cbinvertx = new ActionCheckBox(resources.getString("Inverted"), plot.getDomainAxis().isInverted()) {
        public void actionPerformed(ActionEvent e) {
        }
      });
      section.add(panel);
     
      xcards = new JPanel();
      xcards.setLayout(new CardLayout());
     
      Box hbox = Box.createHorizontalBox();
      hbox.add(new JLabel(resources.getString("Period")));
      hbox.add(nfperiodx = new NumberField(cna==null ? 0 : cna.getPeriod()));
      hbox.add(Box.createHorizontalGlue());
      hbox.add(new JLabel(resources.getString("Offset")));
      hbox.add(nfoffsetx = new NumberField(cna==null ? 0 : cna.getOffset()));
      xcards.add(hbox,"cyclic");
     
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      double autorange = plot.getDomainAxis().getFixedAutoRange();
      panel.add(cbfixedautox = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
        public void actionPerformed(ActionEvent e) {
          nffixedautox.setEnabled(isSelected() && isEnabled());
        }
      });
      panel.add(nffixedautox = new NumberField(autorange,10));
      xcards.add(panel,"normal");

      section.add(xcards);
     
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(cbautox = new ActionCheckBox(resources.getString("Auto-update"), plot.getDomainAxis().isAutoRange()) {
        public void actionPerformed(ActionEvent e) {
          cbfixedautox.setEnabled(isSelected());
          cbfixedautox.apply();
          lpxmin.setEnabled(!isSelected());
          lpxmax.setEnabled(!isSelected());
          tfpxmin.setEnabled(!isSelected());
          tfpxmax.setEnabled(!isSelected());
        }
      });
      panel.add(lpxmin = new JLabel(resources.getString("minLabel")));
      panel.add(tfpxmin = new NumberField(10));
      tfpxmin.setValue(plot.getDomainAxis().getLowerBound());
      panel.add(lpxmax = new JLabel(resources.getString("maxLabel")));
      panel.add(tfpxmax = new NumberField(10));
      tfpxmax.setValue(plot.getDomainAxis().getUpperBound());
      cbautox.apply();
      section.add(panel);
     
      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));
     
      cna = null;
      if (plot.getRangeAxis() instanceof CyclicNumberAxis) cna = (CyclicNumberAxis)plot.getRangeAxis();
     
      panel.add(cbcycley = new ActionCheckBox(resources.getString("CyclicAxis"), cna!=null) {
        public void actionPerformed(ActionEvent e) {
          CardLayout cl = (CardLayout)(ycards.getLayout());
          if (isSelected()) cl.show(ycards, "cyclic");
          else cl.show(ycards, "normal");
        }
      });
      panel.add(cbinverty = new ActionCheckBox(resources.getString("Inverted"), plot.getRangeAxis().isInverted()) {
        public void actionPerformed(ActionEvent e) {
        }
      });
      section.add(panel);
     
      ycards = new JPanel();
      ycards.setLayout(new CardLayout());
     
      hbox = Box.createHorizontalBox();
      hbox.add(new JLabel(resources.getString("Period")));
      hbox.add(nfperiody = new NumberField(cna==null ? 0 : cna.getPeriod()));
      hbox.add(Box.createHorizontalGlue());
      hbox.add(new JLabel(resources.getString("Offset")));
      hbox.add(nfoffsety = new NumberField(cna==null ? 0 : cna.getOffset()));
      ycards.add(hbox,"cyclic");
     
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      autorange = plot.getRangeAxis().getFixedAutoRange();
      panel.add(cbfixedautoy = new ActionCheckBox(resources.getString("FixedRange"),autorange!=0) {
        public void actionPerformed(ActionEvent e) {
          nffixedautoy.setEnabled(isSelected() && isEnabled());
        }
      });
      panel.add(nffixedautoy = new NumberField(autorange,10));
      ycards.add(panel,"normal");

      section.add(ycards);
     
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(cbautoy = new ActionCheckBox(resources.getString("Auto-update"), plot.getRangeAxis().isAutoRange()) {
        public void actionPerformed(ActionEvent e) {
          cbfixedautoy.setEnabled(isSelected());
          cbfixedautoy.apply();
          lpymin.setEnabled(!isSelected());
          lpymax.setEnabled(!isSelected());
          tfpymin.setEnabled(!isSelected());
          tfpymax.setEnabled(!isSelected());
        }
      });
      panel.add(lpymin = new JLabel(resources.getString("minLabel")));
      panel.add(tfpymin = new NumberField(10));
      tfpymin.setValue(plot.getRangeAxis().getLowerBound());
      panel.add(lpymax = new JLabel(resources.getString("maxLabel")));
      panel.add(tfpymax = new NumberField(10));
      tfpymax.setValue(plot.getRangeAxis().getUpperBound());
      cbautoy.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();
View Full Code Here

Examples of javax.swing.Box

            baseColorMapperSource = ShapeNode.this.baseColorMapperSource;
            highlightColorMapperSource = ShapeNode.this.highlightColorMapperSource;
            baseColorMapper = ShapeNode.this.baseColorMapper;
            highlightColorMapper = ShapeNode.this.highlightColorMapper;
           
            Box box = Box.createHorizontalBox();
            box.add(new JLabel(NodeResourcesManager.resources.getString("Name")));
            box.add(Box.createHorizontalGlue());
            box.add(tfName = new JTextField(name));
            if (showName) add(box);
           
            box = Box.createHorizontalBox();
            box.add(new JLabel(NodeResourcesManager.resources.getString("DisplayMode")));
            box.add(Box.createHorizontalGlue());
            box.add(rbShading = new JRadioButton(NodeResourcesManager.resources.getString("Shading"), mode==SHADING_MODE));
            box.add(rbFlat = new JRadioButton(NodeResourcesManager.resources.getString("Flat"), mode==SHADING_MODE));
            box.add(rbFilled = new JRadioButton(NodeResourcesManager.resources.getString("Filled"), mode==FILLED_MODE));
            box.add(rbWireframe = new JRadioButton(NodeResourcesManager.resources.getString("Wireframe"), mode==WIREFRAME_MODE));
            ButtonGroup bg = new ButtonGroup();
            bg.add(rbShading);
            bg.add(rbFlat);
            bg.add(rbFilled);
            bg.add(rbWireframe);
            add(box);

            box = Box.createHorizontalBox();
            box.add(new JLabel(NodeResourcesManager.resources.getString("BaseColor")));
      box.add(Box.createHorizontalGlue());
      box.add(bBaseColor = new JButton("    "));
      noColor = bBaseColor.getBackground();
      bBaseColor.setFocusPainted(false);
      bBaseColor.setBackground(baseColor);
            add(box);

            box = Box.createHorizontalBox();
            box.add(new JLabel(NodeResourcesManager.resources.getString("HighlightColor")));
      box.add(Box.createHorizontalGlue());
            box.add(bHighlightColor = new JButton("    "));
            bHighlightColor.setFocusPainted(false);
      bHighlightColor.setBackground(highlightColor);
            add(box);

            bBaseColor.addActionListener(new ActionListener() {
View Full Code Here

Examples of javax.swing.Box

    protected NumberField nfPeriod;
    protected JCheckBox cbAutoStop;

    public PropertiesPanel() {
      setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
      Box box = Box.createHorizontalBox();
      box.add(new JLabel(resources.getString("Period")));
      box.add(Box.createHorizontalGlue());
      box.add(nfPeriod = new NumberField(getPeriod(), 5));
      add(box);
      box = Box.createHorizontalBox();
      box.add(cbAutoStop = new JCheckBox(resources.getString("AutoStopWhenStepFails"),isAutoStop()));
      box.add(Box.createHorizontalGlue());
      add(box);
    }
View Full Code Here

Examples of javax.swing.Box

    public PlotPanel() {
     
      setLayout(new BorderLayout());

      JPanel panel;
      Box section;
     
      Box content = Box.createVerticalBox();
     
      setName(resources.getString("PlotProperties"));

      PiePlot plot = (PiePlot)chart.getPlot();
      SourcePieDataset dst = (SourcePieDataset)plot.getDataset();

      // Create the title section
      section=Box.createHorizontalBox();
      section.add(new JLabel(resources.getString("PlotTitle:")));
      section.add(tfTitle = new JTextField());
      tfTitle.setText(chart.getTitle().getText());
      content.add(section);

      section=Box.createVerticalBox();
      section.setBorder(BorderFactory.createTitledBorder(resources.getString("Series")));

      Box box = Box.createHorizontalBox();
      box.add(pcbxcurves = new JComboBox());
      box.add(pcurvecolor = new JButton("    "));
      box.add(pcurvedelete = new JButton(resources.getString("Delete")));
      section.add(box);
     
      box = Box.createHorizontalBox();
      box.add(new JLabel(resources.getString("ExplodedRatio(>=1)")));
      box.add(tfRatio = new NumberField(1.0));
     
      // So long as this does not work for 3D pies, do not show it
      if (!(plot instanceof Pie3DPlot)) section.add(box);
     
      content.add(section);
View Full Code Here

Examples of javax.swing.Box

    protected NumberField nfPeriod;
    protected JCheckBox cbAutoStop;

    public PropertiesPanel() {
      setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
      Box box = Box.createHorizontalBox();
      box.add(new JLabel(resources.getString("Period")));
      box.add(Box.createHorizontalGlue());
      box.add(nfPeriod = new NumberField(getPeriod(), 5));
      add(box);
      box = Box.createHorizontalBox();
      box.add(cbAutoStop = new JCheckBox(resources.getString("AutoStopWhenStepFails"),isAutoStop()));
      box.add(Box.createHorizontalGlue());
      add(box);
    }
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.