Esempio n. 1
0
    public CrystalSize() {
      setBorder(new TitledBorder("Lattice"));
      HVPanel p1 = new HVPanel.v();
      x = p1.addIntFieldSpinner("h max", null, 2, defaultValues.crystalX);
      y = p1.addIntFieldSpinner("k max", null, 2, defaultValues.crystalY);
      z = p1.addIntFieldSpinner("l  max", null, 2, defaultValues.crystalZ);
      ((NumberFormatter) x.edit.getFormatter()).setMinimum(new Integer(0));
      ((NumberFormatter) y.edit.getFormatter()).setMinimum(new Integer(0));
      ((NumberFormatter) z.edit.getFormatter()).setMinimum(new Integer(0));
      HVPanel p0 = new HVPanel.h();
      p0.addSubPane(p1);

      HVPanel.v p2 = new HVPanel.v();
      p2.addButton(new JButton("More"));
      p2.addButton(new JButton("Less"));
      addSubPane(p0);
      addSubPane(p2);
    }
Esempio n. 2
0
    public Screen() {
      setBorder(new TitledBorder("Screen"));
      HVPanel.h p1 = new HVPanel.h();
      w = p1.addIntFieldSpinner("Size ", null, 2, (int) defaultValues.wScreen);
      h = p1.addIntFieldSpinner(" x ", "cm", 2, (int) defaultValues.hFlatScreen);
      ((NumberFormatter) w.edit.getFormatter()).setMinimum(new Integer(1));
      ((NumberFormatter) h.edit.getFormatter()).setMinimum(new Integer(1));
      addSubPane(p1);
      HVPanel.h p10 = new HVPanel.h();
      y = p10.addIntFieldSpinner("Distance ", "cm", 2, (int) defaultValues.zScreen);
      addSubPane(p10);

      HVPanel p11 = new HVPanel.h();
      p11.addButtonGroupped(new JRadioButton("Flat"));
      p11.addButtonGroupped(new JRadioButton("Cylindric"));
      addSubPane(p11);
      addButton(persistant = new JCheckBox("Persistant"));
      persistant.setSelected(true);
      HVPanel p2 = new HVPanel.h();
      p2.addButton(new JButton("Clear"));
      // p2.addButton(new JButton("Snap"));
      p2.addButton(new JButton("Help"));
      addSubPane(p2);
      flat = true;
    }
Esempio n. 3
0
 public LatticePane(String name, String suffix, Lattice def, String units) {
   setBorder(new TitledBorder(name));
   HVPanel p1 = new HVPanel.v();
   a = p1.addFloatField("a" + suffix, units, 4, (float) def.a, "0.00");
   b = p1.addFloatField("b" + suffix, units, 4, (float) def.b, "0.00");
   c = p1.addFloatField("c" + suffix, units, 4, (float) def.c, "0.00");
   HVPanel p2 = new HVPanel.v();
   alpha = p2.addIntField("alpha" + suffix, "°", 3, (int) Math.round(def.alpha));
   beta = p2.addIntField("beta" + suffix, "°", 3, (int) Math.round(def.beta));
   gamma = p2.addIntField("gamma" + suffix, "°", 3, (int) Math.round(def.gamma));
   addSubPane(p1);
   addSubPane(p2);
 }
Esempio n. 4
0
    public Animation() {
      setBorder(new TitledBorder("Animation"));
      HVPanel.v p1 = new HVPanel.v();

      HVPanel p2 = new HVPanel.h();
      p2.addButton(new JToggleButton("Omega"));
      p2.addButton(new JToggleButton("Chi"));
      p2.addButton(new JToggleButton("Phi"));
      p1.addSubPane(p2);

      HVPanel p3 = new HVPanel.h();
      p3.addButton(new JToggleButton("Sequential"));
      p3.addButton(new JToggleButton("Debye-Scherrer"));
      p1.addSubPane(p3);

      HVPanel.h p5 = new HVPanel.h();
      p5.left();
      p5.addButton(fromToEnable = new JCheckBox(""));
      HVPanel.v p61 = new HVPanel.v();
      p61.expand(false);
      from = p61.addIntField("", "°", 2, defaultValues.startAngle);
      p5.addSubPane(p61);
      HVPanel.v p62 = new HVPanel.v();
      p62.expand(false);
      to = p62.addIntField("-", "°", 2, defaultValues.stopAngle);
      p5.addSubPane(p62);
      p5.putExtraSpace();
      p1.addSubPane(p5);
      p5.expand(true);
      speed = p5.addSliderAndValueH("Speed", null, 1, 20, defaultValues.speed, 0, 80);

      HVPanel p7 = new HVPanel.h();
      p7.addButton(new JToggleButton("Lambda"));
      p7.addButton(laue = new JButton("Laue"));
      p1.addSubPane(p7);
      // p1.putExtraSpace();

      HVPanel.h p8 = new HVPanel.h();
      p8.expand(true);
      p8.addButton(precession = new JToggleButton("Precession"));
      HVPanel.v p9 = new HVPanel.v();
      p9.expand(false);
      angle = p9.addIntFieldSpinner(" Angle", "°", 2, defaultValues.mu);
      model3d.precessionClass.setAngle(defaultValues.mu);
      model3d.mask3d.setR(
          Math.sin(model3d.precessionClass.mu) * (model3d.p3d.y * defaultValues.maskDistFract));

      p8.addSubPane(p9);
      p8.addButton(mask = new JCheckBox("Mask"));
      p1.addSubPane(p8);

      addSubPane(p1);
      laue.setForeground(Color.blue);
      animator = new Animator();
      animator.from = defaultValues.startAngle;
      animator.to = defaultValues.stopAngle;
      animator.fromToEnable = false;
      animator.speed = 1;

      setSpeed();

      fromToEnable.setSelected(false);
      from.setEnable(false);
      to.setEnable(false);
    }