Examples of Box


Examples of javax.swing.Box

        packSection.add(progress = new JProgressBar(), BorderLayout.SOUTH);
       
    add(packSection,BorderLayout.CENTER);
   
    Box hbox = Box.createHorizontalBox();
    hbox.add(new JLabel(Installer.resources.getString("location")));
   
    location = new File(Installer.resources.getString("defaultLocation"+os));
   
    hbox.add(tfLoc = new JTextField());
    updateLoc();
    Dimension d = tfLoc.getPreferredSize();
    d.width = getWidth();
    tfLoc.setMaximumSize(d);
    hbox.add(btnLoc = new JButton(Installer.resources.getString("chooseLocation")));

    add(hbox,BorderLayout.SOUTH);
   
    btnLoc.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
View Full Code Here

Examples of javax.swing.Box

        mapperCopy = (AutomatonActionMapper)mapper.clone();
      } catch (CloneNotSupportedException e) {
        mapperCopy = mapper;
      }

      Box content = Box.createVerticalBox();

      Box topBox = Box.createHorizontalBox();

      JPanel gridPanel = new JPanel(new BorderLayout());
      gridPanel.setBorder(BorderFactory.createTitledBorder(resources.getString("GridArrayParameters")));
      JPanel colpane = new JPanel(new GridLayout(2,2));
      colpane.add(new JLabel(resources.getString("NumberOfColumns")));
      colpane.add(nfNumCellX = new NumberField(cells[0].length,5));
      colpane.add(new JLabel(resources.getString("ActiveColumn")));
      colpane.add(nfActiveX = new NumberField(activeX,5));
      gridPanel.add(colpane,BorderLayout.WEST);

      JPanel rowpane = new JPanel(new GridLayout(2,2));
      rowpane.add(new JLabel(resources.getString("NumberOfRows")));
      rowpane.add(nfNumCellY = new NumberField(cells.length,5));
      rowpane.add(new JLabel(resources.getString("ActiveRow")));
      rowpane.add(nfActiveY = new NumberField(activeY,5));
      gridPanel.add(rowpane,BorderLayout.EAST);
      topBox.add(gridPanel);

      JPanel dimensionsPanel = new JPanel(new BorderLayout());
      dimensionsPanel.setBorder(BorderFactory.createTitledBorder(resources.getString("Dimensions")));
      Box box = Box.createHorizontalBox();
      box.add(cbResize = new JCheckBox(resources.getString("AllowResize"),allowResize));
      box.add(Box.createHorizontalGlue());
      box.add(cbRatio = new JCheckBox(resources.getString("FixedRatio"),fixedRatio));
      dimensionsPanel.add(box,BorderLayout.NORTH);

      box = Box.createHorizontalBox();
      box.add(lwidth = new JLabel(resources.getString("Width")));
      box.add(nfWidth = new NumberField((long)_w));
      nfWidth.setHorizontalAlignment(JTextField.RIGHT);
      box.add(Box.createHorizontalGlue());
      box.add(lheight = new JLabel(resources.getString("Height")));
      box.add(nfHeight = new NumberField((long)_h));
      nfHeight.setHorizontalAlignment(JTextField.RIGHT);
      dimensionsPanel.add(box,BorderLayout.SOUTH);

      topBox.add(dimensionsPanel);

      content.add(topBox);

      box = Box.createHorizontalBox();
      JPanel panel = mapperCopy.createPanel(new JDialog(),null)// TODO refactoring on Automaton shape, do like
      // all other builtin shapes !
      panel.setBorder(BorderFactory.createTitledBorder(resources.getString("ActionMapper")));
      box.add(panel);

      panel = new JPanel(new BorderLayout());
      dstree = SourceTree.getFromPool("PropertiesPanel0");
      JScrollPane dslistScrollPane = new JScrollPane(dstree);
      panel.add(dslistScrollPane);
      panel.setBorder(BorderFactory.createTitledBorder(resources.getString("DataSource")));
      box.add(panel);
      dstree.setSelectedValue(sourceCopy);
      dstree.removeAllTreeSelectionListeners();
      dstree.addTreeSelectionListener(new TreeSelectionListener() {
        public void valueChanged(TreeSelectionEvent e) {
          if (!e.isAddedPath()) return;
View Full Code Here

Examples of javax.swing.Box

    JLabel lrangemin, lrangemax, lnrangemin, lnrangemax, lwrangemin, lwrangemax, lcrangemin, lcrangemax;
    JTextField tfTitle;
   
    public BoundsPanel() {
      setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
      Box p1 = new Box(BoxLayout.Y_AXIS);
     
      setName(resources.getString("Properties"));

      JPanel panel;
      Box section;

     
      // Create the title section
      section=Box.createHorizontalBox();
      section.add(new JLabel(resources.getString("PlotTitle:")));
      section.add(tfTitle = new JTextField());
      tfTitle.setText(chart.getTitle().getText());
      p1.add(section);
     
     
      DatasetDelegatedMeterPlot plot = (DatasetDelegatedMeterPlot)chart.getPlot();
      SourceMeterDataset dst = (SourceMeterDataset)plot.getDataset();

      section = new Box(BoxLayout.Y_AXIS);
      section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("OverallRange")));

      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(cbautorange = new ActionCheckBox(resources.getString("Auto-update"), plot.isAutorange()) {
        public void actionPerformed(ActionEvent e) {
          lrangemin.setEnabled(!isSelected());
          lrangemax.setEnabled(!isSelected());
          tfrangemin.setEnabled(!isSelected());
          tfrangemax.setEnabled(!isSelected());
        }
      });
      panel.add(lrangemin = new JLabel(resources.getString("minLabel")));
      panel.add(tfrangemin = new NumberField(10));
      tfrangemin.setValue(plot.getRange().getLowerBound());
      panel.add(lrangemax = new JLabel(resources.getString("maxLabel")));
      panel.add(tfrangemax = new NumberField(10));
      tfrangemax.setValue(plot.getRange().getUpperBound());
      section.add(panel);
      cbautorange.apply();
      p1.add(section);

      section = new Box(BoxLayout.Y_AXIS);
      section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("'Normal'Range")));
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(cbnrange = new ActionCheckBox(resources.getString("Enable"), plot.getNormalRange()!=null) {
        public void actionPerformed(ActionEvent e) {
          lnrangemin.setEnabled(isSelected());
          lnrangemax.setEnabled(isSelected());
          tfnrangemin.setEnabled(isSelected());
          tfnrangemax.setEnabled(isSelected());
        }
      });
      panel.add(lnrangemin = new JLabel(resources.getString("minLabel")));
      panel.add(tfnrangemin = new NumberField(10));
      if (plot.getNormalRange()!=null) tfnrangemin.setValue(plot.getNormalRange().getLowerBound());
      panel.add(lnrangemax = new JLabel(resources.getString("maxLabel")));
      panel.add(tfnrangemax = new NumberField(10));
      if (plot.getNormalRange()!=null) tfnrangemax.setValue(plot.getNormalRange().getUpperBound());
      section.add(panel);
      cbnrange.apply();
      p1.add(section);

      section = new Box(BoxLayout.Y_AXIS);
      section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("'Warning'Range")));
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(cbwrange = new ActionCheckBox(resources.getString("Enable"), plot.getWarningRange()!=null) {
        public void actionPerformed(ActionEvent e) {
          lwrangemin.setEnabled(isSelected());
          lwrangemax.setEnabled(isSelected());
          tfwrangemin.setEnabled(isSelected());
          tfwrangemax.setEnabled(isSelected());
        }
      });
      panel.add(lwrangemin = new JLabel(resources.getString("minLabel")));
      panel.add(tfwrangemin = new NumberField(10));
      if (plot.getWarningRange()!=null) tfwrangemin.setValue(plot.getWarningRange().getLowerBound());
      panel.add(lwrangemax = new JLabel(resources.getString("maxLabel")));
      panel.add(tfwrangemax = new NumberField(10));
      if (plot.getWarningRange()!=null) tfwrangemax.setValue(plot.getWarningRange().getUpperBound());
      section.add(panel);
      cbwrange.apply();
      p1.add(section);

      section = new Box(BoxLayout.Y_AXIS);
      section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("'Critical'Range")));
      panel = new JPanel();
      panel.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel.add(cbcrange = new ActionCheckBox(resources.getString("Enable"), plot.getCriticalRange()!=null) {
        public void actionPerformed(ActionEvent e) {
          lcrangemin.setEnabled(isSelected());
          lcrangemax.setEnabled(isSelected());
          tfcrangemin.setEnabled(isSelected());
          tfcrangemax.setEnabled(isSelected());
        }
      });
      panel.add(lcrangemin = new JLabel(resources.getString("minLabel")));
      panel.add(tfcrangemin = new NumberField(10));
      if (plot.getCriticalRange()!=null) tfcrangemin.setValue(plot.getCriticalRange().getLowerBound());
      panel.add(lcrangemax = new JLabel(resources.getString("maxLabel")));
      panel.add(tfcrangemax = new NumberField(10));
      if (plot.getCriticalRange()!=null) tfcrangemax.setValue(plot.getCriticalRange().getUpperBound());
      section.add(panel);
      cbcrange.apply();
      p1.add(section);

      add(p1);
