Examples of Box


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));
      panel.add(pcbautox = new ActionCheckBox(resources.getString("Auto-update"), plot.getDomainAxis().isAutoRange()) {
        public void actionPerformed(ActionEvent e) {
          pcbfixedautox.setEnabled(isSelected());
          pcbfixedautox.apply();
          plpxmin.setEnabled(!isSelected());
          plpxmax.setEnabled(!isSelected());
          ptfpxmin.setEnabled(!isSelected());
          ptfpxmax.setEnabled(!isSelected());
        }
      });
      double autorange = plot.getDomainAxis().getFixedAutoRange();
      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);
 
        box = Box.createHorizontalBox();
 
        box.add(new JLabel(resources.getString("Curves:")));
        box.add(scbxcurves = new JComboBox());
        box.add(scurvecolor = new JButton("    "));
        box.add(scurvedelete = new JButton(resources.getString("Delete")));
        section.add(box);
        content.add(section);
 
        scbxcurves.setEditable(true);
        //noCurveColor = scurvecolor.getBackground();
View Full Code Here

Examples of javax.swing.Box

      valuePanel.add(new JLabel(resources.getString("Value=")));
      valuePanel.add(theValue = new JTextField(10));
      valuePanel.setVisible(false);
      this.getContentPane().add(valuePanel);

      Box box;

      intervalPanel = Box.createVerticalBox();
      box = Box.createHorizontalBox();
      box.add(mincb = new ActionCheckBox(resources.getString("Min"), true) {
        public void actionPerformed(ActionEvent e) {
          minValue.setEnabled(isSelected());
          minInc.setEnabled(isSelected());
        }
      });
      box.add(minValue = new JTextField(10));
      minValue.getDocument().addDocumentListener(new DocumentListener() {
        public void insertUpdate(DocumentEvent e) {
          updateType();
        }
        public void removeUpdate(DocumentEvent e) {
          updateType();
        }
        public void changedUpdate(DocumentEvent e) {
          updateType();
        }
      });
      box.add(minInc = new JCheckBox(resources.getString("BoundIncluded"), true));
      intervalPanel.add(box);

      box = Box.createHorizontalBox();
      box.add(maxcb = new ActionCheckBox(resources.getString("Max"), true) {
        public void actionPerformed(ActionEvent e) {
          maxValue.setEnabled(isSelected());
          maxInc.setEnabled(isSelected());
        }
      });
      box.add(maxValue = new JTextField(10));
      maxValue.getDocument().addDocumentListener(new DocumentListener() {
        public void insertUpdate(DocumentEvent e) {
          updateType();
        }
        public void removeUpdate(DocumentEvent e) {
          updateType();
        }
        public void changedUpdate(DocumentEvent e) {
          updateType();
        }
      });
      box.add(maxInc = new JCheckBox(resources.getString("BoundIncluded"), true));
      intervalPanel.add(box);
      intervalPanel.setVisible(false);
      this.getContentPane().add(intervalPanel);
      mincb.apply();
      maxcb.apply();

      box = Box.createHorizontalBox();
      box.add(Box.createHorizontalGlue());
      box.add(cancel = new JButton(resources.getString("Cancel")));
      box.add(ok = new JButton(resources.getString("OK")));

      this.getContentPane().add(box);
     
      ok.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e) {
View Full Code Here

Examples of javax.swing.Box

    // Test Connection Button Panel (Both the button and the status label

    setFieldConstraints(gbc, 7);

    Box buttonBox = Box.createHorizontalBox();
    buttonBox.add(_testConnectionButton);
    buttonBox.add(Box.createHorizontalStrut(20));
    buttonBox.add(_testConnectionStatusLabel);
    _testConnectionButton.addActionListener(new TestConnectionButtonListener());
    pnl.add(buttonBox, gbc);

    // Separator
View Full Code Here

Examples of jinngine.geometry.Box

    // start jinngine
    scene = new DefaultScene(new SAP2(), new NonsmoothNonlinearConjugateGradient(44), new DisabledDeactivationPolicy());
    scene.setTimestep(0.1);
   
    // add boxes to bound the world
    Body floor = new Body("floor", new Box(1500,20,1500));
    floor.setPosition(new Vector3(0,-30,0));
    floor.setFixed(true);
   
    Body back = new Body( "back", new Box(200,200,20));   
    back.setPosition(new Vector3(0,0,-55));
    back.setFixed(true);

    Body front = new Body( "front", new Box(200,200,20));   
    front.setPosition(new Vector3(0,0,-7));
    front.setFixed(true);

    Body left = new Body( "left", new Box(20,200,200));   
    left.setPosition(new Vector3(-35,0,0));
    left.setFixed(true);

    Body right = new Body( "right", new Box(20,200,200));   
    right.setPosition(new Vector3(10,0,0));
    right.setFixed(true);   
   
    Box boxgeometry = new Box(6,6,6);
    Body box = new Body( "box", boxgeometry );
    box.setPosition(new Vector3(-10,-11,-25));
       
    // add all to scene
    scene.addBody(floor);
View Full Code Here

Examples of ket.display.box.Box

  public Box toBox(Argument argument, Vector<Box> boxArgs, long settings, ColourScheme colourScheme) {
    switch (boxArgs.size()) {
      case 0:
      case 1:
        {
          Box sum1 = new BoxWord(argument, Symbol.Sigma.toUnicode(),
              Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN|Box.LARGE_FONT|Box.PLAIN_FONT);
          Box arg1 = boxArgs.firstElement();
          arg1.setProperty(Box.LEFT_ALIGN|Box.Y_CENTRE_ALIGN);

          BoxList list1 = new BoxList(argument, Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN);

          list1.nextHorizontalPath(new Box[]{sum1, arg1});
          list1.nextVerticalPath(new Box[]{sum1});
          list1.nextVerticalPath(new Box[]{arg1});
          return list1;
        }
      case 2:
        {
          Box sum2 = new BoxWord(argument,
              Symbol.Sigma.toUnicode(),
              Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN|Box.LARGE_FONT|Box.PLAIN_FONT);
          Box arg2 = boxArgs.get(1);
          Box from2 = boxArgs.get(0);

          BoxList list2 = new BoxList(argument, Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN);

          list2.nextHorizontalPath(new Box[]{sum2, arg2});
          list2.nextHorizontalPath(new Box[]{from2});
          list2.nextVerticalPath(new Box[]{sum2, from2});
          list2.nextVerticalPath(new Box[]{arg2});

          arg2.setProperty(Box.LEFT_ALIGN|Box.Y_CENTRE_ALIGN);
          from2.setProperty(Box.X_CENTRE_ALIGN|Box.TOP_ALIGN|Box.SMALL_FONT);
          return list2;
        }
      default:
        {
          Box sumDefault = new BoxWord(argument,
              Symbol.Sigma.toUnicode(),
              Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN|Box.LARGE_FONT|Box.PLAIN_FONT);
          Box arg = boxArgs.get(2);
          arg.setProperty(Box.LEFT_ALIGN|Box.Y_CENTRE_ALIGN);
          Box from = boxArgs.get(0);
          Box to = boxArgs.get(1);

          BoxList list = new BoxList(argument, Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN);

          list.nextHorizontalPath(new Box[]{to});
          list.nextHorizontalPath(new Box[]{sumDefault, arg});
          list.nextHorizontalPath(new Box[]{from});
          list.nextVerticalPath(new Box[]{to, sumDefault, from});
          list.nextVerticalPath(new Box[]{arg});

          from.setProperty(Box.X_CENTRE_ALIGN|Box.TOP_ALIGN|Box.SMALL_FONT);
          to.setProperty(Box.X_CENTRE_ALIGN|Box.BOTTOM_ALIGN|Box.SMALL_FONT);
          return list;
        }
    }
  }
View Full Code Here

Examples of limelight.util.Box

  @Override
  public void doExpansion(Panel thePanel)
  {
    PanelBase panel = (PanelBase)thePanel;
    Box bounds = panel.getParent().getChildConsumableBounds();
    panel.setLocation(bounds.x, bounds.y);
    panel.setSize(bounds.width, bounds.height);
  }
View Full Code Here

Examples of mindnotes.client.ui.Box

  private boolean _valid;

  public MockLayoutTreeElement(int x, int y, int w, int h,
      LayoutTreeElement parent, NodeLocation location) {
    _children = new ArrayList<LayoutTreeElement>();
    _elementBounds = new Box(x, y, w, h);
    _location = location;
  }
View Full Code Here

Examples of net.minecraft.src.buildcraft.core.Box

                for (ChunkCoordIntPair coords : chunkCoords) {

                    int chunkX = coords.chunkXPos * 16;
                    int chunkZ = coords.chunkZPosition * 16;

                    Box outsideLaser = new Box();
                    outsideLaser.initialize(chunkX, playerY, chunkZ, chunkX + 16, playerY, chunkZ + 16);
                    outsideLaser.createLasers(mc.theWorld, LaserKind.Blue);
                    lasers.add(outsideLaser);

                    Box insideLaser = new Box();
                    insideLaser.initialize(chunkX + 7, playerY, chunkZ + 7, chunkX + 9, playerY, chunkZ + 9);
                    insideLaser.createLasers(mc.theWorld, LaserKind.Red);
                    lasers.add(insideLaser);
                }
            }
        }
    }
