Package java.awt

Examples of java.awt.FileDialog


    /**
     * Load a board from a file.
     */
    public void boardLoad() {
        FileDialog fd = new FileDialog(this, "Load Board...", FileDialog.LOAD);
        fd.setDirectory("data" + File.separator + "boards");
        if (boardName.getText().length() > 0) {
            fd.setFile(boardName.getText());
        }
        fd.setLocation(this.getLocation().x + 150, this.getLocation().y + 100);
        fd.setVisible(true);

        if (fd.getFile() == null) {
            // I want a file, y'know!
            return;
        }
        String curpath = fd.getDirectory();
        String curfile = fd.getFile();
        // load!
        try {
            InputStream is = new FileInputStream(new File(curpath, curfile));
            board.load(is);
            // okay, done!
View Full Code Here


      JOptionPane.showMessageDialog(this,message,"Programminfos",
          JOptionPane.PLAIN_MESSAGE,
          new ImageIcon(ClassLoader.getSystemResource("images/logo.gif")));
      return;
    } else {
      FileDialog dialog = new FileDialog(this,"Choose File",FileDialog.LOAD);
      if("image...".equals(e.getActionCommand())) {
        if(pathImage != null) {
          dialog.setDirectory(pathImage);
        }
        else {
          if(pathDrill != null) {
            dialog.setDirectory(pathDrill);
          }
        }
        if(fileImage != null) {
          dialog.setFile(fileImage);
        }
        dialog.setTitle("Choose Image - File");
        /*JOptionPane.showMessageDialog(this, "Der Stücklistenoutput muss in ProAlpha\n" +
            "mit der Codierung ISO-8859-1 ausgegeben worden sein!",
            "Hinweis zur Codierung der Stückliste",JOptionPane.INFORMATION_MESSAGE);*/
      }

      if("drill...".equals(e.getActionCommand())) {
        if(pathDrill != null) {
          dialog.setDirectory(pathDrill);
        }
        else {
          if(pathImage != null) {
            dialog.setDirectory(pathImage);
          }
        }
        if(fileDrill != null) {
          dialog.setFile(fileDrill);
        }
        dialog.setTitle("Choose Drill - File");
      }

      /*if("log...".equals(e.getActionCommand())) {
        if(pathLog != null) {
          dialog.setDirectory(pathLog);
        }
        else {
          if(pathPl != null) {
            dialog.setDirectory(pathPl);
          } else {
            if(pathParallel != null) {
              dialog.setDirectory(pathParallel);
            }
          }

        }
        if(fileLog != null) {
          dialog.setFile(fileLog);
        }
        dialog.setTitle("Choose Log - File");
      }*/
      dialog.setVisible(true);

      if("image...".equals(e.getActionCommand())){
        if(dialog.getFile() != null) {
          fileImage = dialog.getFile();
          pathImage = dialog.getDirectory();
          jLabelImage.setText("Selected image file:  " + pathImage + fileImage);
        }
        try {
          bild = ImageIO.read(new File(pathImage + fileImage));
          zoom = 1;
          leinwand.repaint();
        } catch ( IOException exp) {
          System.err.println(exp.getMessage());
          bild =  null;
        }
      }

      if("drill...".equals(e.getActionCommand())){
        if(dialog.getFile() != null) {
          fileDrill = dialog.getFile();
          pathDrill = dialog.getDirectory();
          jLabelDrill.setText("Selected drill file:  " + pathDrill + fileDrill);
        }
      }

      /*      if("log...".equals(e.getActionCommand())){
 
View Full Code Here

        FILE_SEP = prop.getProperty("file.separator");
    }

    public void actionPerformed(ActionEvent e) {
        String cmd = e.getActionCommand();
        FileDialog fd;
        String lastFile, lastDir;
        boolean fail = false;

        if (cmd.equals("XData")) {
            operation = X_DATA;
        } else if (cmd.equals("XList")) {
            operation = X_LIST;
        } else if (cmd.equals("Close")) {
            setVisible(false);
        } else if (cmd.equals("Apply")) {
            DefaultMutableTreeNode dmn;
            Vector v = tree.getSelectedPaths();
            switch (operation) {
            case X_DATA:
                // Perform operation (filter TBD)
                // export the data
                // use file dialog to get file name/loc?
                // (extend file dialog class to add more functionality/options?)
                fd = new FileDialog(parent, resource.getString("ExportDataTo"),
                        FileDialog.SAVE);
                // fd.setDirectory ("");
                fd.setFile("dash.txt");
                fd.show();
                lastDir = fd.getDirectory();
                lastFile = fd.getFile();
                if (lastFile != null)
                    exportInteractively(v, new File(lastDir, lastFile));
                break;
            case X_LIST:
                // Perform operation (filter TBD)
                // export the hierarchy
                // use file dialog to get file name/loc?
                // (extend file dialog class to add more functionality/options?)
                fd = new FileDialog(parent, resource
                        .getString("ExportHierarchyTo"), FileDialog.SAVE);
                // fd.setDirectory ("");
                fd.setFile("hierarch.txt");
                fd.show();
                lastFile = fd.getFile();
                if (lastFile != null) {
                    JDialog working;
                    working = new JDialog(parent, resource
                            .getString("ExportExportingDots"));
                    working.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
                    JLabel lab = new JLabel(resource
                            .getString("ExportExportingMessage"));
                    working.getContentPane().add(lab, "Center");
                    working.pack();
                    working.show();
                    Thread.yield();

                    lastDir = fd.getDirectory();
                    try {
                        PrintWriter out = new PrintWriter(new BufferedWriter(
                                new FileWriter(lastDir + FILE_SEP + lastFile)));
                        parent.getHierarchy().orderedDump(out, v);
                        out.close();
View Full Code Here

    FILE_SEP = prop.getProperty ("file.separator");
  }

  public void actionPerformed(ActionEvent e) {
    String cmd = e.getActionCommand();
    FileDialog fd;
    String lastFile, lastDir;
    boolean fail = false;

    if (cmd.equals("XData")) {
      operation = X_DATA;
    } else if (cmd.equals("XList")) {
      operation = X_LIST;
    } else if (cmd.equals("Close")) {
      setVisible(false);
    } else if (cmd.equals("Apply")) {
      DefaultMutableTreeNode dmn;
      Vector v = tree.getSelectedPaths();
      switch (operation) {
      case X_DATA:
        // Perform operation (filter TBD)
        //export the data
        // use file dialog to get file name/loc?
        //  (extend file dialog class to add more functionality/options?)
        fd = new FileDialog (parent,
                             resource.getString("ExportDataTo"),
                             FileDialog.SAVE);
        //fd.setDirectory ("");
        fd.setFile ("dash.txt");
        fd.show();
        lastDir = fd.getDirectory();
        lastFile = fd.getFile ();
        if (lastFile != null)
          exportInteractively(v, new File(lastDir, lastFile));
        break;
      case X_LIST:
        // Perform operation (filter TBD)
        //export the hierarchy
        // use file dialog to get file name/loc?
        //  (extend file dialog class to add more functionality/options?)
        fd = new FileDialog (parent,
                             resource.getString("ExportHierarchyTo"),
                             FileDialog.SAVE);
        //fd.setDirectory ("");
        fd.setFile ("hierarch.txt");
        fd.show();
        lastFile = fd.getFile ();
        if (lastFile != null) {
          JDialog working;
          working = new JDialog (parent, resource.getString("ExportExportingDots"));
          working.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
          JLabel lab = new JLabel (resource.getString("ExportExportingMessage"));
          working.getContentPane().add(lab, "Center");
          working.pack();
          working.show();
          Thread.yield();

          lastDir  = fd.getDirectory ();
          try {
            PrintWriter out =
              new PrintWriter (new BufferedWriter
                               (new FileWriter(lastDir + FILE_SEP + lastFile)));
            parent.props.orderedDump(out, v);
View Full Code Here

        File dotStarterFileFile = new File(dsf);
        externalFiles.put(fileID, dotStarterFileFile);
       
        if (!dotStarterFileFile.exists()) {
            if (fileSel) {
                FileDialog dia = new FileDialog((JFrame) null, "Please show me the path to " + fileID + " (select the file and confirm)", FileDialog.LOAD);
                dia.setFilenameFilter(new FileNamePostfixFilter(".eas"));
                dia.setVisible(true);
   
                if (dia.getDirectory() == null || dia.getFile() == null) {
                    GeneralDialog.message(fileID + " is not available, sorry I will not be able to perform the according actions.", fileID + " not available");
                    throw new RuntimeException(fileID + " not available: " + dsf);
                }
               
                dotStarterFileFile = new File(dia.getDirectory() + File.separator + dia.getFile());
            } else {
                JFileChooser dia = new JFileChooser(".");
                dia.setCurrentDirectory(new File(System.getProperty("user.home")));
                dia.setDialogTitle("Please show me the path to " + fileID + " (select the directory and confirm)");
                dia.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                int result = dia.showOpenDialog(null);
                if (result == JFileChooser.APPROVE_OPTION) {
                    dotStarterFileFile = dia.getSelectedFile();
                } else {
                    GeneralDialog.message(fileID + " is not available, sorry I will not be able to perform the according actions.", fileID + " not available");
                    throw new RuntimeException(fileID + " not available: " + dsf);
                }
            }
View Full Code Here

                            ausg1 != null,
                            ausg2 != null);
                   
                    this.aktGrph.setzeAktSegAusg(this.aktAusg);
                } else if (cmd.equals("Speichern...")) {
                    FileDialog dia;
                    String oldVerz;
                   
                    dia = new FileDialog(this,
                                         "Pfeil als PNG speichern",
                                         FileDialog.SAVE);
                   
                    dia.setFilenameFilter(new DateiFilter("png"));
                   
                    dia.setVisible(true);

                    if (!(dia.getDirectory() == null)
                        && !(dia.getFile() == null)) {
                        oldVerz = this.pars.getStdPfad();
                        this.pars.setStdPfad(dia.getDirectory());
                        this.aktGrph.savePNG(dia.getFile());
                        this.pars.setStdPfad(oldVerz);
                    }
                }
            }
           
View Full Code Here

                            ausg2 != null);

                    this.aktGrph.setzeAktSegAusg(this.aktAusg);
                } else if (cmd.equals("Speichern...")) {
                    GeneralDialog diaAllg;
                    FileDialog dia;
                    String oldVerz;
                    ArrayList<String> modi = new ArrayList<String>(4);
                    modi.add("png");
                    modi.add("bmp");
                    modi.add("jpg");
                    modi.add("Abbrechen");
                   
                    diaAllg = new GeneralDialog(
                            this,
                            "",
                            "Skalierung und Dateityp angeben",
                            modi,
                            "1",
                            50,
                            50,
                            true);
                    diaAllg.setVisible(true);
                   
                    if (!diaAllg.getResult().equals("Abbrechen")) {
                        dia = new FileDialog(this, "Pfeil als PNG speichern",
                                FileDialog.SAVE);
   
                        dia.setFilenameFilter(
                                new FileNamePostfixFilter(diaAllg.getResult()));
   
                        dia.setVisible(true);
   
                        if (dia.getDirectory() != null
                                && dia.getFile() != null) {
                            oldVerz = this.pars.getStdDirectory();
                            this.pars.setStdDirectory(dia.getDirectory());
                            this.aktGrph.savePNG(
                                    dia.getFile(),
                                    diaAllg.getResult(),
                                    Double.parseDouble(diaAllg.getText()));
                            this.pars.setStdDirectory(oldVerz);
                        }
                    }
View Full Code Here

                        }
                    }
                   
                } else if (cmd.equals(
                           Messages.getString("SteuerFenster.ErzeugeHEX"))) {
                    FileDialog dia;

                    dia = new FileDialog(this,
                                         Messages.getString("SteuerFenster."
                                                        + "ErzeugeHEXTitel"),
                                         FileDialog.SAVE);
                    dia.setVisible(true);

                    if (!(dia.getDirectory() == null)
                        && !(dia.getFile() == null)) {
                        LinkedList<Integer> seq
                            = this.aktGrph.getRob().erzeugeSequenz(
                                    this.aktGrph.getAktAut());
                        FileWriter f = new FileWriter(dia.getDirectory()
                                                      + File.separatorChar
                                                      + dia.getFile());
                        Iterator<Integer> it = seq.iterator();

                        while (it.hasNext()) {
                            f.write(((Integer) it.next()).intValue());
                        }
                        f.close();
                    }
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Vereinfache"))) {
                    this.aktGrph.getRob().vAuts()[
                                   this.aktGrph.getAktAut()].vereinfache();
                    Condition condSimp =
                        this.aktGrph.getRob().getConds()[
                                  this.aktGrph.getAktAut()].simplify();
                    this.aktGrph.getRob().setCond(this.aktGrph.getAktAut(),
                                                  condSimp);
                   
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.VereinfacheAlle"))) {
                    Iterator<Vis> it = this.graphen.iterator();
                    Condition condSimp;
                    Vis aktVis;
                    while (it.hasNext()) {
                        aktVis = (Vis) it.next();
                        for (int i = 0;
                             i < aktVis.getRob().vAuts().length;
                             i++) {
                            aktVis.getRob().vAuts()[i].vereinfache();

                            condSimp = this.aktGrph.getRob().getConds()[
                                          i].simplify();
                            this.aktGrph.getRob().setCond(i, condSimp);
                            aktVis.neuZeichnen();
                        }
                    }
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.InterpretScript"))) {
                   
                    this.aktGrph.getRob().vAuts()[
                        this.aktGrph.getAktAut()].erzeugeAusScript(
                            this.aktGrph.holeAktTxtSeq());
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Automatenzahl"))) {
                   
                    ArrayList<String> b
                        = new ArrayList<String>(1);
                    b.add(Messages.getString(
                        "SteuerFenster.OK"));
                    AllgemeinerDialog dia2
                        = new AllgemeinerDialog(
                            this,
                            "reef",
                            "Anzahl der Automaten "
                            + "(wirkt sich nur auf zuk�nftige Roboter aus)",
                            b,
                            "" + this.autAnz,
                            1,
                            50,
                            true);

                    dia2.setVisible(true);
                   
                    this.autAnz = Integer.parseInt(dia2.getText());
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Gesamtautomat"))) {
                    EndlicherAutomat[] eas = this.aktGrph.getRob().getVAut();
                    Condition[] conds = this.aktGrph.getRob().getConds();
                   
                    this.neuerGraph();
                    this.waehleGraph(this.graphZaehl - 1);
                    this.aktGrph.erzeugeAktAusSequenz(
                       SonstMeth.gesamtAutomat(eas, conds).erzeugeStringSeq(),
                       SonstMeth.ausBed("t"),
                       false);
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Fancy"))) {
                    this.pars.setEinfacheDar(!this.pars.getEinfacheDar());
                    if (this.pars.getEinfacheDar()) {
                        this.pars.setBezier(
                          fmg.fmg8.graphVis.zeichenModi.Konstanten.BEZ_FANCY);
                    } else {
                        this.pars.setBezier(
                          fmg.fmg8.graphVis.zeichenModi.Konstanten.BEZ_NORMAL);
                    }
                } else if (cmd.equals("PNG...")) {
                    FileDialog dia;
                    String oldVerz;
                   
                    dia = new FileDialog(this,
                                         "Automatendarstellung als PNG "
                                         + "speichern",
                                         FileDialog.SAVE);
                   
                    dia.setFilenameFilter(new DateiFilter("png"));
                   
                    dia.setVisible(true);

                    if (!(dia.getDirectory() == null)
                        && !(dia.getFile() == null)) {
                        oldVerz = this.pars.getStdPfad();
                        this.pars.setStdPfad(dia.getDirectory());
                        this.aktGrph.savePNG(dia.getFile());
                        this.pars.setStdPfad(oldVerz);
                    }
                } else if (cmd.equals("Alle l�schen!")) {
                    ArrayList<String> butts = new ArrayList<String>(2);
                    ArrayList<String> choices = new ArrayList<String>(5);
                    ArrayList<Boolean> aktiv = new ArrayList<Boolean>(5);
                   
                    String gra, tra, con, koo, png, tmp, dat, gz, gif;
                   
                    butts.add("Abbrechen");
                    butts.add("OK");

                    gra = "Alle GRA-Dateien l�schen";
                    tra = "Alle TRA-Dateien l�schen";
                    con = "Alle CON-Dateien l�schen";
                    koo = "Alle KOO-Dateien l�schen";
                    png = "Alle PNG-Dateien l�schen";
                    tmp = "Alle TMP-Dateien l�schen";
                    dat = "Alle DAT-Dateien l�schen";
                    gz = "Alle GZ-Dateien l�schen";
                    gif = "Alle GIF-Dateien l�schen";
                   
                   
                    choices.add(gra);
                    aktiv.add(false);
                    choices.add(tra);
                    aktiv.add(false);
                    choices.add(con);
                    aktiv.add(false);
                    choices.add(koo);
                    aktiv.add(false);
                    choices.add(png);
                    aktiv.add(true);
                    choices.add(tmp);
                    aktiv.add(true);
                    choices.add(dat);
                    aktiv.add(false);
                    choices.add(gz);
                    aktiv.add(false);
                    choices.add(gif);
                    aktiv.add(false);
                   
                    Ankreuzdialog dia = new Ankreuzdialog(
                            this,
                            "Geben Sie an, welche Dateitypen aus"
                                + " dem Verzeichnis '"
                                + this.pars.getStdPfad()
                                + "' gel�scht werden sollen",
                            "L�schen best�tigen",
                            butts,
                            choices,
                            aktiv);
                   
                    dia.setVisible(true);
                   
                    if (dia.getResult().equals("OK")) {
                        if (dia.getAuswahl().contains(tmp)) {
                            SonstMeth.deleteALL(
                                    fmg.fmg8.graphVis.Konstanten.TEMP_ENDUNG,
                                    this.pars);
                        }
                       
                        if (dia.getAuswahl().contains(con)) {
                            SonstMeth.deleteALL(
                                    fmg.fmg8.graphVis.Konstanten.BED_ENDUNG,
                                    this.pars);
                        }
                       
                        if (dia.getAuswahl().contains(koo)) {
                            SonstMeth.deleteALL(
                                    fmg.fmg8.graphVis.Konstanten.KOORD_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(gra)) {
                            SonstMeth.deleteALL(
                                    fmg.fmg8.graphVis.Konstanten.GRAPH_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(tra)) {
                            SonstMeth.deleteALL(
                                    fmg.fmg8.graphVis.Konstanten.TRANS_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(png)) {
                            SonstMeth.deleteALL(
                                    fmg.fmg8.graphVis.Konstanten.PNG_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(dat)) {
                            SonstMeth.deleteALL(
                                    "dat",
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(gz)) {
                            SonstMeth.deleteALL(
                                    "gz",
                                    this.pars);
                        }
                       
                        if (dia.getAuswahl().contains(gif)) {
                            SonstMeth.deleteALL(
                                    "gif",
                                    this.pars);
                        }
                    }
View Full Code Here

                            ausg2 != null);

                    this.aktGrph.setzeAktSegAusg(this.aktAusg);
                } else if (cmd.equals("Speichern...")) {
                    AllgemeinerDialog diaAllg;
                    FileDialog dia;
                    String oldVerz;
                    ArrayList<String> modi = new ArrayList<String>(4);
                    modi.add("png");
                    modi.add("bmp");
                    modi.add("jpg");
                    modi.add("Abbrechen");
                   
                    diaAllg = new AllgemeinerDialog(
                            this,
                            "",
                            "Skalierung und Dateityp angeben",
                            modi,
                            "1",
                            50,
                            50,
                            true);
                    diaAllg.setVisible(true);
                   
                    if (!diaAllg.getResult().equals("Abbrechen")) {
                        dia = new FileDialog(this, "Pfeil als PNG speichern",
                                FileDialog.SAVE);
   
                        dia.setFilenameFilter(
                                new DateiFilter(diaAllg.getResult()));
   
                        dia.setVisible(true);
   
                        if (dia.getDirectory() != null
                                && dia.getFile() != null) {
                            oldVerz = this.pars.getStdPfad();
                            this.pars.setStdPfad(dia.getDirectory());
                            this.aktGrph.savePNG(
                                    dia.getFile(),
                                    diaAllg.getResult(),
                                    Double.parseDouble(diaAllg.getText()));
                            this.pars.setStdPfad(oldVerz);
                        }
                    }
View Full Code Here

                        }
                    }
                   
                } else if (cmd.equals(
                           Messages.getString("SteuerFenster.ErzeugeHEX"))) {
                    FileDialog dia;

                    dia = new FileDialog(this,
                                         Messages.getString("SteuerFenster."
                                                        + "ErzeugeHEXTitel"),
                                         FileDialog.SAVE);
                    dia.setVisible(true);

                    if (!(dia.getDirectory() == null)
                        && !(dia.getFile() == null)) {
                        LinkedList<Integer> seq
                            = this.aktGrph.getRob().erzeugeSequenz(
                                    this.aktGrph.getAktAut());
                        FileWriter f = new FileWriter(dia.getDirectory()
                                                      + File.separatorChar
                                                      + dia.getFile());
                        Iterator<Integer> it = seq.iterator();

                        while (it.hasNext()) {
                            f.write(it.next().intValue());
                        }
                        f.close();
                    }
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Vereinfache"))) {
                    this.aktGrph.getRob().vAuts()[
                                   this.aktGrph.getAktAut()].vereinfache();
                    Condition condSimp =
                        this.aktGrph.getRob().getConds()[
                                  this.aktGrph.getAktAut()].simplify();
                    this.aktGrph.getRob().setCond(this.aktGrph.getAktAut(),
                                                  condSimp);
                   
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.VereinfacheAlle"))) {
                    Iterator<Vis> it = this.graphen.iterator();
                    Condition condSimp;
                    Vis aktVis;
                    while (it.hasNext()) {
                        aktVis = it.next();
                        for (int i = 0;
                             i < aktVis.getRob().vAuts().length;
                             i++) {
                            aktVis.getRob().vAuts()[i].vereinfache();

                            condSimp = this.aktGrph.getRob().getConds()[
                                          i].simplify();
                            this.aktGrph.getRob().setCond(i, condSimp);
                            aktVis.neuZeichnen();
                        }
                    }
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.InterpretScript"))) {
                   
                    this.aktGrph.getRob().vAuts()[
                        this.aktGrph.getAktAut()].erzeugeAusScript(
                            this.aktGrph.holeAktTxtSeq(), this.pars);
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Automatenzahl"))) {
                   
                    ArrayList<String> b
                        = new ArrayList<String>(1);
                    b.add(Messages.getString(
                        "SteuerFenster.OK"));
                    GeneralDialog dia2
                        = new GeneralDialog(
                            this,
                            "reef",
                            "Anzahl der Automaten "
                            + "(wirkt sich nur auf zukünftige Roboter aus)",
                            b,
                            "" + this.autAnz,
                            1,
                            50,
                            true);

                    dia2.setVisible(true);
                   
                    this.autAnz = Integer.parseInt(dia2.getText());
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Gesamtautomat"))) {
                    EndlicherAutomat[] eas = this.aktGrph.getRob().getVAut();
                    Condition[] conds = this.aktGrph.getRob().getConds();
                   
                    this.neuerGraph();
                    this.waehleGraph(this.graphZaehl - 1);
                    this.aktGrph.erzeugeAktAusSequenz(
                       StaticMethods.gesamtAutomat(eas, conds, this.pars).erzeugeStringSeq(),
                       StaticMethods.ausBed("t"),
                       false);
                } else if (cmd.equals(
                        Messages.getString("SteuerFenster.Fancy"))) {
                    this.pars.setParValue(eas.statistics.ConstantsStatistics.EINFACHE_DARSTELLUNG,
                            !this.pars.getParValueBoolean(eas.statistics.ConstantsStatistics.EINFACHE_DARSTELLUNG));
                    if (this.pars.getParValueBoolean(eas.statistics.ConstantsStatistics.EINFACHE_DARSTELLUNG)) {
                        this.pars.setParValue(eas.statistics.ConstantsStatistics.BEZIER_KONST,
                                eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.BEZ_FANCY);
                    } else {
                        this.pars.setParValue(eas.statistics.ConstantsStatistics.BEZIER_KONST,
                                eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.BEZ_NORMAL);
                    }
                } else if (cmd.equals("PNG...")) {
                    FileDialog dia;
                    String oldVerz;
                   
                    dia = new FileDialog(this,
                                         "Automatendarstellung als PNG "
                                         + "speichern",
                                         FileDialog.SAVE);
                   
                    dia.setFilenameFilter(new FileNamePostfixFilter("png"));
                   
                    dia.setVisible(true);

                    if (!(dia.getDirectory() == null)
                        && !(dia.getFile() == null)) {
                        oldVerz = this.pars.getStdDirectory();
                        this.pars.setStdDirectory(dia.getDirectory());
                        this.aktGrph.savePNGandPDF(dia.getFile());
                        this.pars.setStdDirectory(oldVerz);
                    }
                } else if (cmd.equals("Alle löschen!")) {
                    ArrayList<String> butts = new ArrayList<String>(2);
                    ArrayList<String> choices = new ArrayList<String>(5);
                    ArrayList<Boolean> aktiv = new ArrayList<Boolean>(5);
                   
                    String gra, tra, con, koo, png, tmp, dat, gz, gif, txt;
                   
                    butts.add("Abbrechen");
                    butts.add("OK");

                    gra = "Alle GRA-Dateien löschen";
                    tra = "Alle TRA-Dateien löschen";
                    con = "Alle CON-Dateien löschen";
                    koo = "Alle KOO-Dateien löschen";
                    png = "Alle PNG-Dateien löschen";
                    tmp = "Alle TMP-Dateien löschen";
                    dat = "Alle DAT-Dateien löschen";
                    gz = "Alle GZ-Dateien löschen";
                    gif = "Alle GIF-Dateien löschen";
                    txt = "Alle TXT-Dateien löschen";
                   
                   
                    choices.add(gra);
                    aktiv.add(false);
                    choices.add(tra);
                    aktiv.add(false);
                    choices.add(con);
                    aktiv.add(false);
                    choices.add(koo);
                    aktiv.add(true);
                    choices.add(png);
                    aktiv.add(true);
                    choices.add(tmp);
                    aktiv.add(true);
                    choices.add(dat);
                    aktiv.add(true);
                    choices.add(gz);
                    aktiv.add(false);
                    choices.add(gif);
                    aktiv.add(false);
                    choices.add(txt);
                    aktiv.add(false);
                   
                    CheckboxDialog dia = new CheckboxDialog(
                            this,
                            "Geben Sie an, welche Dateitypen aus"
                                + " dem Verzeichnis '"
                                + this.pars.getStdDirectory()
                                + "' gelöscht werden sollen",
                            "Löschen best�tigen",
                            butts,
                            choices,
                            aktiv);
                   
                    dia.setVisible(true);
                   
                    if (dia.getResult().equals("OK")) {
                        if (dia.getAuswahl().contains(tmp)) {
                            StaticMethods.deleteALL(
                                    eas.startSetup.marbBuilder.ConstantsGraphVis.TEMP_ENDUNG,
                                    this.pars);
                        }
                       
                        if (dia.getAuswahl().contains(con)) {
                            StaticMethods.deleteALL(
                                    eas.startSetup.marbBuilder.ConstantsGraphVis.BED_ENDUNG,
                                    this.pars);
                        }
                       
                        if (dia.getAuswahl().contains(koo)) {
                            StaticMethods.deleteALL(
                                    eas.startSetup.marbBuilder.ConstantsGraphVis.KOORD_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(gra)) {
                            StaticMethods.deleteALL(
                                    eas.startSetup.marbBuilder.ConstantsGraphVis.GRAPH_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(tra)) {
                            StaticMethods.deleteALL(
                                    eas.startSetup.marbBuilder.ConstantsGraphVis.TRANS_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(png)) {
                            StaticMethods.deleteALL(
                                    eas.startSetup.marbBuilder.ConstantsGraphVis.PNG_ENDUNG,
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(dat)) {
                            StaticMethods.deleteALL(
                                    "dat",
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(gz)) {
                            StaticMethods.deleteALL(
                                    "gz",
                                    this.pars);
                        }
                       
                        if (dia.getAuswahl().contains(gif)) {
                            StaticMethods.deleteALL(
                                    "gif",
                                    this.pars);
                        }

                        if (dia.getAuswahl().contains(txt)) {
                            StaticMethods.deleteALL(
                                    "txt",
                                    this.pars);
                        }
                    }
View Full Code Here

TOP

Related Classes of java.awt.FileDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.