View Full Code Here

Examples of javax.swing.Box

        protected JLabel ldynamic, lsubsample, ldynamicbuffersize;

        protected JComboBox cbxCharset;

        public ASCIIFileOptionComponent() {
            Box box = new Box(BoxLayout.Y_AXIS);
            Box hbox = Box.createHorizontalBox();
            hbox.add(cbsubsample = new ActionCheckBox(resources.getStringValue("asciiOptionSubSampling"), false) {
                public void actionPerformed(ActionEvent e) {
                    nfsubsample.setEnabled(isSelected());
                    lsubsample.setEnabled(isSelected());
                    if (!isSelected()) {
                        nfsubsample.setValue(1);
                    }
                }
            });
            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());
            hbox.add(cbxCharset = new JComboBox());
            cbxCharset.addItem(resources.getStringValue("asciiOptionNoCharset"));
            SortedMap map = Charset.availableCharsets();
            for (Iterator it = map.keySet().iterator(); it.hasNext();) {
                cbxCharset.addItem(it.next());
            }
View Full Code Here

Examples of javax.swing.Box

    final ExpressionMappingTable table = createTable(owner);
    final JPanel pane = new JPanel(new BorderLayout());
    final ActionListener actionListener = listener; // make it visible for anonymous classes

    Box namePanel = Box.createHorizontalBox();
    final JTextField tfName = new JTextField(20);
    namePanel.add(new JLabel(resources.getString("MapperName:")));
    namePanel.add(Box.createHorizontalGlue());
    namePanel.add(tfName);
    tfName.setText((name==null) ? "" : name);
    if (listener!=null) pane.add(namePanel, BorderLayout.NORTH);
   
    Box leftPane = Box.createVerticalBox();
    leftPane.add(new JLabel(resources.getString("CurrentAssociations(double-clickToEdit)")));
    //Create the scroll pane and add the table to it.
    leftPane.add(new JScrollPane(table));
    pane.add(leftPane, BorderLayout.CENTER);

    final JButton newv, newi, del, up, down, ok;

    JPanel rightPane = new JPanel(new BorderLayout());