View Full Code Here

Examples of net.phys2d.raw.shapes.Box

   */
  protected void keyHit(char c) {
    super.keyHit(c);
   
    if (c == ' ') {
      Body body2 = new Body("Mover1", new Box(40.0f, 40.0f), 300.0f);
      body2.setPosition(-50, (float) (((Math.random() * 50) + 150)));
      world.add(body2);
      body2.adjustAngularVelocity(1);
      body2.adjustVelocity(new Vector2f(200,(float) (Math.random() * 200)));
    }
 
View Full Code Here

Examples of net.sourceforge.jaad.mp4.boxes.Box

  private Codec codec;

  public AudioTrack(Box trak, MP4InputStream in) {
    super(trak, in);

    final Box mdia = trak.getChild(BoxTypes.MEDIA_BOX);
    final Box minf = mdia.getChild(BoxTypes.MEDIA_INFORMATION_BOX);
    smhd = (SoundMediaHeaderBox) minf.getChild(BoxTypes.SOUND_MEDIA_HEADER_BOX);

    final Box stbl = minf.getChild(BoxTypes.SAMPLE_TABLE_BOX);

    //sample descriptions: 'mp4a' and 'enca' have an ESDBox, all others have a CodecSpecificBox
    final SampleDescriptionBox stsd = (SampleDescriptionBox) stbl.getChild(BoxTypes.SAMPLE_DESCRIPTION_BOX);
    if(stsd.getChildren().get(0) instanceof AudioSampleEntry) {
      sampleEntry = (AudioSampleEntry) stsd.getChildren().get(0);
      final long type = sampleEntry.getType();
      if(sampleEntry.hasChild(BoxTypes.ESD_BOX)) findDecoderSpecificInfo((ESDBox) sampleEntry.getChild(BoxTypes.ESD_BOX));
      else decoderInfo = DecoderInfo.parse((CodecSpecificBox) sampleEntry.getChildren().get(0));
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.