Package eas.miscellaneous.system.windowFrames

Examples of eas.miscellaneous.system.windowFrames.GeneralDialog


            }
        } else { // If not directory.
            boolean copy = true;
           
            if (dest.exists() && askBeforeOverwrite) {
                GeneralDialog dia = new GeneralDialog(
                        null,
                        "File " + dest.getAbsolutePath() + " already exists. Should it be overwritten?",
                        "",
                        GeneralDialog.YES_NO,
                        null);
                dia.setVisible(true);
                if (dia.getResult().equals(GeneralDialog.NO)) {
                    copy = false;
                }
            }
           
            if (copy) {
View Full Code Here


     * @param seq  Die zu prüfende Sequenz.
     * @return  Ob die Sequenz korrekt ist oder der Benutzer keine Überprüfung
     *          angefordert hat.
     */
    private boolean seqKorrPruef(final String seq) {
        final GeneralDialog confirm;
        final GeneralDialog dia;
        final ArrayList<String> buttonsConf = new ArrayList<String>();
        buttonsConf.add(eas.startSetup.marbBuilder.Messages.getString("Vis.Yes"));
        buttonsConf.add(eas.startSetup.marbBuilder.Messages.getString("Vis.No"));
        buttonsConf.add(eas.startSetup.marbBuilder.Messages.getString("Vis.Cancel"));
        final ArrayList<String> buttons = new ArrayList<String>();
        buttons.add(eas.startSetup.marbBuilder.Messages.getString("SteuerFenster.OK"));


        confirm = new GeneralDialog(null,
        eas.startSetup.marbBuilder.Messages.getString(
                "SteuerFenster.ObSeqParsen"),
        eas.startSetup.marbBuilder.Messages.getString(
                "SteuerFenster.ObSeqParsenTitel"),
        buttonsConf,
        null);
        confirm.setVisible(true);
      
        if (confirm.getResult().equals(
                eas.startSetup.marbBuilder.Messages.getString(
                       "Vis.Yes"))) {
            if (!this.seqErkenner.erkenne(seq)) {
                dia = new GeneralDialog(null,
                        null,
                        eas.startSetup.marbBuilder.Messages.getString(
                            "SteuerFenster.Earley"),
                            buttons,
                        "<"
                        + seq
                        + ">\n\n\n"
                        + this.seqErkenner.toString());
                dia.setVisible(true);
                return false;
            }
        } else if (confirm.getResult().equals(
                eas.startSetup.marbBuilder.Messages.getString("Vis.Cancel"))) {
            return false;
View Full Code Here

            }
           
            color = new Color((int) (255 * (1 - colFac)), (int) (255 * colFac), 0);

            if (simTime.getLastTick() > startGreen + 200 && !gewonnen) {
                GeneralDialog dia = new GeneralDialog(
                        null,
                        "Gewonnen! Verbrauch: " + ((Phys3Env) ((AbstractEnvironment2D) this.getEnvironment())).allFuel() + " Liter.",
                        "Level gewonnen!",
                        GeneralDialog.OK_BUTT,
                        null);
                dia.setVisible(true);
               
                gewonnen = true;
            }
        } else {
            startGreen = simTime.getLastTick();
View Full Code Here

        this.area.setText(TextToSet);
        this.area.setCaretPosition(0);
    }

    private void parseProcess() {
        GeneralDialog diaAllg = new GeneralDialog(
                this,
                "",
                "Type in word to be checked by Earley parsing (leave field empty for 'lambda')",
                GeneralDialog.OK_CANCEL_BUTT,
                "",
                50,
                75,
                true);
        diaAllg.setVisible(true);
       
        if (diaAllg.getResult().equals(GeneralDialog.OK)) {
            EarleyGrammar gr = new EarleyGrammar(scheduler.getGrammar());
            EarleyParser p = new EarleyParser(gr, GlobalVariables.getPrematureParameters());
           
            String parseString = diaAllg.getText().replace(",", "").replace(" ", "");
           
            boolean b = p.erkenne(parseString);
           
            if (parseString.length() == 0) {
                parseString = "lambda";
            }
           
            String erkannt;
           
            if (b) {
                erkannt = "the string CAN be produced by the grammar";
            } else {
                erkannt = "the string CANNOT be produced by the grammar";
            }
           
            GeneralDialog diaAllg2 = new GeneralDialog(
                    this,
                    "Here comes the result of parsing string '"
                            + parseString
                            + "' with current grammar:\n \n"
                            + b + " (" + erkannt + ")",
                    "Result of parsing " + parseString,
                    GeneralDialog.OK_BUTT,
                    null,
                    50,
                    75,
                    true);
            diaAllg2.setVisible(true);
        }
    }
View Full Code Here

            }
           
            color = new Color((int) (255 * (1 - colFac)), (int) (255 * colFac), 0);
           
            if (simTime.getLastTick() > startGreen + greenStepsToWin && !gewonnen) {
                GeneralDialog dia = new GeneralDialog(
                        null,
                        "Gewonnen! Verbrauch: " + ((Phys3Env) ((AbstractEnvironment2D) this.getEnvironment())).allFuel() + " Liter.",
                        "Level gewonnen!",
                        GeneralDialog.OK_BUTT,
                        null);
                dia.setVisible(true);
               
                gewonnen = true;
            }
        } else {
            startGreen = simTime.getLastTick();
View Full Code Here

    public void runAfterSimulation(TetrisEnvironment umg, ParCollection params) {
        super.runAfterSimulation(umg, params);
       
        umg.broadcastRemainingChartEvents(umg.getSimTime().getCurrentTime());
       
        GeneralDialog dia = new GeneralDialog(
                null,
                null,
                "Game over - ranking: "
                    + umg.getPlace()
                    + " - points: "
                    + (umg.getPoints()),
                GeneralDialog.OK_BUTT, "Your name?",
                1,
                40,
                true);
       
        dia.setVisible(true);
        umg.getScorez().put(umg.getPoints(), dia.getText());
        umg.storeScorez();
//        for (long p : this.scorez.keySet()) {
//            StaticMethods.log(StaticMethods.LOG_INFO, "\n(" + i + ") "
//                    + this.scorez.get(p) + " - " + p, this.getParCollection(),
//                    "plain", null);
//            i--;
//        }
        StaticMethods.log(
                StaticMethods.LOG_INFO,
                "Game over! " + (umg.getPoints()) + " points.",
                params,
                "",
                umg.getPoints());
       
        GeneralDialog dia2 = new GeneralDialog(null, null,
                "HIGHSCOREZ - ranking: " + umg.getPlace() + " - points: "
                        + (umg.getPoints()), GeneralDialog.OK_BUTT, umg.scorezString(),
                30, 60, false);
        dia2.setVisible(true);
    }
View Full Code Here

       
        if (new File("./sharedDirectory/Polytris/username.txt").exists()) {
            username = StaticMethods.liesTextArray(new File("./sharedDirectory/Polytris/username.txt"), params, true).get(0);
        }
       
        GeneralDialog dia0 = new GeneralDialog(
                null,
                null,
                "Enter your name for score " + umg.getScore(),
                new String[] {"Store"},
                username,
                30,
                50,
                true);
       
        dia0.setLocationRelativeTo(null);
        dia0.setVisible(true);
       
        if (umg.getScorez().isHighscore(umg.getScore())) {
            umg.addHighscore(umg.getScore(), dia0.getText(), params.getParValueInt("Polytris.Level"));
        }

        boolean isExtreme = false;
        String extreme = ".";
        if (params.getParValueBoolean("Polytris.Ultimate")) {
            extreme = " Extreme!";
            isExtreme = true;
        }
       
        List<Score> globalScorez = ScoreoidApi.addScore((int) umg.getScore(), dia0.getText(), level, isExtreme);
        List<String> globalScorezString = ScoreoidApi.convertList(globalScorez, umg.getScore(), username, level, isExtreme);
       
        StaticMethods.speichereTextDatei("./sharedDirectory/Polytris", "username.txt", dia0.getText(), params);
       
        if (globalScorez != null) {
            GeneralDialog diaGlobalScore = new GeneralDialog(
                    null,
                    null,
                    "Global highscorez -- Your score: " + umg.getScore(),
                    new String[] {"Close"},
                    globalScorezString.toString().replace("]", "").replace("[", "").replace(", ", "\n")
                        + "\n\nThank you for playing Lhuk's Polytris" + extreme,
                    15,
                    50,
                    false);
            diaGlobalScore.setLocationRelativeTo(null);
            diaGlobalScore.setVisible(true);
        } else {
            GeneralDialog diaGlobalScore = new GeneralDialog(
                    null,
                    "The server is not available, global scores were not submitted.",
                    "Server not available.",
                    new String[] {"Close"},
                    null,
                    15,
                    50,
                    false);
            diaGlobalScore.setLocationRelativeTo(null);
            diaGlobalScore.setVisible(true);
           
            GeneralDialog diaLocalScore = new GeneralDialog(
                    null,
                    null,
                    "Local highscorez -- Your score: " + umg.getScore(),
                    new String[] {"Close"},
                    umg.getScorez().toString() + "\n\nThank you for playing Lhuk's Polytris" + extreme,
                    15,
                    50,
                    false);
            diaLocalScore.setLocationRelativeTo(null);
            diaLocalScore.setVisible(true);
        }

        System.exit(0);
    }