View Full Code Here

Examples of javax.swing.Box

     */
    protected void createFootPane() {
        footPane = new JPanel(new BorderLayout());
        footPane.add(status = new JLabel(), BorderLayout.WEST);

        Box zoomPane = new  Box(BoxLayout.X_AXIS);
        zoomPane.add(new JLabel("Z:"));
        zoomPane.add(tfZoom = new JTextField());

        // Zoom text filed
        tfZoom.setPreferredSize(new Dimension(120, 20));
        tfZoom.setMaximumSize(new Dimension(120, 20));
        tfZoom.setMinimumSize(new Dimension(120, 20));
        tfZoom.addActionListener(this);

        // Zoom tool bar               
        JToolBar  zoomToolbar = new JToolBar();
        zoomToolbar.setRollover(true);
        zoomToolbar.setFloatable(false);
        zoomToolbar.add(aZoomIn);
        zoomToolbar.add(aZoomOut);

        zoomPane.add(zoomToolbar);


        zoomPane.add(new JPanel());

        footPane.add(zoomPane, BorderLayout.EAST);


        // Force the foot Pane height to 30 px
View Full Code Here

Examples of javax.swing.Box

          ChartPropertyEditPanel panel = new ChartPropertyEditPanel(chart);
          JTabbedPane tab = findTab(panel);
          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);
View Full Code Here

