()
| 504 | } |
| 505 | |
| 506 | public void askForPOV() { |
| 507 | // der Pfad war wohl nich korrekt |
| 508 | int optReturn = JOptionPane.showConfirmDialog(new Panel(), |
| 509 | "Can't find SURF - do you want me to try using POV?", |
| 510 | "Can't find SURF", JOptionPane.YES_NO_CANCEL_OPTION, |
| 511 | JOptionPane.QUESTION_MESSAGE); |
| 512 | switch (optReturn) { |
| 513 | case 0: |
| 514 | // ja, dann nutze POV |
| 515 | pov.setSelected(true); |
| 516 | if (!povAvailable()) { |
| 517 | // der Pfad war wohl nich korrekt |
| 518 | optReturn = JOptionPane |
| 519 | .showConfirmDialog( |
| 520 | new Panel(), |
| 521 | "Can't find POV - do you konow where POV is installed2?", |
| 522 | "Can't find POV", |
| 523 | |
| 524 | JOptionPane.YES_NO_CANCEL_OPTION, |
| 525 | JOptionPane.QUESTION_MESSAGE); |
| 526 | switch (optReturn) { |
| 527 | case 0: |
| 528 | // ja, dann nutze POV |
| 529 | // creating new Frame |
| 530 | final JFrame frame2 = new JFrame("load POV"); |
| 531 | |
| 532 | // adding container |
| 533 | Container contentPane = frame2.getContentPane(); |
| 534 | |
| 535 | // creating Filechooser |
| 536 | JFileChooser fileChooser = new JFileChooser( |
| 537 | surfex_.currentDirectory); |
| 538 | |
| 539 | // adding filechooser |
| 540 | contentPane.add(fileChooser, BorderLayout.CENTER); |
| 541 | |
| 542 | // Create ActionListener |
| 543 | ActionListener actionListener = new ActionListener() { |
| 544 | public void actionPerformed(ActionEvent actionEvent) { |
| 545 | JFileChooser theFileChooser = (JFileChooser) actionEvent |
| 546 | .getSource(); |
| 547 | |
| 548 | // get command2 |
| 549 | String command2 = actionEvent.getActionCommand(); |
| 550 | |
| 551 | // check if doubleclickt or if "open" was pressed |
| 552 | if (command2.equals(JFileChooser.APPROVE_SELECTION)) { |
| 553 | File selectedFile = theFileChooser |
| 554 | .getSelectedFile(); |
| 555 | |
| 556 | // making savepopup invisible/removing it |
| 557 | frame2.dispose(); |
| 558 | |
| 559 | // creating complete filepath |
| 560 | String filelocation = new String(selectedFile |
| 561 | .getParent() |
| 562 | + File.separator |
| 563 | + selectedFile.getName()); |
no test coverage detected