public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Size ") || e.getActionCommand().equals(" x ")) { double dw = w.getFloatValue(), dh = h.getFloatValue(); model3d.setScreenSize(dw, dh); } else if (e.getActionCommand().equals("Distance ")) { model3d.projScreen.clearImage(); double d = y.getFloatValue(); model3d.p3d.setPos(d); model3d.mask3d.setY(d); } else if (e.getActionCommand().equals("Flat")) { if (flat) return; flat = true; super.actionPerformed(new ActionEvent(this, 0, "horizontal")); w.setEnable(true); model3d.setFlatScreen(); h.setValue(new Double(model3d.p3d.h)); w.setValue(new Double(model3d.p3d.w)); model3d.univers.scale(2); model3d.precessionClass.setAngle(animPane.angle.getFloatValue()); model3d.precessionClass.setRotation(paramPane.precess.getValue()); paramPane.precess.setEnabled(true); animPane.angle.setEnable(true); animPane.precession.setEnabled(true); animPane.mask.setEnabled(true); model3d.setMask(animPane.mask.isSelected()); } else if (e.getActionCommand().equals("Cylindric")) { if (!flat) return; flat = false; super.actionPerformed(new ActionEvent(this, 0, "vertical")); w.setEnable(false); w.name.setEnabled(true); model3d.setCylindricScreen(); h.setValue(new Double(model3d.p3d.h)); w.edit.setText(""); model3d.univers.scale(.5); model3d.precessionClass.setAngle(0); model3d.precessionClass.setRotation(0); paramPane.precess.setEnabled(false); animPane.angle.setEnable(false); animPane.precession.setEnabled(false); animPane.mask.setEnabled(false); model3d.setMask(false); } else if (e.getActionCommand().equals("Persistant")) { model3d.persistant = ((JCheckBox) e.getSource()).isSelected(); } else if (e.getActionCommand().equals("Clear")) { model3d.projScreen.clearImage(); } else if (e.getActionCommand().equals("Help")) { help.show(true); } model3d.doRays(false); }
public void put(Lattice l) { a.setValue(new Float(l.a)); b.setValue(new Float(l.b)); c.setValue(new Float(l.c)); alpha.setValue(new Float(l.alpha)); beta.setValue(new Float(l.beta)); gamma.setValue(new Float(l.gamma)); }
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("More")) { HVPanel.quiet = true; x.setValue(new Integer(Math.round(x.getFloatValue()) + 1)); y.setValue(new Integer(Math.round(y.getFloatValue()) + 1)); z.setValue(new Integer(Math.round(z.getFloatValue()) + 1)); HVPanel.quiet = false; } else if (e.getActionCommand().equals("Less")) { int a; HVPanel.quiet = true; x.setValue(new Integer((a = (int) x.getFloatValue()) == 0 ? 0 : a - 1)); y.setValue(new Integer((a = (int) y.getFloatValue()) == 0 ? 0 : a - 1)); z.setValue(new Integer((a = (int) z.getFloatValue()) == 0 ? 0 : a - 1)); HVPanel.quiet = false; } model3d.net.setCrystalSize( (int) x.getFloatValue(), (int) y.getFloatValue(), (int) z.getFloatValue()); model3d.doRays(false); }