Examples of javax.swing.Box

        protected JTextField tfSeed;
       
        public OptionPanel() {
            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"));
            vbox.add(box);
            cardPane.add(vbox,"d");
           
            add(cardPane);
           
            rbDynamic.addChangeListener(new ChangeListener() {
View Full Code Here

Examples of javax.swing.Box

    if(c!=null) add(c,BorderLayout.EAST);
    dialog=null;
  }

  protected JComponent createUpperContent() {
    Box box = Box.createHorizontalBox();
    box.setBorder(BorderFactory.createEtchedBorder());
    cbRotEnabled=resources.getCheckBox("cbRotEnabled",this);
    box.add(cbRotEnabled);
    box.add(Box.createHorizontalStrut(6));
    cbTransEnabled=resources.getCheckBox("cbTransEnabled",this);
    box.add(cbTransEnabled);
    box.add(Box.createHorizontalStrut(6));
    cbTransFirst=resources.getCheckBox("cbTransFirst",this);
    box.add(cbTransFirst);
   
    return box;
  }
View Full Code Here

Examples of javax.swing.Box

        if (actionList.size()>0) currentAction = actionList.getAction(0);
        else currentAction = createNewAction();
       
        setLayout(new BorderLayout());

        Box box = Box.createHorizontalBox();
        box.add(new JLabel(resources.getString("Name")));
        box.add(Box.createHorizontalGlue());
        box.add(tfName = new JTextField(actionList.getName()));
        add(box, BorderLayout.NORTH);
       
        Box definitionBox = Box.createHorizontalBox();

        Box actionBox = Box.createVerticalBox();
        actionBox.setBorder(BorderFactory.createTitledBorder(resources.getString("ActionDefinition")));
        actionBox.add(cbxAction = new JComboBox());
        for (int i=0; i<AutomatonAction.NUMBER_OF_POSSIBLE_ACTIONS; ++i) {
          cbxAction.addItem(AutomatonAction.toString(i));
        }
        cbxAction.setEditable(false);
       
        cbxAction.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            currentAction.action = cbxAction.getSelectedIndex();
            setActionProperties();
          }
        });
       
        optionPanel = new JPanel(new CardLayout());

        // ---------- Text options -----------
        Box options = Box.createVerticalBox();
        options.add(Box.createVerticalGlue());

        box = Box.createHorizontalBox();
        box.add(rbFixedText = new ActionRadioButton(resources.getString("FixedText")) {
          public void stateChanged(ChangeEvent e) {
            if (rbFixedText.isSelected()) currentAction.option = new Object[] {new Integer(6), tfFixedText.getText()};
            else currentAction.option = new Object[] {new Integer(cbxformat.getSelectedIndex())};
            setActionProperties();
          }
        });
        box.add(Box.createHorizontalGlue());
        box.add(tfFixedText = new JTextField());
        tfFixedText.getDocument().addDocumentListener(new DocumentListener() {
          public void insertUpdate(DocumentEvent e) {
            currentAction.option = new Object[] {new Integer(6), tfFixedText.getText()};
            setActionProperties();
          }
          public void removeUpdate(DocumentEvent e) {
            currentAction.option = new Object[] {new Integer(6), tfFixedText.getText()};
            setActionProperties();
          }
          public void changedUpdate(DocumentEvent e) {
            currentAction.option = new Object[] {new Integer(6), tfFixedText.getText()};
            setActionProperties();
          }
        });
        options.add(box);

        box = Box.createHorizontalBox();
        box.add(rbUseSource = new JRadioButton(resources.getString("UseDataSourceValueAs")));
        box.add(Box.createHorizontalGlue());
        box.add(cbxformat = new JComboBox());
        cbxformat.addItem(resources.getString("String"));
        cbxformat.addItem(resources.getString("Decimal"));
        cbxformat.addItem(resources.getString("Scientific"));
        cbxformat.addItem(resources.getString("Hexadecimal"));
        cbxformat.addItem(resources.getString("Octal"));
        cbxformat.addItem(resources.getString("Binary"));
        cbxformat.setEditable(false);
        options.add(box);
       
        ButtonGroup bg = new ButtonGroup();
        bg.add(rbFixedText);
        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) {
            currentAction.option = new Object[] { new Integer(cbxformat.getSelectedIndex()) };
            setActionProperties();
          }
        });

        options.add(box);

        JPanel textOptions = new JPanel(new BorderLayout());
        textOptions.add(options, BorderLayout.NORTH);
        optionPanel.add(textOptions, "text");
       
        // ---------- Move options -----------

        options = Box.createVerticalBox();
        options.add(Box.createVerticalGlue());

        Box descPanel = Box.createHorizontalBox();
        descPanel.add(new JLabel(resources.getString("WhenReachingAnArrayEdge")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);

        descPanel = Box.createHorizontalBox();
        descPanel.add(rbDoNothing = new JRadioButton(resources.getString("DoNothing")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);
       
        descPanel = Box.createHorizontalBox();
        descPanel.add(rbWrap = new JRadioButton(resources.getString("WrapToOtherSide")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);

        descPanel = Box.createHorizontalBox();
        descPanel.add(rbExtend = new JRadioButton(resources.getString("ExtendArray")));
        descPanel.add(Box.createHorizontalGlue());
        options.add(descPanel);

        options.add(Box.createVerticalGlue());

        rbDoNothing.addChangeListener(new ChangeListener() {
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.