Esempio n. 1
0
 private void set(double omega, double chi, double phi) {
   HVPanel.quiet = true;
   rotX.setValue(omega);
   rotY.setValue(chi);
   rotZ.setValue(phi);
   model3d.orientationClass.setOmega(omega);
   model3d.orientationClass.setChi(chi);
   model3d.orientationClass.setPhi(phi);
   HVPanel.quiet = false;
 }
Esempio n. 2
0
 public void actionPerformed(ActionEvent e) {
   boolean ajustR = false;
   if (e.getActionCommand().equals("Lambda")) {
     double l = ((SliderAndValue) e.getSource()).getValue();
     model3d.s.setLambda(l);
     model3d.net.gonioHead.setY(model3d.s.lambdaToRadius(l));
     ajustR = true;
   } else if (e.getActionCommand().equals("Omega")) {
     model3d.orientationClass.setOmega(((SliderAndValue) e.getSource()).getValue());
   } else if (e.getActionCommand().equals("Chi")) {
     model3d.orientationClass.setChi(((SliderAndValue) e.getSource()).getValue());
   } else if (e.getActionCommand().equals("Phi")) {
     model3d.orientationClass.setPhi(((SliderAndValue) e.getSource()).getValue());
   } else if (e.getActionCommand().equals("Precession")) {
     model3d.precessionClass.setRotation(((SliderAndValue) e.getSource()).getValue());
   } else if (e.getActionCommand().equals("Reset angles")) {
     rotX.setValue(0);
     rotY.setValue(0);
     rotZ.setValue(0);
     precess.setValue(0);
     //				HVPanel.quiet = true;
     //				uvw.edit.setText("0 1 0");
     //				HVPanel.quiet = false;
     model3d.projScreen.clearImage();
   } else if (e.getActionCommand().equals("u v w")) {
     HVPanel.quiet = true;
     int[] ii = ((int[]) ((EditField) e.getSource()).getValue());
     u = ii[0];
     v = ii[1];
     w = ii[2];
     lattice.setOrientation(ii[0], ii[1], ii[2]);
     reciprocal = lattice.reciprocal();
     model3d.net.setLattice(reciprocal);
     HVPanel.quiet = false;
   }
   model3d.doRays(ajustR);
 }