}else if (gac.equals(resource.getString("popup4"))){
class MoveDialog extends JDialog
{
public static final long serialVersionUID = 1;
public MoveDialog ()
{
super (Control.this.view, resource.getString("popup4"), true); //Modal
JComponent cp = new JPanel();
setContentPane (cp);
setLayout (new GridLayout (4, 1, 7, 7));
JLabel jlab = new JLabel (resource.getString("move") + picked.getLocation());
add (jlab);
JPanel jpan = new JPanel(new FlowLayout (FlowLayout.LEFT, 5, 0), true);
spinX = new JSpinner (new SpinnerNumberModel (picked.getLocation().x, -300, 300, .1));
jpan.add (new JLabel (resource.getString("move2") + " : ("));
jpan.add (spinX);
jpan.add (new JLabel ("/")); //öffentliche Variablen
spinY = new JSpinner (new SpinnerNumberModel (picked.getLocation().y, -300, 300, .1));
jpan.add (spinY);
jpan.add (new JLabel ("/"));
spinZ = new JSpinner (new SpinnerNumberModel (picked.getLocation().z, -300, 300, .1));
jpan.add (spinZ);
jpan.add (new JLabel (")"));
add (jpan);
JPanel jpan2 = new JPanel (new GridLayout (1, 2, 7, 7));
JButton exit = new JButton (resource.getString("cancel"));
jpan2.add(exit);
JButton ok = new JButton ("OK");
jpan2.add(ok);
add (jpan2);
class MoveDialogListener implements ActionListener
{
public void actionPerformed (ActionEvent evt)
{
if (evt.getActionCommand().equals("OK")){
OKPressed = true; //OK
}
MoveDialog.this.setVisible (false);
}
}
MoveDialogListener mdl = new MoveDialogListener();
ok.addActionListener(mdl);
exit.addActionListener(mdl);
JButton preview = new JButton (resource.getString("preview"));
preview.addActionListener(new ActionListener(){
public void actionPerformed (ActionEvent evt)
{
//unwichtig, Vorschaufenster
}
});
add (preview);
((JComponent)getContentPane()).setBorder (BorderFactory.createEmptyBorder(6, 6, 6, 6));
pack();
setLocationRelativeTo (null);
setVisible (true);
}
public boolean OKPressed = false; //Variable ob der Dialog mit OK beendet wurde
public JSpinner spinX; //öffentliche Variablen zum Abfragen
public JSpinner spinY;
public JSpinner spinZ;
}
MoveDialog md = new MoveDialog();
if (md.OKPressed){
Point3f newloc = new Point3f (
((Number)md.spinX.getModel().getValue()).floatValue(),
((Number)md.spinY.getModel().getValue()).floatValue(),
((Number)md.spinZ.getModel().getValue()).floatValue());
Control.this.view.actual.actionDone (UndoRedoAction.getMoveInstance(picked, picked.getLocation(), newloc));
picked.setMindLocation(newloc);
}else{
return;
}
}