View Full Code Here

        buttons.add(ja);
        buttons.add(nein);
        buttons.add(alle);
        buttons.add(keiner);
        buttons.add(abbrechen);
        GeneralDialog nachfrage;
        nachfrage = new GeneralDialog(this, Messages
                .getString("Vis.SollDerEndlicheAutomat")
                + this.robName + Messages.getString("Vis.GespeichertWerden"),
                Messages.getString("Vis.saveGraph"), buttons, null);

        if (!anweisung.equals(alle) && !anweisung.equals(keiner)) {
            nachfrage.setVisible(true);
        }

        if (anweisung.equals(alle) || nachfrage.getResult().equals(ja)
                || nachfrage.getResult().equals(alle)) {

            this.rob.speichereAuts(this.robName);

            this.savePNGandPDF(this.robName);
           
            try {
                FileOutputStream fs = new FileOutputStream(pfad + this.robName
                        + "." + eas.startSetup.marbBuilder.ConstantsGraphVis.KOORD_ENDUNG);
                ObjectOutputStream os = new ObjectOutputStream(fs);
                os.writeObject(this.darstArten);
                os.close();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        if (anweisung.equals(alle) || anweisung.equals(keiner)) {
            return anweisung;
        } else {
            return nachfrage.getResult();
        }
    }
View Full Code Here

                while (it.hasNext()) {
                    Vis v = it.next();
                    arr.add(v.toString());
                }
               
                GeneralDialog dia = new GeneralDialog(
                          this,
                          "Draw trajectories",
                          "select robot(s) for drawing trajectories "
                              + "and last snapshot to be considered.",
                          arr,
                          "Zeichne mit Fitness",
                          "Zeichne",
                          true,
                          this.aufnahme.popNum() - 1);
                dia.setPosition(new Vector2D(400, 200));
                dia.setSize(new Vector2D(850, 250));
               
                dia.setVisible(true);
                if (dia.getResult().equals("Zeichne")
                        || dia.getResult().equals("Zeichne mit Fitness")) {
                    String[] gewGraphen = dia.getListe().getSelectedItems();
                    int[] grIndizes = new int[gewGraphen.length];
                    String name;
                   
                    for (int i = 0; i < gewGraphen.length; i++) {
                        grIndizes[i] = -1;
                       
                        for (int j = 0; j < this.graphen.size(); j++) {
                            name = this.graphen.get(j).getGraphName();
                            if (name.equals(gewGraphen[i])) {
                                grIndizes[i] = j;
                            }
                        }
                    }
                   
                    this.zeichneTraj(grIndizes,
                                     this.traceListe.getSelectedIndex(),
                                     Integer.parseInt(dia.getZusatzText()),
                                     dia.getResult().equals(
                                             "Zeichne mit Fitness"));
                }
            } else if (cmd.equals("Finde beste")) {
                long max = Integer.MIN_VALUE;
                PopSnapshot p;
View Full Code Here

   
    /**
     * Extrahiert die Fitnesswerte der aktuellen Roboter.
     */
    private void extrahiereFit() {
        GeneralDialog dia;
        ArrayList<String> buttons = new ArrayList<String>();
        String sGes;

        sGes = StatisticMethods.extrahiereFit(this.aufnahme);
       
        buttons.add(new String("Ok"));
        dia = new GeneralDialog(this,
                                    "",
                                    "Extrahierte Fitnesswerte",
                                    buttons,
                                    sGes,
                                    10,
                                    100,
                                    false);
        dia.setVisible(true);
    }
View Full Code Here

TOP

Related Classes of eas.miscellaneous.system.windowFrames.GeneralDialog

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.