diff --git a/Quellcodes/alg_ds_graphentester/+libs/LICENSECommonsIO.txt b/Quellcodes/alg_ds_graphentester/+libs/LICENSECommonsIO.txt new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/+libs/LICENSECommonsIO.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/Quellcodes/alg_ds_graphentester/+libs/LICENSEJDom.txt b/Quellcodes/alg_ds_graphentester/+libs/LICENSEJDom.txt new file mode 100644 index 0000000..5a75e93 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/+libs/LICENSEJDom.txt @@ -0,0 +1,56 @@ +/*-- + + $Id: LICENSE.txt,v 1.11 2004/02/06 09:32:57 jhunter Exp $ + + Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the disclaimer that follows + these conditions in the documentation and/or other materials + provided with the distribution. + + 3. The name "JDOM" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact . + + 4. Products derived from this software may not be called "JDOM", nor + may "JDOM" appear in their name, without prior written permission + from the JDOM Project Management . + + In addition, we request (but do not require) that you include in the + end-user documentation provided with the redistribution and/or in the + software itself an acknowledgement equivalent to the following: + "This product includes software developed by the + JDOM Project (http://www.jdom.org/)." + Alternatively, the acknowledgment may be graphical using the logos + available at http://www.jdom.org/images/logos. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + This software consists of voluntary contributions made by many + individuals on behalf of the JDOM Project and was originally + created by Jason Hunter and + Brett McLaughlin . For more information + on the JDOM Project, please see . + + */ + diff --git a/Quellcodes/alg_ds_graphentester/+libs/commons-io-2.4.jar b/Quellcodes/alg_ds_graphentester/+libs/commons-io-2.4.jar new file mode 100644 index 0000000..90035a4 Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/+libs/commons-io-2.4.jar differ diff --git a/Quellcodes/alg_ds_graphentester/+libs/csv.jar b/Quellcodes/alg_ds_graphentester/+libs/csv.jar new file mode 100644 index 0000000..805e0cd Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/+libs/csv.jar differ diff --git a/Quellcodes/alg_ds_graphentester/+libs/jdom-1.1.3.jar b/Quellcodes/alg_ds_graphentester/+libs/jdom-1.1.3.jar new file mode 100644 index 0000000..a287727 Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/+libs/jdom-1.1.3.jar differ diff --git a/Quellcodes/alg_ds_graphentester/.gitignore b/Quellcodes/alg_ds_graphentester/.gitignore new file mode 100644 index 0000000..1a934ef --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/.gitignore @@ -0,0 +1,10 @@ +**/*.class +**/*.ctxt +**/*.sh +repo.adoc +repo_subtree.adoc +*.~lock +/alt +/hide +Gemfile +Gemfile.lock diff --git a/Quellcodes/alg_ds_graphentester/GraphenTester.java b/Quellcodes/alg_ds_graphentester/GraphenTester.java new file mode 100644 index 0000000..0e9d0c5 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/GraphenTester.java @@ -0,0 +1,53 @@ +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.layout.VBox; +import javafx.scene.image.Image; +import javafx.stage.Stage; +import control.Controller; + +/** + * Dies ist die Startklasse für die GUI des Graphentesters + * In BlueJ gibt es teilweise Probleme, dass die Menüs bei Mausklick nicht + * offen bleiben. Dann bitte das Programm über die Main-Funktion starten. + * + * @author Dirk Zechnall, Thomas Schaller + * @version 28.02.2023 (v7.0) + * + */ + +public class GraphenTester extends Application { + + @Override + public void start(Stage primaryStage) { + try { + FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/graphenalgorithmen.fxml")); + Controller c = new Controller(); + c.setStage(primaryStage); + loader.setController(c); + VBox root = (VBox) loader.load(); + Scene scene = new Scene(root); + Image icon = new Image("/view/icon.png"); + primaryStage.getIcons().add(icon); + primaryStage.setScene(scene); + primaryStage.show(); + primaryStage.setOnCloseRequest(e -> + { + c.saveAktConfig(); + + c.mBeenden(null); + System.exit(0); + }); + + + } + catch(Exception e) { + System.out.println(e); + e.printStackTrace(); + } + } + public static void main(String[] args) { + new Thread(() -> Application.launch(GraphenTester.class)).start(); + } +} diff --git a/Quellcodes/alg_ds_graphentester/README.TXT b/Quellcodes/alg_ds_graphentester/README.TXT new file mode 100644 index 0000000..9e110ca --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/README.TXT @@ -0,0 +1,15 @@ +PROJEKTBEZEICHNUNG: GraphenTester +PROJEKTZWECK: Didaktisches Werkzeug um Graphenrepräsentation und -algorithmen kennen zu lernen +VERSION oder DATUM: 24.06.2021 + +INSTALLATIONSHINWEISE: +im Ordner Hintergrund + +WIE IST DAS PROJEKT IN BLUEJ ZU STARTEN: +Rechtsklick auf die Klasse Graphentester +--> new +--> OK + +AUTOR(EN): Dirk Zechnall / Thomas Schaller +********************************************************************************************** + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo.java new file mode 100644 index 0000000..ff0ebae --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo.java @@ -0,0 +1,259 @@ +package algorithmen; + +import java.lang.Thread; +import java.nio.file.*; +import graph.*; +import java.util.List; +import javafx.scene.control.Alert; +import javafx.scene.control.Alert.AlertType; +import javafx.scene.control.ButtonType; +import javafx.application.Platform; + +/** + * + * Abstrakte Oberklasse für alle zu simulierende Algorithmen + * Diese müssen die Methode getBezeichnung(): String und fuehreAlgorithmusAus() überschreiben. + * + * @version 6.7 (Dez. 2020) + * @author Thomas Schaller + */ + +public abstract class GraphAlgo extends Thread { + + // Anfang Attribute + private boolean stepping; // Einzelschrittmodus + private boolean waitforrepaint; // wird gerade gezeichnet (=> nicht nochmal zeichnen beauftragen) + private boolean waitforclick; // wird auf Klick für nächsten Step gewartet + protected boolean inArbeit; + protected GraphPlotter gp; + private Knoten startKnoten; + private int speed =100; + private Hilfe hilfe; + protected Graph g; + private List aktuellerZustand; + // Ende Attribute + + // Anfang Methoden + /** + * Erzeugt neues Algorithmus-Objekt + */ + public GraphAlgo() { + stepping = true; + waitforrepaint = false; + waitforclick = false; + aktuellerZustand = null; + setDaemon(true); + } + + /** + * Setzt die Referenz auf die GraphAnzeige und das Hilfefenster + * @param graphPlotter + * @param hilfe + */ + public void setGUIElemente(GraphPlotter graphPlotter, Hilfe hilfe) { + gp = graphPlotter; + g = gp.getGraph(); + this.hilfe = hilfe; + if (hilfe != null) hilfe.setGraphPlotter(gp); + } + + /** + * Setzt Referenz auf den Graphen + * @param g Graph auf den der Algorithmus angewendet wird + */ + public void setGraph(Graph g) { + this.g = g; + gp = null; + hilfe = null; + } + + /** + * Gibt Referenz auf den Graphen zurück + * @return g Graph, auf den der Algorithmus angewendet wird + */ + public Graph getGraph() { + return g; + } + + /** + * Muss vom Algorithmus aufgerufen werden, um einen Haltepunkt zu setzen + */ + public void step() { + if(gp == null) return; + try{ + //System.out.println("Step"); + gp.updateImage(); + aktuellerZustand = g.getStatus(); + waitforclick = true; + if (hilfe != null) hilfe.setReviewAllowed(true); + int i = 0; + while((waitforclick && (stepping || i*10 < speed)) && !isInterrupted()){ + Thread.sleep(10); + i++; + } + + if (hilfe != null) hilfe.setReviewAllowed(false); + g.setStatus(aktuellerZustand); + aktuellerZustand = null; + }catch(Exception e) { + // Erneutes Stop, damit nicht stop während des Sleeps hier abgefangen wird. + stop(); + } + } + + /** + * Wird gerade auf einen Buttonklick für den nächsten Step gewartet? + * @return true/false + */ + public boolean getWaitforclick() { + return waitforclick; + } + + /** + * Setzt, ob gewartet wird. Damit kann übermittelt werden, dass der Button gedrückt wurde + * @param wairforclickNeu Soll weiter gewartet werden? + */ + public void setWaitforclick(boolean waitforclickNeu) { + waitforclick = waitforclickNeu; + } + + /** + * Setzt, ob im Einzelschrittmodus ausgeführt werden soll + * @param stepping true/false + */ + public void setStepping(boolean stepping) { + this.stepping = stepping; + } + + /** + * Setzt die Wartezeit im automatischen Modus + * @param delay Wartezeit + */ + public void setSpeed(int delay) { + this.speed = delay; + } + + /** + * Ausführung des Algorithmus + */ + public void run() + { + if(!inArbeit && gp != null) + { + // System.out.println("Algorithmus gestartet"); + inArbeit = true; + try{ + if (hilfe != null) hilfe.setReviewAllowed(false); + fuehreAlgorithmusAus(); + gp.updateImage(); + // System.out.println("Algorithmus beendet"); + } catch( ThreadDeath e){ + // System.out.println("Algorithmus vorzeitig beendet."+e); + } + if (hilfe != null) hilfe.setReviewAllowed(true); + inArbeit = false; + return; + } + else + { + return; + } + } + // Ende Methoden + + /** + * Setzen des Startknotens + * @param k Startknoten + */ + public void setStartKnoten(Knoten k) { + startKnoten = k; + } + + /** + * Abfragen des Startknotens für den Algorithmus + * @return gesetzter Startknoten oder Knoten Nr. 0 + */ + public Knoten getStartKnoten() { + if (startKnoten != null) { + return startKnoten; + } else { + return g.getKnoten(0); + } // end of if-else + } + + /** + * Methode für den eigentlichen Algorithmus + */ + public abstract void fuehreAlgorithmusAus(); + + /** + * Name des Algorithmus für die Dropdown-Auswahl + */ + public abstract String getBezeichnung(); + + /** + * Öffnet ein Anzeigefenster mit einer Meldung. Die + * Meldung wird ggf. auch im Hilfefenster angezeigt. + * Ist für die Verwendung im Algorithmus gedacht. + * @param s Meldung + */ + public void melde(String s) { + info(s); + Platform.runLater(() -> { + Alert meldung = new Alert(AlertType.INFORMATION, s, ButtonType.OK); + meldung.setTitle("Information"); + meldung.setHeaderText(null); + meldung.showAndWait(); + }); + } + + /** + * Text in das Hilfefenster einfügen + * Ist für die Verwendung im Algorithmus gedacht. + * @param s Hilfetext + */ + public void info(String s) { + if(hilfe != null) hilfe.append(s+"\n"); + } + + /** + * Löscht das Hilfefenster + */ + public void resetInfo() { + if(hilfe != null) hilfe.loescheAlles(); + } + + /** + * Rückt im Hilfefenster eine Ebene tiefer ein. + * Ist für die Verwendung im Algorithmus gedacht. + */ + public void infoIndentMore() { + if(hilfe != null) hilfe.indentMore(); + + } + + /** + * Rückt im Hilfefenster eine Ebene aus. + * Ist für die Verwendung im Algorithmus gedacht. + */ + public void infoIndentLess() { + if(hilfe != null) hilfe.indentLess(); + + } + + /** + * Initialisiert den Graphen + */ + public void init() { + gp.getGraphOptions().knotenKurztext = new String[]{"Wert"}; + gp.getGraphOptions().knotenLangtext = new String[]{"Infotext","Wert","Markiert","Besucht"}; + if(g.isGewichtet()) { + gp.getGraphOptions().kanteKurztext = new String[]{"Gewicht"}; + gp.getGraphOptions().kanteLangtext = new String[]{"Gewicht","Markiert","Gelöscht"}; + } else { + gp.getGraphOptions().kanteKurztext = new String[]{}; + gp.getGraphOptions().kanteLangtext = new String[]{"Markiert","Gelöscht"}; + } + } + +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_BellmanFord.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_BellmanFord.java new file mode 100644 index 0000000..812fc5f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_BellmanFord.java @@ -0,0 +1,87 @@ +package algorithmen; + +import java.util.List; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen. + * Algorithmus: Bellman-Ford + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_BellmanFord extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Kürzester Pfad (Bellman-Ford)"; + } + + private String knoteninfo(Knoten k) { + if (!k.getInfotext().equals("")) { + return k.getInfotext()+" (Wert "+k.getDoubleWert()+")"; + } else { + return "Knoten Nr. "+g.getNummer(k)+" (Wert "+k.getDoubleWert()+")"; + } + } + + public void init() { + for(Knoten k : g.getAlleKnoten()) { + k.setWert(Double.POSITIVE_INFINITY); + } + info("Setze alle Entfernungen auf unendlich"); + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + + getStartKnoten().setWert(0); + info("Setze Startknoten auf Entfernung 0"); + step(); + for(int i = 0; i < g.getAnzahlKnoten()-1; i++) { + info(""+i+". Durchgang"); + infoIndentMore(); + for(Kante k: g.getAlleKanten()) { + info("Kante von "+knoteninfo(k.getStart())+" nach "+knoteninfo(k.getZiel())); + Knoten von = k.getStart(); + Knoten nach = k.getZiel(); + if(von.getDoubleWert()+k.getGewicht() < nach.getDoubleWert()){ + nach.setWert(von.getDoubleWert()+k.getGewicht()); + List alterWeg = g.getEingehendeKanten(nach, ka -> ka.isMarkiert()); + if(alterWeg.size()>0) alterWeg.get(0).setMarkiert(false); + info("Neue Entfernung für "+knoteninfo(nach)+":"+nach.getDoubleWert()); + k.setMarkiert(true); + } + if(!g.isGerichtet() && nach.getDoubleWert()+k.getGewicht() < von.getDoubleWert()){ + von.setWert(nach.getDoubleWert()+k.getGewicht()); + info("Neue Entfernung für "+knoteninfo(von)+":"+von.getDoubleWert()); + List alterWeg = g.getEingehendeKanten(von, ka -> ka.isMarkiert()); + if(alterWeg.size()>0) alterWeg.get(0).setMarkiert(false); + k.setMarkiert(true); + } + step(); + } + infoIndentLess(); + step(); + } + info("Zyklenkontrolle"); + for(Kante k: g.getAlleKanten()) { + if(k.getStart().getDoubleWert()+k.getGewicht() < k.getZiel().getDoubleWert()){ + melde("Es gibt einen Zyklus negativen Gewichts"); + info("Es gibt einen Zyklus negativen Gewichts"); + g.initialisiereAlleKnoten(); + return; + } + } + step(); + } // end of for + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Breitensuche.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Breitensuche.java new file mode 100644 index 0000000..d9c992e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Breitensuche.java @@ -0,0 +1,72 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus nummeriert alle Knoten des Graphen. + * Algorithmus: Breitensuche mit ToDo-Liste (Schlange) + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_Breitensuche extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Nummerierung (Breitensuche)"; + } + +// Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + int nr = 0; + info("Erzeuge leere toDo-Liste und füge Startknoten hinzu"); + List toDo = new ArrayList(); + toDo.add(getStartKnoten()); + + while(toDo.size()>0) { + info("Nimm ersten Knoten aus der toDo-Liste (momentan "+toDo.size()+" Elemente) heraus"); + Knoten k = toDo.remove(0); + nr++; + infoIndentMore(); + k.setBesucht(false); + k.setMarkiert(true); + k.setWert(nr); + info("Markiere den Knoten und gib ihm die Nummer "+nr); + info("Für jeden Nachbarknoten"); + infoIndentMore(); + for(Knoten n : g.getNachbarknoten(k)) { + if(!n.isMarkiert()){ + if( !toDo.contains(n)) { + toDo.add(n); + g.getKante(k,n).setMarkiert(true); + n.setBesucht(true); + info("- ist noch nicht markiert, füge der ToDo-Liste am Ende hinzu.\n" + +" toDo-Liste hat jetzt "+toDo.size()+" Elemente"); + } else { + info("- ist schon in ToDo-Liste"); + } + } else { + info("- ist schon markiert"); + } + } + infoIndentLess(); + infoIndentLess(); + step(); + } + info("ToDo-Liste fertig abgearbeitet"); + + } // end + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ColoringBacktracking.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ColoringBacktracking.java new file mode 100644 index 0000000..e2d7cec --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ColoringBacktracking.java @@ -0,0 +1,93 @@ +package algorithmen; + +import java.util.List; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + * die gleiche Farbe haben und möglichst wenige Farben benutzt werden. + * Algorithmus: Backtracking + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_ColoringBacktracking extends GraphAlgo { + + // Anfang Attribute + int besteAnzahl; + List beste; + + public String getBezeichnung() { + return "Map Coloring (Vollständing)"; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + besteAnzahl = Integer.MAX_VALUE; + bestimmeColoring(0); + g.setStatus(beste); + step(); + } + + private void bestimmeColoring(int benutzteFarben) { + int min = Integer.MAX_VALUE; + + List knoten = g.getAlleKnoten(k->k.getFarbe()<=0); + List status = g.getStatus(); + if(knoten.size() == 0) { + if(benutzteFarben < besteAnzahl) { + besteAnzahl = benutzteFarben; + beste = status; + info("Neue beste Lösung: "+besteAnzahl+" Farben"); + } + else { + info("Keine neue beste Lösung"); + } + step(); + return; + } + + Knoten aktuellerKnoten = knoten.get(0); + info("Bearbeite einen noch nicht gefärbten Knoten: Knoten Nr. "+g.getNummer(aktuellerKnoten)); + infoIndentMore(); + + boolean[] farbenliste = new boolean[g.getAnzahlKnoten()+1]; + List nachbarn = g.getNachbarknoten(aktuellerKnoten); + info("Setze alle Farbe der Farbenliste auf unbenutzt und prüfe alle Nachbarknoten"); + infoIndentMore(); + // speichere alle Farben in dem Array farbenliste[], die in der Adjazenzliste vom Knoten k als Wert vorkommen + for (Knoten k : nachbarn){ + info("Knoten "+g.getNummer(k)+": Setze Farbe "+k.getFarbe()+" auf benutzt"); + farbenliste[k.getFarbe()]=true; + } + infoIndentLess(); + + info("Teste alle zulässigen Farben"); + infoIndentMore(); + for(int i=1; i<5; i++) { + if(!farbenliste[i]){ + aktuellerKnoten.setFarbe(i); + info("Setze Knoten "+g.getNummer(aktuellerKnoten)+" auf Farbe "+i); + if(knoten.size()>1) step(); + infoIndentMore(); + bestimmeColoring(Math.max(i, benutzteFarben)); + info("Kehre zu Knoten Nr. "+g.getNummer(aktuellerKnoten)+" zurück"); + infoIndentLess(); + } else { + info("Farbe "+i+" ist benutzt"); + } + } + infoIndentLess(); + + aktuellerKnoten.setFarbe(0); + infoIndentLess(); + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ColoringGreedy.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ColoringGreedy.java new file mode 100644 index 0000000..d8e0980 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ColoringGreedy.java @@ -0,0 +1,71 @@ +package algorithmen; + +import java.util.List; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + * die gleiche Farbe haben und möglichst wenige Farben benutzt werden. + * Algorithmus: Näherungslösung mit Greedy-Algorithmus + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ +public class GraphAlgo_ColoringGreedy extends GraphAlgo { + + // Anfang Attribute + + + + public String getBezeichnung() { + return "Map-Coloring (Greedy)"; + } + + + // Ende Attribute + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + List knoten = g.getAlleKnoten(); + info("Wiederhole für jeden Knoten"); + for (Knoten aktuellerKnoten: knoten ) { + // Liste in der die Farben der adjazenten Knoten abgehakt werden. Die Farben + // sind von 1 bis n (# Knoten) kodiert und werden spaeter in Farben decodiert + boolean[] farbenliste = new boolean[g.getAnzahlKnoten()+1]; + List nachbarn = g.getNachbarknoten(aktuellerKnoten); + + info("Bearbeite Knoten "+g.getNummer(aktuellerKnoten)); + infoIndentMore(); + info("Setze alle Farbe der Farbenliste auf unbenutzt"); + info("Wiederhole für jeden Nachbarknoten"); + infoIndentMore(); + // speichere alle Farben in dem Array farbenliste[], die in der Adjazenzliste vom Knoten k als Wert vorkommen + for (Knoten k : nachbarn){ + info("Knoten "+g.getNummer(k)+": Setze Farbe "+k.getFarbe()+" auf benutzt"); + farbenliste[k.getFarbe()]=true; + } + infoIndentLess(); + + info("Suche in Farbenliste nach unbenutzer Farbe"); + infoIndentMore(); + // faerbe den Knoten k (setze den Farbwert des Knotens) mit der niedrigst-moeglichen Farbe (kleinster Index > 0 in der farbenliste) + for (int i=1; i knoten = g.getAlleKnoten(); + Collections.shuffle(knoten); + info("Wiederhole für jeden Knoten"); + for (Knoten aktuellerKnoten: knoten ) { + // Liste in der die Farben der adjazenten Knoten abgehakt werden. Die Farben + // sind von 1 bis n (# Knoten) kodiert und werden spaeter in Farben decodiert + boolean[] farbenliste = new boolean[g.getAnzahlKnoten()+1]; + List nachbarn = g.getNachbarknoten(aktuellerKnoten); + + info("Bearbeite Knoten "+g.getNummer(aktuellerKnoten)); + infoIndentMore(); + info("Setze alle Farbe der Farbenliste auf unbenutzt"); + info("Wiederhole für jeden Nachbarknoten"); + infoIndentMore(); + // speichere alle Farben in dem Array farbenliste[], die in der Adjazenzliste vom Knoten k als Wert vorkommen + for (Knoten k : nachbarn){ + info("Knoten "+g.getNummer(k)+": Setze Farbe "+k.getFarbe()+" auf benutzt"); + farbenliste[k.getFarbe()]=true; + } + infoIndentLess(); + + info("Suche in Farbenliste nach unbenutzer Farbe"); + infoIndentMore(); + // faerbe den Knoten k (setze den Farbwert des Knotens) mit der niedrigst-moeglichen Farbe (kleinster Index > 0 in der farbenliste) + for (int i=1; i toDo = new ArrayList(); + getStartKnoten().setBesucht(true); + getStartKnoten().setWert(0); + toDo.add(getStartKnoten()); + + while(toDo.size()>0) { + info("Sortiere toDo-Liste"); + Collections.sort(toDo); + info("Nimm ersten Knoten aus der toDo-Liste (momentan "+toDo.size()+" Elemente) heraus"); + Knoten k = toDo.remove(0); + infoIndentMore(); + k.setMarkiert(true); + info("Markiere den Knoten"); + info("Er hat Entfernung "+k.getIntWert()); + info("Für jeden Nachbarknoten"); + infoIndentMore(); + for(Knoten n : g.getNachbarknoten(k)) { + if(!n.isMarkiert()){ + info("- ist noch nicht markiert"); + Kante ka = g.getKante(k, n); + if(n.getDoubleWert() > k.getDoubleWert()+ka.getGewicht()){ + if(n.isBesucht()) { + List eingehend = g.getEingehendeKanten(n, ka2 -> !ka2.isGeloescht() && ka2.isMarkiert()); + Kante alterWeg = eingehend.get(0); + alterWeg.setGeloescht(true); + alterWeg.setMarkiert(false); + + info(" loesche bisherigen Weg dorthin"); + } + n.setWert(k.getIntWert()+ka.getGewicht()); + if(!toDo.contains(n)) toDo.add(n); + ka.setMarkiert(true); + n.setBesucht(true); + info(" setze Entfernung "+(n.getDoubleWert())+" und füge ggf. ToDo-Liste hinzu."); + info(" toDo-Liste hat jetzt "+toDo.size()+" Elemente"); + } else { + info(" keine neue beste Entfernung"); + ka.setGeloescht(true); + } + } + } + infoIndentLess(); + infoIndentLess(); + step(); + } + info("ToDo-Liste fertig abgearbeitet"); + + } // end + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DijkstraMitVorgaenger.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DijkstraMitVorgaenger.java new file mode 100644 index 0000000..015ceee --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DijkstraMitVorgaenger.java @@ -0,0 +1,109 @@ +package algorithmen; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.nio.file.*; +import java.util.Arrays; + +import graph.*; +/** + * Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen. + * Algorithmus: Dijkstra + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DijkstraMitVorgaenger extends GraphAlgo { + + // Anfang Attribute + public String getBezeichnung() { + return "Kürzester Pfad (Dijkstra mit Vorgänger)"; + } + + + public void init() { + List alle = g.getAlleKnoten(); + for(Knoten k : alle) { + k.set("Vorgänger","-"); + k.set("Entfernung",Double.POSITIVE_INFINITY); + k.setSortierkriterium("Entfernung"); + } + gp.getGraphOptions().knotenKurztext = new String[]{"Entfernung","Vorgänger"}; + gp.getGraphOptions().knotenLangtext = new String[]{"Infotext","Entfernung","Vorgänger","Markiert","Besucht"}; + } + + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + + + + info("Erzeuge leere toDo-Liste und füge Startknoten hinzu"); + List toDo = new ArrayList(); + getStartKnoten().setBesucht(true); + getStartKnoten().set("Entfernung", 0); + toDo.add(getStartKnoten()); + + while(toDo.size()>0) { + info("Sortiere toDo-Liste nach der Entfernung"); + Collections.sort(toDo); + info("Nimm ersten Knoten aus der toDo-Liste (momentan "+toDo.size()+" Elemente) heraus"); + Knoten k = toDo.remove(0); + infoIndentMore(); + k.setMarkiert(true); + info("Markiere den Knoten"); + info("Er hat Entfernung "+k.getString("Entfernung")); + info("Für jeden Nachbarknoten"); + infoIndentMore(); + for(Knoten n : g.getNachbarknoten(k)) { + if(!n.isMarkiert()){ + if(!n.getInfotext().isEmpty()) { + info("- "+n.getInfotext()+" ist noch nicht markiert"); + } else { + info("- Knoten Nr. "+g.getNummer(n)+" ist noch nicht markiert"); + } + Kante ka = g.getKante(k, n); + if(!n.isBesucht() || n.getDouble("Entfernung") > k.getDouble("Entfernung") + ka.getGewicht()){ + if(n.isBesucht()) { + List eingehend = g.getEingehendeKanten(n, ka2 -> !ka2.isGeloescht() && ka2.isMarkiert()); + Kante alterWeg = eingehend.get(0); + // Kante alterWeg = g.beschraenkeKantenAuf(g.getEingehendeKanten(n), Graph.MARKIERT, Graph.NICHTGELOESCHT).get(0); + // alterWeg.setGeloescht(true); + // alterWeg.setMarkiert(false); + alterWeg.setGeloescht(true); + alterWeg.setMarkiert(false); + + info(" loesche bisherigen Weg dorthin"); + } + + n.set("Entfernung", k.getInt("Entfernung")+ka.getGewicht()); + if(k.getInfotext().equals("")) { + n.set("Vorgänger",g.getNummer(k)); + } else { + n.set("Vorgänger",k.getInfotext()); + } + if(!toDo.contains(n)) toDo.add(n); + ka.setMarkiert(true); + n.setBesucht(true); + info(" setze Entfernung "+n.getString("Entfernung")+" und füge ggf. ToDo-Liste hinzu."); + info(" toDo-Liste hat jetzt "+toDo.size()+" Elemente"); + } else { + info(" keine neue beste Entfernung"); + ka.setGeloescht(true); + } + } + } + infoIndentLess(); + infoIndentLess(); + step(); + } + info("ToDo-Liste fertig abgearbeitet"); + + } // end + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetBacktracking.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetBacktracking.java new file mode 100644 index 0000000..181f52e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetBacktracking.java @@ -0,0 +1,78 @@ +package algorithmen; + +import java.util.List; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Backtracking + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetBacktracking extends GraphAlgo { + + // Anfang Attribute + int besteAnzahl; + List beste; + + public String getBezeichnung() { + return "Dominierende Menge (Vollständig)"; + } + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + long starttime = System.currentTimeMillis(); + if (g.getAnzahlKnoten()==0) { + return; + } + besteAnzahl = Integer.MAX_VALUE; + bestimmeDominierendeMenge(0); + g.setStatus(beste); + long endtime = System.currentTimeMillis(); + melde("Minimale dominierende Menge in "+((endtime-starttime)/1000)+" Sekunden gefunden."); + step(); + } + + + + private void bestimmeDominierendeMenge(int knoten) { + List status = g.getStatus(); + + List markierte = g.getAlleKnoten(kn->kn.isMarkiert()); + List nichtbesucht = g.getAlleKnoten(kn->!kn.isBesucht() && !kn.isMarkiert()); + + // Verbessert die Laufzeit deutlich, aber verhindert das exponentielle Wachstum nicht + // if(markierte.size() >=besteAnzahl) return; + + Knoten k = g.getKnoten(knoten); + if(k != null && nichtbesucht.size()>0) { + bestimmeDominierendeMenge(knoten+1); + g.setStatus(status); + k.setMarkiert(true); + k.setBesucht(false); + for(Knoten n: g.getNachbarknoten(k, kn->!kn.isBesucht() && !kn.isMarkiert())) { + n.setBesucht(true); + } + bestimmeDominierendeMenge(knoten+1); + g.setStatus(status); + } else { + step(); + + if(nichtbesucht.size()==0){ + if(markierte.size() < besteAnzahl) { + besteAnzahl = markierte.size(); + beste = status; + } + } + + } + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGenetisch.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGenetisch.java new file mode 100644 index 0000000..a4dd669 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGenetisch.java @@ -0,0 +1,149 @@ +package algorithmen; + +import java.util.List; +import java.nio.file.*; +import java.util.Random; +import java.util.Arrays; + +import graph.*; + +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Genetischer Algorithmus + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGenetisch extends GraphAlgo { + + private int popGroesse=500; + private int fitGroesse=80; + private int[][] population; + private int[][] fittest; + private int generation; + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Genetisch)"; + } + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + population = new int[popGroesse][g.getAnzahlKnoten()]; + double[] bewertungen = new double[popGroesse]; + for(int i=0; i bewertungen[beste]) { + beste = j; + } + } + fittest[i] = population[beste]; + bewertungen[beste] = Double.MIN_VALUE; + } + showTeilmenge(fittest[0]); + + Random r = new Random(); + for(generation = 0; generation < 100; generation++) { + for(int j=0; j bewertungen[beste]) { + beste = j; + } + } + fittest[i] = population[beste]; + bewertungen[beste] = Double.MIN_VALUE; + } + showTeilmenge(fittest[0]); + this.info("Bisher beste dominierende Menge (Generation "+generation+"): "+(g.getAnzahlKnoten()-getBewertung(fittest[0]))+" Knoten."); + step(); + } + + step(); + } + + public int[] erzeugeZufaelligeTeilmenge(){ + Random r = new Random(); + int[] teilmenge = new int[g.getAnzahlKnoten()]; + + for(int i=0; i< g.getAnzahlKnoten(); i++) { + teilmenge[i] = r.nextInt(2); + } + return teilmenge; + } + + public int[] kreuze(int[] tm1, int[] tm2) { + Random r = new Random(); + int crossover = r.nextInt(tm1.length); + int[] new_tm = Arrays.copyOf(tm1, tm1.length); + for(int j = crossover; j< tm2.length; j++) { + new_tm[j] = tm2[j]; + } + return new_tm; + } + + public int[] mutiere(int[] tm) { + Random r = new Random(); + int anz_mut = r.nextInt(3); + int[] new_tm = Arrays.copyOf(tm, tm.length); + for(int z =0; z knoten = g.getAlleKnoten(k->!k.isMarkiert()); + + info("Wiederhole für jeden noch nicht markierten Knoten"); + infoIndentMore(); + for(Knoten k : knoten) { + List nachbarn = g.getNachbarknoten(k); + k.setWert(nachbarn.size()); + info("Setze Wert von Knoten Nr. "+g.getNummer(k)+" auf "+nachbarn.size()+" Nachbarn"); + } + infoIndentLess(); + info("Sortiere die Liste"); + knoten.sort(Comparator.comparing(Knoten::getIntWert).reversed()); + Knoten bester = knoten.get(0); + info("Nimm den Knoten mit den meisten Nachbarn => Knoten Nr. "+g.getNummer(bester)); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyB.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyB.java new file mode 100644 index 0000000..3f0bff9 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyB.java @@ -0,0 +1,77 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * Nimm den Knoten mit den wenigsten Nachbarn + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyB extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (b))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * Nimm den Knoten mit den wenigsten Nachbarn + */ + private Knoten bestimmeBesten() { + List knoten = g.getAlleKnoten(k->!k.isMarkiert()); + + info("Wiederhole für jeden noch nicht markierten Knoten"); + infoIndentMore(); + for(Knoten k : knoten) { + List nachbarn = g.getNachbarknoten(k); + k.setWert(nachbarn.size()); + info("Setze Wert von Knoten Nr. "+g.getNummer(k)+" auf "+nachbarn.size()+" Nachbarn"); + } + infoIndentLess(); + info("Sortiere die Liste"); + knoten.sort(Comparator.comparing(Knoten::getIntWert)); + Knoten bester = knoten.get(0); + info("Nimm den Knoten mit den wenigsten Nachbarn => Knoten Nr. "+g.getNummer(bester)); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyC.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyC.java new file mode 100644 index 0000000..31dda8b --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyC.java @@ -0,0 +1,79 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * Nimm den Knoten mit den meisten Nachbarn + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyC extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (c))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * Nimm den Knoten mit den meisten Nachbarn + */ + private Knoten bestimmeBesten() { + List knoten = g.getAlleKnoten(k->!k.isMarkiert()); + + info("Wiederhole für jeden noch nicht markierten Knoten"); + infoIndentMore(); + for(Knoten k : knoten) { + List nachbarn = g.getNachbarknoten(k, kn -> !kn.isMarkiert() && !kn.isBesucht()); + k.setWert(nachbarn.size()); + if(!k.isMarkiert() && !k.isBesucht()) k.setWert(k.getIntWert()+1); + info("Setze Wert von Knoten Nr. "+g.getNummer(k)+" auf "+nachbarn.size()+" neu überdeckte Knoten"); + } + infoIndentLess(); + info("Sortiere die Liste"); + knoten.sort(Comparator.comparing(Knoten::getIntWert).reversed()); + Knoten bester = knoten.get(0); + info("Nimm den Knoten mit den meisten neu überdeckten Knoten => Knoten Nr. "+g.getNummer(bester)); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyD.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyD.java new file mode 100644 index 0000000..fdb1a3c --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyD.java @@ -0,0 +1,79 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * Nimm den Knoten mit den meisten Nachbarn + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyD extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (d))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * Nimm den Knoten mit den meisten Nachbarn + */ + private Knoten bestimmeBesten() { + List knoten = g.getAlleKnoten(k->!k.isMarkiert()); + + info("Wiederhole für jeden noch nicht markierten Knoten"); + infoIndentMore(); + for(Knoten k : knoten) { + List nachbarn = g.getNachbarknoten(k, kn -> !kn.isMarkiert() && !kn.isBesucht()); + k.setWert(nachbarn.size()); + if(!k.isMarkiert() && !k.isBesucht()) k.setWert(k.getIntWert()+1); + info("Setze Wert von Knoten Nr. "+g.getNummer(k)+" auf "+nachbarn.size()+" neu überdeckte Knoten"); + } + infoIndentLess(); + info("Sortiere die Liste"); + knoten.sort(Comparator.comparing(Knoten::getIntWert)); + Knoten bester = knoten.get(0); + info("Nimm den Knoten mit den wenigsten neu überdeckten Knoten => Knoten Nr. "+g.getNummer(bester)); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyE.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyE.java new file mode 100644 index 0000000..67b250f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyE.java @@ -0,0 +1,98 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyE extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (e))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat + */ + + private Knoten bestimmeBesten() { + Random r= new Random(); + + List markierte = g.getAlleKnoten(k->k.isMarkiert() ); + List nichtabgedeckte = g.getAlleKnoten(k->!k.isMarkiert() ); + if(markierte.size()==0) return g.getKnoten(r.nextInt(g.getAnzahlKnoten())); + + List entfernung3 = new ArrayList(); + List status = g.getStatus(); + for(Knoten start: markierte) { + info("Bestimme Entfernung von Knoten "+g.getKnoteninfo(start,false)+" zu allen anderen Knoten"); + + g.initialisiereAlleKnoten(); + GraphAlgo moore = new GraphAlgo_Moore(); + moore.setGraph(g); + moore.setStartKnoten(start); + moore.fuehreAlgorithmusAus(); + + entfernung3 = g.getAlleKnoten(k->k.getIntWert()==3); + entfernung3.retainAll(nichtabgedeckte); + info("Habe "+entfernung3.size()+" Knoten mit Entfernung 3 gefunden."); + if(entfernung3.size()>0) break; + } + Knoten bester; + if(entfernung3.size()>0) { + info("Wähle zufällig einen von diesen"); + bester = entfernung3.get(r.nextInt(entfernung3.size())); + } else { + info("Wählen einen zufälligen Knoten aus"); + bester = nichtabgedeckte.get(r.nextInt(nichtabgedeckte.size())); + } + bester.setFarbe(5); + step(); + g.setStatus(status); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyF.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyF.java new file mode 100644 index 0000000..21673c2 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyF.java @@ -0,0 +1,98 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyF extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (f))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat + */ + + private Knoten bestimmeBesten() { + Random r= new Random(); + + List markierte = g.getAlleKnoten(k->k.isMarkiert() ); + List nichtabgedeckte = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht() ); + if(markierte.size()==0) return g.getKnoten(r.nextInt(g.getAnzahlKnoten())); + + List entfernung2 = new ArrayList(); + List status = g.getStatus(); + for(Knoten start: markierte) { + info("Bestimme Entfernung von Knoten "+g.getKnoteninfo(start,false)+" zu allen anderen Knoten"); + + g.initialisiereAlleKnoten(); + GraphAlgo moore = new GraphAlgo_Moore(); + moore.setGraph(g); + moore.setStartKnoten(start); + moore.fuehreAlgorithmusAus(); + + entfernung2 = g.getAlleKnoten(k->k.getIntWert()==2); + entfernung2.retainAll(nichtabgedeckte); + info("Habe "+entfernung2.size()+" noch nicht überdeckte Knoten mit Entfernung 2 gefunden."); + if(entfernung2.size()>0) break; + } + Knoten bester; + if(entfernung2.size()>0) { + info("Wähle zufällig einen von diesen"); + bester = entfernung2.get(r.nextInt(entfernung2.size())); + } else { + info("Wählen einen zufälligen Knoten aus"); + bester = nichtabgedeckte.get(r.nextInt(nichtabgedeckte.size())); + } + bester.setFarbe(5); + step(); + g.setStatus(status); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyG.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyG.java new file mode 100644 index 0000000..cb4e7cf --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyG.java @@ -0,0 +1,98 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyG extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (g))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat + */ + + private Knoten bestimmeBesten() { + Random r= new Random(); + + List markierte = g.getAlleKnoten(k->k.isMarkiert() ); + List nichtabgedeckte = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht() ); + if(markierte.size()==0) return g.getKnoten(r.nextInt(g.getAnzahlKnoten())); + + List entfernung3 = new ArrayList(); + List status = g.getStatus(); + for(Knoten start: markierte) { + info("Bestimme Entfernung von Knoten "+g.getKnoteninfo(start,false)+" zu allen anderen Knoten"); + + g.initialisiereAlleKnoten(); + GraphAlgo moore = new GraphAlgo_Moore(); + moore.setGraph(g); + moore.setStartKnoten(start); + moore.fuehreAlgorithmusAus(); + + entfernung3 = g.getAlleKnoten(k->k.getIntWert()==3); + entfernung3.retainAll(nichtabgedeckte); + info("Habe "+entfernung3.size()+" noch nicht überdeckte Knoten mit Entfernung 3 gefunden."); + if(entfernung3.size()>0) break; + } + Knoten bester; + if(entfernung3.size()>0) { + info("Wähle zufällig einen von diesen"); + bester = entfernung3.get(r.nextInt(entfernung3.size())); + } else { + info("Wählen einen zufälligen Knoten aus"); + bester = nichtabgedeckte.get(r.nextInt(nichtabgedeckte.size())); + } + bester.setFarbe(5); + step(); + g.setStatus(status); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyH.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyH.java new file mode 100644 index 0000000..b1d7c8d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyH.java @@ -0,0 +1,101 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * ein nicht abgedeckten Knoten, der von möglichst vielen schon ausgewählten Knoten die Entfernung 3 hat + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyH extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (h))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * ein nicht abgedeckten Knoten, der von möglichst vielen schon ausgewählten Knoten die Entfernung 3 hat + */ + private Knoten bestimmeBesten() { + Random r = new Random(); + List markierte = g.getAlleKnoten(k->k.isMarkiert() ); + List nichtabgedeckte = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht() ); + if(markierte.size()==0) return g.getKnoten(r.nextInt(g.getAnzahlKnoten())); + + List entfernung3 = new ArrayList(); + List status = g.getStatus(); + g.initialisiereAlleKnoten(); + List zaehlstatus = g.getStatus(); + + for(Knoten start: markierte) { + info("Bestimme Entfernung von Knoten "+g.getKnoteninfo(start,false)+" zu allen anderen Knoten"); + g.initialisiereAlleKnoten(); + GraphAlgo moore = new GraphAlgo_Moore(); + moore.setGraph(g); + moore.setStartKnoten(start); + moore.fuehreAlgorithmusAus(); + + entfernung3 = g.getAlleKnoten(k->k.getIntWert()==3); + entfernung3.retainAll(nichtabgedeckte); + info("Habe "+entfernung3.size()+" noch nicht überdeckte Knoten mit Entfernung 3 gefunden "); + g.setStatus(zaehlstatus); + for(Knoten kandidat: entfernung3) { + kandidat.setWert(kandidat.getIntWert()+1); + } + info("... und erhöher die Anzahl bei diesen Knoten"); + zaehlstatus= g.getStatus(); + + } + info("Sortiere die Knoten nach der Anzahl der ausgewählten Knoten mit Abstand 3"); + nichtabgedeckte.sort(Comparator.comparing(Knoten::getIntWert).reversed()); + + Knoten bester = nichtabgedeckte.get(0); + bester.setFarbe(5); + info("Nehme den besten"); + step(); + g.setStatus(status); + return bester; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyI.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyI.java new file mode 100644 index 0000000..cdcf6d9 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_DominatingSetGreedyI.java @@ -0,0 +1,114 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.nio.file.*; +import java.util.Random; + +import graph.*; +/** + * Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + * und bestimmt den Zeitbedarf. + * Algorithmus: Greedy mit Strategie: + * ein nicht abgedeckten Knoten, der von den ausgewählten Knoten eine möglichst große Entfernung hat + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_DominatingSetGreedyI extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Dominierende Menge (Greedy (i))"; + } + + /** Bestimmt besten Knoten nach Strategie: + * ein nicht abgedeckten Knoten, der von den ausgewählten Knoten eine möglichst große Entfernung hat + */ + + private Knoten bestimmeBesten() { + Random r = new Random(); + List markierte = g.getAlleKnoten(k->k.isMarkiert() ); + List nichtabgedeckte = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht() ); + if(markierte.size()==0) return g.getKnoten(r.nextInt(g.getAnzahlKnoten())); + + List status = g.getStatus(); + g.initialisiereAlleKnoten(); + for(Knoten k : g.getAlleKnoten()) { + k.setWert(Integer.MAX_VALUE); + k.setMarkiert(false); + } + info("Setze alle Entfernungen auf unendlich"); + List toDo = new ArrayList(); + + for(Knoten start: markierte) { + for(Knoten k : g.getAlleKnoten()) { + k.setBesucht(false); + k.setMarkiert(false); + } + info("Bestimme Entfernung von Knoten "+g.getKnoteninfo(start,false)+" zu allen anderen Knoten"); + + start.setBesucht(true); + start.setWert(0); + toDo.add(start); + + while(toDo.size()>0) { + Knoten k = toDo.remove(0); + k.setMarkiert(true); + for(Knoten n : g.getNachbarknoten(k)) { + if(!n.isBesucht() && n.getIntWert()>k.getIntWert()+1){ + n.setWert(k.getIntWert()+1); + toDo.add(n); + g.getKante(k,n).setMarkiert(true); + n.setBesucht(true); + } + } + } + info("... und reduziere Entfernung, wenn nötig."); + + } + info("Sortiere Knoten nach Entfernung"); + nichtabgedeckte.sort(Comparator.comparing(Knoten::getIntWert).reversed()); + + Knoten bester = nichtabgedeckte.get(0); + bester.setFarbe(5); + info("... und nimm den am weitesten entfernten"); + step(); + g.setStatus(status); + return bester; + } + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + List knoten = g.getAlleKnoten(k->!k.isMarkiert() && !k.isBesucht()); + info("Solange es noch nicht überdeckte Knoten gibt, wiederhole..."); + int nr = 1; + while(knoten.size() > 0) { + info("Bestimme "+(nr++)+". hinzuzufügenden Knoten"); + infoIndentMore(); + Knoten bester = bestimmeBesten(); + bester.setMarkiert(true); + bester.setBesucht(false); + info("Markiere diesen Knoten ..."); + List nachbarn = g.getNachbarknoten(bester,kn->!kn.isMarkiert() && !kn.isBesucht()); + for(Knoten k : nachbarn) { + k.setBesucht(true); + } + info("... und setze alle bisher nicht überdeckten Nachbarn auf besucht"); + knoten = g.getAlleKnoten(kn->!kn.isMarkiert() && !kn.isBesucht()); + step(); + infoIndentLess(); + }// end of while + + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_EulerkreisExistenz.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_EulerkreisExistenz.java new file mode 100644 index 0000000..a14d026 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_EulerkreisExistenz.java @@ -0,0 +1,84 @@ +package algorithmen; + +import java.util.ArrayList; +import java.util.List; +import graph.*; +/** + * Dieser Algorithmus testet, ob ein Eulerkreis existiert. + * Algorithmus: Zunächst wird auf geraden Grad der Knoten getestet, danach + * mit Tiefensuche der Zusammenhang des Graphen überprüft. + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_EulerkreisExistenz extends GraphAlgo { + + public String getBezeichnung() { + return "Eulerkreis (Existenz)"; + } + + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + + boolean gradOk = true; + info("Setze gradOK auf true"); + for(Knoten k: g.getAlleKnoten()) { + info("Knoten "+g.getNummer(k)+" hat Grad "+g.getNachbarknoten(k).size()); + if(g.getNachbarknoten(k).size() % 2 != 0) { + gradOk = false; + info("Setze gradOK auf false"); + } + } + info("Alle Knoten untersucht"); + step(); + + if(!gradOk) { + melde("Es gibt keinen Euler-Kreis, da der Grad nicht immer gerade ist"); + return; + } + + List toDo = new ArrayList(); + getStartKnoten().setBesucht(true); + toDo.add(getStartKnoten()); + info("Erzeuge leere toDo-Liste und füge Startknoten hinzu"); + + int nr=0; + while(toDo.size()>0) { + info("Nimm ersten Knoten aus der toDo-Liste (momentan "+toDo.size()+" Elemente) heraus"); + Knoten k = toDo.remove(0); + nr++; + infoIndentMore(); + k.setMarkiert(true); + k.setWert(nr); + info("Markiere den Knoten und gib ihm die Nummer "+nr); + info("Für jeden Nachbarknoten"); + infoIndentMore(); + for(Knoten n : g.getNachbarknoten(k)) { + if(!n.isBesucht()){ + info("- kennzeichne als besucht, füge der ToDo-Liste am Anfang hinzu."); + toDo.add(0, n); + g.getKante(k,n).setMarkiert(true); + n.setBesucht(true); + info(" toDo-Liste hat jetzt "+toDo.size()+" Elemente"); + } else { + info("- ist schon als besucht gekennzeichnet."); + } + } + infoIndentLess(); + infoIndentLess(); + step(); + } + if(nr == g.getAnzahlKnoten()) { + melde("Es gibt einen Euler-Kreis"); + } else + { + melde("Es gibt keinen Euler-Kreis, da der Graph nicht zusammenhängend ist."); + } + + } // end + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_MST_Kruskal.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_MST_Kruskal.java new file mode 100644 index 0000000..48d8c33 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_MST_Kruskal.java @@ -0,0 +1,85 @@ +package algorithmen; + +import java.util.List; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; + +/** + * + * Dieser Algorithmus sucht einen minimal Spanning Tree + * Algorithmus: Kruskal + * + * @version 1.0 from 11.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_MST_Kruskal extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "MST (Kruskal)"; + } + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + int farbe = 1; + List kanten = g.getAlleKanten(); + List knoten = g.getAlleKnoten(); + info("Hole eine Liste aller Kanten und eine aller Knoten"); + Collections.sort(kanten); + info("Sortiere Kanten aufsteigend"); + info("Wiederhole für alle Kanten:"); + for (Kante k: kanten) { + info("Bearbeite Kante mit Gewicht: "+k.getGewicht()); + infoIndentMore(); + int f1 = k.getStart().getFarbe(); + int f2 = k.getZiel().getFarbe(); + if(f1 == 0 && f2 == 0) { + info("Beide Knoten gehören noch zu keinem Teilgraphen"); + k.getStart().setFarbe(farbe); + k.getZiel().setFarbe(farbe); + k.setMarkiert(true); + info("=> setze beide auf Farbe "+farbe+" und markiere die Kante"); + farbe++; + } else + if(f1 == 0) { + info("Der Knoten Nr. "+g.getNummer(k.getStart())+" gehört noch zu keinem Teilgraphen"); + k.getStart().setFarbe(f2); + k.setMarkiert(true); + info("=> setze ihn auf die Farbe des Knotens Nr. "+g.getNummer(k.getZiel())+" und markiere die Kante"); + } else + if(f2 == 0) { + info("Der Knoten Nr. "+g.getNummer(k.getZiel())+" gehört noch zu keinem Teilgraphen"); + k.getZiel().setFarbe(f1); + k.setMarkiert(true); + info("=> setze ihn auf die Farbe des Knotens Nr. "+g.getNummer(k.getStart())+" und markiere die Kante"); + } else + if(f1 == f2) { + info("Beide Knoten gehören zum gleichen Teilgraphen"); + k.setGeloescht(true); + info("lösche die Kante"); + } else + { + info("Beide Knoten gehören zu unterschiedlichen Teilgraphen"); + int min = Math.min(f1,f2); + int max = Math.max(f1,f2); + for(Knoten k1 : knoten) { + if(k1.getFarbe() == max) k1.setFarbe(min); + } + info("=> färbe alle Knoten mit Farbe "+max+" mit der Farbe "+min); + k.setMarkiert(true); + info(" und markiere die Kante"); + } + infoIndentLess(); + step(); + } + } // end of for + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_MST_Prim.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_MST_Prim.java new file mode 100644 index 0000000..df91cac --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_MST_Prim.java @@ -0,0 +1,85 @@ +package algorithmen; + +import java.util.List; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; + +/** + * + * Dieser Algorithmus sucht einen minimal Spanning Tree + * Algorithmus: Prim + * + * @version 1.0 from 11.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_MST_Prim extends GraphAlgo { + + // Anfang Attribute + + // Ende Attribute + public String getBezeichnung() { + return "MST (Prim)"; + } + + public void fuehreAlgorithmusAus() { + int markiert = 0; + List knoten; + List kanten; + knoten = g.getAlleKnoten(); + kanten = g.getAlleKanten(); + + if(knoten.size()==0) return; + + Collections.sort(kanten); + info("Sortiere die Kanten nach ihrem Gewicht:"); + infoIndentMore(); + for(Kante ka2 : kanten) { + info("Kante ("+g.getNummer(ka2.getStart())+"-"+g.getNummer(ka2.getZiel())+") mit Gewicht "+ka2.getGewicht()); + } + infoIndentLess(); + if(getStartKnoten()!= null) { + getStartKnoten().setMarkiert(true); + info("Setze Startknoten auf markiert"); + } else { + + knoten.get(0).setMarkiert(true); + info("Setze einen beliebigen Knoten auf markiert"); + } + markiert++; + step(); + + while(knoten.size() > markiert) { + info("Suche Kante mit dem geringsten Gewicht von markiertem Teilbaum zu unmarkiertem Teilbaum"); + infoIndentMore(); + Kante ka=null; + for(Kante ka2 : kanten) { + if(ka2.getStart().isMarkiert() != ka2.getZiel().isMarkiert()) { + ka = ka2; + break; + } + if(ka2.getStart().isMarkiert() && ka2.getZiel().isMarkiert()) { + info("Kante ("+g.getNummer(ka2.getStart())+"-"+g.getNummer(ka2.getZiel())+") mit Gewicht "+ka2.getGewicht()+": Beide Knoten schon markiert."); + } else { + info("Kante ("+g.getNummer(ka2.getStart())+"-"+g.getNummer(ka2.getZiel())+") mit Gewicht "+ka2.getGewicht()+": Beide Knoten noch nicht markiert."); + } + + } + infoIndentLess(); + if(ka != null) { + ka.setMarkiert(true); + kanten.remove(ka); + info("Kante ("+g.getNummer(ka.getStart())+"-"+g.getNummer(ka.getZiel())+") mit Gewicht "+ka.getGewicht()+" gefunden. Markiere sie."); + ka.getStart().setMarkiert(true); + ka.getZiel().setMarkiert(true); + markiert++; + info("Markiere die angrenzenden Knoten."); + } + step(); + } + + } + +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Moore.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Moore.java new file mode 100644 index 0000000..cad7715 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Moore.java @@ -0,0 +1,69 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus findet die kürzesten Pfade in einem ungewichteten Graphen. + * Algorithmus: Algorithmus A von Moore + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_Moore extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Kürzester Pfad (Moore)"; + } + +// Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + + info("Erzeuge leere toDo-Liste und füge Startknoten hinzu"); + List toDo = new ArrayList(); + getStartKnoten().setBesucht(true); + getStartKnoten().setWert(0); + toDo.add(getStartKnoten()); + + while(toDo.size()>0) { + info("Nimm ersten Knoten aus der toDo-Liste (momentan "+toDo.size()+" Elemente) heraus"); + Knoten k = toDo.remove(0); + infoIndentMore(); + k.setMarkiert(true); + info("Markiere den Knoten"); + info("Er hat Entfernung "+k.getIntWert()); + info("Für jeden Nachbarknoten"); + infoIndentMore(); + for(Knoten n : g.getNachbarknoten(k)) { + if(!n.isBesucht()){ + n.setWert(k.getIntWert()+1); + toDo.add(n); + info("- ist noch nicht markiert, setze Entfernung "+(k.getIntWert()+1)+" und füge der ToDo-Liste am Ende hinzu."); + g.getKante(k,n).setMarkiert(true); + n.setBesucht(true); + info(" toDo-Liste hat jetzt "+toDo.size()+" Elemente"); + } else { + info("- ist schon markiert"); + } + } + infoIndentLess(); + infoIndentLess(); + step(); + } + info("ToDo-Liste fertig abgearbeitet"); + + } // end + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPBacktracking.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPBacktracking.java new file mode 100644 index 0000000..c484856 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPBacktracking.java @@ -0,0 +1,112 @@ +package algorithmen; + +import java.util.List; +import java.nio.file.*; + +import graph.*; + +/** + * + * Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + * Salesman Problem). + * Algorithmus: Backtracking + * + * @version 1.0 from 11.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_TSPBacktracking extends GraphAlgo { + + private List besteLoesung = null; + private double besteStrecke = Double.MAX_VALUE; + private Knoten start; + + // Anfang Attribute + + + public String getBezeichnung() { + return "TSP (Vollständig)"; + } + + + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + start = this.getStartKnoten(); + probiere(start); + g.setStatus(besteLoesung); + step(); + melde("beste Route gefunden:" +getInfo()); + } // end of for + + public void probiere(Knoten akt) { + boolean fertig = true; + infoIndentMore(); + akt.setMarkiert(true); + info("Markiere Knoten Nr."+g.getNummer(akt)); + step(); + + List nochNichtBesucht = g.getAlleKnoten(kn->!kn.isMarkiert()); + if(nochNichtBesucht.isEmpty()) { + info("Keine weiteren nicht besuchten Knoten übrig"); + g.getKante(akt,start).setMarkiert(true); + info("Markiere Kante zum Startpunkt"); + List gewaehlteKanten = g.getAlleKanten(ka->ka.isMarkiert()); + double laenge = 0; + for(Kante k:gewaehlteKanten) { + laenge+=k.getGewicht(); + } + info("Summiere alle Streckenlängen: Gesamtlänge ist "+laenge); + if(laenge < besteStrecke) { + info("Neue beste Strecke => merke diese Strecke"); + besteStrecke = laenge; + besteLoesung = g.getStatus();; + } + step(); + infoIndentLess(); + g.getKante(akt,start).setMarkiert(false); + akt.setMarkiert(false); + info("Kehre zum vorherigen Knoten zurück"); + step(); + return; + } + + info("untersuche alle ausgehenden Kanten:"); + List kanten = g.getAusgehendeKanten(akt); + for(Kante k: kanten) { + if(!k.getAnderesEnde(akt).isMarkiert()) { + k.setMarkiert(true); + info("Kante zu Knoten Nr. "+g.getNummer(k.getAnderesEnde(akt))+"=> nicht markiert, probiere diesen Weg"); + probiere(k.getAnderesEnde(akt)); + k.setMarkiert(false); + } else { + info("Kante zu Knoten Nr. "+g.getNummer(k.getAnderesEnde(akt))+"=> schon markiert, kein sinnvoller Weg"); + } + } + + akt.setMarkiert(false); + info("kehre zu vorherigem Knoten zurück"); + infoIndentLess(); + step(); + } + + public String getInfo() { + List kanten = g.getAlleKanten(); + double laenge = 0; + int anz =0; + for(Kante k:kanten) { + if(k.isMarkiert()) { + laenge+=k.getGewicht(); + anz++; + } + } + + return "Weglänge ("+anz+" von "+g.getAnzahlKnoten()+" Kanten): "+laenge+" km. Bisher beste Gesamtlösung "+this.besteStrecke+" km"; +} + + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGenetisch.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGenetisch.java new file mode 100644 index 0000000..527a2ef --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGenetisch.java @@ -0,0 +1,182 @@ +package algorithmen; + +import java.util.List; +import java.nio.file.*; +import java.util.Random; +import java.util.Arrays; + +import graph.*; + +/** + * + * description + * + * @version 1.0 from 26.04.2019 + * @author + */ + +public class GraphAlgo_TSPGenetisch extends GraphAlgo { + + private int popGroesse=500; + private int fitGroesse=80; + private int[][] population; + private int[][] fittest; + private int generation; + + // Anfang Attribute + + public String getBezeichnung() { + return "TSP (Genetisch)"; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + population = new int[popGroesse][g.getAnzahlKnoten()+1]; + double[] rundreiseLaenge = new double[popGroesse]; + for(int i=0; i kanten = g.getAlleKanten(); + double laenge = 0; + int anz =0; + for(Kante k:kanten) { + if(k.isMarkiert()) { + laenge+=k.getGewicht(); + anz++; + } + } + + //return ""+generation+";"+laenge; + return "Bisher beste Weglänge (Generation "+generation+"): "+laenge+" km."; + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedy.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedy.java new file mode 100644 index 0000000..d3cf87a --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedy.java @@ -0,0 +1,81 @@ +package algorithmen; + +import java.util.List; +import java.nio.file.*; +import java.util.Collections; + +import graph.*; + +/** + * + * Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + * Salesman Problem). + * Algorithmus: Greedy + * Strategie: Verlängere den Weg immer mit der kürzesten Kante, die vom aktuellen Ende der Route ausgeht. + * vlg. Minimal Spanning Tree (Prim) + * + * @version 1.0 from 11.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_TSPGreedy extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "TSP (Greedy: Knoten)"; + } + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + Knoten start = this.getStartKnoten(); + Knoten akt = start; + Kante min; + int anz = 0; + int laenge = 0; + info("Starte mit Knoten Nr. "+g.getNummer(start)); + do{ + akt.setMarkiert(true); + info("Markiere diesen Knoten"); + final Knoten aktK = akt; + min = null; + List kanten = g.getAusgehendeKanten(akt, ka -> !ka.getAnderesEnde(aktK).isMarkiert()); + info("Betrachte alle ausgehenden Kanten zu unmarkierten Knoten.\n und sortiere diese Kanten nach Gewicht."); + if(kanten.size() > 0) { + Collections.sort(kanten); + min = kanten.get(0); + info("Kürzeste Kante geht zu Knoten "+g.getNummer(min.getAnderesEnde(akt))); + laenge += min.getGewicht(); + anz++; + min.setMarkiert(true); + info("Markiere diese Kante (Länge "+laenge+" nach "+anz+" von "+g.getAlleKnoten().size()+" Knoten)"); + akt = min.getAnderesEnde(akt); + info("mache mit diesem Knoten weiter"); + } + step(); + }while (min!=null); + g.getKante(akt,start).setMarkiert(true); + info("Markiere die Kante vom letzten Knoten zum Startknoten"); + step(); + melde("Route gefunden: "+getInfo()); + } // end of for + + public String getInfo() { + List kanten = g.getAlleKanten(); + double laenge = 0; + int anz =0; + for(Kante k:kanten) { + if(k.isMarkiert()) { + laenge+=k.getGewicht(); + anz++; + } + } + + return "Weglänge ("+anz+" von "+g.getAnzahlKnoten()+" Kanten): "+laenge+" km."; + } + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedy2.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedy2.java new file mode 100644 index 0000000..78a47d1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedy2.java @@ -0,0 +1,172 @@ +package algorithmen; + +import java.util.List; +import java.nio.file.*; +import java.util.Comparator; +import java.util.Collections; + +import graph.*; + +/** + * + * Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + * Salesman Problem). + * Algorithmus: Greedy + * Strategie: Sortiere Kanten der Länge nach. Füge sie der Reihe nach der Route hinzu, wenn nicht schon ein + * Weg zwischen den beiden Knoten vorhanden ist und die Knoten nicht schon Grad zwei erreicht haben. + * vgl. Minimal Spanning Tree (Kruskal) + * + * @version 1.0 from 11.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_TSPGreedy2 extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "TSP (Greedy: kürzeste Kante)"; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + int farbe = 1; + int anzkanten = 0; + List kanten = g.getAlleKanten(); + List knoten = g.getAlleKnoten(); + info("Hole eine Liste aller Kanten und eine aller Knoten"); + Collections.sort(kanten); + info("Sortiere Kanten aufsteigend"); + info("Wiederhole für jede Kante"); + for (Kante k: kanten) { + info("Bearbeite Kante mit Gewicht: "+k.getGewicht()); + infoIndentMore(); + int f1 = k.getStart().getFarbe(); + int f2 = k.getZiel().getFarbe(); + if(f1 == 0 && f2 == 0) { + info("Beide Knoten gehören noch zu keinem Teilgraphen"); + k.getStart().setFarbe(farbe); + k.getZiel().setFarbe(farbe); + k.setMarkiert(true); + anzkanten++; + info("=> setze beide auf Farbe "+farbe+" und markiere die Kante"); + farbe++; + } else + if(f1 == 0 && g.getAusgehendeKanten(k.getZiel(), k2->k2.isMarkiert()).size()==1) { + info("Der Knoten Nr. "+g.getNummer(k.getStart())+" gehört noch zu keinem Teilgraphen und verlängert eine Route"); + k.getStart().setFarbe(f2); + k.setMarkiert(true); + anzkanten++; + info("=> setze ihn auf die Farbe des Knotens Nr. "+g.getNummer(k.getZiel())+" und markiere die Kante"); + } else + if(f2 == 0 && g.getAusgehendeKanten(k.getStart(), k2->k2.isMarkiert()).size()==1) { + info("Der Knoten Nr. "+g.getNummer(k.getZiel())+" gehört noch zu keinem Teilgraphen und verlängert eine Route"); + k.getZiel().setFarbe(f1); + k.setMarkiert(true); + anzkanten++; + info("=> setze ihn auf die Farbe des Knotens Nr. "+g.getNummer(k.getStart())+" und markiere die Kante"); + } else + if(f1 == f2) { + if(anzkanten == g.getAnzahlKnoten()-1 && istRoutenende(k.getZiel()) && istRoutenende(k.getStart())){ + k.setMarkiert(true); + info("=> markiere die Kante und schließe damit die Rundreise"); + infoIndentLess(); + step(); + break; + } else { + info("Beide Knoten gehören zum gleichen Teilgraphen"); + } + } else + if(istRoutenende(k.getZiel()) && istRoutenende(k.getStart())){ + info("Beide Knoten gehören zu unterschiedlichen Teilgraphen, die vereinigt werden können."); + int min = Math.min(f1,f2); + int max = Math.max(f1,f2); + for(Knoten k1 : knoten) { + if(k1.getFarbe() == max) k1.setFarbe(min); + } + info("=> färbe alle Knoten mit Farbe "+max+" mit der Farbe "+min); + k.setMarkiert(true); + anzkanten++; + info(" und markiere die Kante"); + } + infoIndentLess(); + step(); + } + melde("Rundreise gefunden:"+ getInfo()); + } + + private boolean istRoutenende(Knoten k) { + return g.getAusgehendeKanten(k, k2->k2.isMarkiert()).size()==1; + } + // Knoten start = this.getStartKnoten(); + + // List kanten = g.getAlleKanten(); + // kanten.sort(Comparator.comparingDouble(Kante::getGewicht)); + + // for(Kante k: kanten) { + // for (Knoten v: g.getAlleKnoten()) v.setBesucht(false); + // if(!findeWeg(k.getStart(), k.getZiel()) && bestimmeGrad(k.getStart())!=2 && bestimmeGrad(k.getZiel())!=2) { + // k.setMarkiert(true); + // } else { + // k.setMarkiert(true); + // boolean alleZwei=true; + // for(Knoten v: g.getAlleKnoten()) { + // if(bestimmeGrad(v) != 2) { + // alleZwei = false; + // } + // } + // if(alleZwei) { + // break; + // } + // k.setMarkiert(false); + // } + // step(); + // } // end of for + // step(); + // melde("Rundreise gefunden:"+ getInfo()); + // } + + private int bestimmeGrad(Knoten k) { + List kantenV = g.getAusgehendeKanten(k, k2->k2.isMarkiert()); + return kantenV.size(); + } + + // /** + // * Hilfsmethode zum kurzsichtigen Algorithmus. + // * Findet die minimale Kante von einem gegebenen StartKnoten. + // * + // * @param Knoten startKnoten Der StartKnoten, von dem aus die Adjazenzliste durchlaufen wird + // * @return Kante Die gesuchte minimale Kante + // */ + // public boolean findeWeg(Knoten s, Knoten z) { + // if(s==z) return true; + + // boolean gefunden = false; + // s.setBesucht(true); + // List kanten = g.getAusgehendeKanten(s); + // for (Kante k: kanten) { + // if(k.isMarkiert()) { // Nur markierte Kanten zaehlen als Weg + // if(!k.getAnderesEnde(s).isBesucht()) { + // if(findeWeg(k.getAnderesEnde(s), z)) return true; + // } + // } + // } // end of for + // return false; + // } + + public String getInfo() { + List kanten = g.getAlleKanten(); + double laenge = 0; + int anz =0; + for(Kante k:kanten) { + if(k.isMarkiert()) { + laenge+=k.getGewicht(); + anz++; + } + } + + return "Weglänge ("+anz+" von "+g.getAnzahlKnoten()+" Kanten): "+laenge+" km."; + } + + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedyOpt.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedyOpt.java new file mode 100644 index 0000000..c56e7fb --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TSPGreedyOpt.java @@ -0,0 +1,112 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.nio.file.*; + +import graph.*; + +/** + * + * Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + * Salesman Problem). + * Algorithmus: Greedy mit anschließender Optimierung: + * Jeder Knoten wird der Reihe nach aus der Rundreise entfernt und dort wieder eingefügt, wo die Rundreise + * sich am wenigsten verlängert. Diese Optimierung wird 5x wiederholt. + * + * @version 1.0 from 11.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_TSPGreedyOpt extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "TSP (Greedy: Knoten + Optimierung)"; + } + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + Knoten start = this.getStartKnoten(); + Knoten akt = start; + List reihung = new ArrayList(); + reihung.add(start); + Kante min; + do{ + List kanten = g.getAusgehendeKanten(akt); + min = null; + double mindist = Double.MAX_VALUE; + for(Kante k: kanten) { + if(!k.getAnderesEnde(akt).isMarkiert()) { + if(min == null || mindist > k.getGewicht()) { + min = k; + mindist = k.getGewicht(); + } + } + } + akt.setMarkiert(true); + if(min != null) { + min.setMarkiert(true); + akt = min.getAnderesEnde(akt); + reihung.add(akt); + } + step(); + }while (min!=null); + g.getKante(akt,start).setMarkiert(true); + step(); + // Versuch der Optimierung + for(int o=0; o<5 ; o++) + for(Knoten kn : g.getAlleKnoten()) { + List markierteKanten = g.getAusgehendeKanten(kn, ka->ka.isMarkiert()); + for(Kante k: markierteKanten){ + k.setMarkiert(false); + } + g.getKante(markierteKanten.get(0).getAnderesEnde(kn),markierteKanten.get(1).getAnderesEnde(kn)).setMarkiert(true); + double laengeBest = Double.MAX_VALUE; + Kante kanteBest = null; + for(Kante k2: g.getAlleKanten()) { + if(k2.isMarkiert()) { + double laengeNeu = g.getKante(k2.getStart(),kn).getGewicht()+g.getKante(k2.getZiel(),kn).getGewicht()-k2.getGewicht() ; + if(laengeBest > laengeNeu) { + laengeBest = laengeNeu; + kanteBest = k2; + } + } + } + kanteBest.setMarkiert(false); + g.getKante(kanteBest.getStart(),kn).setMarkiert(true); + g.getKante(kanteBest.getZiel(),kn).setMarkiert(true); + step(); + } + step(); + melde("Rundreise gefunden:"+ getInfo()); + + } // end of for + + public double getLaenge() { + List kanten = g.getAlleKanten(); + double laenge = 0; + for(Kante k:kanten) { + if(k.isMarkiert()) laenge+=k.getGewicht(); + } + return laenge; + } + + public String getInfo() { + List kanten = g.getAlleKanten(); + double laenge = 0; + int anz =0; + for(Kante k:kanten) { + if(k.isMarkiert()) { + laenge+=k.getGewicht(); + anz++; + } + } + + return "Weglänge ("+anz+" von "+g.getAnzahlKnoten()+" Kanten): "+laenge+" km."; + } + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Tiefensuche.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Tiefensuche.java new file mode 100644 index 0000000..7d20241 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_Tiefensuche.java @@ -0,0 +1,73 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus nummeriert alle Knoten des Graphen. + * Algorithmus: Tiefensuche mit ToDo-Liste (Stapel) + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_Tiefensuche extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Nummerierung (Tiefensuche)"; + } + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + int nr = 0; + info("Erzeuge leere toDo-Liste und füge Startknoten hinzu"); + List toDo = new ArrayList(); + toDo.add(getStartKnoten()); + + while(toDo.size()>0) { + info("Nimm ersten Knoten aus der toDo-Liste (momentan "+toDo.size()+" Elemente) heraus"); + Knoten k = toDo.remove(0); + nr++; + infoIndentMore(); + k.setBesucht(false); + k.setMarkiert(true); + k.setWert(nr); + info("Markiere den Knoten und gib ihm die Nummer "+nr); + info("Für jeden Nachbarknoten"); + infoIndentMore(); + for(Knoten n : g.getNachbarknoten(k)) { + if(!n.isMarkiert()){ + if( !toDo.contains(n)) { + toDo.add(0, n); + g.getKante(k,n).setMarkiert(true); + n.setBesucht(true); + info("- ist noch nicht markiert, füge der ToDo-Liste am Anfang hinzu.\n"+ + " toDo-Liste hat jetzt "+toDo.size()+" Elemente"); + } else { + info("- ist schon in ToDo-Liste"); + } + } else { + info("- ist schon markiert"); + } + } + infoIndentLess(); + infoIndentLess(); + step(); + } + info("ToDo-Liste fertig abgearbeitet"); + + } // end + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TiefensucheRek.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TiefensucheRek.java new file mode 100644 index 0000000..8616a61 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_TiefensucheRek.java @@ -0,0 +1,60 @@ +package algorithmen; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus nummeriert alle Knoten des Graphen. + * Algorithmus: Tiefensuche rekursiv + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_TiefensucheRek extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Nummerierung (Tiefensuche rekursiv)"; + } + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + if (g.getAnzahlKnoten()==0) { + return; + } + nummeriere(getStartKnoten(), 0); + } // end + + private int nummeriere(Knoten k, int nr) { + // Abbruchbedingung + if(k.isBesucht()) { + info("Untersuche "+g.getKnoteninfo(k,false)+" => ist schon besucht"); + } else { + nr++; + k.setBesucht(true); + k.setWert(nr); + info("Untersuche "+g.getKnoteninfo(k,false)+" => bekommt Nummer: "+nr); + step(); + info("Untersuche Nachbarn von "+g.getKnoteninfo(k,false)); + infoIndentMore(); + List nachbarn = g.getNachbarknoten(k); + for(Knoten n : nachbarn) { + nr = nummeriere(n,nr); + } + info("Keine weiteren Nachbarn von "+g.getKnoteninfo(k,false)); + infoIndentLess(); + step(); + } + return nr; + + } + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ZyklusBacktracking.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ZyklusBacktracking.java new file mode 100644 index 0000000..596da2f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_ZyklusBacktracking.java @@ -0,0 +1,80 @@ +package algorithmen; + +import java.util.List; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus ist ein Beispiel für einen Backtracking-Algorithmus. + * Er sucht einen Zyklus im Graphen. + * Algorithmus: Backtracking + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_ZyklusBacktracking extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Zyklensuche (Backtracking)"; + } + + public void fuehreAlgorithmusAus() { + List loesung = backtracking(getStartKnoten()); + if(loesung != null) g.setStatus(loesung); + step(); + } + + public List backtracking(Knoten k){ + + List loesung = null; + + info("Untersuche Knoten "+g.getNummer(k)); + + // Abbruchbedingung + if (k.isMarkiert()) { + // Ausführung unterbrechen + info("Knoten ist schon bearbeitet => Zyklus gefunden"); + step(); + loesung = g.getStatus(); + } else { + + List aktuellerZustand = g.getStatus(); + info("Knoten ist noch nicht bearbeitet => Speichere Zustand des Graphen"); + + // Aktion mit Knoten durchführen, z.B. markieren + k.setMarkiert(true); + info("Markiere den Knoten und betrachte alle nicht markierten, ausgehenden Kanten"); + // Ausführung unterbrechen + step(); + + // Probiere alle Möglichkeiten ( + // hier alle nicht markierten, ausgehenden Kanten + List ausgehend = g.getAusgehendeKanten(k, ka->!ka.isMarkiert()); + infoIndentMore(); + int nr=1; + for(Kante ausgehendeKante : ausgehend) { + k.setMarkiert(true); + ausgehendeKante.setMarkiert(true); + info("Probiere Kante "+nr); + infoIndentMore(); + Knoten nachbar = ausgehendeKante.getAnderesEnde(k); + loesung = backtracking(nachbar); + infoIndentLess(); + g.setStatus(aktuellerZustand); + info("Kehre zurück"); + step(); + if(loesung != null) break; + nr++; + } + infoIndentLess(); + } + return loesung; + } + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_toplogischeSortierung.java b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_toplogischeSortierung.java new file mode 100644 index 0000000..ed02226 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/GraphAlgo_toplogischeSortierung.java @@ -0,0 +1,73 @@ +package algorithmen; + +import java.util.List; +import java.util.Collections; +import java.nio.file.*; + +import graph.*; +/** + * Dieser Algorithmus findet eine topologische Sortierung des Graphen. + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_toplogischeSortierung extends GraphAlgo { + + // Anfang Attribute + + public String getBezeichnung() { + return "Topologische Sortierung"; + } + + + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + String reihenfolge = ""; + if (g.getAnzahlKnoten()==0) { + return; + } + info("Bestimme die Anzahl der eingehenden Kanten für jeden Knoten"); + infoIndentMore(); + List knoten = g.getAlleKnoten(); + for(Knoten k: knoten) { + k.setWert(g.getEingehendeKanten(k).size()); + info("Setze Wert von von "+g.getKnoteninfo(k, false)+" auf "+g.getEingehendeKanten(k).size()); + } + infoIndentLess(); + step(); + + while(knoten.size()>0) { + Collections.sort(knoten); + info("Sortiere die noch nicht markierten Knoten nach ihrem Wert"); + Knoten k = knoten.get(0); + k.setMarkiert(true); + info("Nimm Knoten mit dem geringsten Wert: "+g.getKnoteninfo(k,false)+" und markiere ihn."); + + if(k.getIntWert() != 0) { + melde("Fehler: Wert ist nicht 0 - Zyklus vorhanden - Keine topologische Sortierung möglich"); + knoten.clear(); + return; + } else { + reihenfolge += " "+g.getKnoteninfo(k, false); + info("Füge ihn der Liste hinzu: "+reihenfolge); + knoten.remove(k); + info("Reduziere den Wert aller Nachbarn von "+g.getKnoteninfo(k,false)+" um 1"); + infoIndentMore(); + for(Knoten k2 : g.getNachbarknoten(k)) { + k2.setWert(k2.getIntWert()-1); + info("Setze "+g.getKnoteninfo(k2, false)+" auf "+k2.getIntWert()); + } + infoIndentLess(); + } + step(); + } + melde("Topologische Sortierung: "+reihenfolge); + + } // end + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/algorithmen/package.bluej b/Quellcodes/alg_ds_graphentester/algorithmen/package.bluej new file mode 100644 index 0000000..7ed1910 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/algorithmen/package.bluej @@ -0,0 +1,268 @@ +#BlueJ package file +dependency1.from=GraphAlgo_DominatingSetGreedyF +dependency1.to=GraphAlgo +dependency1.type=UsesDependency +dependency2.from=GraphAlgo_DominatingSetGreedyF +dependency2.to=GraphAlgo_Moore +dependency2.type=UsesDependency +dependency3.from=GraphAlgo_DominatingSetGreedyG +dependency3.to=GraphAlgo +dependency3.type=UsesDependency +dependency4.from=GraphAlgo_DominatingSetGreedyG +dependency4.to=GraphAlgo_Moore +dependency4.type=UsesDependency +dependency5.from=GraphAlgo_DominatingSetGreedyE +dependency5.to=GraphAlgo +dependency5.type=UsesDependency +dependency6.from=GraphAlgo_DominatingSetGreedyE +dependency6.to=GraphAlgo_Moore +dependency6.type=UsesDependency +dependency7.from=GraphAlgo_DominatingSetGreedyH +dependency7.to=GraphAlgo +dependency7.type=UsesDependency +dependency8.from=GraphAlgo_DominatingSetGreedyH +dependency8.to=GraphAlgo_Moore +dependency8.type=UsesDependency +objectbench.height=66 +objectbench.width=1428 +package.divider.horizontal=0.6003172085646312 +package.divider.vertical=0.9027962716378163 +package.editor.height=671 +package.editor.width=1292 +package.editor.x=100 +package.editor.y=118 +package.frame.height=852 +package.frame.width=1452 +package.numDependencies=8 +package.numTargets=32 +package.showExtends=true +package.showUses=true +readme.height=60 +readme.name=@README +readme.width=49 +readme.x=10 +readme.y=10 +target1.height=50 +target1.name=GraphAlgo_ColoringGreedyRandom +target1.showInterface=false +target1.type=ClassTarget +target1.width=290 +target1.x=740 +target1.y=590 +target10.height=50 +target10.name=GraphAlgo_DominatingSetGreedyF +target10.showInterface=false +target10.type=ClassTarget +target10.width=280 +target10.x=430 +target10.y=420 +target11.height=50 +target11.name=GraphAlgo_DominatingSetGreedyG +target11.showInterface=false +target11.type=ClassTarget +target11.width=290 +target11.x=430 +target11.y=470 +target12.height=50 +target12.name=GraphAlgo_TSPGreedy +target12.showInterface=false +target12.type=ClassTarget +target12.width=230 +target12.x=740 +target12.y=160 +target13.height=50 +target13.name=GraphAlgo_DominatingSetGreedyD +target13.showInterface=false +target13.type=ClassTarget +target13.width=290 +target13.x=430 +target13.y=320 +target14.height=50 +target14.name=GraphAlgo_TSPGenetisch +target14.showInterface=false +target14.type=ClassTarget +target14.width=230 +target14.x=740 +target14.y=340 +target15.height=50 +target15.name=GraphAlgo_DominatingSetGreedyE +target15.showInterface=false +target15.type=ClassTarget +target15.width=280 +target15.x=430 +target15.y=370 +target16.height=50 +target16.name=GraphAlgo_DominatingSetGenetisch +target16.showInterface=false +target16.type=ClassTarget +target16.width=300 +target16.x=430 +target16.y=640 +target17.height=50 +target17.name=GraphAlgo_ZyklusBacktracking +target17.showInterface=false +target17.type=ClassTarget +target17.width=230 +target17.x=160 +target17.y=410 +target18.height=50 +target18.name=GraphAlgo_DominatingSetGreedyH +target18.showInterface=false +target18.type=ClassTarget +target18.width=290 +target18.x=430 +target18.y=520 +target19.height=50 +target19.name=GraphAlgo_DominatingSetGreedyI +target19.showInterface=false +target19.type=ClassTarget +target19.width=280 +target19.x=430 +target19.y=570 +target2.height=50 +target2.name=GraphAlgo_Tiefensuche +target2.showInterface=false +target2.type=ClassTarget +target2.width=210 +target2.x=160 +target2.y=160 +target20.height=50 +target20.name=GraphAlgo_Moore +target20.showInterface=false +target20.type=ClassTarget +target20.width=210 +target20.x=150 +target20.y=480 +target21.height=50 +target21.name=GraphAlgo_BellmanFord +target21.showInterface=false +target21.type=ClassTarget +target21.width=210 +target21.x=150 +target21.y=660 +target22.height=50 +target22.name=GraphAlgo_Breitensuche +target22.showInterface=false +target22.type=ClassTarget +target22.width=210 +target22.x=160 +target22.y=280 +target23.height=50 +target23.name=GraphAlgo_toplogischeSortierung +target23.showInterface=false +target23.type=ClassTarget +target23.width=250 +target23.x=160 +target23.y=350 +target24.height=50 +target24.name=GraphAlgo_DominatingSetBacktracking +target24.showInterface=false +target24.type=ClassTarget +target24.width=320 +target24.x=430 +target24.y=100 +target25.height=50 +target25.name=GraphAlgo_ColoringGreedy +target25.showInterface=false +target25.type=ClassTarget +target25.width=240 +target25.x=740 +target25.y=530 +target26.height=50 +target26.name=GraphAlgo_DijkstraMitVorgaenger +target26.showInterface=false +target26.type=ClassTarget +target26.width=250 +target26.x=150 +target26.y=600 +target27.height=50 +target27.name=GraphAlgo_EulerkreisExistenz +target27.showInterface=false +target27.type=ClassTarget +target27.width=220 +target27.x=160 +target27.y=100 +target28.height=50 +target28.name=GraphAlgo_TiefensucheRek +target28.showInterface=false +target28.type=ClassTarget +target28.width=210 +target28.x=160 +target28.y=220 +target29.height=50 +target29.name=GraphAlgo_TSPGreedy2 +target29.showInterface=false +target29.type=ClassTarget +target29.width=230 +target29.x=740 +target29.y=220 +target3.height=50 +target3.name=GraphAlgo_TSPBacktracking +target3.showInterface=false +target3.type=ClassTarget +target3.width=240 +target3.x=740 +target3.y=100 +target30.height=50 +target30.name=GraphAlgo_ColoringBacktracking +target30.showInterface=false +target30.type=ClassTarget +target30.width=270 +target30.x=740 +target30.y=470 +target31.height=50 +target31.name=GraphAlgo_Dijkstra +target31.showInterface=false +target31.type=ClassTarget +target31.width=210 +target31.x=150 +target31.y=540 +target32.height=50 +target32.name=GraphAlgo_TSPGreedyOpt +target32.showInterface=false +target32.type=ClassTarget +target32.width=230 +target32.x=740 +target32.y=280 +target4.height=50 +target4.name=GraphAlgo_MST_Prim +target4.showInterface=false +target4.type=ClassTarget +target4.width=230 +target4.x=1030 +target4.y=100 +target5.height=50 +target5.name=GraphAlgo_DominatingSetGreedyB +target5.showInterface=false +target5.type=ClassTarget +target5.width=290 +target5.x=430 +target5.y=220 +target6.height=50 +target6.name=GraphAlgo +target6.showInterface=false +target6.type=AbstractTarget +target6.width=100 +target6.x=450 +target6.y=10 +target7.height=50 +target7.name=GraphAlgo_DominatingSetGreedyC +target7.showInterface=false +target7.type=ClassTarget +target7.width=290 +target7.x=430 +target7.y=270 +target8.height=50 +target8.name=GraphAlgo_MST_Kruskal +target8.showInterface=false +target8.type=ClassTarget +target8.width=230 +target8.x=1030 +target8.y=160 +target9.height=50 +target9.name=GraphAlgo_DominatingSetGreedyA +target9.showInterface=false +target9.type=ClassTarget +target9.width=290 +target9.x=430 +target9.y=170 diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/01_4inseln.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/01_4inseln.csv new file mode 100644 index 0000000..d713e64 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/01_4inseln.csv @@ -0,0 +1,21 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,inseln4.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +188,244,3,2,1 +196,127,0,2 +331,164,0,1,3 +315,297,0,2 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/02_5inseln.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/02_5inseln.csv new file mode 100644 index 0000000..f95e8a6 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/02_5inseln.csv @@ -0,0 +1,22 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,inseln5.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +196,130,4,1 +319,168,0,3,4,2 +403,199,1,4 +312,284,1,4 +199,225,0,1,2,3 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/03_zusammenhang_beispiel1.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/03_zusammenhang_beispiel1.csv new file mode 100644 index 0000000..6e581b0 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/03_zusammenhang_beispiel1.csv @@ -0,0 +1,31 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Größe der Knoten +vertexSize,19 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +122,257,2,1 +284,196,0,3,10,11 +191,353,0,3,8 +332,293,1,2 +438,240,6,5,7 +448,402,4,6,7 +218,273,4,5,9 +198,431,4,5,9 +334,382,2,11 +107,365,6,7 +488,195,1,11 +488,326,1,8,10 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/04_zusammenhang_beispiel2.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/04_zusammenhang_beispiel2.csv new file mode 100644 index 0000000..92b9936 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/01_eulerkreis/04_zusammenhang_beispiel2.csv @@ -0,0 +1,31 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Größe der Knoten +vertexSize,19 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,0 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +122,257,2,1 +284,196,0,3,10,11,6 +191,353,0,3,8 +332,293,1,2 +438,240,5,7 +448,402,4,6,7 +218,273,1,5,9 +198,431,4,5,9 +334,382,2,11 +107,365,6,7 +488,195,1,11 +488,326,1,8,10 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/02_topologischesortierung/01_aufbausimulation1.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/02_topologischesortierung/01_aufbausimulation1.csv new file mode 100644 index 0000000..b52d928 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/02_topologischesortierung/01_aufbausimulation1.csv @@ -0,0 +1,26 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,siedlerohnefischer.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,1 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list,infotext +Farm,284,83,1,3 +Mühle,533,109,2 +Bäckerei,690,154,6,5 +Schweinefarm,124,239,4 +Metzger,171,404,5,6 +Kohlemine,425,441,7,8 +Erzmine,734,308,7 +Eisenschmelze,552,336,8 +Werkzeugmacher,401,258,0,4,5,7 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/02_topologischesortierung/02_aufbausimulation2.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/02_topologischesortierung/02_aufbausimulation2.csv new file mode 100644 index 0000000..347b375 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/02_topologischesortierung/02_aufbausimulation2.csv @@ -0,0 +1,27 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,siedler.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,1 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list,infotext +Farm,285,101,1,3 +Mühle,531,105,2 +Bäckerei,694,159 +Schweinefarm,119,239,4 +Metzger,167,409 +Kohlemine,423,445,7,8 +Erzmine,724,314,7 +Eisenschmelze,537,326,8 +Werkzeugmacher,389,246,0,4 +Fischerhütte,741,456,6,5 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/01_seerosenteich.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/01_seerosenteich.csv new file mode 100644 index 0000000..5a92178 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/01_seerosenteich.csv @@ -0,0 +1,20 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,00e090,FF0000,A0A0A0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,teich.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/02_deutschlandkarte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/02_deutschlandkarte.csv new file mode 100644 index 0000000..120821a --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/02_deutschlandkarte.csv @@ -0,0 +1,60 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Kantenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,AAAAAA,FF0000,A0A0A0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,60.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Augsburg,314,654,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,61.0,-,-,-,-,-,-,-,-,-,-,-,83.0,-,- +Bayreuth,358,502,-,-,-,-,-,-,-,187.0,-,-,-,-,-,-,-,-,-,-,-,-,-,198.0,-,-,-,-,-,-,74.0,-,-,159.0,-,-,-,-,-,-,-,147.0 +Berlin,457,250,-,-,-,-,-,125.0,-,-,-,-,91.0,-,-,-,-,-,-,-,-,-,-,184.0,-,131.0,-,-,-,130.0,-,-,-,-,-,-,200.0,-,-,-,-,- +Bremen,192,196,-,-,-,-,-,-,-,-,-,-,-,-,-,-,110.0,118.0,-,-,-,-,-,-,-,-,-,-,-,-,-,120.0,-,-,-,-,-,-,-,-,110.0,- +Cottbus,509,312,-,-,-,-,-,-,138.0,-,-,-,119.0,-,-,-,-,-,-,-,-,-,-,244.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Dresden,488,375,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,140.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Erfurt,313,400,-,-,-,-,-,-,-,-,-,-,-,-,180.0,-,-,-,-,135.0,-,-,-,170.0,-,209.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Essen,82,348,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,188.0,-,-,75.0,-,-,-,-,-,87.0,-,-,-,-,-,-,-,-,-,-,-,-,- +Frankfurt/Main,178,476,-,-,-,-,-,-,-,-,-,-,-,-,95.0,-,-,-,-,-,-,125.0,-,-,-,-,106.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Frankfurt/Oder,523,269,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Freiburg,124,683,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,130.0,-,-,-,-,-,175.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Fulda,234,438,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,105.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,100.0 +Garmisch-Part.,337,723,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,155.0,-,-,89.0,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Hamburg,261,153,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,154.0,-,-,85.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,120.0,-,-,-,-,- +Hannover,244,267,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,238.0,-,-,-,-,-,136.0,-,-,-,-,-,135.0,-,-,-,-,-,-,-,-,-,- +Karlsruhe,153,598,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,58.0,-,-,-,-,-,-,-,-,-,-,81.0,-,-,-,- +Kassel,222,374,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,243.0,-,-,247.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Kiel,270,83,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,139.0,-,-,-,-,- +Koblenz,114,462,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,110.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,128.0,-,-,- +Köln,77,390,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,217.0,-,-,- +Leipzig,403,362,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,108.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Lindau,203,712,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,216.0,-,126.0,-,- +Magdeburg,356,293,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Mannheim,173,544,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,117.0,-,-,-,-,-,162.0 +München,372,672,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,162.0,-,180.0,106.0,-,-,-,-,-,-,-,- +Münster,113,309,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,60.0,-,-,-,-,-,-,-,-,-,- +Neubrandenburg,433,156,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,103.0,-,187.0,-,-,-,-,- +Nürnberg,335,550,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,105.0,-,-,-,-,-,-,-,108.0 +Osnabrück,144,274,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Passau,472,625,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,128.0,-,-,-,-,-,-,-,- +Regensburg,405,584,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Rostock,381,111,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,90.0,-,-,-,-,- +Saarbrücken,67,561,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,103.0,-,-,- +Schwerin,343,143,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Stuttgart,205,614,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,100.0,-,157.0 +Trier,48,508,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Ulm,256,647,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Wilhelmshaven,148,159,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +Würzburg,269,512,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/03_badenbaden.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/03_badenbaden.csv new file mode 100644 index 0000000..e6b2643 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/03_badenbaden.csv @@ -0,0 +1,199 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,9 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,badenbaden.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +645,600,1,91.0,52,32.0 +655,690,0,91.0,2,62.0 +685,636,1,62.0,3,58.0,5,139.0 +686,578,2,58.0,4,122.0,52,54.0 +700,457,3,122.0,8,15.0,54,47.0 +782,536,2,139.0,6,59.0,16,154.0,17,139.0 +758,482,5,59.0,10,30.0 +768,407,8,74.0,10,46.0,50,92.0 +715,458,4,15.0,7,74.0,9,64.0 +779,463,8,64.0,11,13.0,15,88.0 +764,453,6,30.0,7,46.0,11,17.0 +781,450,9,13.0,10,17.0,12,98.0 +832,366,11,98.0,14,43.0,13,96.0 +860,274,12,96.0,51,48.0,64,123.0,96,53.0,97,100.0 +874,377,12,43.0,15,57.0 +861,432,9,88.0,14,57.0,16,27.0 +886,422,5,154.0,15,27.0,56,32.0 +914,491,5,139.0,19,128.0,57,24.0 +926,564,21,131.0,57,70.0,92,148.0 +817,575,17,128.0,20,33.0,22,212.0 +839,599,19,33.0,21,48.0 +822,644,18,131.0,20,48.0,99,112.0 +691,745,19,212.0,23,18.0,24,71.0 +703,758,22,18.0 +629,780,22,71.0,25,63.0,98,38.0 +598,725,24,63.0,26,37.0,27,32.0 +564,739,25,37.0,30,96.0 +589,694,25,32.0,28,77.0,29,68.0 +592,617,27,77.0,29,34.0,37,61.0 +562,632,27,68.0,28,34.0,30,33.0,32,67.0 +533,648,26,96.0,29,33.0,31,65.0,104,20.0 +518,585,30,65.0,32,10.0,105,20.0 +524,577,29,67.0,31,10.0,33,14.0 +519,564,32,14.0,34,29.0,45,32.0 +546,554,33,29.0,39,23.0,35,36.0 +534,520,34,36.0,38,22.0,44,19.0,41,26.0 +585,499,40,19.0,37,57.0,38,34.0 +590,556,28,61.0,36,57.0,39,21.0 +555,514,35,22.0,36,34.0,39,46.0 +569,558,34,23.0,37,21.0,38,46.0 +596,483,36,19.0,54,60.0,41,69.0,48,75.0 +528,495,35,26.0,40,69.0,43,25.0 +483,503,45,38.0,43,20.0,46,43.0 +503,499,41,25.0,42,20.0,44,33.0 +517,529,35,19.0,43,33.0,45,18.0 +501,537,33,32.0,42,38.0,44,18.0 +465,464,42,43.0,47,36.0,176,58.0 +480,431,46,36.0,55,58.0,109,59.0 +602,408,40,75.0,49,31.0,55,70.0 +608,378,48,31.0,50,116.0,93,66.0 +715,332,7,92.0,49,116.0,51,109.0,60,120.0 +820,301,13,48.0,50,109.0,58,72.0 +633,570,0,32.0,3,54.0,53,47.0 +639,523,52,47.0,54,62.0 +653,463,4,47.0,40,60.0,53,62.0 +538,437,47,58.0,48,70.0 +910,401,16,32.0,80,170.0,65,108.0 +938,495,17,24.0,18,70.0 +821,229,51,72.0,59,25.0 +841,214,58,25.0,60,62.0 +782,233,50,120.0,59,62.0,61,14.0 +770,225,60,14.0,62,41.0,111,68.0 +801,198,61,41.0,97,73.0,115,105.0 +911,139,73,80.0,97,55.0 +953,194,13,123.0,69,144.0,95,64.0,96,79.0 +911,293,56,108.0,66,148.0,96,32.0 +1043,227,65,148.0,79,43.0 +1323,213,78,179.0,68,127.0 +1199,185,67,127.0,69,103.0,94,74.0 +1096,175,64,144.0,68,103.0,79,59.0,70,82.0 +1051,106,69,82.0,76,48.0,71,64.0,95,69.0 +987,114,70,64.0,73,24.0,72,54.0,95,47.0 +950,154,71,54.0 +976,93,63,80.0,71,24.0,74,90.0 +1056,52,73,90.0,76,20.0,75,92.0 +1140,14,74,92.0 +1073,63,70,48.0,74,20.0,77,236.0 +1306,103,76,236.0 +1147,244,67,179.0,79,62.0 +1086,233,66,43.0,69,59.0,78,62.0,80,75.0 +1040,292,56,170.0,79,75.0,83,68.0,82,90.0 +1221,299,82,92.0 +1129,308,80,90.0,81,92.0,83,73.0 +1071,352,80,68.0,82,73.0,84,53.0,92,115.0 +1113,384,83,53.0,88,261.0,85,60.0 +1168,361,84,60.0,86,73.0 +1239,377,85,73.0,87,142.0 +1376,340,86,142.0 +1029,631,84,261.0,89,150.0 +908,720,88,150.0,90,24.0 +887,709,89,24.0,91,108.0 +799,771,90,108.0,106,73.0 +1031,460,18,148.0,83,115.0 +561,331,49,66.0,110,101.0,112,38.0,125,39.0 +1272,171,68,74.0 +1005,157,64,64.0,70,69.0,71,47.0 +911,261,13,53.0,64,79.0,65,32.0 +870,175,13,100.0,62,73.0,63,55.0 +654,808,24,38.0,99,125.0,100,62.0 +754,733,21,112.0,98,125.0 +592,811,98,62.0,101,68.0 +524,809,100,68.0,102,83.0,104,154.0 +441,807,101,83.0,103,165.0,144,70.0 +493,650,102,165.0,105,62.0,104,22.0 +514,655,30,20.0,101,154.0,103,22.0 +498,588,31,20.0,103,62.0 +840,831,91,73.0,107,170.0 +1008,804,106,170.0,108,142.0 +1108,703,107,142.0 +459,376,47,59.0,125,74.0,122,42.0,139,51.0,176,54.0 +644,274,93,101.0,111,67.0,114,41.0 +707,251,61,68.0,110,67.0,115,31.0 +543,298,93,38.0,113,44.0,124,35.0 +579,272,112,44.0,116,23.0,114,72.0 +640,233,110,41.0,113,72.0,116,71.0,115,60.0 +699,221,62,105.0,111,31.0,114,60.0 +571,250,113,23.0,114,71.0,117,60.0 +516,274,116,60.0,123,48.0,118,42.0 +489,242,117,42.0,119,43.0,135,53.0 +446,246,118,43.0,120,72.0,136,81.0 +419,179,119,72.0,126,21.0,133,61.0 +523,106,133,67.0 +463,334,109,42.0,123,32.0,134,35.0 +483,309,117,48.0,122,32.0,124,30.0,135,36.0 +512,315,112,35.0,123,30.0,125,24.0 +522,337,93,39.0,109,74.0,124,24.0 +433,194,120,21.0,129,39.0,128,39.0,127,43.0 +470,215,126,43.0 +472,190,126,39.0,129,20.0,131,30.0 +465,171,126,39.0,128,20.0,130,25.0,132,25.0 +475,148,129,25.0,132,19.0,133,15.0 +499,177,128,30.0,132,19.0 +488,162,129,25.0,130,19.0,131,19.0 +464,138,120,61.0,121,67.0,130,15.0 +431,320,122,35.0,139,30.0,135,44.0,137,60.0 +457,284,118,53.0,123,36.0,134,44.0 +369,221,119,81.0,142,56.0,140,58.0,137,62.0 +385,281,134,60.0,136,62.0,138,32.0 +359,299,137,32.0,140,82.0,139,75.0,178,25.0 +417,347,109,51.0,134,30.0,138,75.0,177,64.0 +312,232,136,58.0,138,82.0,141,52.0 +320,181,140,52.0,143,83.0,142,30.0 +348,169,136,56.0,141,30.0,143,74.0 +326,98,141,83.0,142,74.0 +371,814,102,70.0,145,56.0 +317,801,144,56.0,146,81.0 +335,722,145,81.0,147,59.0,157,141.0 +277,731,146,59.0,148,146.0 +164,824,147,146.0,149,113.0 +64,771,148,113.0,150,62.0 +123,752,149,62.0,165,102.0,151,167.0 +243,636,150,167.0,152,48.0,156,65.0 +213,598,151,48.0,153,46.0,154,49.0 +167,593,152,46.0 +202,550,152,49.0,179,34.0,155,69.0,163,38.0 +266,525,154,69.0,156,65.0,161,49.0 +286,587,151,65.0,155,65.0,157,47.0 +333,581,146,141.0,156,47.0,158,62.0 +368,530,157,62.0,159,69.0 +332,471,158,69.0,175,70.0,160,51.0 +282,483,159,51.0,162,26.0,163,79.0 +313,511,155,49.0,162,52.0 +262,500,160,26.0,161,52.0 +208,512,154,38.0,160,79.0,174,72.0,164,229.0 +5,617,163,229.0,167,77.0 +34,703,150,102.0,166,117.0 +130,636,165,117.0 +9,540,164,77.0,168,183.0 +170,454,167,183.0,169,42.0,173,35.0 +129,463,168,42.0,170,58.0 +137,406,169,58.0,171,71.0 +70,429,170,71.0,172,66.0 +9,453,171,66.0 +203,441,168,35.0,174,101.0 +136,517,163,72.0,173,101.0 +393,437,159,70.0,177,71.0,176,38.0 +427,420,46,58.0,109,54.0,175,38.0 +359,375,139,64.0,175,71.0,178,69.0 +337,310,138,25.0,177,69.0 +171,563,154,34.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/04_inseln.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/04_inseln.csv new file mode 100644 index 0000000..783e31e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/04_inseln.csv @@ -0,0 +1,25 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,2_mst_insel_karte_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +579,272,3,700.0,1,310.0,7,130.0,2,500.0 +356,334,0,310.0,3,180.0,4,200.0,2,110.0,7,420.0,6,350.0 +429,245,0,500.0,1,110.0,7,90.0,6,170.0,4,460.0 +291,436,0,700.0,1,180.0,5,230.0,4,190.0 +262,251,1,200.0,2,460.0,3,190.0,5,100.0,6,80.0 +113,199,3,230.0,4,100.0,6,70.0 +290,113,1,350.0,2,170.0,4,80.0,5,70.0,7,380.0 +501,166,0,130.0,1,420.0,2,90.0,6,380.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/05_gerichtet.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/05_gerichtet.csv new file mode 100644 index 0000000..37550a2 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/05_gerichtet.csv @@ -0,0 +1,30 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,0 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Kantenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,000000,FF0000,A0A0A0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,1 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +130,30,2,5.0 +40,90,0,8.0,3,2.0,4,18.0 +220,90,1,10.0,3,3.0 +130,170,4,12.0,6,30.0 +40,230,5,4.0 +130,280,3,14.0,6,26.0 +220,230,2,16.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/06_negative_kantengewichte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/06_negative_kantengewichte.csv new file mode 100644 index 0000000..6b8b4d8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/06_negative_kantengewichte.csv @@ -0,0 +1,24 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,0 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +130,30,1,8.0,2,5.0 +40,90,0,8.0,3,2.0,4,18.0,2,-6.0 +220,90,0,5.0,1,-6.0,6,16.0,3,3.0 +130,170,1,2.0,2,3.0,5,14.0,6,-10.0,4,-3.0 +40,230,1,18.0,3,-3.0,5,4.0 +130,280,3,14.0,4,4.0,6,26.0 +220,230,2,16.0,3,-10.0,5,26.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/07_negative_kantengewichte2.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/07_negative_kantengewichte2.csv new file mode 100644 index 0000000..9a443d8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/03_routenplanung/07_negative_kantengewichte2.csv @@ -0,0 +1,24 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +130,30,1,8.0,2,5.0 +40,90,0,8.0,3,2.0,4,18.0,2,-6.0 +220,90,0,5.0,1,-6.0,6,16.0,3,5.0 +130,170,1,2.0,2,5.0,5,14.0,6,-10.0,4,-3.0 +40,230,1,18.0,3,-3.0,5,4.0 +130,280,3,14.0,4,4.0,6,26.0 +220,230,2,16.0,3,-10.0,5,26.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/01_eisverkaeufer_blanko.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/01_eisverkaeufer_blanko.csv new file mode 100644 index 0000000..8873978 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/01_eisverkaeufer_blanko.csv @@ -0,0 +1,17 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,eis2.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/02_eisverkaeufer.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/02_eisverkaeufer.csv new file mode 100644 index 0000000..8bf1b44 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/02_eisverkaeufer.csv @@ -0,0 +1,51 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Größe der Knoten +vertexSize,17 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,eis2.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +15,16,1,21 +112,15,0,15,2 +218,14,1,7,3 +328,13,2,4,6 +405,13,3,5 +406,80,4,10,6 +326,81,3,5,8,7 +223,80,2,6,13,14,15 +326,174,6,9,28,13 +366,174,8,10,12 +409,175,5,9,11 +416,232,10,31,12 +374,237,9,11,30 +222,175,7,8,27,17,14 +173,122,7,13,16 +111,82,1,7,16,20 +110,123,14,15,17 +109,174,13,16,26,18 +64,173,17,23,19 +63,129,18,20,22 +64,81,15,19,21 +16,80,0,20,22 +17,128,19,21,23 +18,172,18,22,24 +18,294,23,25 +109,294,24,29,26 +109,246,17,25,27 +221,246,13,26,28 +325,247,8,27,29 +327,296,25,28,30 +373,297,12,29,31 +416,294,11,30 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/03_graph_knoten5.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/03_graph_knoten5.csv new file mode 100644 index 0000000..f4e5bcb --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/03_graph_knoten5.csv @@ -0,0 +1,22 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +247,228,1,3 +458,188,0,4 +358,310,4,3 +252,400,0,2,4 +436,461,1,2,3 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/04_graph_knoten6.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/04_graph_knoten6.csv new file mode 100644 index 0000000..f6439e3 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/04_graph_knoten6.csv @@ -0,0 +1,23 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +229,211,1,3,2 +458,188,0,4,5 +358,310,0,4 +252,400,0,4 +444,439,1,2,3,5 +525,331,1,4 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/05_graph_knoten7.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/05_graph_knoten7.csv new file mode 100644 index 0000000..8b58426 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/05_graph_knoten7.csv @@ -0,0 +1,24 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +229,211,3,2,6 +431,265,4,5,2 +358,310,0,1,4,6,3 +252,400,0,2,4 +444,439,1,2,3,5 +525,331,1,4,6 +390,71,0,2,5 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/06_graph_knoten8.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/06_graph_knoten8.csv new file mode 100644 index 0000000..80da538 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/06_graph_knoten8.csv @@ -0,0 +1,25 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +229,211,3,2,6 +431,265,4,5,2 +358,310,0,1,4,6,3 +252,400,0,2,4 +444,439,1,2,3,5 +525,331,1,4,6,7 +390,71,0,2,5,7 +610,168,5,6 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/07_graph_knoten9.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/07_graph_knoten9.csv new file mode 100644 index 0000000..b733498 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/07_graph_knoten9.csv @@ -0,0 +1,26 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +229,211,3,2,6 +431,265,4,5,2 +358,310,0,1,4,6,3 +252,400,0,2,4 +444,439,1,2,3,5,8 +525,331,1,4,6,7,8 +390,71,0,2,5,7 +610,168,5,6,8 +614,426,4,5,7 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/08_graph_knoten10.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/08_graph_knoten10.csv new file mode 100644 index 0000000..faa7287 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/08_graph_knoten10.csv @@ -0,0 +1,27 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +229,211,3,2,6 +431,265,4,5,2 +358,310,0,1,4,6,3 +252,400,0,2,4 +444,439,1,2,3,5,8 +525,331,1,4,6,7,8,9 +390,71,0,2,5,7,9 +610,168,5,6,8,9 +614,426,4,5,7 +524,191,5,6,7 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/09_graph_knoten15.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/09_graph_knoten15.csv new file mode 100644 index 0000000..5d8f48d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/09_graph_knoten15.csv @@ -0,0 +1,32 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +229,211,3,2,6,13,12 +431,265,4,5,2 +358,310,0,1,4,6,3 +252,400,0,2,4,14,13 +434,403,1,2,3,5,8,14 +525,331,1,4,6,7,8,9 +390,71,0,2,5,7,9,12,11 +610,168,5,6,8,9,11 +614,426,4,5,7,10,14 +524,191,5,6,7 +752,325,8,11 +671,91,6,7,10 +239,78,0,6,13 +161,288,0,3,12 +338,481,3,4,8 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/10_graph_domknoten6.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/10_graph_domknoten6.csv new file mode 100644 index 0000000..6d3556d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/10_graph_domknoten6.csv @@ -0,0 +1,45 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list,infotext +*,123,150,17,18,19,20 +*,412,130,21,22 +*,361,360,12,9,14,13 +*,153,366,15,16 +*,174,540,7,8,6 +*,654,374,11,23,24,25,26,10,27 +,91,486,4,14,7,16 +,249,484,4,6,14,9 +,294,541,4,9,10,27 +,359,467,2,7,8,10,14 +,513,461,5,8,9,11,27 +,519,362,5,10,12 +,466,289,2,11,23,22 +,305,250,2,20,15,14,22 +,283,382,2,6,7,9,13,15 +,188,302,3,13,14 +,51,252,3,6,17,20 +,61,147,0,16,18 +,76,69,0,17,19 +,203,69,0,18,20,21 +,273,165,0,13,16,19,21 +,421,55,1,19,20,22 +,546,117,1,12,13,21,23,24 +,614,259,5,12,22,24 +,696,294,5,22,23,25 +,730,400,5,24,26 +,725,543,5,25,27 +,643,523,5,8,10,26 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/11_graph_domkonten10.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/11_graph_domkonten10.csv new file mode 100644 index 0000000..9859341 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/04_dominierendemenge/11_graph_domkonten10.csv @@ -0,0 +1,59 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list,infotext +*,109,94,34,31,32,33 +*,474,118,35,36,37,38 +*,466,345,19,18,17,16 +*,224,417,25,24,22 +*,272,257,23,20,21 +*,375,568,12,9,10,11 +*,91,552,29,30 +*,45,316,27,26,28 +*,539,514,14,13,15 +,298,517,5,24,10,29 +,402,482,5,9,15,16,23 +,448,569,5,14,15 +,324,608,5,29 +,562,451,8,17,14,16,15 +,602,542,8,11,13 +,473,508,8,10,11,13 +,452,404,2,10,13,19 +,548,356,2,13,36,18 +,492,264,2,17,35 +,405,327,2,16,23 +,316,188,4,40,32 +,213,218,4,32,31,27,28,22 +,227,315,3,21,24 +,352,309,4,10,19,24,35 +,280,377,3,9,22,23 +,147,420,3,28,26,29,30 +,59,388,7,25,30 +,76,269,7,21,34,31 +,118,325,7,21,25 +,171,573,6,9,12,25,30 +,76,486,6,25,26,29 +,101,163,0,21,27 +,193,134,0,20,21,41 +,192,45,0,41,34,38 +,42,46,0,27,33 +,419,157,1,18,23,40 +,548,181,1,17,37 +,568,68,1,36,38 +,406,60,1,33,37,40 +*,302,102,41,40 +,361,114,20,35,38,39 +,248,72,32,33,39 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/05_repraesentation/01_graph1.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/05_repraesentation/01_graph1.csv new file mode 100644 index 0000000..008feca --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/05_repraesentation/01_graph1.csv @@ -0,0 +1,24 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +130,30,1,2 +40,90,0,2,3,4 +220,90,0,1,6,3 +130,170,1,2,4,5,6 +40,230,1,3,5 +130,280,3,4,6 +220,230,2,3,5 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/05_repraesentation/02_graph2.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/05_repraesentation/02_graph2.csv new file mode 100644 index 0000000..301d7cf --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/05_repraesentation/02_graph2.csv @@ -0,0 +1,19 @@ +# Der Graph ist durch kommagetrennte Werte kodiert. Der Graph liegt hier in Form einer Adjazenzmatrix vor. Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +# +# Header: +# gerichtet 1, ungerichtet 0 +directed,0 +# gewichtet 1, ungewichtet 0 +weighted,1 +# Knotenfarben +vertextColor,A0A0A0,FF0000,0000FF,00FF00,FFFF00,00FFFF,FF00FF,FF8080 +# +# Graph: +matrix +130,30,-,8.0,5.0,-,-,-,- +40,90,8.0,-,10.0,2.0,18.0,-,- +220,90,5.0,10.0,-,3.0,-,-,16.0 +130,170,-,2.0,3.0,-,12.0,14.0,30.0 +40,230,-,18.0,-,12.0,-,4.0,- +130,280,-,-,-,14.0,4.0,-,26.0 +220,230,-,-,16.0,30.0,-,26.0,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/01_deutschlandkarte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/01_deutschlandkarte.csv new file mode 100644 index 0000000..c1f981d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/01_deutschlandkarte.csv @@ -0,0 +1,65 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0,739.0,651.0,446.0,123.0,240.0,721.0,466.0,330.0,740.0,475.0,354.0,345.0,307.0,556.0,145.0,60.0,573.0,625.0,496.0,284.0,650.0,206.0,715.0,472.0,256.0,683.0,570.0,642.0,321.0,590.0,408.0,255.0,505.0,418,367 +Augsburg,322,655,-,-,239.0,593.0,715.0,574.0,472.0,422.0,601.0,365.0,649.0,340.0,335.0,117.0,720.0,600.0,221.0,432.0,820.0,430.0,538.0,431.0,184.0,530.0,297.0,61.0,620.0,729.0,180.0,580.0,232.0,167.0,782.0,356.0,742.0,149.0,475.0,83.0,825,243 +Bayreuth,358,502,-,-,-,352.0,572.0,339.0,237.0,187.0,494.0,264.0,414.0,457.0,187.0,334.0,596.0,460.0,337.0,278.0,693.0,345.0,431.0,198.0,372.0,295.0,329.0,244.0,520.0,494.0,74.0,635.0,273.0,159.0,547.0,446.0,562.0,264.0,485.0,252.0,682,147 +Berlin,457,250,-,-,-,-,375.0,125.0,214.0,288.0,480.0,564.0,91.0,800.0,474.0,686.0,279.0,258.0,670.0,367.0,343.0,610.0,553.0,184.0,739.0,131.0,657.0,596.0,450.0,130.0,426.0,410.0,625.0,511.0,237.0,745.0,200.0,631.0,725.0,604.0,485,490 +Bremen,192,196,-,-,-,-,-,496.0,478.0,351.0,249.0,450.0,467.0,722.0,388.0,856.0,110.0,118.0,595.0,288.0,205.0,415.0,315.0,367.0,780.0,251.0,541.0,766.0,170.0,353.0,590.0,120.0,796.0,690.0,277.0,590.0,228.0,645.0,524.0,660.0,110,490 +Cottbus,509,312,-,-,-,-,-,-,138.0,320.0,608.0,585.0,119.0,800.0,490.0,686.0,430.0,378.0,670.0,502.0,511.0,633.0,683.0,244.0,739.0,233.0,660.0,596.0,579.0,304.0,426.0,528.0,478.0,440.0,382.0,768.0,359.0,631.0,748.0,604.0,598,485 +Dresden,479,388,-,-,-,-,-,-,-,220.0,581.0,485.0,177.0,700.0,390.0,586.0,492.0,385.0,570.0,402.0,573.0,533.0,583.0,140.0,639.0,228.0,560.0,496.0,597.0,366.0,325.0,590.0,378.0,340.0,444.0,668.0,421.0,531.0,648.0,504.0,660,385 +Erfurt,313,400,-,-,-,-,-,-,-,-,367.0,268.0,366.0,533.0,180.0,515.0,376.0,289.0,403.0,135.0,459.0,318.0,373.0,170.0,567.0,209.0,339.0,425.0,384.0,438.0,264.0,373.0,459.0,344.0,435.0,453.0,480.0,435.0,433.0,447.0,451,298 +Essen,82,348,-,-,-,-,-,-,-,-,-,256.0,600.0,524.0,297.0,736.0,350.0,258.0,397.0,188.0,454.0,160.0,75.0,475.0,655.0,384.0,327.0,646.0,87.0,599.0,465.0,135.0,676.0,560.0,525.0,359.0,474.0,472.0,292.0,535.0,290,360 +Frankfurt/Main,178,476,-,-,-,-,-,-,-,-,-,-,661.0,262.0,95.0,502.0,509.0,362.0,135.0,190.0,599.0,125.0,185.0,407.0,430.0,445.0,106.0,412.0,280.0,704.0,235.0,340.0,330.0,326.0,686.0,188.0,629.0,200.0,235.0,310.0,500,130 +Frankfurt/Oder,523,269,-,-,-,-,-,-,-,-,-,-,-,873.0,547.0,759.0,382.0,331.0,743.0,440.0,446.0,683.0,626.0,211.0,812.0,202.0,730.0,669.0,523.0,279.0,499.0,483.0,559.0,584.0,317.0,815.0,306.0,704.0,799.0,677.0,558,647 +Freiburg,124,683,-,-,-,-,-,-,-,-,-,-,-,-,357.0,490.0,759.0,624.0,130.0,457.0,852.0,333.0,435.0,642.0,175.0,700.0,195.0,400.0,548.0,942.0,378.0,556.0,480.0,480.0,935.0,312.0,881.0,207.0,360.0,268.0,716,318 +Fulda,234,438,-,-,-,-,-,-,-,-,-,-,-,-,-,477.0,410.0,272.0,238.0,105.0,504.0,227.0,277.0,311.0,390.0,346.0,166.0,382.0,304.0,605.0,202.0,290.0,412.0,295.0,577.0,290.0,525.0,260.0,345.0,270.0,450,100 +Garmisch-Part.,337,723,-,-,-,-,-,-,-,-,-,-,-,-,-,-,869.0,742.0,360.0,575.0,960.0,580.0,675.0,513.0,155.0,615.0,444.0,89.0,763.0,813.0,267.0,755.0,293.0,195.0,866.0,508.0,855.0,300.0,611.0,181.0,915,389 +Hamburg,260,155,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,154.0,640.0,312.0,85.0,520.0,381.0,387.0,806.0,271.0,580.0,772.0,260.0,235.0,616.0,200.0,816.0,710.0,140.0,690.0,120.0,668.0,624.0,686.0,220,512 +Hannover,244,267,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,500.0,238.0,238.0,410.0,295.0,252.0,656.0,136.0,433.0,647.0,190.0,395.0,476.0,135.0,676.0,567.0,327.0,553.0,269.0,526.0,487.0,536.0,225,369 +Karlsruhe,156,588,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,330.0,731.0,206.0,310.0,515.0,273.0,576.0,58.0,270.0,421.0,815.0,253.0,429.0,459.0,353.0,802.0,188.0,754.0,81.0,233.0,160.0,589,195 +Kassel,222,374,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,405.0,243.0,243.0,278.0,490.0,247.0,265.0,482.0,200.0,508.0,309.0,190.0,509.0,404.0,477.0,383.0,428.0,360.0,361.0,370.0,345,209 +Kiel,270,83,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,600.0,493.0,485.0,895.0,369.0,671.0,882.0,348.0,280.0,702.0,297.0,911.0,800.0,194.0,778.0,139.0,762.0,714.0,715.0,315,605 +Koblenz,114,462,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,110.0,454.0,501.0,496.0,145.0,521.0,243.0,760.0,350.0,300.0,580.0,445.0,687.0,203.0,635.0,270.0,128.0,381.0,460,248 +Köln,77,390,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,488.0,604.0,417.0,247.0,578.0,144.0,646.0,415.0,200.0,611.0,510.0,562.0,283.0,521.0,367.0,217.0,484.0,360,300 +Leipzig,403,362,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,564.0,108.0,497.0,436.0,450.0,322.0,266.0,410.0,461.0,349.0,375.0,585.0,364.0,471.0,568.0,444.0,485,410 +Lindau,203,712,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,727.0,363.0,194.0,683.0,879.0,301.0,733.0,364.0,310.0,932.0,480.0,908.0,216.0,417.0,126.0,888,309 +Magdeburg,356,293,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,505.0,522.0,342.0,269.0,360.0,291.0,563.0,449.0,316.0,611.0,311.0,573.0,599.0,537.0,366,460 +Mannheim,174,539,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,347.0,350.0,761.0,248.0,410.0,444.0,343.0,731.0,117.0,686.0,138.0,146.0,214.0,570,162 +München,372,672,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,668.0,731.0,162.0,655.0,180.0,106.0,771.0,413.0,773.0,210.0,522.0,124.0,825,294 +Münster,113,312,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,529.0,490.0,60.0,695.0,585.0,471.0,427.0,398.0,502.0,361.0,560.0,220,385 +Neubrandenburg,433,156,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,567.0,436.0,762.0,644.0,103.0,870.0,187.0,764.0,871.0,741.0,474,752 +Nürnberg,335,550,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,485.0,205.0,105.0,615.0,356.0,604.0,213.0,309.0,188.0,645,108 +Osnabrück,144,274,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,746.0,585.0,367.0,478.0,317.0,557.0,412.0,610.0,160,390 +Passau,472,625,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,128.0,814.0,562.0,803.0,400.0,618.0,310.0,860,323 +Regensburg,393,583,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,702.0,455.0,699.0,286.0,504.0,208.0,740,207 +Rostock,381,111,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,848.0,90.0,809.0,821.0,791.0,424,702 +Saarbrücken,67,561,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,822.0,210.0,103.0,303.0,633,309 +Schwerin,343,143,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,789.0,763.0,771.0,335,612 +Stuttgart,205,614,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,307.0,100.0,717,157 +Trier,48,508,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,418.0,515,351 +Ulm,256,647,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,770,180 +Wilhelmshaven,149,155,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,554 +Würzburg,269,512,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/02_deutschlandkarte_4staedte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/02_deutschlandkarte_4staedte.csv new file mode 100644 index 0000000..3e9410f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/02_deutschlandkarte_4staedte.csv @@ -0,0 +1,29 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0 +Augsburg,322,655,-,-,239.0,593.0 +Bayreuth,358,502,-,-,-,352.0 +Berlin,457,250,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/03_deutschlandkarte_5staedte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/03_deutschlandkarte_5staedte.csv new file mode 100644 index 0000000..48e412a --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/03_deutschlandkarte_5staedte.csv @@ -0,0 +1,30 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0 +Augsburg,322,655,-,-,239.0,593.0,715.0 +Bayreuth,358,502,-,-,-,352.0,572.0 +Berlin,457,250,-,-,-,-,375.0 +Bremen,192,196,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/04_deutschlandkarte_6staedte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/04_deutschlandkarte_6staedte.csv new file mode 100644 index 0000000..7896e03 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/04_deutschlandkarte_6staedte.csv @@ -0,0 +1,31 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0,739.0 +Augsburg,322,655,-,-,239.0,593.0,715.0,574.0 +Bayreuth,358,502,-,-,-,352.0,572.0,339.0 +Berlin,457,250,-,-,-,-,375.0,125.0 +Bremen,192,196,-,-,-,-,-,496.0 +Cottbus,509,312,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/05_deutschlandkarte_7staedte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/05_deutschlandkarte_7staedte.csv new file mode 100644 index 0000000..0623eac --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/05_deutschlandkarte_7staedte.csv @@ -0,0 +1,32 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0,739.0,651.0 +Augsburg,322,655,-,-,239.0,593.0,715.0,574.0,472.0 +Bayreuth,358,502,-,-,-,352.0,572.0,339.0,237.0 +Berlin,457,250,-,-,-,-,375.0,125.0,214.0 +Bremen,192,196,-,-,-,-,-,496.0,478.0 +Cottbus,509,312,-,-,-,-,-,-,138.0 +Dresden,479,388,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/06_deutschlandkarte_8staedte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/06_deutschlandkarte_8staedte.csv new file mode 100644 index 0000000..ef9eee2 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/06_deutschlandkarte_8staedte.csv @@ -0,0 +1,33 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0,739.0,651.0,446.0 +Augsburg,322,655,-,-,239.0,593.0,715.0,574.0,472.0,422.0 +Bayreuth,358,502,-,-,-,352.0,572.0,339.0,237.0,187.0 +Berlin,457,250,-,-,-,-,375.0,125.0,214.0,288.0 +Bremen,192,196,-,-,-,-,-,496.0,478.0,351.0 +Cottbus,509,312,-,-,-,-,-,-,138.0,320.0 +Dresden,479,388,-,-,-,-,-,-,-,220.0 +Erfurt,313,400,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/07_deutschlandkarte_9staedte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/07_deutschlandkarte_9staedte.csv new file mode 100644 index 0000000..5a8fcb7 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/07_deutschlandkarte_9staedte.csv @@ -0,0 +1,34 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0,739.0,651.0,446.0,123.0 +Augsburg,322,655,-,-,239.0,593.0,715.0,574.0,472.0,422.0,601.0 +Bayreuth,358,502,-,-,-,352.0,572.0,339.0,237.0,187.0,494.0 +Berlin,457,250,-,-,-,-,375.0,125.0,214.0,288.0,480.0 +Bremen,192,196,-,-,-,-,-,496.0,478.0,351.0,249.0 +Cottbus,509,312,-,-,-,-,-,-,138.0,320.0,608.0 +Dresden,479,388,-,-,-,-,-,-,-,220.0,581.0 +Erfurt,313,400,-,-,-,-,-,-,-,-,367.0 +Essen,82,348,-,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/08_deutschlandkarte_10staedte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/08_deutschlandkarte_10staedte.csv new file mode 100644 index 0000000..b48ab67 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/06_travelingsalesman/08_deutschlandkarte_10staedte.csv @@ -0,0 +1,35 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: Farbbeschreibung (z.B. red) oder RGB-Hexcode (z.B. #FF0000) oder invisible +# Reihenfolge: markiert (+1), besucht(+2), beendet(+4), z.B. markiert+beender=>6.Farbe +vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0,739.0,651.0,446.0,123.0,240.0 +Augsburg,322,655,-,-,239.0,593.0,715.0,574.0,472.0,422.0,601.0,365.0 +Bayreuth,358,502,-,-,-,352.0,572.0,339.0,237.0,187.0,494.0,264.0 +Berlin,457,250,-,-,-,-,375.0,125.0,214.0,288.0,480.0,564.0 +Bremen,192,196,-,-,-,-,-,496.0,478.0,351.0,249.0,450.0 +Cottbus,509,312,-,-,-,-,-,-,138.0,320.0,608.0,585.0 +Dresden,479,388,-,-,-,-,-,-,-,220.0,581.0,485.0 +Erfurt,313,400,-,-,-,-,-,-,-,-,367.0,268.0 +Essen,82,348,-,-,-,-,-,-,-,-,-,256.0 +Frankfurt/Main,178,476,-,-,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/01_coloring_land.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/01_coloring_land.csv new file mode 100644 index 0000000..3135241 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/01_coloring_land.csv @@ -0,0 +1,27 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,606060,FF5080,D0D0D0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,1_coloring_news_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +161,53,1,3 +227,142,0,2 +154,227,1,3 +65,147,0,2 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/02_coloring_land.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/02_coloring_land.csv new file mode 100644 index 0000000..af28b5e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/02_coloring_land.csv @@ -0,0 +1,24 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,2_coloring_news_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +177,46,1,3 +226,143,0,2,3 +147,227,1,3 +83,134,0,1,2 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/03_coloring_land.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/03_coloring_land.csv new file mode 100644 index 0000000..1eb98e2 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/03_coloring_land.csv @@ -0,0 +1,29 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,3_coloring_land1_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +38,66,1,7 +111,61,0,2 +170,119,1,3,7 +188,236,2,4,8 +206,315,3,5 +129,316,4,6,8 +54,310,5,7 +30,210,0,2,6,8 +119,259,3,5,7 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/04_coloring_land.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/04_coloring_land.csv new file mode 100644 index 0000000..280da25 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/04_coloring_land.csv @@ -0,0 +1,28 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,4_coloring_land2_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +66,130,1,6,7 +146,51,0,2,7 +257,38,1,3,7 +384,53,2,4,7 +380,180,3,5,7 +289,255,4,6 +114,237,0,5,7 +216,151,0,1,2,3,4,6 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/05_coloring_land.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/05_coloring_land.csv new file mode 100644 index 0000000..5fb2a8c --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/05_coloring_land.csv @@ -0,0 +1,26 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,6_coloring_land4_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +71,49,1,5 +170,70,0,2,5 +164,231,1,3,5 +94,290,2,4,5 +33,280,3,5 +60,120,0,1,2,3,4 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/06_coloring_land.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/06_coloring_land.csv new file mode 100644 index 0000000..aef854a --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/06_coloring_land.csv @@ -0,0 +1,30 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,5_coloring_land3_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +35,46,1,9,8 +140,49,0,3,2,7,8 +189,25,1,3 +278,74,1,2,4,7 +370,60,3,5,7 +423,263,4,6,7 +148,267,5,7,8,9 +280,170,1,3,4,5,6,8 +90,130,0,1,6,7,9 +26,224,0,6,8 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/07_coloring_painter.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/07_coloring_painter.csv new file mode 100644 index 0000000..f4c1a2c --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/07_coloring_painter.csv @@ -0,0 +1,42 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Größe der Knoten +vertexSize,12 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,7_coloring_maler_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix +80,40,-,0.0,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,- +114,28,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +145,29,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +170,53,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +193,69,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,- +114,84,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,- +136,87,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,- +211,88,-,-,-,-,-,-,-,-,0.0,0.0,-,-,-,-,-,-,-,-,-,- +190,131,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +209,149,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,- +209,170,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,- +172,189,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,- +121,199,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,- +121,229,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,- +120,250,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,0.0,0.0,-,- +92,289,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,- +146,272,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,- +180,250,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,- +177,290,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0 +182,314,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/08_karte_eu.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/08_karte_eu.csv new file mode 100644 index 0000000..5d13744 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/08_karte_eu.csv @@ -0,0 +1,49 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Größe der Knoten +vertexSize,19 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,karte_eu.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix +500,224,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +489,145,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +390,160,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +135,329,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +502,259,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +493,294,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +454,356,-,-,-,-,-,-,-,0.0,0.0,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,- +409,419,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,0.0,0.0,-,-,-,-,-,-,-,-,-,- +336,405,-,-,-,-,-,-,-,-,-,0.0,0.0,0.0,0.0,0.0,-,0.0,-,-,-,-,-,-,-,-,-,-,- +330,304,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +285,366,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +272,397,-,-,-,-,-,-,-,-,-,-,-,-,0.0,0.0,-,-,-,-,-,-,-,-,-,-,-,-,- +291,417,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,-,-,-,-,- +245,478,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,0.0,-,-,- +341,511,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,0.0,-,-,-,- +401,457,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,0.0,-,-,-,-,0.0,-,-,-,- +457,432,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,-,-,- +463,462,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,0.0,0.0,-,-,-,- +540,474,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,-,- +553,535,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,-,-,- +520,603,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +429,492,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,-,-,- +403,487,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +134,591,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,0.0,-,- +76,572,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +705,646,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- +409,684,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/09_karte_usa.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/09_karte_usa.csv new file mode 100644 index 0000000..5a44921 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/07_mapcoloring/09_karte_usa.csv @@ -0,0 +1,72 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Größe der Knoten +vertexSize,19 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,karte_usa.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +154,82,1,2 +88,140,0,2,9,11 +199,160,0,1,3,4,9,10 +261,108,2,4,5,6 +310,213,2,3,6,7,8,10 +430,112,3,6,21 +446,190,3,4,5,7,20,21 +433,249,4,6,8,16,20 +328,326,4,7,10,13,15,16 +129,263,1,2,10,11,12 +228,297,2,4,8,9,12 +66,308,1,9,12 +205,413,9,10,11,13 +309,416,8,12,14 +480,480,13,15,17,18 +485,403,8,14,16,18,19 +474,333,7,8,15,19 +583,499,14,18,35 +578,416,14,15,17,19,30,35 +577,362,15,16,18,20,25,28,30 +557,249,6,7,19,21,22,25 +538,160,5,6,20,22 +623,196,20,21,23,25 +654,139,22 +700,207,26,27 +634,296,19,20,22,26,28 +686,289,24,25,27,28 +740,270,24,26,28,29,37 +706,353,19,25,26,27,29,30,49 +784,308,27,28,37,46,49 +681,389,18,19,28,31,33,34,35,49 +826,373,30,32,49 +807,421,31,33 +750,425,30,32,34,36 +694,484,30,33,35,36 +638,468,17,18,30,34 +791,527,33,34 +823,245,27,29,38,45,46 +861,186,37,39,42,43,45 +898,150,38,40,41,42 +920,163,39,41,42 +947,113,39,40 +918,186,38,39,40,43,44 +909,217,38,42,44 +943,203,42,43 +897,257,37,38,46 +850,280,29,37,45,49 +113,549 +333,607 +829,332,28,29,30,31,46 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/01_muddy_city.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/01_muddy_city.csv new file mode 100644 index 0000000..87fd31e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/01_muddy_city.csv @@ -0,0 +1,29 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,17 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,1_mst_muddy_city_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +123,41,1,5.0,2,3.0,4,4.0 +295,56,0,5.0,3,3.0,5,2.0,2,3.0,9,4.0 +197,90,0,3.0,1,3.0,5,3.0,6,4.0,4,5.0 +377,97,1,3.0,9,2.0 +75,141,0,4.0,2,5.0,7,2.0,6,4.0 +251,144,1,2.0,2,3.0,9,3.0,8,3.0,6,4.0 +160,196,2,4.0,4,4.0,5,4.0,8,2.0,7,3.0 +50,244,4,2.0,6,3.0,8,3.0 +232,255,5,3.0,6,2.0,7,3.0,9,4.0 +358,202,1,4.0,3,2.0,5,3.0,8,4.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/02_deutschlandkarte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/02_deutschlandkarte.csv new file mode 100644 index 0000000..07ac597 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/02_deutschlandkarte.csv @@ -0,0 +1,65 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,10 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Kantenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,invisible,FF0000,A0A0A0 +# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: nichts, markiert, besucht, besucht und markiert +# mind. 12 Farben müssen angegeben werden.vertexColor,A0A0A0,FF0000,FFFF00,00FFFF,AA00AA,888800,008888,880088,00a0FF,a400FF,FFa400,FF00a4,00FFa4,a4FF00 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,deutschland_bundeslaende_bunt.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzmatrix vor. +# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten. +matrix,infotext +Aachen,25,415,-,570.0,532.0,637.0,369.0,739.0,651.0,446.0,123.0,240.0,721.0,466.0,330.0,740.0,475.0,354.0,345.0,307.0,556.0,145.0,60.0,573.0,625.0,496.0,284.0,650.0,206.0,715.0,472.0,256.0,683.0,570.0,642.0,321.0,590.0,408.0,255.0,505.0,418.0,367.0 +Augsburg,322,655,-,-,239.0,593.0,715.0,574.0,472.0,422.0,601.0,365.0,649.0,340.0,335.0,117.0,720.0,600.0,221.0,432.0,820.0,430.0,538.0,431.0,184.0,530.0,297.0,61.0,620.0,729.0,180.0,580.0,232.0,167.0,782.0,356.0,742.0,149.0,475.0,83.0,825.0,243.0 +Bayreuth,358,502,-,-,-,352.0,572.0,339.0,237.0,187.0,494.0,264.0,414.0,457.0,187.0,334.0,596.0,460.0,337.0,278.0,693.0,345.0,431.0,198.0,372.0,295.0,329.0,244.0,520.0,494.0,74.0,635.0,273.0,159.0,547.0,446.0,562.0,264.0,485.0,252.0,682.0,147.0 +Berlin,457,250,-,-,-,-,375.0,125.0,214.0,288.0,480.0,564.0,91.0,800.0,474.0,686.0,279.0,258.0,670.0,367.0,343.0,610.0,553.0,184.0,739.0,131.0,657.0,596.0,450.0,130.0,426.0,410.0,625.0,511.0,237.0,745.0,200.0,631.0,725.0,604.0,485.0,490.0 +Bremen,192,196,-,-,-,-,-,496.0,478.0,351.0,249.0,450.0,467.0,722.0,388.0,856.0,110.0,118.0,595.0,288.0,205.0,415.0,315.0,367.0,780.0,251.0,541.0,766.0,170.0,353.0,590.0,120.0,796.0,690.0,277.0,590.0,228.0,645.0,524.0,660.0,110.0,490.0 +Cottbus,509,312,-,-,-,-,-,-,138.0,320.0,608.0,585.0,119.0,800.0,490.0,686.0,430.0,378.0,670.0,502.0,511.0,633.0,683.0,244.0,739.0,233.0,660.0,596.0,579.0,304.0,426.0,528.0,478.0,440.0,382.0,768.0,359.0,631.0,748.0,604.0,598.0,485.0 +Dresden,479,388,-,-,-,-,-,-,-,220.0,581.0,485.0,177.0,700.0,390.0,586.0,492.0,385.0,570.0,402.0,573.0,533.0,583.0,140.0,639.0,228.0,560.0,496.0,597.0,366.0,325.0,590.0,378.0,340.0,444.0,668.0,421.0,531.0,648.0,504.0,660.0,385.0 +Erfurt,313,400,-,-,-,-,-,-,-,-,367.0,268.0,366.0,533.0,180.0,515.0,376.0,289.0,403.0,135.0,459.0,318.0,373.0,170.0,567.0,209.0,339.0,425.0,384.0,438.0,264.0,373.0,459.0,344.0,435.0,453.0,480.0,435.0,433.0,447.0,451.0,298.0 +Essen,82,348,-,-,-,-,-,-,-,-,-,256.0,600.0,524.0,297.0,736.0,350.0,258.0,397.0,188.0,454.0,160.0,75.0,475.0,655.0,384.0,327.0,646.0,87.0,599.0,465.0,135.0,676.0,560.0,525.0,359.0,474.0,472.0,292.0,535.0,290.0,360.0 +Frankfurt/Main,178,476,-,-,-,-,-,-,-,-,-,-,661.0,262.0,95.0,502.0,509.0,362.0,135.0,190.0,599.0,125.0,185.0,407.0,430.0,445.0,106.0,412.0,280.0,704.0,235.0,340.0,330.0,326.0,686.0,188.0,629.0,200.0,235.0,310.0,500.0,130.0 +Frankfurt/Oder,523,269,-,-,-,-,-,-,-,-,-,-,-,873.0,547.0,759.0,382.0,331.0,743.0,440.0,446.0,683.0,626.0,211.0,812.0,202.0,730.0,669.0,523.0,279.0,499.0,483.0,559.0,584.0,317.0,815.0,306.0,704.0,799.0,677.0,558.0,647.0 +Freiburg,124,683,-,-,-,-,-,-,-,-,-,-,-,-,357.0,490.0,759.0,624.0,130.0,457.0,852.0,333.0,435.0,642.0,175.0,700.0,195.0,400.0,548.0,942.0,378.0,556.0,480.0,480.0,935.0,312.0,881.0,207.0,360.0,268.0,716.0,318.0 +Fulda,234,438,-,-,-,-,-,-,-,-,-,-,-,-,-,477.0,410.0,272.0,238.0,105.0,504.0,227.0,277.0,311.0,390.0,346.0,166.0,382.0,304.0,605.0,202.0,290.0,412.0,295.0,577.0,290.0,525.0,260.0,345.0,270.0,450.0,100.0 +Garmisch-Part.,337,723,-,-,-,-,-,-,-,-,-,-,-,-,-,-,869.0,742.0,360.0,575.0,960.0,580.0,675.0,513.0,155.0,615.0,444.0,89.0,763.0,813.0,267.0,755.0,293.0,195.0,866.0,508.0,855.0,300.0,611.0,181.0,915.0,389.0 +Hamburg,260,155,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,154.0,640.0,312.0,85.0,520.0,381.0,387.0,806.0,271.0,580.0,772.0,260.0,235.0,616.0,200.0,816.0,710.0,140.0,690.0,120.0,668.0,624.0,686.0,220.0,512.0 +Hannover,244,267,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,500.0,238.0,238.0,410.0,295.0,252.0,656.0,136.0,433.0,647.0,190.0,395.0,476.0,135.0,676.0,567.0,327.0,553.0,269.0,526.0,487.0,536.0,225.0,369.0 +Karlsruhe,156,588,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,330.0,731.0,206.0,310.0,515.0,273.0,576.0,58.0,270.0,421.0,815.0,253.0,429.0,459.0,353.0,802.0,188.0,754.0,81.0,233.0,160.0,589.0,195.0 +Kassel,222,374,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,405.0,243.0,243.0,278.0,490.0,247.0,265.0,482.0,200.0,508.0,309.0,190.0,509.0,404.0,477.0,383.0,428.0,360.0,361.0,370.0,345.0,209.0 +Kiel,270,83,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,600.0,493.0,485.0,895.0,369.0,671.0,882.0,348.0,280.0,702.0,297.0,911.0,800.0,194.0,778.0,139.0,762.0,714.0,715.0,315.0,605.0 +Koblenz,114,462,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,110.0,454.0,501.0,496.0,145.0,521.0,243.0,760.0,350.0,300.0,580.0,445.0,687.0,203.0,635.0,270.0,128.0,381.0,460.0,248.0 +Köln,77,390,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,488.0,604.0,417.0,247.0,578.0,144.0,646.0,415.0,200.0,611.0,510.0,562.0,283.0,521.0,367.0,217.0,484.0,360.0,300.0 +Leipzig,403,362,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,564.0,108.0,497.0,436.0,450.0,322.0,266.0,410.0,461.0,349.0,375.0,585.0,364.0,471.0,568.0,444.0,485.0,410.0 +Lindau,203,712,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,727.0,363.0,194.0,683.0,879.0,301.0,733.0,364.0,310.0,932.0,480.0,908.0,216.0,417.0,126.0,888.0,309.0 +Magdeburg,356,293,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,505.0,522.0,342.0,269.0,360.0,291.0,563.0,449.0,316.0,611.0,311.0,573.0,599.0,537.0,366.0,460.0 +Mannheim,174,539,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,347.0,350.0,761.0,248.0,410.0,444.0,343.0,731.0,117.0,686.0,138.0,146.0,214.0,570.0,162.0 +München,372,672,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,668.0,731.0,162.0,655.0,180.0,106.0,771.0,413.0,773.0,210.0,522.0,124.0,825.0,294.0 +Münster,113,312,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,529.0,490.0,60.0,695.0,585.0,471.0,427.0,398.0,502.0,361.0,560.0,220.0,385.0 +Neubrandenburg,433,156,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,567.0,436.0,762.0,644.0,103.0,870.0,187.0,764.0,871.0,741.0,474.0,752.0 +Nürnberg,335,550,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,485.0,205.0,105.0,615.0,356.0,604.0,213.0,309.0,188.0,645.0,108.0 +Osnabrück,144,274,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,746.0,585.0,367.0,478.0,317.0,557.0,412.0,610.0,160.0,390.0 +Passau,472,625,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,128.0,814.0,562.0,803.0,400.0,618.0,310.0,860.0,323.0 +Regensburg,393,583,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,702.0,455.0,699.0,286.0,504.0,208.0,740.0,207.0 +Rostock,381,111,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,848.0,90.0,809.0,821.0,791.0,424.0,702.0 +Saarbrücken,67,561,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,822.0,210.0,103.0,303.0,633.0,309.0 +Schwerin,343,143,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,789.0,763.0,771.0 +Stuttgart,205,614,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,307.0,100.0,717.0,157.0 +Trier,48,508,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,418.0,515.0,351.0 +Ulm,256,647,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,770.0,180.0 +Wilhelmshaven,149,155,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,554.0 +Würzburg,269,512,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/03_badenbaden.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/03_badenbaden.csv new file mode 100644 index 0000000..e6b2643 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/03_badenbaden.csv @@ -0,0 +1,199 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Größe der Knoten +vertexSize,9 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,badenbaden.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +645,600,1,91.0,52,32.0 +655,690,0,91.0,2,62.0 +685,636,1,62.0,3,58.0,5,139.0 +686,578,2,58.0,4,122.0,52,54.0 +700,457,3,122.0,8,15.0,54,47.0 +782,536,2,139.0,6,59.0,16,154.0,17,139.0 +758,482,5,59.0,10,30.0 +768,407,8,74.0,10,46.0,50,92.0 +715,458,4,15.0,7,74.0,9,64.0 +779,463,8,64.0,11,13.0,15,88.0 +764,453,6,30.0,7,46.0,11,17.0 +781,450,9,13.0,10,17.0,12,98.0 +832,366,11,98.0,14,43.0,13,96.0 +860,274,12,96.0,51,48.0,64,123.0,96,53.0,97,100.0 +874,377,12,43.0,15,57.0 +861,432,9,88.0,14,57.0,16,27.0 +886,422,5,154.0,15,27.0,56,32.0 +914,491,5,139.0,19,128.0,57,24.0 +926,564,21,131.0,57,70.0,92,148.0 +817,575,17,128.0,20,33.0,22,212.0 +839,599,19,33.0,21,48.0 +822,644,18,131.0,20,48.0,99,112.0 +691,745,19,212.0,23,18.0,24,71.0 +703,758,22,18.0 +629,780,22,71.0,25,63.0,98,38.0 +598,725,24,63.0,26,37.0,27,32.0 +564,739,25,37.0,30,96.0 +589,694,25,32.0,28,77.0,29,68.0 +592,617,27,77.0,29,34.0,37,61.0 +562,632,27,68.0,28,34.0,30,33.0,32,67.0 +533,648,26,96.0,29,33.0,31,65.0,104,20.0 +518,585,30,65.0,32,10.0,105,20.0 +524,577,29,67.0,31,10.0,33,14.0 +519,564,32,14.0,34,29.0,45,32.0 +546,554,33,29.0,39,23.0,35,36.0 +534,520,34,36.0,38,22.0,44,19.0,41,26.0 +585,499,40,19.0,37,57.0,38,34.0 +590,556,28,61.0,36,57.0,39,21.0 +555,514,35,22.0,36,34.0,39,46.0 +569,558,34,23.0,37,21.0,38,46.0 +596,483,36,19.0,54,60.0,41,69.0,48,75.0 +528,495,35,26.0,40,69.0,43,25.0 +483,503,45,38.0,43,20.0,46,43.0 +503,499,41,25.0,42,20.0,44,33.0 +517,529,35,19.0,43,33.0,45,18.0 +501,537,33,32.0,42,38.0,44,18.0 +465,464,42,43.0,47,36.0,176,58.0 +480,431,46,36.0,55,58.0,109,59.0 +602,408,40,75.0,49,31.0,55,70.0 +608,378,48,31.0,50,116.0,93,66.0 +715,332,7,92.0,49,116.0,51,109.0,60,120.0 +820,301,13,48.0,50,109.0,58,72.0 +633,570,0,32.0,3,54.0,53,47.0 +639,523,52,47.0,54,62.0 +653,463,4,47.0,40,60.0,53,62.0 +538,437,47,58.0,48,70.0 +910,401,16,32.0,80,170.0,65,108.0 +938,495,17,24.0,18,70.0 +821,229,51,72.0,59,25.0 +841,214,58,25.0,60,62.0 +782,233,50,120.0,59,62.0,61,14.0 +770,225,60,14.0,62,41.0,111,68.0 +801,198,61,41.0,97,73.0,115,105.0 +911,139,73,80.0,97,55.0 +953,194,13,123.0,69,144.0,95,64.0,96,79.0 +911,293,56,108.0,66,148.0,96,32.0 +1043,227,65,148.0,79,43.0 +1323,213,78,179.0,68,127.0 +1199,185,67,127.0,69,103.0,94,74.0 +1096,175,64,144.0,68,103.0,79,59.0,70,82.0 +1051,106,69,82.0,76,48.0,71,64.0,95,69.0 +987,114,70,64.0,73,24.0,72,54.0,95,47.0 +950,154,71,54.0 +976,93,63,80.0,71,24.0,74,90.0 +1056,52,73,90.0,76,20.0,75,92.0 +1140,14,74,92.0 +1073,63,70,48.0,74,20.0,77,236.0 +1306,103,76,236.0 +1147,244,67,179.0,79,62.0 +1086,233,66,43.0,69,59.0,78,62.0,80,75.0 +1040,292,56,170.0,79,75.0,83,68.0,82,90.0 +1221,299,82,92.0 +1129,308,80,90.0,81,92.0,83,73.0 +1071,352,80,68.0,82,73.0,84,53.0,92,115.0 +1113,384,83,53.0,88,261.0,85,60.0 +1168,361,84,60.0,86,73.0 +1239,377,85,73.0,87,142.0 +1376,340,86,142.0 +1029,631,84,261.0,89,150.0 +908,720,88,150.0,90,24.0 +887,709,89,24.0,91,108.0 +799,771,90,108.0,106,73.0 +1031,460,18,148.0,83,115.0 +561,331,49,66.0,110,101.0,112,38.0,125,39.0 +1272,171,68,74.0 +1005,157,64,64.0,70,69.0,71,47.0 +911,261,13,53.0,64,79.0,65,32.0 +870,175,13,100.0,62,73.0,63,55.0 +654,808,24,38.0,99,125.0,100,62.0 +754,733,21,112.0,98,125.0 +592,811,98,62.0,101,68.0 +524,809,100,68.0,102,83.0,104,154.0 +441,807,101,83.0,103,165.0,144,70.0 +493,650,102,165.0,105,62.0,104,22.0 +514,655,30,20.0,101,154.0,103,22.0 +498,588,31,20.0,103,62.0 +840,831,91,73.0,107,170.0 +1008,804,106,170.0,108,142.0 +1108,703,107,142.0 +459,376,47,59.0,125,74.0,122,42.0,139,51.0,176,54.0 +644,274,93,101.0,111,67.0,114,41.0 +707,251,61,68.0,110,67.0,115,31.0 +543,298,93,38.0,113,44.0,124,35.0 +579,272,112,44.0,116,23.0,114,72.0 +640,233,110,41.0,113,72.0,116,71.0,115,60.0 +699,221,62,105.0,111,31.0,114,60.0 +571,250,113,23.0,114,71.0,117,60.0 +516,274,116,60.0,123,48.0,118,42.0 +489,242,117,42.0,119,43.0,135,53.0 +446,246,118,43.0,120,72.0,136,81.0 +419,179,119,72.0,126,21.0,133,61.0 +523,106,133,67.0 +463,334,109,42.0,123,32.0,134,35.0 +483,309,117,48.0,122,32.0,124,30.0,135,36.0 +512,315,112,35.0,123,30.0,125,24.0 +522,337,93,39.0,109,74.0,124,24.0 +433,194,120,21.0,129,39.0,128,39.0,127,43.0 +470,215,126,43.0 +472,190,126,39.0,129,20.0,131,30.0 +465,171,126,39.0,128,20.0,130,25.0,132,25.0 +475,148,129,25.0,132,19.0,133,15.0 +499,177,128,30.0,132,19.0 +488,162,129,25.0,130,19.0,131,19.0 +464,138,120,61.0,121,67.0,130,15.0 +431,320,122,35.0,139,30.0,135,44.0,137,60.0 +457,284,118,53.0,123,36.0,134,44.0 +369,221,119,81.0,142,56.0,140,58.0,137,62.0 +385,281,134,60.0,136,62.0,138,32.0 +359,299,137,32.0,140,82.0,139,75.0,178,25.0 +417,347,109,51.0,134,30.0,138,75.0,177,64.0 +312,232,136,58.0,138,82.0,141,52.0 +320,181,140,52.0,143,83.0,142,30.0 +348,169,136,56.0,141,30.0,143,74.0 +326,98,141,83.0,142,74.0 +371,814,102,70.0,145,56.0 +317,801,144,56.0,146,81.0 +335,722,145,81.0,147,59.0,157,141.0 +277,731,146,59.0,148,146.0 +164,824,147,146.0,149,113.0 +64,771,148,113.0,150,62.0 +123,752,149,62.0,165,102.0,151,167.0 +243,636,150,167.0,152,48.0,156,65.0 +213,598,151,48.0,153,46.0,154,49.0 +167,593,152,46.0 +202,550,152,49.0,179,34.0,155,69.0,163,38.0 +266,525,154,69.0,156,65.0,161,49.0 +286,587,151,65.0,155,65.0,157,47.0 +333,581,146,141.0,156,47.0,158,62.0 +368,530,157,62.0,159,69.0 +332,471,158,69.0,175,70.0,160,51.0 +282,483,159,51.0,162,26.0,163,79.0 +313,511,155,49.0,162,52.0 +262,500,160,26.0,161,52.0 +208,512,154,38.0,160,79.0,174,72.0,164,229.0 +5,617,163,229.0,167,77.0 +34,703,150,102.0,166,117.0 +130,636,165,117.0 +9,540,164,77.0,168,183.0 +170,454,167,183.0,169,42.0,173,35.0 +129,463,168,42.0,170,58.0 +137,406,169,58.0,171,71.0 +70,429,170,71.0,172,66.0 +9,453,171,66.0 +203,441,168,35.0,174,101.0 +136,517,163,72.0,173,101.0 +393,437,159,70.0,177,71.0,176,38.0 +427,420,46,58.0,109,54.0,175,38.0 +359,375,139,64.0,175,71.0,178,69.0 +337,310,138,25.0,177,69.0 +171,563,154,34.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/04_inseln.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/04_inseln.csv new file mode 100644 index 0000000..7cf1f12 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/04_inseln.csv @@ -0,0 +1,25 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,2 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,2_mst_insel_karte_trans.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +572,381,3,700.0,1,310.0,7,130.0,2,500.0 +357,346,0,310.0,3,180.0,4,200.0,2,110.0,7,420.0,6,350.0 +437,253,0,500.0,1,110.0,7,90.0,6,170.0,4,460.0 +274,434,0,700.0,1,180.0,5,230.0,4,190.0 +262,253,1,200.0,2,460.0,3,190.0,5,100.0,6,80.0 +114,181,3,230.0,4,100.0,6,70.0 +303,115,1,350.0,2,170.0,4,80.0,5,70.0,7,380.0 +505,164,0,130.0,1,420.0,2,90.0,6,380.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/05_standardbsp1.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/05_standardbsp1.csv new file mode 100644 index 0000000..5d0bee0 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/05_standardbsp1.csv @@ -0,0 +1,24 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,0 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +130,30,1,8.0,2,5.0 +40,90,0,8.0,2,10.0,3,2.0,4,18.0 +220,90,0,5.0,1,10.0,6,16.0,3,3.0 +130,170,1,2.0,2,3.0,4,12.0,5,14.0,6,30.0 +40,230,1,18.0,3,12.0,5,4.0 +130,280,3,14.0,4,4.0,6,26.0 +220,230,2,16.0,3,30.0,5,26.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/06_standardbsp2.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/06_standardbsp2.csv new file mode 100644 index 0000000..b995c75 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/06_standardbsp2.csv @@ -0,0 +1,25 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,0 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +90,70,1,3.0,3,2.0,4,7.0 +220,70,0,3.0,2,1.0,4,8.0 +350,70,1,1.0,4,6.0,5,3.0 +90,150,0,2.0,4,6.0 +220,150,0,7.0,1,8.0,2,6.0,3,6.0,5,3.0,6,6.0,7,5.0 +350,150,2,3.0,4,3.0 +160,230,4,6.0,7,9.0 +280,230,4,5.0,6,9.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/07_negativekantengewichte.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/07_negativekantengewichte.csv new file mode 100644 index 0000000..6b8b4d8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/08_minimalspanningtree/07_negativekantengewichte.csv @@ -0,0 +1,24 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,1 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,0 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,1 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +130,30,1,8.0,2,5.0 +40,90,0,8.0,3,2.0,4,18.0,2,-6.0 +220,90,0,5.0,1,-6.0,6,16.0,3,3.0 +130,170,1,2.0,2,3.0,5,14.0,6,-10.0,4,-3.0 +40,230,1,18.0,3,-3.0,5,4.0 +130,280,3,14.0,4,4.0,6,26.0 +220,230,2,16.0,3,-10.0,5,26.0 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/10_weitereuebungen/13_2_scotlandyard.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/10_weitereuebungen/13_2_scotlandyard.csv new file mode 100644 index 0000000..b1fc777 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/10_weitereuebungen/13_2_scotlandyard.csv @@ -0,0 +1,222 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Größe der Knoten +vertexSize,23 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,1 +# Kantenfarben: RGB-Hexcode (z.B. FF0000) oder invisible +# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten +edgeColor,0000FF,FF0000,A0A0A0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,scotlandyard.png +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list +196,48,7,8,57,45 +546,25,19,9 +760,31,10,11,3,21,22 +892,17,2,12 +1434,33,14,15 +1592,32,28,6 +1764,41,5,16,41 +123,123,0,17,18 +267,130,0,18,19 +655,123,1,10,20,33 +761,148,2,9,21 +841,125,2,22 +1002,117,3,22,23,13,51,88,66,45 +1147,86,12,24,14 +1309,76,4,13,15,25,27,28,40 +1457,127,4,14,27,28 +1744,179,6,28,29 +55,185,7,42,30 +176,206,7,8,31 +348,169,1,8,32 +503,235,9,32 +763,261,2,10,33,22,34,64 +888,189,2,11,12,21,36,66 +1091,196,12,36,37 +1177,224,13,37,38 +1301,123,14,38,26 +1323,202,25,39,27 +1383,172,14,15,26,40 +1595,217,5,14,15,16,41,40,54 +1810,204,16,41 +110,250,17,42,43 +291,295,18,43,32,44 +437,273,19,20,31,45 +677,299,9,21,46,47,45,62 +813,332,21,47,35,64 +863,339,34,36,48 +953,262,22,23,35,49 +1130,281,23,24,49,50 +1213,257,24,25,50,51 +1362,311,26,51,40,52 +1409,291,14,27,28,39,53,51,86 +1750,289,6,28,29,55,71 +30,317,17,30,56 +209,360,30,31,57 +341,386,31,57,58,59,45 +460,349,0,12,32,33,44,46,60,57,77,78,73 +550,326,33,45,61 +700,393,33,34,61,62 +902,397,35,49,65 +999,337,36,37,48 +1172,347,37,38,51,66,67 +1258,325,12,38,39,40,50,68,66,85 +1369,385,39,68,53 +1441,362,40,52,54,69 +1596,358,28,53,70,88 +1802,380,41,90 +83,394,42,57,72 +271,415,0,43,44,45,56,58,73,76,74 +311,465,44,57,74,75 +366,448,44,60,75 +491,461,45,59,75,61,77 +559,443,46,47,60,78 +711,521,33,47,78,63,79,64,99 +802,503,62,80,64 +898,485,21,34,62,63,65,81,66 +964,470,48,64,66,81 +1062,454,12,22,50,51,64,65,67,83,101,81,78,88,110 +1186,427,50,66,68,84 +1305,412,51,52,67,85 +1452,439,53,70,86 +1568,437,54,69,88,71 +1705,451,41,70,90,89 +85,469,56,73,91 +150,543,45,57,72,91,74,93 +236,517,57,58,73,93 +356,513,58,59,60,76 +425,568,57,75,94,95,77,93,123 +519,558,45,60,76,78,96 +593,540,45,61,62,66,77,97,92,110 +739,574,62,98,99 +869,596,63,81,99 +916,563,64,65,66,80,100,99,139 +1037,546,100,101 +1121,507,66,84 +1194,478,67,83,102 +1319,529,51,68,102,86,103,101,115 +1451,558,40,69,85,87,104 +1514,576,86,88,116 +1561,531,12,54,66,70,87,104,139,158 +1650,531,71,90,104 +1785,534,55,71,89,106,104 +39,601,72,73,92 +52,655,78,91,93 +168,635,73,74,76,92,94 +222,624,76,93,121 +488,662,76,96,108 +545,641,77,95,97,108 +627,611,78,96,98,109 +693,632,79,97,109,111 +824,664,62,79,80,81,100,112,111,110 +955,612,81,82,99,113 +1114,548,66,82,85,102,114,126 +1217,538,84,85,101 +1320,587,85,115 +1615,613,86,88,89,90,105,117,106 +1724,632,104,106 +1810,638,90,104,105,118,160 +381,740 +575,752,95,96,109,123 +660,669,97,98,108,110 +720,736,66,78,99,109,111,123,162,152 +751,716,98,99,110,124 +878,710,99,113,124 +972,683,100,112,114,125,131,130 +1106,636,101,113,126,125 +1321,716,85,103,126,127,116,117,141 +1472,768,87,115,117,128 +1583,740,104,115,116,118,134 +1764,833,106,117,135 +47,893,120,143 +115,897,119,121,144 +197,888,94,120,122,145,143 +428,879,121,123,136,148,164 +559,853,76,108,110,122,129,137,152 +791,773,111,112,130 +1038,731,113,114,139,126 +1191,767,101,114,115,125,133,132 +1326,805,115,128,141,133 +1457,820,116,127,134,142,141 +757,857,123,138,130 +822,810,113,124,129 +967,802,113,139 +1128,881,126,139,140,156 +1254,836,126,127,140,141 +1525,863,117,128,135,160,142,158 +1725,948,118,134,161 +349,957,122,146 +601,904,123,149,151 +748,909,129,152,153 +965,894,81,88,125,131,132,153,155,152,158 +1174,907,132,133,157,141 +1322,933,115,127,128,133,140,158,156,142,157 +1455,916,128,134,141,159,158 +72,1050,119,121,176,144,162 +131,1043,120,143,145 +223,1038,121,144,146,162 +293,1014,136,145,163 +377,1005,148,163 +453,997,122,147,149,164 +542,970,137,148,150 +589,1007,149,151,165,164 +649,965,137,150,152 +686,1016,110,123,138,139,151,153,166,165,183,179 +833,974,138,139,152,154,155 +882,1038,153,166,167 +991,1037,139,153,156,168,183 +1080,1048,132,141,155,157,169,184 +1222,988,140,141,156,170 +1405,1023,88,134,139,141,142,159,171,187,160,198,186,184 +1509,1041,142,158,160,172 +1638,1029,106,134,158,159,173,198 +1804,1032,135,174 +210,1086,110,143,145,176,190,175 +304,1086,146,147,177,178 +476,1114,122,148,150,178,179,190 +657,1069,150,152,180,182 +798,1095,152,154,182,167 +847,1131,154,166,183 +991,1110,155,183 +1065,1124,156,170,184 +1227,1190,157,169,185,197,171 +1365,1111,158,170,186 +1550,1166,159,187,199,173 +1707,1125,160,172,174 +1793,1188,161,173,199 +41,1178,162,188,189,176 +120,1156,143,162,175 +251,1147,163,188,190 +412,1164,163,164,190 +507,1182,152,164,180,192,189,183 +608,1156,165,179,181,192 +663,1171,180,182,194 +761,1121,165,166,181,195 +917,1192,152,155,167,168,179,195,184,196 +1039,1266,156,158,169,183,185,186 +1145,1240,170,184,197 +1319,1201,158,171,184,187,197 +1479,1201,158,172,186,198 +120,1282,175,177,189 +205,1329,175,179,188,190,191 +311,1241,162,164,177,178,189,191 +338,1350,189,190,193 +582,1249,179,180,193 +611,1289,191,192,194 +686,1286,181,193,196 +791,1219,182,183,196 +816,1293,183,194,195 +1224,1347,170,185,186,198 +1498,1345,158,160,187,197,199 +1594,1315,172,174,198 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/beispielgraphen/10_weitereuebungen/17_2_oberstufenplan.csv b/Quellcodes/alg_ds_graphentester/beispielgraphen/10_weitereuebungen/17_2_oberstufenplan.csv new file mode 100644 index 0000000..3c643f0 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/beispielgraphen/10_weitereuebungen/17_2_oberstufenplan.csv @@ -0,0 +1,35 @@ +# Anzeigeoptionen:# Gewichte anzeigen 1, Gewichte nicht anzeigen 0 +showWeights,0 +# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0 +showInfoText,1 +# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2 +vertexStyle,0 +# Bild im Hintergrund (bitte im "images"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben! +image,0 +# +# Graph: +# gewichtet 1, ungewichtet 0 +weighted,0 +# gerichtet 1, ungerichtet 0 +directed,0 +# Der Graph liegt hier in Form einer Adjazenzliste vor. +# Jede Zeile steht fuer einen Knoten, durch Komma getrennt steht der adjazente Knoten mit dem zugehoerigen Kantengewicht. +list,infotext +M,68,104 +m,103,66 +D,207,29 +d,265,30 +Inf,453,283 +E,358,52 +e,398,86 +Ch,299,406 +F,452,146 +f,458,203 +ch,243,405 +s,42,183 +bk,38,256 +b,112,362 +B,159,387 +p,381,380 +P,416,351 +mu,59,306 \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/config.csv b/Quellcodes/alg_ds_graphentester/config.csv new file mode 100644 index 0000000..6b46207 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/config.csv @@ -0,0 +1,3 @@ +false,false +180.0,174.0,1328.0,762.0 + diff --git a/Quellcodes/alg_ds_graphentester/control/Controller.java b/Quellcodes/alg_ds_graphentester/control/Controller.java new file mode 100644 index 0000000..2df4018 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/Controller.java @@ -0,0 +1,586 @@ +package control; + +import imp.*; +import graph.*; +import algorithmen.*; +import java.io.FileReader; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.FileWriter; + +import javafx.fxml.*; +import javafx.scene.control.*; +import javafx.scene.control.Alert.AlertType; +import javafx.event.*; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.*; +import javafx.scene.Node; +import javafx.scene.text.*; +import javafx.geometry.Pos; +import javafx.stage.*; // Dateiöffnen / Speichern-Dialog +import java.io.File; +import java.nio.file.*; +import javafx.stage.FileChooser.ExtensionFilter; +import javafx.scene.image.Image; +import javafx.geometry.Rectangle2D; + +import java.util.List; +import java.util.ArrayList; +import javafx.collections.ObservableList; +/** + * Die Klasse Controller stellt den Controller des Hauptfensters / Menu dar. + * + * @author Thomas Schaller + * @version 03.03.2023 (v7.1) + * v7.0: Die aktuelle Bildschirmposition und der angezeigte Graph werden in config.csv abgelegt. + * v7.1: Verzeichnisauswahl für Laden/Speichern verbessert + */ + +public class Controller { + private String version = "7.0 (Februar 2023)"; + private String pfad; // Pfad der aktuell angezeigten Datei + + @FXML + private TabPane tpRekursionen; + + @FXML + private CheckMenuItem mOptionKnotenwerte; + + @FXML + private CheckMenuItem mOptionKnotenname; + + @FXML + private CheckMenuItem mOptionKantengewichte; + + @FXML + private CheckMenuItem mOptionKnoteninfo; + + @FXML + private CheckMenuItem mOptionBild; + + @FXML + private CheckMenuItem mHilfefenster; + + @FXML + private MenuItem mmSpeichern; + + @FXML + private Menu mmBearbeiten; + + @FXML + private Menu mmExperimentieren; + + @FXML + private Menu mmSimulieren; + + @FXML + private Menu mmZuruecksetzen; + + @FXML + private Menu mmAnsicht; + + private FileChooser dateidialog; + private Graph graph; + private GraphOptions options; + private Stage stage; + + public void initialize() { + + dateidialog = new FileChooser(); + dateidialog.setInitialDirectory(new File("beispielgraphen")); + + oeffneHauptTab(); + mNeuerGraph(null); + + tpRekursionen.getSelectionModel().selectedItemProperty(). + addListener((value, tabOld, tabNew) -> changeTab(tabOld, tabNew)); + + BufferedReader in =null; + try{ + in = new BufferedReader(new FileReader("config.csv")); + String fullScreen = in.readLine(); + String posSize = in.readLine(); + String[] ps = posSize.split(","); + Rectangle2D ss = Screen.getPrimary().getBounds(); + + stage.setX(Double.parseDouble(ps[0])); + stage.setY(Double.parseDouble(ps[1])); + stage.setWidth(Math.min(Double.parseDouble(ps[2]), ss.getWidth()-Double.parseDouble(ps[0]))); + stage.setHeight(Math.min(Double.parseDouble(ps[3]), ss.getHeight()-Double.parseDouble(ps[1]))); + String[] fs = fullScreen.split(","); + if(fs[0].equals("true")) stage.setFullScreen(true); + if(fs[1].equals("true")) stage.setMaximized(true); + pfad = in.readLine(); + File f = new File(pfad); + f.getCanonicalPath(); + if(!pfad.isBlank() && f.exists()){ + graphLaden(pfad); + dateidialog.setInitialDirectory((f.getAbsoluteFile()).getParentFile()); + } else { + pfad = ""; + } + } + catch(Exception e) { + pfad = ""; + dateidialog.setInitialDirectory(new File("beispielgraphen")); + } + finally{ + try{if(in != null) in.close();} catch(IOException e) {} + showTitle(); + } + + } + + public void saveAktConfig() { + PrintWriter pWriter = null; + String s = "config.csv"; + try { + pWriter = new PrintWriter(new FileWriter(s)); + pWriter.println(stage.isFullScreen()+","+stage.isMaximized()); + stage.setFullScreen(false); + stage.setMaximized(false); + pWriter.println(stage.getX()+","+stage.getY()+","+stage.getWidth()+","+ stage.getHeight()); + pWriter.println(pfad); + } catch (IOException ioe) { + ioe.printStackTrace(); + } finally { + if (pWriter != null) { + pWriter.flush(); + pWriter.close(); + } + } + } + + private void changeTab(Tab tabOld, Tab tabNew) { + if(tpRekursionen.getTabs().indexOf(tabNew)1) tpRekursionen.getTabs().remove(1); + + TabMitController tc = (TabMitController) (tpRekursionen.getTabs().get(0)); + + graph = new Graph(); + options = new GraphOptions(graph); + tc.setGraph(graph, options); + pfad = ""; + + showTitle(); + menuChangeAnsicht(); + } + + void schliesseTabs() { + while(tpRekursionen.getTabs().size()>1) { + TabMitController tc = (TabMitController) (tpRekursionen.getTabs().get(1)); + if(tc instanceof SimulationTabMitController) { + ((SimulationTabMitController) tc).showHilfe(false); + } + tpRekursionen.getTabs().remove(1); + } + } + + @FXML + void mBearbeiten(MouseEvent event) { + + try { // try-catch ist notwendig, um Fehler durch fehlende Dateien abzufangen. + schliesseTabs(); + EditTabMitController newtab = new EditTabMitController(graph, options); + newtab.setText("Bearbeiten"); + tpRekursionen.getTabs().add(newtab); + FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/edittab.fxml")); + loader.setController(newtab); + newtab.setContent((Node) loader.load()); + tpRekursionen.getSelectionModel().select(newtab); + } + catch(Exception e) { + //System.out.println(e); + } + } + + @FXML + void mSimuliere(MouseEvent event) { + + try { // try-catch ist notwendig, um Fehler durch fehlende Dateien abzufangen. + schliesseTabs(); + + SimulationTabMitController newtab = new SimulationTabMitController(graph, options); + newtab.setText("Algorithmen-Simulation"); + tpRekursionen.getTabs().add(newtab); + FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/simulationstab.fxml")); + loader.setController(newtab); + newtab.setContent((Node) loader.load()); + tpRekursionen.getSelectionModel().select(newtab); + } + catch(Exception e) { + // System.out.println(e); + } + } + + @FXML + void mExperimentiereKanten(ActionEvent event) { + schliesseTabs(); + + GraphOptions neu = options.copy(); + neu.bildAnzeigen = false; + neu.auswahl = 0; + neu.fokusArt = 1; + neu.parent = null; + // neu.markiert = Auswahl.BELIEBIG; + // neu.geloescht = Auswahl.BELIEBIG; + // neu.besucht = Auswahl.BELIEBIG; + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.tabOeffnen(neu); + } + + @FXML + void mExperimentiereKnoten(ActionEvent event) { + schliesseTabs(); + + GraphOptions neu = options.copy(); + neu.bildAnzeigen = false; + neu.auswahl = 0; + neu.fokusArt = 0; + neu.parent = null; + if(neu.farbenKanten[0].equals("invisible")) neu.farbenKanten[0]="808080"; + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.tabOeffnen(neu); + } + + @FXML + void mExperimentiereAuswahl(ActionEvent event) { + schliesseTabs(); + + GraphOptions neu = options.copy(); + neu.bildAnzeigen = false; + neu.auswahl = 2; + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + + if(tc.viewer.getSelectedKnoten() != null) { + neu.fokusArt = 0; // Knoten + neu.parent = tc.viewer.getSelectedKnoten(); + tc.tabOeffnen(neu); + + } else { + if(tc.viewer.getSelectedKante() != null) { + neu.fokusArt = 1; //Kante + neu.parent = tc.viewer.getSelectedKante(); + tc.tabOeffnen(neu); + + } + } + } + + @FXML + public void mBeenden(ActionEvent event) { + saveAktConfig(); + schliesseTabs(); + ((Stage)tpRekursionen.getScene().getWindow()).close(); + System.exit(0); + } + + void menuChangeAnsicht() { + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + GraphOptions options = tc.getGraphOptions(); + mOptionBild.setSelected(options.bildAnzeigen); + mOptionKantengewichte.setSelected(options.showEdgeWeights); + mOptionKnotenname.setSelected(options.showVertexText); + mOptionKnotenwerte.setSelected(options.showVertexValue); + mOptionKnoteninfo.setSelected(options.showVertexInfo); + + mmSpeichern.setDisable(!tc.getText().equals("Bearbeiten")); + /* mmBearbeiten.setDisabled(!tc.getText().equals("Graph")); + mmExperimentieren.setVisible(tc.getText().equals("Graph")); + mmSimulieren.setVisible(tc.getText().equals("Graph")); + mmZuruecksetzen.setVisible(!tc.getText().equals("Bearbeiten")); + */ + mmAnsicht.setDisable(tc.getText().equals("Bearbeiten")); + if(tc.getText().equals("Algorithmen-Simulation")) { + mHilfefenster.setDisable(false); + } else + { + mHilfefenster.setSelected(false); + mHilfefenster.setDisable(true); + } + + } + + @FXML + void mChangeOptionBild(ActionEvent event) { + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + GraphOptions options = tc.getGraphOptions(); + options.bildAnzeigen = mOptionBild.isSelected(); + tc.update(); + } + + @FXML + void mChangeOptionKantengewichte(ActionEvent event) { + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + GraphOptions options = tc.getGraphOptions(); + options.showEdgeWeights = mOptionKantengewichte.isSelected(); + tc.update(); + } + + @FXML + void mChangeOptionKnoteninfo(ActionEvent event) { + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + GraphOptions options = tc.getGraphOptions(); + options.showVertexInfo = mOptionKnoteninfo.isSelected(); + tc.update(); + } + + @FXML + void mChangeOptionKnotenname(ActionEvent event) { + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + GraphOptions options = tc.getGraphOptions(); + options.showVertexText = mOptionKnotenname.isSelected(); + if(options.showVertexText) { + options.showVertexValue = false; + mOptionKnotenwerte.setSelected(false); + } + tc.update(); + } + + @FXML + void mChangeOptionKnotenwerte(ActionEvent event) { + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + GraphOptions options = tc.getGraphOptions(); + options.showVertexValue = mOptionKnotenwerte.isSelected(); + if(options.showVertexValue) { + options.showVertexText = false; + mOptionKnotenname.setSelected(false); + } + tc.update(); + } + + @FXML + void mChangeHilfefenster(ActionEvent event) { + TabMitController tc = (TabMitController) (tpRekursionen.getTabs().get(tpRekursionen.getTabs().size()-1)); + if(tc instanceof SimulationTabMitController) { + ((SimulationTabMitController) tc).showHilfe(mHilfefenster.isSelected()); + } + } + + @FXML + void mOeffnen(ActionEvent event) { + dateidialog.getExtensionFilters().clear(); + dateidialog.getExtensionFilters().add(new ExtensionFilter("Graph-Datei (*.csv)", "*.csv")); + + File file = dateidialog.showOpenDialog(null); + if (file != null) { + graphLaden(file.getAbsolutePath()); + dateidialog.setInitialDirectory(file.getAbsoluteFile().getParentFile()); + } + } + + void graphLaden(String p) { + + while(tpRekursionen.getTabs().size()>2) tpRekursionen.getTabs().remove(1); + TabMitController tc = (TabMitController) (tpRekursionen.getTabs().get(0)); + + File f = new File(p); + if(f.exists() ){ + pfad = p; + + Table csvParser = new Table(pfad,"",',','"'); + + graph = new Graph(); + graph.ladeGraph(csvParser); + + options = new GraphOptions(graph); + options.ladeGraph(csvParser); + + tc.setGraph(graph, options); + + if(tpRekursionen.getTabs().size()>1){ + tc = (TabMitController) (tpRekursionen.getTabs().get(1)); + tc.setGraph(graph, options); + } + } + + menuChangeAnsicht(); + showTitle(); + + } + + public void showTitle() { + + if(stage!=null) { + if(pfad == null || pfad.equals("")) { + stage.setTitle("GraphTester by Thomas Schaller - Version "+version); + } else { + String[] arr = pfad.split("[/\\\\]"); + String dateiname = arr[arr.length-1]; + stage.setTitle("GraphTester by Thomas Schaller - Version "+version+" - "+dateiname); + } + } + + } + + @FXML + void mSchliessen(ActionEvent event) { + mNeuerGraph(event); + } + + @FXML + void mSpeichern(ActionEvent event) { + dateidialog.getExtensionFilters().clear(); + dateidialog.getExtensionFilters().add(new ExtensionFilter("Graph-Datei (*.csv)", "*.csv")); + if(!pfad.isBlank()) + dateidialog.setInitialFileName(new File(pfad).getName()); + else + dateidialog.setInitialFileName(""); + + File file = dateidialog.showSaveDialog(null); + if (file != null) { + try{ + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + GraphOptions options = tc.getGraphOptions(); + String text = options.getText(); + text += "#\n# Graph:\n"; + text +=graph.toCSVString(options.saveAsMatrix); + String dateiName = file.getAbsolutePath(); + String name = dateiName.substring(dateiName.lastIndexOf("\\")+1); + if(name.contains(".")) dateiName = dateiName.substring(0, dateiName.lastIndexOf(".")); + Files.write(Paths.get(file.getAbsolutePath()), text.getBytes()); + pfad = file.getAbsolutePath(); + dateidialog.setInitialDirectory(file.getAbsoluteFile().getParentFile()); + showTitle(); + } catch(Exception e) { + + } + } + + } + + @FXML + void mBildExportieren(ActionEvent event) { + dateidialog.getExtensionFilters().clear(); + dateidialog.getExtensionFilters().add(new ExtensionFilter("Bild des Graphen", "*.png","*.gif")); + File file = dateidialog.showSaveDialog(null); + if (file != null) { + try{ + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + Picture p = tc.getViewer().updateImage(); + String dateiName = file.getAbsolutePath(); + p.save(dateiName); + + } catch(Exception e) { + + } + } + } + + @FXML + void mUeber(ActionEvent event) { + Alert alert = new Alert(AlertType.INFORMATION); + alert.setTitle("Graphtester"); + alert.setHeaderText(null); + alert.setContentText("Mit diesem Programm können Sie Graphen modellieren, Graphenalgorithmen von Hand durchspielen oder implementierte Algorithmen schrittweise ausführen.\n\n"+ + "Version: "+version+"\nThomas Schaller\nLandesfachgruppe Informatik (ZSL BW)\n"+ + "Lizenz: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/deed.de)\n\n"+ + "3rd Party:\n CommonsIO.jar, csv.jar, JDom.jar\n Lizenzinfo: siehe Ordner '+libs'" ); + Image icon = new Image("view/icon.png"); + Stage stage = (Stage) alert.getDialogPane().getScene().getWindow(); + stage.getIcons().add(icon); + alert.showAndWait(); + } + + @FXML + void mResetAlles(ActionEvent event) { + graph.initialisiereAlleKanten(); + graph.initialisiereAlleKnoten(); + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.update(); + } + + @FXML + void mResetBesucht(ActionEvent event) { + for(Knoten k : graph.getAlleKnoten()) { + k.setBesucht(false); + } + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.update(); + } + + @FXML + void mResetFarbe(ActionEvent event) { + for(Knoten k : graph.getAlleKnoten()) { + k.setFarbeAutomatisch(true); + } + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.update(); + } + + @FXML + void mResetGeloescht(ActionEvent event) { + for(Kante k : graph.getAlleKanten()) { + k.setGeloescht(false); + } + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.update(); + + } + + @FXML + void mResetKantenmarkierung(ActionEvent event) { + for(Kante k : graph.getAlleKanten()) { + k.setMarkiert(false); + } + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.update(); + + } + + @FXML + void mResetMarkierung(ActionEvent event) { + for(Knoten k : graph.getAlleKnoten()) { + k.setMarkiert(false); + } + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.update(); + + } + + @FXML + void mResetWert(ActionEvent event) { + for(Knoten k : graph.getAlleKnoten()) { + k.setWert(0.0); + } + TabMitController tc = (TabMitController) (tpRekursionen.getSelectionModel().getSelectedItem()); + tc.update(); + + } + +} diff --git a/Quellcodes/alg_ds_graphentester/control/EditTabMitController.java b/Quellcodes/alg_ds_graphentester/control/EditTabMitController.java new file mode 100644 index 0000000..1ebd2c5 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/EditTabMitController.java @@ -0,0 +1,274 @@ +package control; + +import imp.*; +import graph.*; + +import javafx.fxml.*; +import javafx.scene.control.*; +import javafx.event.*; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.*; +import javafx.scene.Node; +import javafx.scene.text.*; +import javafx.geometry.Pos; +import javafx.stage.*; // Dateiöffnen / Speichern-Dialog +import java.io.File; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; + +import java.util.List; +import javafx.collections.ObservableList; +import java.util.Optional; + +/** + * Die Klasse EditTabMitController stellt einen Tab inclusive ihres Controllers + * zur Editierung eines Graphs dar. + * + * @author Thomas Schaller + * @version 03.03.2023 (v7.1) + * v7.1: Aktualisierung der Anzeige bei Wechsel gewichtet/ungewichtet angepasst + * v6.9: Context-Menü schließt, wenn an andere Stelle geklickt wird + */ + +public class EditTabMitController extends TabMitController { + + public EditTabMitController(Graph graph, GraphOptions options) { + this.graph = graph; + this.options = options; + + } + + @FXML + private CheckBox cbGerichtet; + + @FXML + private CheckBox cbGewichtet; + + @FXML + private RadioButton rLeer; + + @FXML + private ToggleGroup tgKnoten; + + @FXML + private RadioButton rNummer; + + @FXML + private RadioButton rWert; + + @FXML + private CheckBox cbInfotext; + + @FXML + private Label lBildname; + + @FXML + private RadioButton rbMatrix; + + @FXML + private ToggleGroup tgMatrixListe; + + @FXML + private RadioButton rbListe; + + @FXML + private Slider sGroesse; + + private FileChooser dateidialog; + + public void initialize() { + + dateidialog = new FileChooser(); + dateidialog.setInitialDirectory(new File("images")); + + options.showEdgeWeights = graph.isGewichtet(); + options.bildAnzeigen = true; + options.showVertexInfo = true; + + viewer.setGraph(graph,options); + viewer.setEditable(); + + cbGerichtet.setSelected(graph.isGerichtet()); + cbGewichtet.setSelected(graph.isGewichtet()); + cbInfotext.setSelected(options.showVertexInfo); + + tgKnoten.selectToggle(rLeer); + if(options.showVertexValue) { tgKnoten.selectToggle(rWert); } + if(options.showVertexText) { tgKnoten.selectToggle(rNummer); } + + cbGerichtet.selectedProperty().addListener((cb, oldValue, newValue) -> setGerichtet(newValue)); + cbGewichtet.selectedProperty().addListener((cb, oldValue, newValue) -> setGewichtet(newValue)); + cbInfotext.selectedProperty().addListener((cb, oldValue, newValue) -> setInfotext(newValue)); + tgKnoten.selectedToggleProperty().addListener((tg, oldValue, newValue) -> setKnotenTyp(newValue)); + if(options.saveAsMatrix) + tgMatrixListe.selectToggle(rbMatrix); + else + tgMatrixListe.selectToggle(rbListe); + + tgMatrixListe.selectedToggleProperty().addListener((tg, oldValue, newValue) -> options.saveAsMatrix = (newValue == rbMatrix)); + lBildname.setText(options.bildDatei); + super.initialize(); + + // this.setOnSelectionChanged(e -> {if(!this.isSelected()) this.getTabPane().getTabs().remove(this);}); + sGroesse.valueProperty().addListener((s,oldValue,newValue) -> sGroesseAendern(newValue)); + + } + + void sGroesseAendern(Number size) { + options.vertexSize = size.intValue(); + update(); + } + + void setGerichtet(boolean gerichtet) { + graph.setGerichtet(gerichtet); + update(); + } + + void setGewichtet(boolean gewichtet) { + graph.setGewichtet(gewichtet); + options.showEdgeWeights = gewichtet; + if(graph.isGewichtet()) { + options.kanteKurztext = new String[]{"Gewicht"}; + options.kanteLangtext = new String[]{"Gewicht","Markiert","Gelöscht"}; + } else { + options.kanteKurztext = new String[]{}; + options.kanteLangtext = new String[]{"Markiert","Gelöscht"}; + } + update(); + } + + void setInfotext(boolean anzeigen) { + options.showVertexInfo = anzeigen; + update(); + } + + void setKnotenTyp(Toggle t) { + if(t == rWert) { options.showVertexValue = true; options.showVertexText = false;} + if(t == rNummer) { options.showVertexValue = false; options.showVertexText = true;} + if(t == rLeer) { options.showVertexValue = false; options.showVertexText = false;} + + update(); + } + + @FXML + void bBildLaden(ActionEvent event) { + String workingDir = System.getProperty("user.dir"); + File file = dateidialog.showOpenDialog(null); + if (file != null) { + try{ + Files.copy( file.toPath(), (new File(workingDir+"\\images\\"+file.getName())).toPath(), StandardCopyOption.REPLACE_EXISTING); + options.bildDatei = file.getName(); + lBildname.setText(options.bildDatei); + update(); + } catch( Exception e) { + System.out.println("Fehler beim Kopieren des Bildes"); + } + } + } + + @FXML + void bBildLoeschen(ActionEvent event) { + options.bildDatei = ""; + lBildname.setText(options.bildDatei); + update(); + } + + @FXML + void bDistanzenBestimmen(ActionEvent event) { + for(Kante k: graph.getAlleKanten()) { + Knoten s = k.getStart(); + Knoten z = k.getZiel(); + k.setGewicht(Math.round(Math.sqrt((s.getX()-z.getX())*(s.getX()-z.getX())+ + (s.getY()-z.getY())*(s.getY()-z.getY())))); + } + update(); + } + + @FXML + void graphClicked(MouseEvent event) { // MousePressed-Event + viewer.mouseClicked(event); + viewer.mouseDown(event); + if((viewer.getSelectedKnoten() != null || viewer.getSelectedKante() != null) && event.isSecondaryButtonDown()) { // Contextmenu + ContextMenu contextMenu = new ContextMenu(); + MenuItem item1 = new MenuItem("Löschen"); + item1.setOnAction(e -> this.mLoesche()); + MenuItem item2 = new MenuItem("Gewicht ändern..."); + item2.setOnAction(e -> this.mWertAendern()); + MenuItem item3 = new MenuItem("Infotext ändern..."); + item3.setOnAction(e -> this.mInfotextAendern()); + + // Add MenuItem to ContextMenu + contextMenu.getItems().clear(); + contextMenu.getItems().add(item1); + + if(viewer.getSelectedKante()!=null && graph.isGewichtet()) + contextMenu.getItems().add(item2); + if (viewer.getSelectedKnoten() != null) + contextMenu.getItems().add( item3 ); + + getViewer().setContextMenu(contextMenu); + //contextMenu.show(viewer, event.getScreenX(), event.getScreenY()); + } + } + + public void mLoesche() { + viewer.setContextMenu(null); + if(viewer.getSelectedKnoten() != null) { + graph.entferneKnoten(viewer.getSelectedKnoten()); + update(); + } + if(viewer.getSelectedKante() != null) { + graph.entferneKante(viewer.getSelectedKante()); + update(); + } + } + + public void mWertAendern() { + viewer.setContextMenu(null); + + Knoten k = viewer.getSelectedKnoten(); + Kante ka = viewer.getSelectedKante(); + if(k != null || ka !=null) { + double v; + if(k != null) v = k.getDoubleWert(); + else v = ka.getGewicht(); + TextInputDialog dialog = new TextInputDialog(""+v); + dialog.setHeaderText(null); + dialog.setTitle("Wert ändern"); + dialog.setContentText("Bitte geben Sie den neuen Wert ein:"); + + Optional result = dialog.showAndWait(); + if (result.isPresent()){ + try{ + v = Double.parseDouble(result.get()); + if(k != null) k.setWert(v); + else ka.setGewicht(v); + update(); + } catch (Exception e) { + System.out.println("Keine Zahl eingegeben"); + } + } + } + } + + public void mInfotextAendern() { + viewer.setContextMenu(null); + + Knoten k = viewer.getSelectedKnoten(); + if(k != null ) { + TextInputDialog dialog = new TextInputDialog(k.getInfotext()); + dialog.setHeaderText(null); + dialog.setTitle("Infotext ändern"); + dialog.setContentText("Bitte geben Sie den Infotext ein:"); + + Optional result = dialog.showAndWait(); + if (result.isPresent()){ + String t = result.get(); + t.replaceAll(",",""); + k.setInfotext(t); + update(); + } + } + } + +} diff --git a/Quellcodes/alg_ds_graphentester/control/HauptTabMitController.java b/Quellcodes/alg_ds_graphentester/control/HauptTabMitController.java new file mode 100644 index 0000000..83fa56d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/HauptTabMitController.java @@ -0,0 +1,56 @@ +package control; + +import imp.*; +import graph.*; +import algorithmen.*; + +import javafx.fxml.*; +import javafx.scene.control.*; +import javafx.event.*; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.*; +import javafx.scene.Node; +import javafx.scene.Scene; +import javafx.scene.text.*; +import javafx.geometry.Pos; +import javafx.scene.image.Image; +import javafx.stage.*; // Dateiöffnen / Speichern-Dialog +import java.io.File; + +import java.util.List; +import java.util.regex.Pattern; + +import javafx.collections.ObservableList; + +/** + * Die Klasse HauptTabMitController stellt einen Tab inclusive ihres Controllers + * für das Hauptfenster des Graphentesters dar. Einzelne Knoten oder Kanten können + * selektiert werden. + * + * @author Thomas Schaller + * @version v6.7 (9.12.2020) + */ + +public class HauptTabMitController extends TabMitController { + + + + public HauptTabMitController(Graph graph, GraphOptions options) { + this.graph = graph; + this.options = options; + setClosable(false); + } + + public void initialize() { + + super.initialize(); + + + } + + + + + + +} diff --git a/Quellcodes/alg_ds_graphentester/control/Hilfefenster.java b/Quellcodes/alg_ds_graphentester/control/Hilfefenster.java new file mode 100644 index 0000000..b2f2340 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/Hilfefenster.java @@ -0,0 +1,176 @@ +package control; + +import javafx.fxml.FXML; +import javafx.scene.control.TextArea; +import javafx.scene.control.TreeView; +import javafx.scene.control.TreeItem; +import javafx.scene.input.MouseEvent; +import javafx.event.ActionEvent; +import javafx.scene.input.Clipboard; +import javafx.scene.input.ClipboardContent; +import java.util.List; +import java.util.ArrayList; +import javafx.stage.*; +import java.util.ConcurrentModificationException; +import javafx.application.Platform; + +import graph.*; + +/** + * Die Klasse Hilfefenster stellt ein Hilfefenster für die Simulation eines + * Algorithmus bereit. + * + * @author Thomas Schaller + * @version v6.7 (9.12.2020) + */ + +public class Hilfefenster extends Stage implements Hilfe{ + + @FXML + private TreeView tvAblauf; + + private List> stufen; + private List> zustaende; + private TreeItem last; + private GraphPlotter gp; + private List aktuell; + private boolean reviewAllowed; + + public void initialize() { + loescheAlles(); + zustaende = new ArrayList>(); + aktuell = null; + reviewAllowed = false; + tvAblauf.getSelectionModel().selectedIndexProperty().addListener((obs,oldValue, newValue)->showState()); + } + + public void setGraphPlotter(GraphPlotter gp) { + this.gp = gp; + } + + public void loescheAlles() { + Platform.runLater(new Runnable() { + @Override + public void run() { + stufen = new ArrayList>(); + zustaende = new ArrayList>(); + TreeItem root = new TreeItem("Algorithmus"); + root.setExpanded(true); + last = root; + tvAblauf.setRoot(root); + tvAblauf.setShowRoot(false); + stufen.add(root); + } + }); + + } + + public void append(String text) { + List status = gp.getGraph().getStatus(); + Platform.runLater(new Runnable() { + @Override + public void run() { + last = new TreeItem(text); + stufen.get(stufen.size()-1).getChildren().add(last); + zustaende.add(status); + } + }); + + } + + public void indentMore() { + Platform.runLater(new Runnable() { + @Override + public void run() { + if(stufen.size() == 1) { // Hauptknoten + TreeItem parent = stufen.get(0); + List children = parent.getChildren(); + for(int i=children.size()-1; i >= 0; i--) { + TreeItem t = children.get(i); + if(t.isExpanded()) { + t.setExpanded(false); + break; + } + } + } + stufen.add(last); + last.setExpanded(true); + last.expandedProperty().addListener((b, o, n) -> showState()); + } + }); + + } + + public void indentLess() { + Platform.runLater(new Runnable() { + @Override + public void run() { + if(stufen.size() > 1) stufen.remove(stufen.size()-1); + } + }); + } + + public void setReviewAllowed(boolean a) { + this.reviewAllowed = a; + if(!reviewAllowed) tvAblauf.getSelectionModel().clearSelection(); + } + + public void showState() { + Platform.runLater(new Runnable() { + @Override + public void run() { + if(reviewAllowed && tvAblauf.getSelectionModel().getSelectedIndex()>=0) { + TreeItem s = tvAblauf.getSelectionModel().getSelectedItem(); + if(!s.isExpanded()) { // suche das letzte Kind + while(s.getChildren().size()>0){ + List c = s.getChildren(); + s = c.get(c.size()-1); + } + } + gp.getGraph().setStatus(zustaende.get(calculateIndex(tvAblauf.getRoot(), s ,0)-1)); + gp.updateImage(); + } + } + }); + + } + + private int calculateIndex(TreeItem t, TreeItem search, int nr) { + if(t == search) return nr; + nr++; + List children = t.getChildren(); + for(TreeItem c : children) { + int i = calculateIndex(c, search, nr); + if(i>0) return i; + nr = -i; + } + return -nr; + } + + @FXML + void bCopyClicked(ActionEvent event) { + final Clipboard clipboard = Clipboard.getSystemClipboard(); + final ClipboardContent content = new ClipboardContent(); + String s = ""; + for(Object c : tvAblauf.getRoot().getChildren()) { + if(c instanceof TreeItem) { + s += generateClipboardContent((TreeItem) c, ""); + } + } + + content.putString(s); + + clipboard.setContent(content); + } + + private String generateClipboardContent(TreeItem t, String tab) { + String s = tab+t.getValue(); + for(Object c : t.getChildren()) { + if(c instanceof TreeItem) { + s += generateClipboardContent((TreeItem) c, tab+" "); + } + } + return s; + } + +} diff --git a/Quellcodes/alg_ds_graphentester/control/MyClassLoader.java b/Quellcodes/alg_ds_graphentester/control/MyClassLoader.java new file mode 100644 index 0000000..d8c19e5 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/MyClassLoader.java @@ -0,0 +1,53 @@ +package control; + +import java.io.*; +import java.net.*; +import java.util.regex.Pattern; + +/** + * Hilfsklasse, um Algorithmen-Classen dynamisch nachladen zu können und + * aktualisierte Class-Dateien während der Laufzeit erneut laden zu können. + * + * @author Schaller (nach http://tutorials.jenkov.com/java-reflection/dynamic-class-loading-reloading.html) + * @version 16.02.2021 + */ +public class MyClassLoader extends ClassLoader{ + + public MyClassLoader(ClassLoader parent) { + super(parent); + } + + public Class loadClass(String name) throws ClassNotFoundException { + if(!name.contains("GraphAlgo_")) + return super.loadClass(name); + + try { + + + URL myUrl = new URL("file:"+name.split(Pattern.quote("."))[0]+"/"+name.split(Pattern.quote("."))[1]+".class"); + URLConnection connection = myUrl.openConnection(); + InputStream input = connection.getInputStream(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + int data = input.read(); + + while(data != -1){ + buffer.write(data); + data = input.read(); + } + + input.close(); + + byte[] classData = buffer.toByteArray(); + + return defineClass(name, classData, 0, classData.length); + + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + return null; + } + +} \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/control/SimulationTabMitController.java b/Quellcodes/alg_ds_graphentester/control/SimulationTabMitController.java new file mode 100644 index 0000000..76f2786 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/SimulationTabMitController.java @@ -0,0 +1,434 @@ +package control; + +import imp.*; +import graph.*; +import algorithmen.*; + +import javafx.fxml.*; +import javafx.scene.control.*; +import javafx.event.*; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.*; +import javafx.scene.Node; +import javafx.scene.Scene; +import javafx.scene.text.*; +import javafx.geometry.Pos; +import javafx.scene.image.Image; +import javafx.stage.*; // Dateiöffnen / Speichern-Dialog +import javafx.application.Platform; +import javafx.scene.input.Clipboard; +import javafx.scene.input.ClipboardContent; +import java.io.File; +import java.net.URI; +import java.net.URL; +import java.net.URLDecoder; +import java.nio.file.*; +import java.util.Collections; +import java.util.stream.Stream; +import java.util.Iterator; +import java.util.List; + +import java.util.ArrayList; +import java.util.regex.Pattern; +import java.lang.reflect.InvocationTargetException; + +import javafx.collections.ObservableList; + +/** + * Die Klasse SimulationTabMitController stellt einen Tab inclusive ihres Controllers + * zur Simulation eines Algorithmus dar. Der Algorithmus kann ausgewählt und schrittweise + * durchgeführt werden. + * + * @author Thomas Schaller + * @version 03.03.2023 (v7.0) + * v7.1: Fehler bei Aktualisierung des Hilfefensters behoben, Splitpane statt HBox + * v7.0: Mechanismus geändert, so dass die init-Methode des Algorithmus beim Wechesel eines Algorithmus + * aufgerufen wird, um die für diesen Algorithmus passenden Anzeigeeinstellungen zu setzen. + * v6.9: Hilfefenster ist in Simulationsfenster integriert + */ +public class SimulationTabMitController extends TabMitController implements Hilfe { + + @FXML + private ComboBox cbAlgorithmen; + + @FXML + private Slider sSpeed; + + @FXML + private Button bStep; + + @FXML + private Button bStart; + + @FXML + private Button bBreak; + + @FXML + private Button bReset; + + private GraphAlgo aktAlgo = null; + private ArrayList algoNamen; + private Hilfe hilfe; + + public SimulationTabMitController(Graph graph, GraphOptions options) { + this.graph = graph; + this.options = options; + + } + + public void initialize() { + this.algoNamen = new ArrayList(); + + File verzeichnis = new File("algorithmen"); + if(verzeichnis != null && verzeichnis.isDirectory()) { + String[] entries = verzeichnis.list(); + for (String name : entries) { + if (name.startsWith("GraphAlgo_") && name.endsWith(".class")){ + try{ + Class c = Class.forName("algorithmen."+name.split(Pattern.quote("."))[0]); + GraphAlgo a = ((GraphAlgo)(c).getDeclaredConstructor().newInstance()); + int i = 0; + while(i < cbAlgorithmen.getItems().size() && cbAlgorithmen.getItems().get(i).compareTo(a.getBezeichnung())<0) + i++; + //System.out.println("Algorithmus: "+a.getBezeichnung()+" geladen."); + cbAlgorithmen.getItems().add(i, a.getBezeichnung()); + + algoNamen.add(i, "algorithmen."+name.split(Pattern.quote("."))[0]); + } + catch(ExceptionInInitializerError e) {} + catch(LinkageError e){} + catch(ClassNotFoundException e) {} + catch(NoSuchMethodException e) {} + catch(InstantiationException e) {} + catch(IllegalAccessException e) {} + catch(InvocationTargetException e) {} + + } + } // end of for + } + verzeichnis = new File( "eigeneAlgorithmen" ); + if(verzeichnis != null && verzeichnis.isDirectory()) { + String[] entries = verzeichnis.list(); + for (String name : entries) { + if (name.startsWith("GraphAlgo_") && name.endsWith(".class")){ + try{ + Class c = Class.forName("eigeneAlgorithmen."+name.split(Pattern.quote("."))[0]); + GraphAlgo a = ((GraphAlgo)(c).getDeclaredConstructor().newInstance()); + int i = 0; + while(i < cbAlgorithmen.getItems().size() && cbAlgorithmen.getItems().get(i).compareTo(a.getBezeichnung())<0) + i++; + //System.out.println("Algorithmus: "+a.getBezeichnung()+" geladen."); + cbAlgorithmen.getItems().add(i, a.getBezeichnung()); + + algoNamen.add(i, "eigeneAlgorithmen."+name.split(Pattern.quote("."))[0]); + } + catch(ExceptionInInitializerError e) {} + catch(LinkageError e){} + catch(ClassNotFoundException e) {} + catch(NoSuchMethodException e) {} + catch(InstantiationException e) {} + catch(IllegalAccessException e) {} + catch(InvocationTargetException e) {} + + } + } // end of for + } + + cbAlgorithmen.getSelectionModel().selectedItemProperty().addListener((options, oldValue, newValue) -> { + changeAlgorithm(); + }); + + viewer.setGraph(graph,options); + this.hilfe = null; + this.aktAlgo = null; + super.initialize(); + + sSpeed.valueProperty().addListener(e -> { if (aktAlgo != null) aktAlgo.setSpeed(910-(int) (sSpeed.getValue()));}); + bStart.managedProperty().bind(bStart.visibleProperty()); + bBreak.managedProperty().bind(bBreak.visibleProperty()); + bBreak.setVisible(false); + + //------------- Hilfefunktion + loescheAlles(); + zustaende = new ArrayList>(); + aktuell = null; + reviewAllowed = false; + tvAblauf.getSelectionModel().selectedIndexProperty().addListener((obs,oldValue, newValue)->showState()); + + } + + public void showHilfe(boolean b) { + if(b) { + lAblauf.setVisible(true); + tvAblauf.setVisible(true); + bClipboard.setVisible(true); + + hilfe = this; + if(aktAlgo != null ) { + aktAlgo.setGUIElemente(viewer,hilfe); + if(aktAlgo.isAlive()) + hilfe.append("Unvollständiger Ablauf"); + } + } + else { + lAblauf.setVisible(false); + tvAblauf.setVisible(false); + bClipboard.setVisible(false); + if(aktAlgo != null && aktAlgo.isAlive()) aktAlgo.setGUIElemente(viewer, null); + hilfe = null; + loescheAlles(); + zustaende = new ArrayList>(); + aktuell = null; + reviewAllowed = false; + } + } + + public void setGraph(Graph graph, GraphOptions options) { + super.setGraph(graph,options); + mReset(null); + } + + public void changeAlgorithm() { + if(aktAlgo != null && aktAlgo.isAlive()) aktAlgo.stop(); + graph.initialisiereAlleKnoten(); + graph.initialisiereAlleKanten(); + + bStep.setDisable(false); + bStart.setDisable(false); + bStart.setVisible(true); + bBreak.setVisible(false); + if (hilfe != null) hilfe.loescheAlles(); + this.aktAlgo = null; + + if(cbAlgorithmen.getSelectionModel().getSelectedIndex() >= 0) { + + try{ + ClassLoader parentClassLoader = MyClassLoader.class.getClassLoader(); + MyClassLoader classLoader = new MyClassLoader(parentClassLoader); + Class c = classLoader.loadClass(algoNamen.get(cbAlgorithmen.getSelectionModel().getSelectedIndex())); + + aktAlgo = ((GraphAlgo)(c).getDeclaredConstructor().newInstance()); + aktAlgo.setStartKnoten(viewer.getSelectedKnoten()); + aktAlgo.setGUIElemente(viewer, hilfe); + aktAlgo.setSpeed(910-(int) (sSpeed.getValue())); + aktAlgo.init(); + } catch( Exception e) { + System.out.println(e); + } + } + + update(); + + } + + @FXML + void mReset(ActionEvent event) { + + changeAlgorithm(); + } + + @FXML + void mStep(ActionEvent event) { + if (aktAlgo == null) return; + if (aktAlgo.getState() == Thread.State.NEW ) { + aktAlgo.setStartKnoten(viewer.getSelectedKnoten()); + aktAlgo.start(); + } else { + if(aktAlgo.isAlive()) { + aktAlgo.setSpeed(910-(int) (sSpeed.getValue())); + aktAlgo.setWaitforclick(false); + } else { + bStep.setDisable(true); + bStart.setDisable(true); + bBreak.setDisable(true); + } // end of if-else + } // end of if-else + try{ + Thread.sleep(100); + } catch(Exception e) {} + + if (!aktAlgo.isAlive()) { + bStep.setDisable(true); + bStart.setDisable(true); + bBreak.setDisable(true); + } + } + + @FXML + void mStart(ActionEvent event) { + if (aktAlgo == null) return; + if (aktAlgo.getState() == Thread.State.NEW ) { + aktAlgo.setStartKnoten(viewer.getSelectedKnoten()); + aktAlgo.setStepping(false); + aktAlgo.start(); + } else { + if(aktAlgo.isAlive()) { + aktAlgo.setSpeed(910-(int) (sSpeed.getValue())); + aktAlgo.setStepping(false); + aktAlgo.setWaitforclick(false); + } + } // end of if-else + + bStep.setDisable(true); + bStart.setVisible(false); + bBreak.setVisible(true); + bBreak.setDisable(false); + + } + + public void mBreak(ActionEvent event) { + if(aktAlgo != null && aktAlgo.isAlive()) { + aktAlgo.setStepping(true); + bStart.setVisible(true); + bBreak.setVisible(false); + bStep.setDisable(false); + } + } + + // --------- Hilfefenster -------------------------------------------- + @FXML + private TreeView tvAblauf; + + @FXML + private Label lAblauf; + + @FXML + private Button bClipboard; + + private List> stufen; + private List> zustaende; + private TreeItem last; + private GraphPlotter gp; + private List aktuell; + private boolean reviewAllowed; + + public void setGraphPlotter(GraphPlotter gp) { + this.gp = gp; + } + + public void loescheAlles() { + Platform.runLater(new Runnable() { + @Override + public void run() { + stufen = new ArrayList>(); + zustaende = new ArrayList>(); + TreeItem root = new TreeItem("Algorithmus"); + root.setExpanded(true); + last = root; + tvAblauf.setRoot(root); + tvAblauf.setShowRoot(false); + stufen.add(root); + } + }); + + } + + public void append(String text) { + List status = gp.getGraph().getStatus(); + Platform.runLater(new Runnable() { + @Override + public void run() { + last = new TreeItem(text); + stufen.get(stufen.size()-1).getChildren().add(last); + zustaende.add(status); + } + }); + + } + + public void indentMore() { + Platform.runLater(new Runnable() { + @Override + public void run() { + if(stufen.size() == 1) { // Hauptknoten + TreeItem parent = stufen.get(0); + List children = parent.getChildren(); + for(int i=children.size()-1; i >= 0; i--) { + TreeItem t = children.get(i); + if(t.isExpanded()) { + t.setExpanded(false); + break; + } + } + } + stufen.add(last); + last.setExpanded(true); + last.expandedProperty().addListener((b, o, n) -> showState()); + } + }); + + } + + public void indentLess() { + Platform.runLater(new Runnable() { + @Override + public void run() { + if(stufen.size() > 1) stufen.remove(stufen.size()-1); + } + }); + } + + public void setReviewAllowed(boolean a) { + this.reviewAllowed = a; + if(!reviewAllowed) tvAblauf.getSelectionModel().clearSelection(); + } + + public void showState() { + Platform.runLater(new Runnable() { + @Override + public void run() { + if(reviewAllowed && tvAblauf.getSelectionModel().getSelectedIndex()>=0) { + TreeItem s = tvAblauf.getSelectionModel().getSelectedItem(); + if(!s.isExpanded()) { // suche das letzte Kind + while(s.getChildren().size()>0){ + List c = s.getChildren(); + s = c.get(c.size()-1); + } + } + gp.getGraph().setStatus(zustaende.get(calculateIndex(tvAblauf.getRoot(), s ,0)-1)); + gp.updateImage(); + } + } + }); + + } + + private int calculateIndex(TreeItem t, TreeItem search, int nr) { + if(t == search) return nr; + nr++; + List children = t.getChildren(); + for(TreeItem c : children) { + int i = calculateIndex(c, search, nr); + if(i>0) return i; + nr = -i; + } + return -nr; + } + + @FXML + void bCopyClicked(ActionEvent event) { + final Clipboard clipboard = Clipboard.getSystemClipboard(); + final ClipboardContent content = new ClipboardContent(); + String s = ""; + for(Object c : tvAblauf.getRoot().getChildren()) { + if(c instanceof TreeItem) { + s += generateClipboardContent((TreeItem) c, ""); + } + } + + content.putString(s); + + clipboard.setContent(content); + } + + private String generateClipboardContent(TreeItem t, String tab) { + String s = tab+t.getValue(); + for(Object c : t.getChildren()) { + if(c instanceof TreeItem) { + s += generateClipboardContent((TreeItem) c, tab+" "); + } + } + return s; + } + +} diff --git a/Quellcodes/alg_ds_graphentester/control/TabMitController.java b/Quellcodes/alg_ds_graphentester/control/TabMitController.java new file mode 100644 index 0000000..ed65a38 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/TabMitController.java @@ -0,0 +1,79 @@ +package control; + +import imp.*; +import graph.*; + +import javafx.fxml.*; +import javafx.scene.control.*; +import javafx.event.*; +import javafx.scene.layout.*; +import javafx.scene.Node; +import javafx.scene.text.*; +import javafx.geometry.Pos; +import javafx.stage.*; // Dateiöffnen / Speichern-Dialog +import java.io.File; + +import java.util.List; +import javafx.collections.ObservableList; +/** + * Die Klasse TabMitController stellt die Oberklasse für alle Tabs des Graphentesters + * dar. + * + * @author Thomas Schaller + * @version v6.7 (9.12.2020) + */ + +public class TabMitController extends Tab { + + protected Graph graph; + protected GraphOptions options; + + @FXML + protected GraphPlotter viewer; + + + public void initialize() { + + + /* viewer.setHvalue(0.5); + viewer.setVvalue(0.5);*/ + + } + + protected void tabOeffnen(GraphOptions taboptions) { + try { // try-catch ist notwendig, um Fehler durch fehlende Dateien abzufangen. + + UnterTabMitController newtab = new UnterTabMitController(graph, taboptions); + newtab.setText("Teilgraph"); + getTabPane().getTabs().add(newtab); + FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/graphtab.fxml")); + loader.setController(newtab); + newtab.setContent((Node) loader.load()); + getTabPane().getSelectionModel().select(newtab); + + } + catch(Exception e) { + System.out.println(e); + } + } + + public GraphOptions getGraphOptions() { + return options; + } + + public void update() { + viewer.updateImage(); + } + + public void setGraph(Graph graph, GraphOptions options) { + this.graph = graph; + this.options = options; + if (viewer != null) viewer.setGraph(graph,options); + update(); + } + + public GraphPlotter getViewer() { + return viewer; + } + +} diff --git a/Quellcodes/alg_ds_graphentester/control/UnterTabMitController.java b/Quellcodes/alg_ds_graphentester/control/UnterTabMitController.java new file mode 100644 index 0000000..1066f12 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/UnterTabMitController.java @@ -0,0 +1,609 @@ +package control; + +import imp.*; +import graph.*; + +import javafx.fxml.*; +import javafx.scene.control.*; +import javafx.event.*; +import javafx.scene.input.MouseEvent; +import javafx.scene.input.ContextMenuEvent; +import javafx.scene.layout.*; +import javafx.scene.Node; +import javafx.scene.text.*; +import javafx.geometry.Pos; +import javafx.collections.FXCollections; +import javafx.scene.control.Alert.AlertType; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Optional; +import javafx.collections.ObservableList; + +/** + * Die Klasse UnterTabMitController stellt einen Tab inclusive ihres Controllers + * zur händischen Erforschung eines Algorithmus. Es wird immer ein einzelner Knoten + * oder eine Kante fokussiert. + * + * @author Thomas Schaller + * @version 24.06.2021 (v6.9) + * v6.9: Context-Menü für die ToDo-Liste: Knoten löschen + */ + +public class UnterTabMitController extends TabMitController { + + @FXML + private VBox infoBox; + + @FXML + private Button wertButton; + + @FXML + private Button besuchtButton; + + @FXML + private Label knotenname; + + @FXML + private Label knotenwert; + + @FXML + private Label knotenMarkiert; + + @FXML + private Label knotenBesucht; + + @FXML + private GridPane farben; + + @FXML + Button bStatus; + + @FXML + Button bGehezu; + + @FXML + Button bAnfang; + + @FXML + Button bEnde; + + @FXML + Button bSortieren; + + @FXML + private CheckBox cbFarbeAutomatisch; + + @FXML + private ListView lvAuswahl; + + private List auswahl; + private List sicherung; + + public UnterTabMitController(Graph graph, GraphOptions options) { + this.graph = graph; + this.options = options; + + } + + public void initialize() { + if(graph.getAnzahlKnoten()==0) { + getTabPane().getTabs().remove(this); + return; + } + + buildAuswahl(); + + this.bAnfang.managedProperty().bind(bAnfang.visibleProperty()); + this.bEnde.managedProperty().bind(bEnde.visibleProperty()); + this.bSortieren.managedProperty().bind(bSortieren.visibleProperty()); + + viewer.setGraph(graph,options); + viewer.setHvalue(0.5); + viewer.setVvalue(0.5); + //auswahl = viewer.getGraph().getAlleKnoten(); + + for(int x = 0; x< 4; x++) { + for(int y = 0; y <3; y++) { + Label l = new Label(); + l.setPrefSize(20,20); + l.setMaxSize(200, 200); + if(options.farbenKnoten.length > y*4+x) { + l.setStyle("-fx-background-color:#"+options.farbenKnoten[y*4+x]); + l.setAlignment(Pos.CENTER); + l.setFont(Font.font("System", FontWeight.BOLD, 12)); + } + else + l.setStyle("-fx-background-color:#FFFFFF"); + + l.setOnMouseClicked(e -> knotenFarbe(e)); + farben.add(l, x, y); + } + } + + fillLvAuswahl(); + lvAuswahl.getSelectionModel().selectedItemProperty().addListener( + (obs, oldValue, newValue) -> showAuswahl()); + + cbFarbeAutomatisch.selectedProperty().addListener((o, oldValue, newValue) -> { + Knoten k = viewer.getSelectedKnoten(); + if (k!=null) { + k.setFarbeAutomatisch(newValue); + viewer.updateImage(); + updateInfofeld(); + } + }); + + super.initialize(); + } + + public void setGraph(Graph graph, GraphOptions options) { + if(graph.getAnzahlKnoten()==0) { + getTabPane().getTabs().remove(this); + return; + } + options.fokusArt = this.options.fokusArt; + options.auswahl = this.options.auswahl; + options.bildAnzeigen = false; + if(options.fokusArt == 0 && this.options.parent!= null) options.parent = graph.getKnoten(0); + if(options.fokusArt == 1 && this.options.parent!= null) options.parent = graph.getKante(0,1); + this.graph = graph; + this.options = options; + viewer.setRestrictTo(null); + buildAuswahl(); + super.setGraph(graph,options); + + } + + public void buildAuswahl() { + auswahl = new ArrayList(); + if(options.auswahl == 0) { // Alle Knoten/Kanten gewählt + if(options.fokusArt == 0) // Knoten + auswahl = new ArrayList(graph.getAlleKnoten()); + else + auswahl = new ArrayList(graph.getAlleKanten()); + } else { + if(options.auswahl == 1) { // Nachbarn + auswahl = new ArrayList(graph.getNachbarknoten(((Knoten) (options.parent)))); + } else { // single + auswahl.add(options.parent); + } + } + if(auswahl.size() == 0) getTabPane().getTabs().remove(this); + } + + public void update() { + super.update(); + updateInfofeld(); + fillLvAuswahl(); + } + + private void fillLvAuswahl() { + if(auswahl.size()==0 ) { + getTabPane().getTabs().remove(this); + } else { + ObservableList items = FXCollections.observableArrayList (); + for(GraphElement ge : auswahl) { + if(ge instanceof Knoten) { + Knoten k = (Knoten) ge; + String beschreibung=""; + if(options.showVertexInfo && !k.getInfotext().isEmpty()) + beschreibung = k.getInfotext(); + else + beschreibung = "Knoten"+ graph.getNummer(k); + + if(options.showVertexValue) { + if(k.getDoubleWert() == k.getIntWert()) + beschreibung += " ("+k.getIntWert()+")"; + else + beschreibung += " ("+k.getDoubleWert()+")"; + } + items.add(beschreibung); + } + if(ge instanceof Kante) { + Kante k = (Kante) ge; + if(options.showEdgeWeights) { + if(k.getGewicht() == (int) k.getGewicht()) + items.add("Kante ("+((int)k.getGewicht())+")"); + else + items.add("Kante ("+k.getGewicht()+")"); + } + else + items.add("Kante Nr."+graph.getNummer(k)); + } + + } + lvAuswahl.setItems(items); + showAuswahl(); + } + } + + private void showAuswahl() { + if(lvAuswahl.getSelectionModel().getSelectedIndex()==-1) { + if(auswahl.contains(viewer.getRestrictTo())) { + lvAuswahl.getSelectionModel().select(auswahl.indexOf(viewer.getRestrictTo())); + } else { + lvAuswahl.getSelectionModel().selectFirst(); + } + } + viewer.setRestrictTo(auswahl.get(lvAuswahl.getSelectionModel().getSelectedIndex())); + updateInfofeld(); + } + + public void setAuswahl(List auswahl) { + this.auswahl = auswahl; + fillLvAuswahl(); + } + + @FXML + void bAnfang(ActionEvent event) { + if(lvAuswahl.getSelectionModel().getSelectedIndex() > 0) { + + lvAuswahl.getSelectionModel().selectFirst(); + showAuswahl(); + } + } + + @FXML + void bBesucht(ActionEvent event) { + Knoten k = viewer.getSelectedKnoten(); + if (k!=null) { + k.setBesucht(!k.isBesucht()); + viewer.updateImage(); + updateInfofeld(); + }else { + Kante ka = viewer.getSelectedKante(); + if(ka!=null) { + ka.setGeloescht(!ka.isGeloescht()); + viewer.updateImage(); + updateInfofeld(); + } + } + } + + @FXML + void bEnde(ActionEvent event) { + if(lvAuswahl.getSelectionModel().getSelectedIndex() < lvAuswahl.getItems().size()-1) { + lvAuswahl.getSelectionModel().selectLast(); + showAuswahl(); + } + } + + @FXML + void knotenFarbe(MouseEvent event) { + + Node source = (Node) event.getSource(); + Integer colIndex = farben.getColumnIndex(source); + Integer rowIndex = farben.getRowIndex(source); + Knoten k = viewer.getSelectedKnoten(); + if (k!=null) { + k.setFarbe(rowIndex*4+colIndex); + ObservableList ln = farben.getChildren(); + for(Node n : ln) { + if(n instanceof Label) + if(n == source){ + ((Label) n).setText("X"); + } + else + ((Label) n).setText(" "); + } + viewer.updateImage(); + updateInfofeld(); + } + + } + + @FXML + void bMarkieren(ActionEvent event) { + Knoten k = viewer.getSelectedKnoten(); + if (k!=null) { + k.setMarkiert(!k.isMarkiert()); + viewer.updateImage(); + updateInfofeld(); + } else { + Kante ka = viewer.getSelectedKante(); + if(ka!=null) { + ka.setMarkiert(!ka.isMarkiert()); + viewer.updateImage(); + updateInfofeld(); + } + } + + } + + public void updateInfofeld() { + GraphElement f = viewer.getRestrictTo(); + if( f instanceof Knoten) { + this.setText(viewer.getGraph().getKnoteninfo((Knoten) f, false)); + } + Knoten k = viewer.getSelectedKnoten(); + Kante ka = viewer.getSelectedKante(); + + if(k!=null) { + infoBox.setVisible(true); + knotenname.setText("Knoten: "+viewer.getGraph().getNummer(k)); + knotenwert.setText("Wert: "+k.getDoubleWert()); + knotenMarkiert.setText(k.isMarkiert() ? "markiert" : "unmarkiert"); + knotenBesucht.setText(k.isBesucht() ? "besucht" : "nicht besucht"); + besuchtButton.setText("Besuchen"); + wertButton.setVisible(true); + farben.setVisible(true); + bGehezu.setVisible(k != viewer.getRestrictTo()); + bAnfang.setVisible(k != viewer.getRestrictTo()); + bEnde.setVisible(k != viewer.getRestrictTo()); + bSortieren.setVisible((options.showEdgeWeights && auswahl.get(0) instanceof Kante) || (options.showVertexValue && auswahl.get(0) instanceof Knoten)); + cbFarbeAutomatisch.setSelected(k.isFarbeAutomatisch()); + ObservableList ln = farben.getChildren(); + for(Node n : ln) { + if(n instanceof Label){ + Integer colIndex = farben.getColumnIndex(n); + Integer rowIndex = farben.getRowIndex(n); + if(rowIndex*4+colIndex == k.getFarbe()){ + ((Label) n).setText("X"); + } + else + ((Label) n).setText(" "); + } + + } + } else { + if(ka != null) { + infoBox.setVisible(true); + knotenname.setText("Kante:"); + knotenwert.setText("Gewicht: "+ka.getGewicht()); + knotenMarkiert.setText(ka.isMarkiert() ? "markiert" : "unmarkiert"); + knotenBesucht.setText(ka.isGeloescht() ? "gelöscht" : "nicht gelöscht"); + besuchtButton.setText("Löschen"); + wertButton.setVisible(false); + farben.setVisible(false); + } + else + infoBox.setVisible(false); + } + + } + + @FXML + void graphClicked(MouseEvent event) { + viewer.mouseClicked(event); + updateInfofeld(); + if(viewer.getSelectedKnoten() != null && event.isSecondaryButtonDown()) { // Contextmenu + ContextMenu contextMenu = new ContextMenu(); + CheckMenuItem item1 = new CheckMenuItem("Markiert"); + item1.setSelected(viewer.getSelectedKnoten().isMarkiert()); + item1.setOnAction((e) -> this.bMarkieren(e)); + CheckMenuItem item2 = new CheckMenuItem("Besucht"); + item2.setOnAction((e) -> this.bBesucht(e)); + item2.setSelected(viewer.getSelectedKnoten().isBesucht()); + MenuItem item3 = new MenuItem("Wert ändern"); + item3.setOnAction((e) -> this.bWertAendern(e)); + MenuItem item5 = new MenuItem("Füge am Anfang der ToDo-Liste hinzu"); + item5.setOnAction((e) -> this.bHinzufuegenAnfang(e)); + MenuItem item6 = new MenuItem("Füge am Ende der ToDo-Liste hinzu"); + item6.setOnAction((e) -> this.bHinzufuegenEnde(e)); + MenuItem item7 = new MenuItem("Loesche aus Liste"); + item7.setOnAction((e) -> this.bLoeschenAusListe(e)); + SeparatorMenuItem sep = new SeparatorMenuItem(); + SeparatorMenuItem sep2 = new SeparatorMenuItem(); + MenuItem item4 = new MenuItem("Gehe zu ..."); + item4.setOnAction((e) -> this.bGeheZu(e)); + + // Add MenuItem to ContextMenu + contextMenu.getItems().addAll(item3, item1, item2, sep, item5, item6, item7, sep2, item4); + contextMenu.show(viewer, event.getScreenX(), event.getScreenY()); + } + if(viewer.getSelectedKante() != null && event.isSecondaryButtonDown()) { // Contextmenu + ContextMenu contextMenu = new ContextMenu(); + CheckMenuItem item1 = new CheckMenuItem("Markiert"); + item1.setSelected(viewer.getSelectedKante().isMarkiert()); + item1.setOnAction((e) -> this.bMarkieren(e)); + CheckMenuItem item2 = new CheckMenuItem("Gelöscht"); + item2.setSelected(viewer.getSelectedKante().isGeloescht()); + item2.setOnAction((e) -> this.bBesucht(e)); + SeparatorMenuItem sep = new SeparatorMenuItem(); + MenuItem item4 = new MenuItem("Gehe zu ..."); + item4.setOnAction((e) -> this.bGeheZu(e)); + + // Add MenuItem to ContextMenu + contextMenu.getItems().addAll( item1, item2, sep, item4); + contextMenu.show(viewer, event.getScreenX(), event.getScreenY()); + } + } + + @FXML + void bHinzufuegenAnfang(ActionEvent event) { + Knoten k = viewer.getSelectedKnoten(); + if(k!=null) { + auswahl.add(0,k); + fillLvAuswahl(); + } + } + + @FXML + void bHinzufuegenEnde(ActionEvent event) { + Knoten k = viewer.getSelectedKnoten(); + if(k!=null) { + auswahl.add(k); + fillLvAuswahl(); + } + } + + @FXML + void bLoeschenAusListe(ActionEvent event) { + Knoten k = viewer.getSelectedKnoten(); + if(k!=null && auswahl.contains(k)) { + auswahl.remove(k); + fillLvAuswahl(); + } + } + + @FXML + void toDoContextMenu(ContextMenuEvent event) { + if(lvAuswahl.getSelectionModel().getSelectedIndex() >= 0) { + + Alert alert = + new Alert(AlertType.NONE, + "Soll der Knoten aus der ToDo-Liste gelöscht werden?", + ButtonType.OK, + ButtonType.CANCEL); + alert.setTitle("ToDo-Liste"); + Optional result = alert.showAndWait(); + + if (result.get() == ButtonType.OK) { + auswahl.remove(lvAuswahl.getSelectionModel().getSelectedIndex()); + fillLvAuswahl(); + } + } + } + + @FXML + void bNaechster(ActionEvent event) { + + if(lvAuswahl.getSelectionModel().isSelected(auswahl.size()-1)) + lvAuswahl.getSelectionModel().selectFirst(); + else + lvAuswahl.getSelectionModel().selectNext(); + showAuswahl(); + } + + // @FXML + // void bListeAnpassen(ActionEvent event) { + // buildAuswahl(); + // fillLvAuswahl(); + + // } + + // @FXML + // void bNeuerTab(ActionEvent event) { + // GraphOptions neu = options.copy(); + // neu.parent = viewer.getRestrictTo(); + // if(neu.parent == null) neu.parent = viewer.getSelectedKnoten(); + // neu.bildAnzeigen = false; + // tabOeffnen(neu); + // } + + @FXML + void bSort(ActionEvent event) { + Collections.sort(auswahl); + fillLvAuswahl(); + } + + @FXML + void bVoheriger(ActionEvent event) { + if(lvAuswahl.getSelectionModel().isSelected(0)) + lvAuswahl.getSelectionModel().selectLast(); + else + lvAuswahl.getSelectionModel().selectPrevious(); + + showAuswahl(); + } + + @FXML + void bWertAendern(ActionEvent event) { + Knoten k = viewer.getSelectedKnoten(); + if (k!=null) { + TextInputDialog dialog = new TextInputDialog(""+k.getDoubleWert()); + dialog.setTitle("Wert ändern"); + dialog.setContentText("Bitte geben Sie den neuen Wert ein:"); + + Optional result = dialog.showAndWait(); + if (result.isPresent()){ + try{ + double v = Double.parseDouble(result.get()); + k.setWert(v); + this.fillLvAuswahl(); + + viewer.updateImage(); + updateInfofeld(); + } catch (Exception e) { + System.out.println("Keine Zahl eingegeben"); + } + } + + } + } + + @FXML + void bGeheZu(ActionEvent event) { + Knoten k = viewer.getSelectedKnoten(); + if (k!=null) { + GraphOptions neu = options.copy(); + neu.auswahl = 2; // single + neu.parent = k; + neu.bildAnzeigen = false; + this.tabOeffnen(neu); + } + } + + @FXML + void mBeenden(ActionEvent event) { + + } + + @FXML + void mBesucheKnoten(ActionEvent event) { + + } + + @FXML + void mBesuchtLoeschen(ActionEvent event) { + + } + + @FXML + void mFaerbeKnoten(ActionEvent event) { + + } + + @FXML + void mMarkiereKnoten(ActionEvent event) { + + } + + @FXML + void mMarkierungenLoeschen(ActionEvent event) { + + } + + @FXML + void mOeffnen(ActionEvent event) { + + } + + @FXML + void mSchliessen(ActionEvent event) { + + } + + @FXML + void mSpeichern(ActionEvent event) { + + } + + @FXML + void mUeber(ActionEvent event) { + + } + + @FXML + void mWertSetzen(ActionEvent event) { + + } + + @FXML + void mZurueck(ActionEvent event) { + + } + + @FXML + void bStatusRestore(ActionEvent event) { + if(sicherung != null) { graph.setStatus(sicherung); update(); } + } + + @FXML + void bStatusSave(ActionEvent event) { + sicherung = graph.getStatus(); + bStatus.setDisable(false); + } +} diff --git a/Quellcodes/alg_ds_graphentester/control/package.bluej b/Quellcodes/alg_ds_graphentester/control/package.bluej new file mode 100644 index 0000000..236b10f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/control/package.bluej @@ -0,0 +1,94 @@ +#BlueJ package file +dependency1.from=TabMitController +dependency1.to=UnterTabMitController +dependency1.type=UsesDependency +dependency2.from=SimulationTabMitController +dependency2.to=MyClassLoader +dependency2.type=UsesDependency +dependency3.from=Controller +dependency3.to=TabMitController +dependency3.type=UsesDependency +dependency4.from=Controller +dependency4.to=HauptTabMitController +dependency4.type=UsesDependency +dependency5.from=Controller +dependency5.to=SimulationTabMitController +dependency5.type=UsesDependency +dependency6.from=Controller +dependency6.to=EditTabMitController +dependency6.type=UsesDependency +objectbench.height=66 +objectbench.width=776 +package.divider.horizontal=0.599476439790576 +package.divider.vertical=0.8537074148296593 +package.editor.height=419 +package.editor.width=640 +package.editor.x=577 +package.editor.y=358 +package.frame.height=600 +package.frame.width=800 +package.numDependencies=6 +package.numTargets=8 +package.showExtends=true +package.showUses=true +readme.height=60 +readme.name=@README +readme.width=49 +readme.x=10 +readme.y=10 +target1.height=50 +target1.name=HauptTabMitController +target1.showInterface=false +target1.type=ClassTarget +target1.width=200 +target1.x=10 +target1.y=140 +target2.height=50 +target2.name=EditTabMitController +target2.showInterface=false +target2.type=ClassTarget +target2.width=180 +target2.x=10 +target2.y=80 +target3.height=70 +target3.name=Hilfefenster +target3.showInterface=false +target3.type=ClassTarget +target3.width=120 +target3.x=10 +target3.y=210 +target4.height=50 +target4.name=TabMitController +target4.showInterface=false +target4.type=ClassTarget +target4.width=140 +target4.x=300 +target4.y=110 +target5.height=50 +target5.name=SimulationTabMitController +target5.showInterface=false +target5.type=ClassTarget +target5.width=210 +target5.x=210 +target5.y=210 +target6.height=50 +target6.name=Controller +target6.showInterface=false +target6.type=ClassTarget +target6.width=90 +target6.x=500 +target6.y=250 +target7.height=70 +target7.name=MyClassLoader +target7.showInterface=false +target7.type=ClassTarget +target7.width=120 +target7.x=140 +target7.y=330 +target8.height=50 +target8.name=UnterTabMitController +target8.showInterface=false +target8.type=ClassTarget +target8.width=180 +target8.x=220 +target8.y=270 diff --git a/Quellcodes/alg_ds_graphentester/doc/GraphenTester.html b/Quellcodes/alg_ds_graphentester/doc/GraphenTester.html new file mode 100644 index 0000000..e2ed1f2 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/GraphenTester.html @@ -0,0 +1,366 @@ + + + + + +GraphenTester (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+

Class GraphenTester

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javafx.application.Application
    • +
    • +
        +
      • GraphenTester
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    public class GraphenTester
    +extends javafx.application.Application
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javafx.application.Application

        +javafx.application.Application.Parameters
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javafx.application.Application

        +STYLESHEET_CASPIAN, STYLESHEET_MODENA
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      GraphenTester() 
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphenTester

        +
        public GraphenTester()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start​(javafx.stage.Stage primaryStage)
        +
        +
        Specified by:
        +
        start in class javafx.application.Application
        +
        +
      • +
      + + + +
        +
      • +

        main

        +
        public static void main​(String[] args)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo.html new file mode 100644 index 0000000..67c2938 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo.html @@ -0,0 +1,669 @@ + + + + + +GraphAlgo (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo

+
+
+ + +
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        inArbeit

        +
        protected boolean inArbeit
        +
      • +
      + + + +
        +
      • +

        g

        +
        protected Graph g
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo

        +
        public GraphAlgo()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setGUIElemente

        +
        public void setGUIElemente​(GraphPlotter graphPlotter,
        +                           Hilfe hilfe)
        +
      • +
      + + + +
        +
      • +

        setGraph

        +
        public void setGraph​(Graph g)
        +
      • +
      + + + +
        +
      • +

        step

        +
        public void step()
        +
      • +
      + + + +
        +
      • +

        getWaitforrepaint

        +
        public boolean getWaitforrepaint()
        +
      • +
      + + + +
        +
      • +

        setWaitforrepaint

        +
        public void setWaitforrepaint​(boolean waitforrepaintNeu)
        +
      • +
      + + + +
        +
      • +

        getWaitforclick

        +
        public boolean getWaitforclick()
        +
      • +
      + + + +
        +
      • +

        setWaitforclick

        +
        public void setWaitforclick​(boolean waitforclickNeu)
        +
      • +
      + + + +
        +
      • +

        setStepping

        +
        public void setStepping​(boolean stepping)
        +
      • +
      + + + +
        +
      • +

        setSpeed

        +
        public void setSpeed​(int delay)
        +
      • +
      + + + +
        +
      • +

        run

        +
        public void run()
        +
        +
        Specified by:
        +
        run in interface Runnable
        +
        Overrides:
        +
        run in class Thread
        +
        +
      • +
      + + + +
        +
      • +

        setStartKnoten

        +
        public void setStartKnoten​(Knoten k)
        +
      • +
      + + + +
        +
      • +

        getStartKnoten

        +
        public Knoten getStartKnoten()
        +
      • +
      + + + +
        +
      • +

        fuehreAlgorithmusAus

        +
        public abstract void fuehreAlgorithmusAus()
        +
      • +
      + + + +
        +
      • +

        getBezeichnung

        +
        public abstract String getBezeichnung()
        +
      • +
      + + + +
        +
      • +

        melde

        +
        public void melde​(String s)
        +
      • +
      + + + +
        +
      • +

        info

        +
        public void info​(String s)
        +
      • +
      + + + +
        +
      • +

        resetInfo

        +
        public void resetInfo()
        +
      • +
      + + + +
        +
      • +

        infoIndentMore

        +
        public void infoIndentMore()
        +
      • +
      + + + +
        +
      • +

        infoIndentLess

        +
        public void infoIndentLess()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_BellmanFord.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_BellmanFord.html new file mode 100644 index 0000000..2e200da --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_BellmanFord.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_BellmanFord (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_BellmanFord

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_BellmanFord
    +extends GraphAlgo
    +
    Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen. + Algorithmus: Bellman-Ford
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_BellmanFord

        +
        public GraphAlgo_BellmanFord()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Breitensuche.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Breitensuche.html new file mode 100644 index 0000000..6f65af1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Breitensuche.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_Breitensuche (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_Breitensuche

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_Breitensuche
    +extends GraphAlgo
    +
    Dieser Algorithmus nummeriert alle Knoten des Graphen. + Algorithmus: Breitensuche mit ToDo-Liste (Schlange)
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_Breitensuche

        +
        public GraphAlgo_Breitensuche()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringBacktracking.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringBacktracking.html new file mode 100644 index 0000000..3cdb909 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringBacktracking.html @@ -0,0 +1,449 @@ + + + + + +GraphAlgo_ColoringBacktracking (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_ColoringBacktracking

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_ColoringBacktracking
    +extends GraphAlgo
    +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden. + Algorithmus: Backtracking
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_ColoringBacktracking

        +
        public GraphAlgo_ColoringBacktracking()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringGreedy.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringGreedy.html new file mode 100644 index 0000000..5e9c1bd --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringGreedy.html @@ -0,0 +1,403 @@ + + + + + +GraphAlgo_ColoringGreedy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_ColoringGreedy

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_ColoringGreedy
    +extends GraphAlgo
    +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden. + Algorithmus: Näherungslösung mit Greedy-Algorithmus
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_ColoringGreedy

        +
        public GraphAlgo_ColoringGreedy()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringGreedyRandom.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringGreedyRandom.html new file mode 100644 index 0000000..9c059a1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ColoringGreedyRandom.html @@ -0,0 +1,403 @@ + + + + + +GraphAlgo_ColoringGreedyRandom (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_ColoringGreedyRandom

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_ColoringGreedyRandom
    +extends GraphAlgo
    +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden. + Algorithmus: Näherungslösung mit Greedy-Algorithmus (Knotenreihenfolge zufällig)
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_ColoringGreedyRandom

        +
        public GraphAlgo_ColoringGreedyRandom()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Dijkstra.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Dijkstra.html new file mode 100644 index 0000000..34dc7f8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Dijkstra.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_Dijkstra (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_Dijkstra

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_Dijkstra
    +extends GraphAlgo
    +
    Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen. + Algorithmus: Dijkstra
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_Dijkstra

        +
        public GraphAlgo_Dijkstra()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetBacktracking.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetBacktracking.html new file mode 100644 index 0000000..5ebaa0a --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetBacktracking.html @@ -0,0 +1,449 @@ + + + + + +GraphAlgo_DominatingSetBacktracking (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetBacktracking

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetBacktracking
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Backtracking
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetBacktracking

        +
        public GraphAlgo_DominatingSetBacktracking()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGenetisch.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGenetisch.html new file mode 100644 index 0000000..94be725 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGenetisch.html @@ -0,0 +1,475 @@ + + + + + +GraphAlgo_DominatingSetGenetisch (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGenetisch

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGenetisch
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Genetischer Algorithmus
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGenetisch

        +
        public GraphAlgo_DominatingSetGenetisch()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        erzeugeZufaelligeTeilmenge

        +
        public int[] erzeugeZufaelligeTeilmenge()
        +
      • +
      + + + +
        +
      • +

        kreuze

        +
        public int[] kreuze​(int[] tm1,
        +                    int[] tm2)
        +
      • +
      + + + +
        +
      • +

        mutiere

        +
        public int[] mutiere​(int[] tm)
        +
      • +
      + + + +
        +
      • +

        showTeilmenge

        +
        public void showTeilmenge​(int[] tm)
        +
      • +
      + + + +
        +
      • +

        getBewertung

        +
        public double getBewertung​(int[] tm)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyA.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyA.html new file mode 100644 index 0000000..2f94ceb --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyA.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyA (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyA

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyA
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + Nimm den Knoten mit den meisten Nachbarn
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyA

        +
        public GraphAlgo_DominatingSetGreedyA()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyB.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyB.html new file mode 100644 index 0000000..8342da5 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyB.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyB (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyB

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyB
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + Nimm den Knoten mit den wenigsten Nachbarn
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyB

        +
        public GraphAlgo_DominatingSetGreedyB()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyC.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyC.html new file mode 100644 index 0000000..de8d5d1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyC.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyC (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyC

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyC
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + Nimm den Knoten mit den meisten Nachbarn
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyC

        +
        public GraphAlgo_DominatingSetGreedyC()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyD.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyD.html new file mode 100644 index 0000000..0d71a72 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyD.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyD (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyD

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyD
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + Nimm den Knoten mit den meisten Nachbarn
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyD

        +
        public GraphAlgo_DominatingSetGreedyD()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyE.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyE.html new file mode 100644 index 0000000..cb8adb0 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyE.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyE (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyE

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyE
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyE

        +
        public GraphAlgo_DominatingSetGreedyE()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyF.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyF.html new file mode 100644 index 0000000..6dca650 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyF.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyF (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyF

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyF
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyF

        +
        public GraphAlgo_DominatingSetGreedyF()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyG.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyG.html new file mode 100644 index 0000000..ba0c5e0 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyG.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyG (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyG

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyG
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + ein nicht abgedeckten Knoten, der von einem beliebigen schon ausgewählten Knoten die Entfernung 3 hat
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyG

        +
        public GraphAlgo_DominatingSetGreedyG()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyH.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyH.html new file mode 100644 index 0000000..8635149 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyH.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyH (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyH

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyH
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + ein nicht abgedeckten Knoten, der von möglichst vielen schon ausgewählten Knoten die Entfernung 3 hat
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyH

        +
        public GraphAlgo_DominatingSetGreedyH()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyI.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyI.html new file mode 100644 index 0000000..f691c00 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_DominatingSetGreedyI.html @@ -0,0 +1,404 @@ + + + + + +GraphAlgo_DominatingSetGreedyI (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_DominatingSetGreedyI

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_DominatingSetGreedyI
    +extends GraphAlgo
    +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf. + Algorithmus: Greedy mit Strategie: + ein nicht abgedeckten Knoten, der von den ausgewählten Knoten eine möglichst große Entfernung hat
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_DominatingSetGreedyI

        +
        public GraphAlgo_DominatingSetGreedyI()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_EulerkreisExistenz.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_EulerkreisExistenz.html new file mode 100644 index 0000000..83b7717 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_EulerkreisExistenz.html @@ -0,0 +1,403 @@ + + + + + +GraphAlgo_EulerkreisExistenz (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_EulerkreisExistenz

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_EulerkreisExistenz
    +extends GraphAlgo
    +
    Dieser Algorithmus testet, ob ein Eulerkreis existiert. + Algorithmus: Zunächst wird auf geraden Grad der Knoten getestet, danach + mit Tiefensuche der Zusammenhang des Graphen überprüft.
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_EulerkreisExistenz

        +
        public GraphAlgo_EulerkreisExistenz()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_MST_Kruskal.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_MST_Kruskal.html new file mode 100644 index 0000000..e9432a2 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_MST_Kruskal.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_MST_Kruskal (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_MST_Kruskal

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_MST_Kruskal
    +extends GraphAlgo
    +
    Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Kruskal
    +
    +
    Version:
    +
    1.0 from 11.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_MST_Kruskal

        +
        public GraphAlgo_MST_Kruskal()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_MST_Prim.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_MST_Prim.html new file mode 100644 index 0000000..6143d6f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_MST_Prim.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_MST_Prim (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_MST_Prim

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_MST_Prim
    +extends GraphAlgo
    +
    Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Prim
    +
    +
    Version:
    +
    1.0 from 11.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_MST_Prim

        +
        public GraphAlgo_MST_Prim()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Moore.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Moore.html new file mode 100644 index 0000000..26d635f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Moore.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_Moore (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_Moore

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_Moore
    +extends GraphAlgo
    +
    Dieser Algorithmus findet die kürzesten Pfade in einem ungewichteten Graphen. + Algorithmus: Algorithmus A von Moore
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_Moore

        +
        public GraphAlgo_Moore()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ScotlandYard.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ScotlandYard.html new file mode 100644 index 0000000..dc85a85 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ScotlandYard.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_ScotlandYard (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_ScotlandYard

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_ScotlandYard
    +extends GraphAlgo
    +
    Dieser Algorithmus findet die kürzesten Pfade in einem ungewichteten Graphen. + Algorithmus: Algorithmus A von Moore
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_ScotlandYard

        +
        public GraphAlgo_ScotlandYard()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPBacktracking.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPBacktracking.html new file mode 100644 index 0000000..93e2078 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPBacktracking.html @@ -0,0 +1,431 @@ + + + + + +GraphAlgo_TSPBacktracking (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_TSPBacktracking

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_TSPBacktracking
    +extends GraphAlgo
    +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem). + Algorithmus: Backtracking
    +
    +
    Version:
    +
    1.0 from 11.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_TSPBacktracking

        +
        public GraphAlgo_TSPBacktracking()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGenetisch.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGenetisch.html new file mode 100644 index 0000000..d5c16e4 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGenetisch.html @@ -0,0 +1,500 @@ + + + + + +GraphAlgo_TSPGenetisch (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_TSPGenetisch

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_TSPGenetisch
    +extends GraphAlgo
    +
    description
    +
    +
    Version:
    +
    1.0 from 26.04.2019
    +
    Author:
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_TSPGenetisch

        +
        public GraphAlgo_TSPGenetisch()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        erzeugeZufaelligeRundreise

        +
        public int[] erzeugeZufaelligeRundreise()
        +
      • +
      + + + +
        +
      • +

        kreuze

        +
        public int[] kreuze​(int[] rr1,
        +                    int[] rr2)
        +
      • +
      + + + +
        +
      • +

        mutiere

        +
        public int[] mutiere​(int[] rr)
        +
      • +
      + + + +
        +
      • +

        mutiere2

        +
        public int[] mutiere2​(int[] rr)
        +
      • +
      + + + +
        +
      • +

        showRundreise

        +
        public void showRundreise​(int[] rundreise)
        +
      • +
      + + + +
        +
      • +

        getLaenge

        +
        public double getLaenge​(int[] rundreise)
        +
      • +
      + + + +
        +
      • +

        getInfo

        +
        public String getInfo()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedy.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedy.html new file mode 100644 index 0000000..9a3d4cf --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedy.html @@ -0,0 +1,419 @@ + + + + + +GraphAlgo_TSPGreedy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_TSPGreedy

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_TSPGreedy
    +extends GraphAlgo
    +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem). + Algorithmus: Greedy + Strategie: Verlängere den Weg immer mit der kürzesten Kante, die vom aktuellen Ende der Route ausgeht. + vlg. Minimal Spanning Tree (Prim)
    +
    +
    Version:
    +
    1.0 from 11.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_TSPGreedy

        +
        public GraphAlgo_TSPGreedy()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedy2.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedy2.html new file mode 100644 index 0000000..e0a3a6a --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedy2.html @@ -0,0 +1,420 @@ + + + + + +GraphAlgo_TSPGreedy2 (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_TSPGreedy2

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_TSPGreedy2
    +extends GraphAlgo
    +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem). + Algorithmus: Greedy + Strategie: Sortiere Kanten der Länge nach. Füge sie der Reihe nach der Route hinzu, wenn nicht schon ein + Weg zwischen den beiden Knoten vorhanden ist und die Knoten nicht schon Grad zwei erreicht haben. + vgl. Minimal Spanning Tree (Kruskal)
    +
    +
    Version:
    +
    1.0 from 11.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_TSPGreedy2

        +
        public GraphAlgo_TSPGreedy2()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedyOpt.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedyOpt.html new file mode 100644 index 0000000..97d41a9 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TSPGreedyOpt.html @@ -0,0 +1,433 @@ + + + + + +GraphAlgo_TSPGreedyOpt (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_TSPGreedyOpt

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_TSPGreedyOpt
    +extends GraphAlgo
    +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem). + Algorithmus: Greedy mit anschließender Optimierung: + Jeder Knoten wird der Reihe nach aus der Rundreise entfernt und dort wieder eingefügt, wo die Rundreise + sich am wenigsten verlängert. Diese Optimierung wird 5x wiederholt.
    +
    +
    Version:
    +
    1.0 from 11.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_TSPGreedyOpt

        +
        public GraphAlgo_TSPGreedyOpt()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Tiefensuche.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Tiefensuche.html new file mode 100644 index 0000000..5325be8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_Tiefensuche.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_Tiefensuche (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_Tiefensuche

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_Tiefensuche
    +extends GraphAlgo
    +
    Dieser Algorithmus nummeriert alle Knoten des Graphen. + Algorithmus: Tiefensuche mit ToDo-Liste (Stapel)
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_Tiefensuche

        +
        public GraphAlgo_Tiefensuche()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TiefensucheRek.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TiefensucheRek.html new file mode 100644 index 0000000..5f63fb1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_TiefensucheRek.html @@ -0,0 +1,402 @@ + + + + + +GraphAlgo_TiefensucheRek (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_TiefensucheRek

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_TiefensucheRek
    +extends GraphAlgo
    +
    Dieser Algorithmus nummeriert alle Knoten des Graphen. + Algorithmus: Tiefensuche rekursiv
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_TiefensucheRek

        +
        public GraphAlgo_TiefensucheRek()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ZyklusBacktracking.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ZyklusBacktracking.html new file mode 100644 index 0000000..0b05140 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_ZyklusBacktracking.html @@ -0,0 +1,417 @@ + + + + + +GraphAlgo_ZyklusBacktracking (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_ZyklusBacktracking

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_ZyklusBacktracking
    +extends GraphAlgo
    +
    Dieser Algorithmus ist ein Beispiel für einen Backtracking-Algorithmus. + Er sucht einen Zyklus im Graphen. + Algorithmus: Backtracking
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_ZyklusBacktracking

        +
        public GraphAlgo_ZyklusBacktracking()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_toplogischeSortierung.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_toplogischeSortierung.html new file mode 100644 index 0000000..9a1f688 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/GraphAlgo_toplogischeSortierung.html @@ -0,0 +1,401 @@ + + + + + +GraphAlgo_toplogischeSortierung (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package algorithmen
+

Class GraphAlgo_toplogischeSortierung

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_toplogischeSortierung
    +extends GraphAlgo
    +
    Dieser Algorithmus findet eine topologische Sortierung des Graphen.
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_toplogischeSortierung

        +
        public GraphAlgo_toplogischeSortierung()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/package-summary.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/package-summary.html new file mode 100644 index 0000000..ee2685f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/package-summary.html @@ -0,0 +1,365 @@ + + + + + +algorithmen (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package algorithmen

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    GraphAlgo +
    description
    +
    GraphAlgo_BellmanFord +
    Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
    +
    GraphAlgo_Breitensuche +
    Dieser Algorithmus nummeriert alle Knoten des Graphen.
    +
    GraphAlgo_ColoringBacktracking +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    GraphAlgo_ColoringGreedy +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    GraphAlgo_ColoringGreedyRandom +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    GraphAlgo_Dijkstra +
    Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
    +
    GraphAlgo_DominatingSetBacktracking +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGenetisch +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyA +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyB +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyC +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyD +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyE +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyF +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyG +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyH +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyI +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_EulerkreisExistenz +
    Dieser Algorithmus testet, ob ein Eulerkreis existiert.
    +
    GraphAlgo_Moore +
    Dieser Algorithmus findet die kürzesten Pfade in einem ungewichteten Graphen.
    +
    GraphAlgo_MST_Kruskal +
    Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Kruskal
    +
    GraphAlgo_MST_Prim +
    Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Prim
    +
    GraphAlgo_Tiefensuche +
    Dieser Algorithmus nummeriert alle Knoten des Graphen.
    +
    GraphAlgo_TiefensucheRek +
    Dieser Algorithmus nummeriert alle Knoten des Graphen.
    +
    GraphAlgo_toplogischeSortierung +
    Dieser Algorithmus findet eine topologische Sortierung des Graphen.
    +
    GraphAlgo_TSPBacktracking +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_TSPGenetisch +
    description
    +
    GraphAlgo_TSPGreedy +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_TSPGreedy2 +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_TSPGreedyOpt +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_ZyklusBacktracking +
    Dieser Algorithmus ist ein Beispiel für einen Backtracking-Algorithmus.
    +
    +
  • +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/algorithmen/package-tree.html b/Quellcodes/alg_ds_graphentester/doc/algorithmen/package-tree.html new file mode 100644 index 0000000..ddc3748 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/algorithmen/package-tree.html @@ -0,0 +1,197 @@ + + + + + +algorithmen Class Hierarchy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package algorithmen

+Package Hierarchies: + +
+ +
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/allclasses-index.html b/Quellcodes/alg_ds_graphentester/doc/allclasses-index.html new file mode 100644 index 0000000..ca886f2 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/allclasses-index.html @@ -0,0 +1,504 @@ + + + + + +All Classes (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

All Classes

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    All Classes Interface Summary Class Summary 
    ClassDescription
    Controller +
    Die Klasse Controller stellt den Controller des Hauptfensters / Menu dar.
    +
    EditTabMitController +
    Die Klasse EditTabMitController stellt einen Tab inclusive ihres Controllers + zur Editierung eines Graphs dar.
    +
    Graph +
    Dies ist das Herz vom "GraphTester" - der Graph selber, gepeichert als Adjazenzliste.
    +
    GraphAlgo +
    description
    +
    GraphAlgo_BellmanFord +
    Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
    +
    GraphAlgo_Breitensuche +
    Dieser Algorithmus nummeriert alle Knoten des Graphen.
    +
    GraphAlgo_Coloring_Schueler +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    GraphAlgo_ColoringBacktracking +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    GraphAlgo_ColoringGreedy +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    GraphAlgo_ColoringGreedyRandom +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    GraphAlgo_Dijkstra +
    Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
    +
    GraphAlgo_DominatingSetBacktracking +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGenetisch +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyA +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyB +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyC +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyD +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyE +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyF +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyG +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyH +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_DominatingSetGreedyI +
    Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
    +
    GraphAlgo_EulerkreisExistenz +
    Dieser Algorithmus testet, ob ein Eulerkreis existiert.
    +
    GraphAlgo_Moore +
    Dieser Algorithmus findet die kürzesten Pfade in einem ungewichteten Graphen.
    +
    GraphAlgo_MST_Kruskal +
    Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Kruskal
    +
    GraphAlgo_MST_Prim +
    Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Prim
    +
    GraphAlgo_Tiefensuche +
    Dieser Algorithmus nummeriert alle Knoten des Graphen.
    +
    GraphAlgo_TiefensucheRek +
    Dieser Algorithmus nummeriert alle Knoten des Graphen.
    +
    GraphAlgo_toplogischeSortierung +
    Dieser Algorithmus findet eine topologische Sortierung des Graphen.
    +
    GraphAlgo_TSPBacktracking +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_TSPGenetisch +
    description
    +
    GraphAlgo_TSPGreedy +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_TSPGreedy2 +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_TSPGreedyOpt +
    Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
    +
    GraphAlgo_ZyklusBacktracking +
    Dieser Algorithmus ist ein Beispiel für einen Backtracking-Algorithmus.
    +
    GraphElement +
    Die Klasse GraphElement ist eine Oberklasse von Knoten und Kanten.
    +
    GraphenTester 
    GraphOptions +
    Die Klasse GraphOptions speichert, wie ein Graph in einem Fenster vom + GraphPlotter angezeigt wird.
    +
    GraphPlotter +
    Der GraphPlotter ist das Herzstueck der Visualisierung und dient als Schnittstelle zur GUI.
    +
    HauptTabMitController +
    Die Klasse HauptTabMitController stellt einen Tab inclusive ihres Controllers + für das Hauptfenster des Graphentesters dar.
    +
    Hilfe 
    Hilfefenster +
    Die Klasse Hilfefenster stellt ein Hilfefenster für die Simulation eines + Algorithmus bereit.
    +
    HSB +
    Hilfsklasse für das HSB-Farbmodell
    +
    Kante +
    Die Klasse Kante beschreibt die Datenstruktur einer Kante, bestehend aus Startknoten, Gewicht und Zielknoten.
    +
    Knoten +
    Diese Klasse Knoten definiert einen Knoten.
    +
    NumberField 
    Picture +
    Bildklasse fuer die Simulation von Processing-Befehlen + + Diese Klasse stellt ein BufferedImage bereit, in das mit Processing-Befehlen gezeichnet + werden kann.
    +
    PictureViewer 
    SimulationTabMitController +
    Die Klasse SimulationTabMitController stellt einen Tab inclusive ihres Controllers + zur Simulation eines Algorithmus dar.
    +
    Table 
    TableRow 
    TabMitController +
    Die Klasse TabMitController stellt die Oberklasse für alle Tabs des Graphentesters + dar.
    +
    UnterTabMitController +
    Die Klasse UnterTabMitController stellt einen Tab inclusive ihres Controllers + zur händischen Erforschung eines Algorithmus.
    +
    XML 
    +
  • +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/allclasses.html b/Quellcodes/alg_ds_graphentester/doc/allclasses.html new file mode 100644 index 0000000..dd81314 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/allclasses.html @@ -0,0 +1,20 @@ + + + + + +All Classes + + + + + + +

All Classes

+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/allpackages-index.html b/Quellcodes/alg_ds_graphentester/doc/allpackages-index.html new file mode 100644 index 0000000..aedcc7b --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/allpackages-index.html @@ -0,0 +1,183 @@ + + + + + +All Packages (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

All Packages

+
+
+ +
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/constant-values.html b/Quellcodes/alg_ds_graphentester/doc/constant-values.html new file mode 100644 index 0000000..a94bd32 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/constant-values.html @@ -0,0 +1,35 @@ + + + + + +Constant Field Values + + + + + + + + +
+
+

Constant Field Values

+
+

Contents

+
+
+
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/Controller.html b/Quellcodes/alg_ds_graphentester/doc/control/Controller.html new file mode 100644 index 0000000..fd60ca8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/Controller.html @@ -0,0 +1,688 @@ + + + + + +Controller (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package control
+

Class Controller

+
+
+ +
+
    +
  • +
    +
    public class Controller
    +extends Object
    +
    Die Klasse Controller stellt den Controller des Hauptfensters / Menu dar.
    +
    +
    Version:
    +
    v6.7 (9.12.2020)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Controller

        +
        public Controller()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        initialize

        +
        public void initialize()
        +
      • +
      + + + +
        +
      • +

        mNeuerGraph

        +
        void mNeuerGraph​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        schliesseTabs

        +
        void schliesseTabs()
        +
      • +
      + + + +
        +
      • +

        mBearbeiten

        +
        void mBearbeiten​(javafx.scene.input.MouseEvent event)
        +
      • +
      + + + +
        +
      • +

        mSimuliere

        +
        void mSimuliere​(javafx.scene.input.MouseEvent event)
        +
      • +
      + + + +
        +
      • +

        mExperimentiereKanten

        +
        void mExperimentiereKanten​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mExperimentiereKnoten

        +
        void mExperimentiereKnoten​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mExperimentiereAuswahl

        +
        void mExperimentiereAuswahl​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mBeenden

        +
        public void mBeenden​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        menuChangeAnsicht

        +
        void menuChangeAnsicht()
        +
      • +
      + + + +
        +
      • +

        mChangeOptionBild

        +
        void mChangeOptionBild​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mChangeOptionKantengewichte

        +
        void mChangeOptionKantengewichte​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mChangeOptionKnoteninfo

        +
        void mChangeOptionKnoteninfo​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mChangeOptionKnotenname

        +
        void mChangeOptionKnotenname​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mChangeOptionKnotenwerte

        +
        void mChangeOptionKnotenwerte​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mChangeHilfefenster

        +
        void mChangeHilfefenster​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mOeffnen

        +
        void mOeffnen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        graphLaden

        +
        void graphLaden​(String dateiname)
        +
      • +
      + + + +
        +
      • +

        mSchliessen

        +
        void mSchliessen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mSpeichern

        +
        void mSpeichern​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mUeber

        +
        void mUeber​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mResetAlles

        +
        void mResetAlles​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mResetBesucht

        +
        void mResetBesucht​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mResetFarbe

        +
        void mResetFarbe​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mResetGeloescht

        +
        void mResetGeloescht​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mResetKantenmarkierung

        +
        void mResetKantenmarkierung​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mResetMarkierung

        +
        void mResetMarkierung​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mResetWert

        +
        void mResetWert​(javafx.event.ActionEvent event)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/EditTabMitController.html b/Quellcodes/alg_ds_graphentester/doc/control/EditTabMitController.html new file mode 100644 index 0000000..79433e1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/EditTabMitController.html @@ -0,0 +1,544 @@ + + + + + +EditTabMitController (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package control
+

Class EditTabMitController

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    javafx.css.Styleable, javafx.event.EventTarget
    +
    +
    +
    public class EditTabMitController
    +extends TabMitController
    +
    Die Klasse EditTabMitController stellt einen Tab inclusive ihres Controllers + zur Editierung eines Graphs dar.
    +
    +
    Version:
    +
    v6.7 (9.12.2020)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + +
        +
      • + + +

        Fields inherited from class javafx.scene.control.Tab

        +CLOSED_EVENT, SELECTION_CHANGED_EVENT, TAB_CLOSE_REQUEST_EVENT
      • +
      +
    • +
    +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      (package private) voidbBildLaden​(javafx.event.ActionEvent event) 
      (package private) voidbBildLoeschen​(javafx.event.ActionEvent event) 
      (package private) voidbDistanzenBestimmen​(javafx.event.ActionEvent event) 
      (package private) voidgraphClicked​(javafx.scene.input.MouseEvent event) 
      voidinitialize() 
      voidmInfotextAendern() 
      voidmLoesche() 
      voidmWertAendern() 
      (package private) voidsetGerichtet​(boolean gerichtet) 
      (package private) voidsetGewichtet​(boolean gewichtet) 
      (package private) voidsetInfotext​(boolean anzeigen) 
      (package private) voidsetKnotenTyp​(javafx.scene.control.Toggle t) 
      (package private) voidsGroesseAendern​(Number size) 
      + +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Tab

        +buildEventDispatchChain, closableProperty, contentProperty, contextMenuProperty, disabledProperty, disableProperty, getClassCssMetaData, getContent, getContextMenu, getCssMetaData, getGraphic, getId, getOnClosed, getOnCloseRequest, getOnSelectionChanged, getProperties, getPseudoClassStates, getStyle, getStyleableParent, getStyleClass, getTabPane, getText, getTooltip, getTypeSelector, getUserData, graphicProperty, hasProperties, idProperty, isClosable, isDisable, isDisabled, isSelected, onClosedProperty, onCloseRequestProperty, onSelectionChangedProperty, selectedProperty, setClosable, setContent, setContextMenu, setDisable, setGraphic, setId, setOnClosed, setOnCloseRequest, setOnSelectionChanged, setStyle, setText, setTooltip, setUserData, styleProperty, tabPaneProperty, textProperty, tooltipProperty
      • +
      + +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        EditTabMitController

        +
        public EditTabMitController​(Graph graph,
        +                            GraphOptions options)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        sGroesseAendern

        +
        void sGroesseAendern​(Number size)
        +
      • +
      + + + +
        +
      • +

        setGerichtet

        +
        void setGerichtet​(boolean gerichtet)
        +
      • +
      + + + +
        +
      • +

        setGewichtet

        +
        void setGewichtet​(boolean gewichtet)
        +
      • +
      + + + +
        +
      • +

        setInfotext

        +
        void setInfotext​(boolean anzeigen)
        +
      • +
      + + + +
        +
      • +

        setKnotenTyp

        +
        void setKnotenTyp​(javafx.scene.control.Toggle t)
        +
      • +
      + + + +
        +
      • +

        bBildLaden

        +
        void bBildLaden​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bBildLoeschen

        +
        void bBildLoeschen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bDistanzenBestimmen

        +
        void bDistanzenBestimmen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        graphClicked

        +
        void graphClicked​(javafx.scene.input.MouseEvent event)
        +
      • +
      + + + +
        +
      • +

        mLoesche

        +
        public void mLoesche()
        +
      • +
      + + + +
        +
      • +

        mWertAendern

        +
        public void mWertAendern()
        +
      • +
      + + + +
        +
      • +

        mInfotextAendern

        +
        public void mInfotextAendern()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/HauptTabMitController.html b/Quellcodes/alg_ds_graphentester/doc/control/HauptTabMitController.html new file mode 100644 index 0000000..ea36392 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/HauptTabMitController.html @@ -0,0 +1,377 @@ + + + + + +HauptTabMitController (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package control
+

Class HauptTabMitController

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    javafx.css.Styleable, javafx.event.EventTarget
    +
    +
    +
    public class HauptTabMitController
    +extends TabMitController
    +
    Die Klasse HauptTabMitController stellt einen Tab inclusive ihres Controllers + für das Hauptfenster des Graphentesters dar. Einzelne Knoten oder Kanten können + selektiert werden.
    +
    +
    Version:
    +
    v6.7 (9.12.2020)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + +
        +
      • + + +

        Fields inherited from class javafx.scene.control.Tab

        +CLOSED_EVENT, SELECTION_CHANGED_EVENT, TAB_CLOSE_REQUEST_EVENT
      • +
      +
    • +
    +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidinitialize() 
      + +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Tab

        +buildEventDispatchChain, closableProperty, contentProperty, contextMenuProperty, disabledProperty, disableProperty, getClassCssMetaData, getContent, getContextMenu, getCssMetaData, getGraphic, getId, getOnClosed, getOnCloseRequest, getOnSelectionChanged, getProperties, getPseudoClassStates, getStyle, getStyleableParent, getStyleClass, getTabPane, getText, getTooltip, getTypeSelector, getUserData, graphicProperty, hasProperties, idProperty, isClosable, isDisable, isDisabled, isSelected, onClosedProperty, onCloseRequestProperty, onSelectionChangedProperty, selectedProperty, setClosable, setContent, setContextMenu, setDisable, setGraphic, setId, setOnClosed, setOnCloseRequest, setOnSelectionChanged, setStyle, setText, setTooltip, setUserData, styleProperty, tabPaneProperty, textProperty, tooltipProperty
      • +
      + +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HauptTabMitController

        +
        public HauptTabMitController​(Graph graph,
        +                             GraphOptions options)
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/Hilfefenster.html b/Quellcodes/alg_ds_graphentester/doc/control/Hilfefenster.html new file mode 100644 index 0000000..e2f637d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/Hilfefenster.html @@ -0,0 +1,462 @@ + + + + + +Hilfefenster (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package control
+

Class Hilfefenster

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javafx.stage.Window
    • +
    • +
        +
      • javafx.stage.Stage
      • +
      • +
          +
        • control.Hilfefenster
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Hilfe, javafx.event.EventTarget
    +
    +
    +
    public class Hilfefenster
    +extends javafx.stage.Stage
    +implements Hilfe
    +
    Die Klasse Hilfefenster stellt ein Hilfefenster für die Simulation eines + Algorithmus bereit.
    +
    +
    Version:
    +
    v6.7 (9.12.2020)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Hilfefenster() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidappend​(String text) 
      voidindentLess() 
      voidindentMore() 
      voidinitialize() 
      voidloescheAlles() 
      voidsetGraphPlotter​(GraphPlotter gp) 
      voidsetReviewAllowed​(boolean a) 
      voidshowState() 
      +
        +
      • + + +

        Methods inherited from class javafx.stage.Stage

        +alwaysOnTopProperty, close, fullScreenExitHintProperty, fullScreenExitKeyProperty, fullScreenProperty, getFullScreenExitHint, getFullScreenExitKeyCombination, getIcons, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getModality, getOwner, getStyle, getTitle, iconifiedProperty, initModality, initOwner, initStyle, isAlwaysOnTop, isFullScreen, isIconified, isMaximized, isResizable, maxHeightProperty, maximizedProperty, maxWidthProperty, minHeightProperty, minWidthProperty, resizableProperty, setAlwaysOnTop, setFullScreen, setFullScreenExitHint, setFullScreenExitKeyCombination, setIconified, setMaxHeight, setMaximized, setMaxWidth, setMinHeight, setMinWidth, setResizable, setScene, setTitle, show, showAndWait, titleProperty, toBack, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.stage.Window

        +addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, forceIntegerRenderScaleProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getOutputScaleX, getOutputScaleY, getProperties, getRenderScaleX, getRenderScaleY, getScene, getUserData, getWidth, getWindows, getX, getY, hasProperties, heightProperty, hide, isFocused, isForceIntegerRenderScale, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, outputScaleXProperty, outputScaleYProperty, removeEventFilter, removeEventHandler, renderScaleXProperty, renderScaleYProperty, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setForceIntegerRenderScale, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setRenderScaleX, setRenderScaleY, setUserData, setWidth, setX, setY, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
      • +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Hilfefenster

        +
        public Hilfefenster()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        initialize

        +
        public void initialize()
        +
      • +
      + + + + + + + +
        +
      • +

        loescheAlles

        +
        public void loescheAlles()
        +
        +
        Specified by:
        +
        loescheAlles in interface Hilfe
        +
        +
      • +
      + + + +
        +
      • +

        append

        +
        public void append​(String text)
        +
        +
        Specified by:
        +
        append in interface Hilfe
        +
        +
      • +
      + + + +
        +
      • +

        indentMore

        +
        public void indentMore()
        +
        +
        Specified by:
        +
        indentMore in interface Hilfe
        +
        +
      • +
      + + + +
        +
      • +

        indentLess

        +
        public void indentLess()
        +
        +
        Specified by:
        +
        indentLess in interface Hilfe
        +
        +
      • +
      + + + +
        +
      • +

        setReviewAllowed

        +
        public void setReviewAllowed​(boolean a)
        +
        +
        Specified by:
        +
        setReviewAllowed in interface Hilfe
        +
        +
      • +
      + + + +
        +
      • +

        showState

        +
        public void showState()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/SimulationTabMitController.html b/Quellcodes/alg_ds_graphentester/doc/control/SimulationTabMitController.html new file mode 100644 index 0000000..d0ae88f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/SimulationTabMitController.html @@ -0,0 +1,467 @@ + + + + + +SimulationTabMitController (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package control
+

Class SimulationTabMitController

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    javafx.css.Styleable, javafx.event.EventTarget
    +
    +
    +
    public class SimulationTabMitController
    +extends TabMitController
    +
    Die Klasse SimulationTabMitController stellt einen Tab inclusive ihres Controllers + zur Simulation eines Algorithmus dar. Der Algorithmus kann ausgewählt und schrittweise + durchgeführt werden.
    +
    +
    Version:
    +
    v6.7 (9.12.2020)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + +
        +
      • + + +

        Fields inherited from class javafx.scene.control.Tab

        +CLOSED_EVENT, SELECTION_CHANGED_EVENT, TAB_CLOSE_REQUEST_EVENT
      • +
      +
    • +
    +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidinitialize() 
      voidmBreak​(javafx.event.ActionEvent event) 
      (package private) voidmReset​(javafx.event.ActionEvent event) 
      (package private) voidmStart​(javafx.event.ActionEvent event) 
      (package private) voidmStep​(javafx.event.ActionEvent event) 
      voidsetGraph​(Graph graph, + GraphOptions options) 
      voidshowHilfe​(boolean b) 
      + +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Tab

        +buildEventDispatchChain, closableProperty, contentProperty, contextMenuProperty, disabledProperty, disableProperty, getClassCssMetaData, getContent, getContextMenu, getCssMetaData, getGraphic, getId, getOnClosed, getOnCloseRequest, getOnSelectionChanged, getProperties, getPseudoClassStates, getStyle, getStyleableParent, getStyleClass, getTabPane, getText, getTooltip, getTypeSelector, getUserData, graphicProperty, hasProperties, idProperty, isClosable, isDisable, isDisabled, isSelected, onClosedProperty, onCloseRequestProperty, onSelectionChangedProperty, selectedProperty, setClosable, setContent, setContextMenu, setDisable, setGraphic, setId, setOnClosed, setOnCloseRequest, setOnSelectionChanged, setStyle, setText, setTooltip, setUserData, styleProperty, tabPaneProperty, textProperty, tooltipProperty
      • +
      + +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SimulationTabMitController

        +
        public SimulationTabMitController​(Graph graph,
        +                                  GraphOptions options)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        showHilfe

        +
        public void showHilfe​(boolean b)
        +
      • +
      + + + + + + + +
        +
      • +

        mReset

        +
        void mReset​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mStep

        +
        void mStep​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mStart

        +
        void mStart​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mBreak

        +
        public void mBreak​(javafx.event.ActionEvent event)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/TabMitController.html b/Quellcodes/alg_ds_graphentester/doc/control/TabMitController.html new file mode 100644 index 0000000..c06a4ca --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/TabMitController.html @@ -0,0 +1,487 @@ + + + + + +TabMitController (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package control
+

Class TabMitController

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javafx.scene.control.Tab
    • +
    • +
        +
      • control.TabMitController
      • +
      +
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      protected Graphgraph 
      protected GraphOptionsoptions 
      protected GraphPlotterviewer 
      +
        +
      • + + +

        Fields inherited from class javafx.scene.control.Tab

        +CLOSED_EVENT, SELECTION_CHANGED_EVENT, TAB_CLOSE_REQUEST_EVENT
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      TabMitController() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      GraphOptionsgetGraphOptions() 
      GraphPlottergetViewer() 
      voidinitialize() 
      voidsetGraph​(Graph graph, + GraphOptions options) 
      protected voidtabOeffnen​(GraphOptions taboptions) 
      voidupdate() 
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Tab

        +buildEventDispatchChain, closableProperty, contentProperty, contextMenuProperty, disabledProperty, disableProperty, getClassCssMetaData, getContent, getContextMenu, getCssMetaData, getGraphic, getId, getOnClosed, getOnCloseRequest, getOnSelectionChanged, getProperties, getPseudoClassStates, getStyle, getStyleableParent, getStyleClass, getTabPane, getText, getTooltip, getTypeSelector, getUserData, graphicProperty, hasProperties, idProperty, isClosable, isDisable, isDisabled, isSelected, onClosedProperty, onCloseRequestProperty, onSelectionChangedProperty, selectedProperty, setClosable, setContent, setContextMenu, setDisable, setGraphic, setId, setOnClosed, setOnCloseRequest, setOnSelectionChanged, setStyle, setText, setTooltip, setUserData, styleProperty, tabPaneProperty, textProperty, tooltipProperty
      • +
      + +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TabMitController

        +
        public TabMitController()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        initialize

        +
        public void initialize()
        +
      • +
      + + + +
        +
      • +

        tabOeffnen

        +
        protected void tabOeffnen​(GraphOptions taboptions)
        +
      • +
      + + + +
        +
      • +

        getGraphOptions

        +
        public GraphOptions getGraphOptions()
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update()
        +
      • +
      + + + + + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/UnterTabMitController.html b/Quellcodes/alg_ds_graphentester/doc/control/UnterTabMitController.html new file mode 100644 index 0000000..1f69eef --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/UnterTabMitController.html @@ -0,0 +1,937 @@ + + + + + +UnterTabMitController (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package control
+

Class UnterTabMitController

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    javafx.css.Styleable, javafx.event.EventTarget
    +
    +
    +
    public class UnterTabMitController
    +extends TabMitController
    +
    Die Klasse UnterTabMitController stellt einen Tab inclusive ihres Controllers + zur händischen Erforschung eines Algorithmus. Es wird immer ein einzelner Knoten + oder eine Kante fokussiert.
    +
    +
    Version:
    +
    v6.7 (9.12.2020)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      (package private) javafx.scene.control.ButtonbAnfang 
      (package private) javafx.scene.control.ButtonbEnde 
      (package private) javafx.scene.control.ButtonbGehezu 
      (package private) javafx.scene.control.ButtonbSortieren 
      (package private) javafx.scene.control.ButtonbStatus 
      + +
        +
      • + + +

        Fields inherited from class javafx.scene.control.Tab

        +CLOSED_EVENT, SELECTION_CHANGED_EVENT, TAB_CLOSE_REQUEST_EVENT
      • +
      +
    • +
    +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      (package private) voidbAnfang​(javafx.event.ActionEvent event) 
      (package private) voidbBesucht​(javafx.event.ActionEvent event) 
      (package private) voidbEnde​(javafx.event.ActionEvent event) 
      (package private) voidbGeheZu​(javafx.event.ActionEvent event) 
      (package private) voidbHinzufuegenAnfang​(javafx.event.ActionEvent event) 
      (package private) voidbHinzufuegenEnde​(javafx.event.ActionEvent event) 
      (package private) voidbLoeschenAusListe​(javafx.event.ActionEvent event) 
      (package private) voidbMarkieren​(javafx.event.ActionEvent event) 
      (package private) voidbNaechster​(javafx.event.ActionEvent event) 
      (package private) voidbSort​(javafx.event.ActionEvent event) 
      (package private) voidbStatusRestore​(javafx.event.ActionEvent event) 
      (package private) voidbStatusSave​(javafx.event.ActionEvent event) 
      voidbuildAuswahl() 
      (package private) voidbVoheriger​(javafx.event.ActionEvent event) 
      (package private) voidbWertAendern​(javafx.event.ActionEvent event) 
      (package private) voidgraphClicked​(javafx.scene.input.MouseEvent event) 
      voidinitialize() 
      (package private) voidknotenFarbe​(javafx.scene.input.MouseEvent event) 
      (package private) voidmBeenden​(javafx.event.ActionEvent event) 
      (package private) voidmBesucheKnoten​(javafx.event.ActionEvent event) 
      (package private) voidmBesuchtLoeschen​(javafx.event.ActionEvent event) 
      (package private) voidmFaerbeKnoten​(javafx.event.ActionEvent event) 
      (package private) voidmMarkiereKnoten​(javafx.event.ActionEvent event) 
      (package private) voidmMarkierungenLoeschen​(javafx.event.ActionEvent event) 
      (package private) voidmOeffnen​(javafx.event.ActionEvent event) 
      (package private) voidmSchliessen​(javafx.event.ActionEvent event) 
      (package private) voidmSpeichern​(javafx.event.ActionEvent event) 
      (package private) voidmUeber​(javafx.event.ActionEvent event) 
      (package private) voidmWertSetzen​(javafx.event.ActionEvent event) 
      (package private) voidmZurueck​(javafx.event.ActionEvent event) 
      voidsetAuswahl​(List<GraphElement> auswahl) 
      voidsetGraph​(Graph graph, + GraphOptions options) 
      voidupdate() 
      voidupdateInfofeld() 
      + +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Tab

        +buildEventDispatchChain, closableProperty, contentProperty, contextMenuProperty, disabledProperty, disableProperty, getClassCssMetaData, getContent, getContextMenu, getCssMetaData, getGraphic, getId, getOnClosed, getOnCloseRequest, getOnSelectionChanged, getProperties, getPseudoClassStates, getStyle, getStyleableParent, getStyleClass, getTabPane, getText, getTooltip, getTypeSelector, getUserData, graphicProperty, hasProperties, idProperty, isClosable, isDisable, isDisabled, isSelected, onClosedProperty, onCloseRequestProperty, onSelectionChangedProperty, selectedProperty, setClosable, setContent, setContextMenu, setDisable, setGraphic, setId, setOnClosed, setOnCloseRequest, setOnSelectionChanged, setStyle, setText, setTooltip, setUserData, styleProperty, tabPaneProperty, textProperty, tooltipProperty
      • +
      + +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        bStatus

        +
        javafx.scene.control.Button bStatus
        +
      • +
      + + + +
        +
      • +

        bGehezu

        +
        javafx.scene.control.Button bGehezu
        +
      • +
      + + + +
        +
      • +

        bAnfang

        +
        javafx.scene.control.Button bAnfang
        +
      • +
      + + + +
        +
      • +

        bEnde

        +
        javafx.scene.control.Button bEnde
        +
      • +
      + + + +
        +
      • +

        bSortieren

        +
        javafx.scene.control.Button bSortieren
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UnterTabMitController

        +
        public UnterTabMitController​(Graph graph,
        +                             GraphOptions options)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        buildAuswahl

        +
        public void buildAuswahl()
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        bAnfang

        +
        void bAnfang​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bBesucht

        +
        void bBesucht​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bEnde

        +
        void bEnde​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        knotenFarbe

        +
        void knotenFarbe​(javafx.scene.input.MouseEvent event)
        +
      • +
      + + + +
        +
      • +

        bMarkieren

        +
        void bMarkieren​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        updateInfofeld

        +
        public void updateInfofeld()
        +
      • +
      + + + +
        +
      • +

        graphClicked

        +
        void graphClicked​(javafx.scene.input.MouseEvent event)
        +
      • +
      + + + +
        +
      • +

        bHinzufuegenAnfang

        +
        void bHinzufuegenAnfang​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bHinzufuegenEnde

        +
        void bHinzufuegenEnde​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bLoeschenAusListe

        +
        void bLoeschenAusListe​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bNaechster

        +
        void bNaechster​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bSort

        +
        void bSort​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bVoheriger

        +
        void bVoheriger​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bWertAendern

        +
        void bWertAendern​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bGeheZu

        +
        void bGeheZu​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mBeenden

        +
        void mBeenden​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mBesucheKnoten

        +
        void mBesucheKnoten​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mBesuchtLoeschen

        +
        void mBesuchtLoeschen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mFaerbeKnoten

        +
        void mFaerbeKnoten​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mMarkiereKnoten

        +
        void mMarkiereKnoten​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mMarkierungenLoeschen

        +
        void mMarkierungenLoeschen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mOeffnen

        +
        void mOeffnen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mSchliessen

        +
        void mSchliessen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mSpeichern

        +
        void mSpeichern​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mUeber

        +
        void mUeber​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mWertSetzen

        +
        void mWertSetzen​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        mZurueck

        +
        void mZurueck​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bStatusRestore

        +
        void bStatusRestore​(javafx.event.ActionEvent event)
        +
      • +
      + + + +
        +
      • +

        bStatusSave

        +
        void bStatusSave​(javafx.event.ActionEvent event)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/package-summary.html b/Quellcodes/alg_ds_graphentester/doc/control/package-summary.html new file mode 100644 index 0000000..348c2e1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/package-summary.html @@ -0,0 +1,207 @@ + + + + + +control (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package control

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Controller +
    Die Klasse Controller stellt den Controller des Hauptfensters / Menu dar.
    +
    EditTabMitController +
    Die Klasse EditTabMitController stellt einen Tab inclusive ihres Controllers + zur Editierung eines Graphs dar.
    +
    HauptTabMitController +
    Die Klasse HauptTabMitController stellt einen Tab inclusive ihres Controllers + für das Hauptfenster des Graphentesters dar.
    +
    Hilfefenster +
    Die Klasse Hilfefenster stellt ein Hilfefenster für die Simulation eines + Algorithmus bereit.
    +
    SimulationTabMitController +
    Die Klasse SimulationTabMitController stellt einen Tab inclusive ihres Controllers + zur Simulation eines Algorithmus dar.
    +
    TabMitController +
    Die Klasse TabMitController stellt die Oberklasse für alle Tabs des Graphentesters + dar.
    +
    UnterTabMitController +
    Die Klasse UnterTabMitController stellt einen Tab inclusive ihres Controllers + zur händischen Erforschung eines Algorithmus.
    +
    +
  • +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/control/package-tree.html b/Quellcodes/alg_ds_graphentester/doc/control/package-tree.html new file mode 100644 index 0000000..fd20dbe --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/control/package-tree.html @@ -0,0 +1,181 @@ + + + + + +control Class Hierarchy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package control

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/GraphAlgo_Coloring_Schueler.html b/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/GraphAlgo_Coloring_Schueler.html new file mode 100644 index 0000000..b6c31cc --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/GraphAlgo_Coloring_Schueler.html @@ -0,0 +1,403 @@ + + + + + +GraphAlgo_Coloring_Schueler (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class GraphAlgo_Coloring_Schueler

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Runnable
    +
    +
    +
    public class GraphAlgo_Coloring_Schueler
    +extends GraphAlgo
    +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden. + Algorithmus: Beispieldatei, in der Schüler den Algorithmus selbst umsetzen können
    +
    +
    Version:
    +
    1.0 from 10.12.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphAlgo_Coloring_Schueler

        +
        public GraphAlgo_Coloring_Schueler()
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/package-summary.html b/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/package-summary.html new file mode 100644 index 0000000..6c5c475 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/package-summary.html @@ -0,0 +1,166 @@ + + + + + +eigeneAlgorithmen (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package eigeneAlgorithmen

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    GraphAlgo_Coloring_Schueler +
    Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
    +
    +
  • +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/package-tree.html b/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/package-tree.html new file mode 100644 index 0000000..fa740d1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/eigeneAlgorithmen/package-tree.html @@ -0,0 +1,168 @@ + + + + + +eigeneAlgorithmen Class Hierarchy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package eigeneAlgorithmen

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/element-list b/Quellcodes/alg_ds_graphentester/doc/element-list new file mode 100644 index 0000000..52fdfdd --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/element-list @@ -0,0 +1 @@ +graph diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/Graph.html b/Quellcodes/alg_ds_graphentester/doc/graph/Graph.html new file mode 100644 index 0000000..f813a43 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/Graph.html @@ -0,0 +1,1317 @@ + + + + + +Graph (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package graph
+

Class Graph

+
+
+ +
+
    +
  • +
    +
    public class Graph
    +extends Object
    +
    Dies ist das Herz vom "GraphTester" - der Graph selber, gepeichert als Adjazenzliste. + Die Klasse erlaubt durch geeignete Methoden: + - die Speicherung als Adjazenzmatrix, + - das Hinzufuegen und Loeschen von knoten und Kanten, + - das Markieren von Knoten und Kanten, + - eine Aussage darueber, ob Knoten oder Kanten enthalten sind und + - eine Ausgabe des Graphen in textueller Form sowie als csv-Datei.
    +
    +
    Version:
    +
    31.01.2021 (v6.5)
    +
    Author:
    +
    Dirk Zechnall, Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Graph() +
      Der Konstruktor erstellt einen neuen ungerichteten, ungewichteten Graphen (genauer eine neue Adjazenzliste)
      +
      Graph​(boolean isGerichtet, + boolean isGewichtet) +
      Der Konstruktor erstellt einen neuen Graphen (genauer eine neue Adjazenzliste)
      +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Graph

        +
        public Graph​(boolean isGerichtet,
        +             boolean isGewichtet)
        +
        Der Konstruktor erstellt einen neuen Graphen (genauer eine neue Adjazenzliste)
        +
        +
        Parameters:
        +
        isGerichtet - gibt an, ob es sich um einen gerichteten Graphen handelt
        +
        isGewichtet - gibt an, ob die Kanten gewichtet sind.
        +
        +
      • +
      + + + +
        +
      • +

        Graph

        +
        public Graph()
        +
        Der Konstruktor erstellt einen neuen ungerichteten, ungewichteten Graphen (genauer eine neue Adjazenzliste)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        loescheGraph

        +
        public void loescheGraph()
        +
        Löscht alle Knoten und Kanten eines Graphen und stellt auf ungerichtet und ungewichtet zurück.
        +
      • +
      + + + +
        +
      • +

        ladeGraph

        +
        public boolean ladeGraph​(Table csvParser)
        +
        Ein Graph wird aus einer csv-Datei erstellt, die entweder + eine Matrix oder eine Adjazenzliste enthält, die den Graph beschreibt.
        +
        +
        Parameters:
        +
        csvParser - Eine CSV-Datei als Table-Objekt
        +
        Returns:
        +
        gibt zurück, ob das Laden erfolgreich war
        +
        +
      • +
      + + + +
        +
      • +

        setGewichtet

        +
        public void setGewichtet​(boolean isGewichtet)
        +
        Legt fest, ob der Graph gewichtet oder ungewichtet ist.
        +
        +
        Parameters:
        +
        isGewichtet - neuer Wert
        +
        +
      • +
      + + + +
        +
      • +

        isGewichtet

        +
        public boolean isGewichtet()
        +
        Gibt zurueck, ob der Graph gewichtet oder ungewichtet ist
        +
        +
        Returns:
        +
        gewichtet? (true/false)
        +
        +
      • +
      + + + +
        +
      • +

        setGerichtet

        +
        public void setGerichtet​(boolean isGerichtet)
        +
        Legt fest, ob der Graph gerichtet oder ungerichtet ist.
        +
        +
        Parameters:
        +
        isGerichtet - neuer Wert
        +
        +
      • +
      + + + +
        +
      • +

        isGerichtet

        +
        public boolean isGerichtet()
        +
        Gibt zurueck, ob der Graph gerichtet oder ungerichtet ist.
        +
        +
        Returns:
        +
        gerichtet? (true/false)
        +
        +
      • +
      + + + +
        +
      • +

        getNummer

        +
        public int getNummer​(Knoten k)
        +
        Gibt die Nummer eines Knotens im Graphen zurück
        +
        +
        Parameters:
        +
        k - gesuchter Knoten
        +
        Returns:
        +
        Nummer des Knotens (mit 0 beginnend)
        +
        +
      • +
      + + + +
        +
      • +

        getNummer

        +
        public int getNummer​(Kante k)
        +
        Gibt die Nummer einer Kante zurück
        +
        +
        Parameters:
        +
        k - gesuchte Kante
        +
        Returns:
        +
        Nummer der Kante (mit 0 beginnend)
        +
        +
      • +
      + + + +
        +
      • +

        getAdjazenzMatrix

        +
        public double[][] getAdjazenzMatrix()
        +
        Die Methode getAdjazenzMatrix() gibt die Adjazenzmatrix zurueck.
        +
        +
        Returns:
        +
        double[][] Die AdjazenzMatrix als zweidimensionales Array
        +
        +
      • +
      + + + +
        +
      • +

        getAlleKanten

        +
        public List<Kante> getAlleKanten​(Predicate<Kante>... filter)
        +
        Gibt eine Liste aller Kanten des Graphen zurück.
        +
        +
        Parameters:
        +
        filter - optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()}
        +
        Returns:
        +
        Liste aller Kanten
        +
        +
      • +
      + + + +
        +
      • +

        entferneMarkierungBeiAllenKnoten

        +
        public void entferneMarkierungBeiAllenKnoten()
        +
        Entfernt die Markierung bei allen Knoten des Graphen.
        +
      • +
      + + + +
        +
      • +

        initialisiereAlleKnoten

        +
        public void initialisiereAlleKnoten()
        +
        Initialisiert alle Knoten des Graphen.
        +
      • +
      + + + +
        +
      • +

        initialisiereAlleKanten

        +
        public void initialisiereAlleKanten()
        +
        Initialisiert alle Kanten des Graphen.
        +
      • +
      + + + +
        +
      • +

        isKnotenEnthalten

        +
        public boolean isKnotenEnthalten​(Knoten k)
        +
        Ueberprueft, ob ein Knoten in der Knotenliste enthalten ist. + Sobald in der Knotenliste der Knoten k gefunden wird, wird true ausgegeben.
        +
        +
        Parameters:
        +
        k - Der gesuchte Knoten
        +
        Returns:
        +
        true= ist enthalten, false = ist nicht enthalten
        +
        +
      • +
      + + + +
        +
      • +

        getAnzahlKnoten

        +
        public int getAnzahlKnoten()
        +
        Gibt die Anzahl der Knoten im Graph zurueck
        +
        +
        Returns:
        +
        Anzahl der Knoten
        +
        +
      • +
      + + + +
        +
      • +

        getAlleKnoten

        +
        public List<Knoten> getAlleKnoten​(Predicate<Knoten>... filter)
        +
        Gibt eine Liste aller Knoten des Graphen zurueck.
        +
        +
        Parameters:
        +
        filter - optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()}
        +
        Returns:
        +
        Die Knotenliste. Falls leer wird eine leere Liste zurueckgegeben
        +
        +
      • +
      + + + +
        +
      • +

        getNachbarknoten

        +
        public List<Knoten> getNachbarknoten​(Knoten k,
        +                                     Predicate<Knoten>... filter)
        +
        Gibt die Liste aller Nachbarknoten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist.
        +
        +
        Parameters:
        +
        k - Der Knoten, zu dem die Adjazenzliste gesucht wird
        +
        filter - optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()}
        +
        Returns:
        +
        Liste der Nachbarknoten
        +
        +
      • +
      + + + +
        +
      • +

        getAusgehendeKanten

        +
        public List<Kante> getAusgehendeKanten​(Knoten k,
        +                                       Predicate<Kante>... filter)
        +
        Gibt eine Liste der ausgehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + unterschieden.
        +
        +
        Parameters:
        +
        k - Der Knoten, zu dem die Kanten gesucht werden
        +
        filter - optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()}
        +
        Returns:
        +
        Liste der ausgehenden Kanten.
        +
        +
      • +
      + + + +
        +
      • +

        getAusgehendeKanten

        +
        public List<Kante> getAusgehendeKanten​(int knotennr,
        +                                       Predicate<Kante>... filter)
        +
        Gibt eine Liste der ausgehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + unterschieden.
        +
        +
        Parameters:
        +
        knotennr - Nummer des Knoten, zu dem die Kanten gesucht werden
        +
        filter - optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()}
        +
        Returns:
        +
        Liste der ausgehenden Kanten.
        +
        +
      • +
      + + + +
        +
      • +

        getEingehendeKanten

        +
        public List<Kante> getEingehendeKanten​(int knotennr,
        +                                       Predicate<Kante>... filter)
        +
        Gibt eine Liste der eingehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + unterschieden.
        +
        +
        Parameters:
        +
        knotennr - Die Nummer des Knotens, zu dem die Kanten gesucht werden
        +
        filter - optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()}
        +
        Returns:
        +
        Liste der eingehenden Kanten.
        +
        +
      • +
      + + + +
        +
      • +

        getEingehendeKanten

        +
        public List<Kante> getEingehendeKanten​(Knoten k,
        +                                       Predicate<Kante>... filter)
        +
        Gibt eine Liste der eingehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + unterschieden.
        +
        +
        Parameters:
        +
        k - Knoten, zu dem die Kanten gesucht werden
        +
        filter - optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()}
        +
        Returns:
        +
        Liste der eingehenden Kanten.
        +
        +
      • +
      + + + +
        +
      • +

        getKnoten

        +
        public Knoten getKnoten​(int knotennr)
        +
        Liefert einen Knoten des Graphen
        +
        +
        Parameters:
        +
        knotennr - Nummer der Knoten (beginnend mit 0)
        +
        Returns:
        +
        liefert den Knoten mit dieser Nummer
        +
        +
      • +
      + + + +
        +
      • +

        neuerKnoten

        +
        public void neuerKnoten​(Knoten k)
        +
        Fügt einen Knoten dem Graph hinzu.
        +
        +
        Parameters:
        +
        k - Der Knoten, der hinzugefuegt werden soll
        +
        +
      • +
      + + + +
        +
      • +

        entferneKnoten

        +
        public void entferneKnoten​(int knotennr)
        +
        Entfernt einen Knoten aus dem Graphen
        +
        +
        Parameters:
        +
        knotennr - Nummer des Knotens, der geloescht werden soll
        +
        +
      • +
      + + + +
        +
      • +

        entferneKnoten

        +
        public boolean entferneKnoten​(Knoten k)
        +
        Entfernt einen Knoten aus dem Graphen
        +
        +
        Parameters:
        +
        k - Knoten, der geloescht werden soll
        +
        Returns:
        +
        gibt zurück, ob der Knoten erfolgreich entfernt wurde.
        +
        +
      • +
      + + + +
        +
      • +

        isKanteEnthalten

        +
        public boolean isKanteEnthalten​(Kante e)
        +
        Ueberprueft, ob eine Kante im Graphen enthalten ist.
        +
        +
        Parameters:
        +
        e - Die zu suchende Kante
        +
        Returns:
        +
        Kante enthalten (true) oder nicht (false)
        +
        +
      • +
      + + + +
        +
      • +

        isKanteEnthalten

        +
        public boolean isKanteEnthalten​(int startNr,
        +                                int zielNr)
        +
        Ueberprueft, ob eine Kante im Graphen enthalten ist. + In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden
        +
        +
        Parameters:
        +
        startNr - Nummer des Startknotens
        +
        zielNr - Nummer des Zielknotens
        +
        Returns:
        +
        boolean Kante enthalten (true) oder nicht (false)
        +
        +
      • +
      + + + +
        +
      • +

        isKanteEnthalten

        +
        public boolean isKanteEnthalten​(Knoten start,
        +                                Knoten ziel)
        +
        Ueberprueft, ob eine Kante im Graphen enthalten ist. + In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden
        +
        +
        Parameters:
        +
        start - Startknoten
        +
        ziel - Zielknoten
        +
        Returns:
        +
        boolean Kante enthalten (true) oder nicht (false)
        +
        +
      • +
      + + + +
        +
      • +

        getKante

        +
        public Kante getKante​(Knoten start,
        +                      Knoten ziel)
        +
        Gibt eine gesuchte Kante aus dem Graphen zurueck. + In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden
        +
        +
        Parameters:
        +
        start - Der StartKnoten
        +
        ziel - Der StartKnoten
        +
        Returns:
        +
        Die gesuchte Kante
        +
        +
      • +
      + + + +
        +
      • +

        getKante

        +
        public Kante getKante​(int startnr,
        +                      int zielnr)
        +
        Gibt eine gesuchte Kante aus dem Graphen zurueck. + In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden
        +
        +
        Parameters:
        +
        startnr - Der Nummer des StartKnoten
        +
        zielnr - Die Nummer des Zielknoten
        +
        Returns:
        +
        Die gesuchte Kante
        +
        +
      • +
      + + + +
        +
      • +

        neueKante

        +
        public void neueKante​(Kante e)
        +
        Fuegt eine Kante dem Graphen hinzu. + Dabei wird ueberprueft, ob die Kante schon im Graphen enthalten ist. + + Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" erstellt.
        +
        +
        Parameters:
        +
        e - Die Kante, die hinzugefuegt werden soll
        +
        +
      • +
      + + + +
        +
      • +

        neueKante

        +
        public void neueKante​(Knoten start,
        +                      Knoten ziel,
        +                      double gewicht)
        +
        Fuegt eine Kante dem Graphen hinzu. + Dabei wird ueberprueft, ob die Kante schon im Graphen enthalten ist. + + Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" erstellt.
        +
        +
        Parameters:
        +
        start - Der StartKnoten der Kante, die hinzugefuegt werden soll
        +
        ziel - Der ZielKnoten der Kante, die hinzugefuegt werden soll
        +
        gewicht - Das Gewicht der Kante, die hinzugefuegt werden soll
        +
        +
      • +
      + + + +
        +
      • +

        entferneKante

        +
        public void entferneKante​(Kante e)
        +
        Entfernt eine Kante aus dem Graphen. + Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" entfernt.
        +
        +
        Parameters:
        +
        e - Die zu entfernende Kante
        +
        +
      • +
      + + + +
        +
      • +

        entferneKante

        +
        public void entferneKante​(Knoten start,
        +                          Knoten ziel)
        +
        Entfernt eine Kante aus dem Graphen. + Dabei wird ueberprueft, ob die Kante ueberhaupt im Graphen enthalten ist. + + Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" entfernt.
        +
        +
        Parameters:
        +
        start - StartKnotens
        +
        ziel - ZielKnotens
        +
        +
      • +
      + + + +
        +
      • +

        entferneKante

        +
        public void entferneKante​(int startnr,
        +                          int zielnr)
        +
        Entfernt eine Kante aus dem Graphen. + Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" entfernt.
        +
        +
        Parameters:
        +
        startnr - Nummer des StartKnotens
        +
        zielnr - Nummer des ZielKnotens
        +
        +
      • +
      + + + +
        +
      • +

        isLeer

        +
        public boolean isLeer()
        +
        Ueberprueft, ob die Adjazenzliste leer ist, d.h. keine Knoten im Graphen enthalten sind.
        +
        +
        Returns:
        +
        true, wenn die Liste leer ist, sonst false
        +
        +
      • +
      + + + +
        +
      • +

        loescheAlles

        +
        public void loescheAlles()
        +
        Loescht den gesamten Graphen
        +
      • +
      + + + +
        +
      • +

        toCSVString

        +
        public String toCSVString​(boolean asMatrix)
        +
        Die Methode erstellt eine CSV-Ausgabe des Graphen entweder als Adjazenzliste oder als Adjazenzmatrix.
        +
        +
        Parameters:
        +
        asMatrix - true, falls die CSV-Ausgabe eine AdjazenzMatrix sein soll, sonst false
        +
        Returns:
        +
        CSV-Ausgabe
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Textuelle Repraesentation des Graphen.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        Der Graph als Stringrepraesentation
        +
        +
      • +
      + + + +
        +
      • +

        ausgabe

        +
        public void ausgabe()
        +
        Konsolenausgabe der textuellen Repraesentation des Graphen.
        +
      • +
      + + + +
        +
      • +

        getKnoteninfo

        +
        public String getKnoteninfo​(Knoten k,
        +                            boolean zeigeWert)
        +
        Info über einen Knoten zurückgeben
        +
        +
        Parameters:
        +
        k - Knoten, des Info ermittelt werden soll
        +
        zeigeWert - Soll der Wert des Knoten in der Info enthalten sein
        +
        Returns:
        +
        Infotext oder Nummer des Knoten und ggf. sein Wert
        +
        +
      • +
      + + + +
        +
      • +

        getStatus

        +
        public List<String> getStatus()
        +
        Speichert den Zustand des Graphen als String-List
        +
        +
        Returns:
        +
        List mit Zustand
        +
        +
      • +
      + + + +
        +
      • +

        setStatus

        +
        public void setStatus​(List<String> status)
        +
        Stellt den Zustand des Graphen aus String-List wieder her
        +
        +
        Parameters:
        +
        status - List mit Zustand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/GraphElement.html b/Quellcodes/alg_ds_graphentester/doc/graph/GraphElement.html new file mode 100644 index 0000000..84a95dd --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/GraphElement.html @@ -0,0 +1,460 @@ + + + + +GraphElement + + + + + + + + + + + +
+
+
+ +
+
Package graph
+

Class GraphElement

+
+
java.lang.Object +
graph.GraphElement
+
+
+
+
All Implemented Interfaces:
+
Comparable<GraphElement>
+
+
+
public abstract class GraphElement +extends Object +implements Comparable<GraphElement>
+
Die Klasse GraphElement ist eine Oberklasse von Knoten und Kanten. + Sie ist nur für die interne Verarbeitung wichtig.
+
+
Version:
+
28.02.2023 (v7.0) + v7.0: Die am Element gespeicherten Informationen werden in einer Hashmap gespeichert. Daher können beliebige weitere Informationen abgelegt werden. + Es wird auch gespeichert, als welcher Typ die Information übergeben wurde.
+
Author:
+
Thomas Schaller
+
+
+
+
    + +
  • +
    +

    Field Summary

    +
    Fields
    +
    +
    Modifier and Type
    +
    Field
    +
    Description
    +
    protected HashMap<String,String>
    + +
     
    +
    protected graph.Graph
    + +
     
    +
    protected String
    + +
     
    +
    protected HashMap<String,String>
    + +
     
    +
    +
    +
  • + +
  • +
    +

    Constructor Summary

    +
    Constructors
    +
    +
    Constructor
    +
    Description
    + +
     
    +
    +
    +
  • + +
  • +
    +

    Method Summary

    +
    +
    +
    +
    +
    Modifier and Type
    +
    Method
    +
    Description
    +
    int
    + +
    +
    Vergleicht den Knoten/Kante mit einem anderen Knoten/Kante bezüglich seines Sortierkriteriums + Das Sortierkriterium ist normalerweise der "Wert", kann aber mit setSortierkriterium gesetzt werden.
    +
    +
    boolean
    + +
    +
    Gibt zusätzliche Daten als int zurück
    +
    +
    double
    + +
    +
    Gibt zusätzliche Daten als int zurück
    +
    +
    int
    +
    getInt(String name)
    +
    +
    Gibt zusätzliche Daten als int zurück
    +
    +
    abstract List<String>
    + +
    +
    Gibt die Beschreibung des Knoten / der Kante als Kurztext für die Anzeige im + Kreis bzw.
    +
    +
    abstract List<String>
    + +
    +
    Gibt die Beschreibung des Knoten / der Kante als Langtext für die Anzeige im + Tooltip-Fenster zurück.
    +
    + + +
    +
    Liefert den Status einer Kante als String.
    +
    + + +
    +
    Gibt zusätzliche Daten als String zurück
    +
    +
    void
    +
    set(String name, + boolean wert)
    +
    +
    Speichert zusätzliche Daten am Knoten oder der Kante
    +
    +
    void
    +
    set(String name, + double wert)
    +
    +
    Speichert zusätzliche Daten am Knoten oder der Kante + Double.POSITIVE_INFINITY bzw.
    +
    +
    void
    +
    set(String name, + int wert)
    +
    +
    Speichert zusätzliche Daten am Knoten oder der Kante + Integer.MAX_VALUE bzw.
    +
    +
    void
    +
    set(String name, + String wert)
    +
    +
    Speichert zusätzliche Daten am Knoten oder der Kante
    +
    +
    void
    +
    setGraph(graph.Graph g)
    +
    +
    Speichert den Graphen, in den Knoten/Kante eingefügt wurde.
    +
    +
    void
    + +
    +
    Setzt das Sortierkriterium des Knoten/der Kante.
    +
    +
    void
    +
    setStatus(String status)
    +
    +
    Setzt den Status einer Kante, der in einem String gespeichert ist.
    +
    +
    +
    +
    +
    +

    Methods inherited from class java.lang.Object

    +clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +
    +
  • +
+
+
+
    + +
  • +
    +

    Field Details

    + +
    +
  • + +
  • +
    +

    Constructor Details

    +
      +
    • +
      +

      GraphElement

      +
      public GraphElement()
      +
      +
    • +
    +
    +
  • + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      setStatus

      +
      public void setStatus(String status)
      +
      Setzt den Status einer Kante, der in einem String gespeichert ist. + Form: markiert,geloescht,farbe + Dabei sind markiert und geloescht boolsche Werte (0 = false, 1 = true) und + die farbe eine Zahl
      +
      +
      Parameters:
      +
      status - Statusstring
      +
      +
      +
    • +
    • +
      +

      getStatus

      +
      public String getStatus()
      +
      Liefert den Status einer Kante als String. + Form: markiert,geloescht,farbe + Dabei sind markiert und geloescht boolsche Werte (0 = false, 1 = true) und + die farbe eine Zahl
      +
      +
      Returns:
      +
      Statusstring
      +
      +
      +
    • +
    • +
      +

      setSortierkriterium

      +
      public void setSortierkriterium(String name)
      +
      Setzt das Sortierkriterium des Knoten/der Kante.
      +
      +
      Parameters:
      +
      name - Bezeichnung des Wertes nach dem sortiert werden soll
      +
      +
      +
    • +
    • +
      +

      getKurztext

      +
      public abstract List<String> getKurztext(String[] namen)
      +
      Gibt die Beschreibung des Knoten / der Kante als Kurztext für die Anzeige im + Kreis bzw. Kasten zurück. Dabei wird jeder Eintrag der Liste als eigene Zeile + dargestellt. Es werden nur die Werte angezeigt. Es sind max. 2 Zeilen zulässig.
      +
      +
      Parameters:
      +
      namen - Namen der Werte, die im Kurztext angezeigt werden sollen.
      +
      +
      +
    • +
    • +
      +

      getLangtext

      +
      public abstract List<String> getLangtext(String[] namen)
      +
      Gibt die Beschreibung des Knoten / der Kante als Langtext für die Anzeige im + Tooltip-Fenster zurück. Dabei wird jeder Eintrag der Liste als eigene Zeile + dargestellt. Es wird jeweils die Bezeichnung und der Wert ausgegeben.
      +
      +
      Parameters:
      +
      namen - Namen der Werte, die im Tooltip angezeigt werden sollen.
      +
      +
      +
    • +
    • +
      +

      setGraph

      +
      public void setGraph(graph.Graph g)
      +
      Speichert den Graphen, in den Knoten/Kante eingefügt wurde. Damit kann er selbst seine Nummer + ermitteln.
      +
      +
      Parameters:
      +
      g - Graph
      +
      +
      +
    • +
    • +
      +

      set

      +
      public void set(String name, + String wert)
      +
      Speichert zusätzliche Daten am Knoten oder der Kante
      +
      +
      Parameters:
      +
      name - Bezeichnung der Art der Daten
      +
      wert - Wert der zu speichernden Daten
      +
      +
      +
    • +
    • +
      +

      set

      +
      public void set(String name, + double wert)
      +
      Speichert zusätzliche Daten am Knoten oder der Kante + Double.POSITIVE_INFINITY bzw. NEGATIVE_INFINITY wird als +/- unendlich dargestellt
      +
      +
      Parameters:
      +
      name - Bezeichnung der Art der Daten
      +
      wert - Wert der zu speichernden Daten
      +
      +
      +
    • +
    • +
      +

      set

      +
      public void set(String name, + int wert)
      +
      Speichert zusätzliche Daten am Knoten oder der Kante + Integer.MAX_VALUE bzw. MIN_VALUE werden als +/- unendlich dargestellt.
      +
      +
      Parameters:
      +
      name - Bezeichnung der Art der Daten
      +
      wert - Wert der zu speichernden Daten
      +
      +
      +
    • +
    • +
      +

      set

      +
      public void set(String name, + boolean wert)
      +
      Speichert zusätzliche Daten am Knoten oder der Kante
      +
      +
      Parameters:
      +
      name - Bezeichnung der Art der Daten
      +
      wert - Wert der zu speichernden Daten
      +
      +
      +
    • +
    • +
      +

      getString

      +
      public String getString(String name)
      +
      Gibt zusätzliche Daten als String zurück
      +
      +
      Parameters:
      +
      name - Bezeichnung der zusätzlichen Daten
      +
      Returns:
      +
      Wert von "name" oder "", wenn name nicht gespeichert ist
      +
      +
      +
    • +
    • +
      +

      getInt

      +
      public int getInt(String name)
      +
      Gibt zusätzliche Daten als int zurück
      +
      +
      Parameters:
      +
      name - Bezeichnung der zusätzlichen Daten
      +
      Returns:
      +
      Wert von "name" oder 0, wenn name nicht gespeichert ist oder keine Zahl ist
      +
      +
      +
    • +
    • +
      +

      getDouble

      +
      public double getDouble(String name)
      +
      Gibt zusätzliche Daten als int zurück
      +
      +
      Parameters:
      +
      name - Bezeichnung der zusätzlichen Daten
      +
      Returns:
      +
      Wert von "name" oder 0, wenn name nicht gespeichert ist oder keine Zahl ist
      +
      +
      +
    • +
    • +
      +

      getBoolean

      +
      public boolean getBoolean(String name)
      +
      Gibt zusätzliche Daten als int zurück
      +
      +
      Parameters:
      +
      name - Bezeichnung der zusätzlichen Daten
      +
      Returns:
      +
      Wert von "name" oder false, wenn name nicht gespeichert ist oder kein Boolean ist
      +
      +
      +
    • +
    • +
      +

      compareTo

      +
      public int compareTo(GraphElement e)
      +
      Vergleicht den Knoten/Kante mit einem anderen Knoten/Kante bezüglich seines Sortierkriteriums + Das Sortierkriterium ist normalerweise der "Wert", kann aber mit setSortierkriterium gesetzt werden.
      +
      +
      Specified by:
      +
      compareTo in interface Comparable<GraphElement>
      +
      Parameters:
      +
      e - anderer Knoten
      +
      Returns:
      +
      kleiner 0 der andere Knoten hat einen größeren Wert, größer 0 der andere Knoten hat einen kleineren Wert, gleich 0 beide sind gleich
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/GraphOptions.html b/Quellcodes/alg_ds_graphentester/doc/graph/GraphOptions.html new file mode 100644 index 0000000..d725772 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/GraphOptions.html @@ -0,0 +1,577 @@ + + + + + +GraphOptions (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package graph
+

Class GraphOptions

+
+
+ +
+
    +
  • +
    +
    public class GraphOptions
    +extends Object
    +
    Die Klasse GraphOptions speichert, wie ein Graph in einem Fenster vom + GraphPlotter angezeigt wird.
    +
    +
    Version:
    +
    v6.7 (9.12.2020)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        bildDatei

        +
        public String bildDatei
        +
      • +
      + + + +
        +
      • +

        bildAnzeigen

        +
        public boolean bildAnzeigen
        +
      • +
      + + + +
        +
      • +

        vertexSize

        +
        public int vertexSize
        +
      • +
      + + + +
        +
      • +

        showEdgeWeights

        +
        public boolean showEdgeWeights
        +
      • +
      + + + +
        +
      • +

        showVertexValue

        +
        public boolean showVertexValue
        +
      • +
      + + + +
        +
      • +

        showVertexText

        +
        public boolean showVertexText
        +
      • +
      + + + +
        +
      • +

        showVertexInfo

        +
        public boolean showVertexInfo
        +
      • +
      + + + +
        +
      • +

        saveAsMatrix

        +
        public boolean saveAsMatrix
        +
      • +
      + + + +
        +
      • +

        stdFarbenKnoten

        +
        public String[] stdFarbenKnoten
        +
      • +
      + + + +
        +
      • +

        stdFarbenKanten

        +
        public String[] stdFarbenKanten
        +
      • +
      + + + +
        +
      • +

        farbenKnoten

        +
        public String[] farbenKnoten
        +
      • +
      + + + +
        +
      • +

        farbenKanten

        +
        public String[] farbenKanten
        +
      • +
      + + + +
        +
      • +

        fokusArt

        +
        public int fokusArt
        +
      • +
      + + + + + + + +
        +
      • +

        auswahl

        +
        public int auswahl
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphOptions

        +
        public GraphOptions()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        ladeGraph

        +
        public void ladeGraph​(Table csvParser)
        +
      • +
      + + + +
        +
      • +

        getText

        +
        public String getText()
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/GraphPlotter.html b/Quellcodes/alg_ds_graphentester/doc/graph/GraphPlotter.html new file mode 100644 index 0000000..b26e18e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/GraphPlotter.html @@ -0,0 +1,560 @@ + + + + + +GraphPlotter + + + + + + + + + +
+
+
Package graph
+

Class GraphPlotter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javafx.scene.Node
    • +
    • +
        +
      • javafx.scene.Parent
      • +
      • +
          +
        • javafx.scene.layout.Region
        • +
        • +
            +
          • javafx.scene.control.Control
          • +
          • +
              +
            • javafx.scene.control.ScrollPane
            • +
            • +
                +
              • imp.PictureViewer
              • +
              • +
                  +
                • graph.GraphPlotter
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable
    +
    +
    +
    public class GraphPlotter
    +extends imp.PictureViewer
    +
    Der GraphPlotter ist das Herzstueck der Visualisierung und dient als Schnittstelle zur GUI.
    +
    +
    Version:
    +
    09.12.2020 (v6.7)
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javafx.scene.control.ScrollPane

        +javafx.scene.control.ScrollPane.ScrollBarPolicy
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class imp.PictureViewer

        +FIT, NORMAL
      • +
      +
        +
      • + + +

        Fields inherited from class javafx.scene.layout.Region

        +USE_COMPUTED_SIZE, USE_PREF_SIZE
      • +
      +
        +
      • + + +

        Fields inherited from class javafx.scene.Node

        +BASELINE_OFFSET_SAME_AS_HEIGHT
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      GraphPlotter() +
      Der Konstruktor legt sowohl Einstellungen des mxGraphen (Drag&Drop, Editable, ...) als auch des Graphen (gewichtet, gerichtet, ...) fest.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidausgabe() +
      Gibt die String-Repraesentation des GraphPlotters auf der Konsole aus.
      +
      graph.GraphgetGraph() +
      Gibt den Graphen zurueck.
      +
      graph.GraphOptionsgetGraphOptions() 
      graph.GraphElementgetRestrictTo() 
      graph.KantegetSelectedKante() +
      Gibt das selektierte Kantenobjekt zurueck.
      +
      graph.KnotengetSelectedKnoten() +
      Gibt das selektierte Knotenobjekt zurueck.
      +
      java.util.List<graph.Knoten>getSelectedKnotenListe() +
      Gibt die selektierte KnotenobjektListe (als Array) zurueck.
      +
      voidmouseClicked​(javafx.scene.input.MouseEvent mouseEvent) 
      voidmouseDown​(javafx.scene.input.MouseEvent mouseEvent) 
      voidmouseDragged​(javafx.scene.input.MouseEvent mouseEvent) 
      voidmouseUp​(javafx.scene.input.MouseEvent mouseEvent) 
      voidsetEditable() 
      voidsetGraph​(graph.Graph graph, + graph.GraphOptions options) 
      voidsetRestrictTo​(graph.GraphElement k) 
      java.lang.StringtoString() +
      Ueberschreibt die Methode toString.
      +
      voidupdateImage() 
      +
        +
      • + + +

        Methods inherited from class imp.PictureViewer

        +back, getImage, pushImage, repaint, setImage, setZoom
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.ScrollPane

        +contentProperty, createDefaultSkin, fitToHeightProperty, fitToWidthProperty, getClassCssMetaData, getContent, getControlCssMetaData, getHbarPolicy, getHmax, getHmin, getHvalue, getInitialFocusTraversable, getMinViewportHeight, getMinViewportWidth, getPrefViewportHeight, getPrefViewportWidth, getVbarPolicy, getViewportBounds, getVmax, getVmin, getVvalue, hbarPolicyProperty, hmaxProperty, hminProperty, hvalueProperty, isFitToHeight, isFitToWidth, isPannable, minViewportHeightProperty, minViewportWidthProperty, pannableProperty, prefViewportHeightProperty, prefViewportWidthProperty, queryAccessibleAttribute, setContent, setFitToHeight, setFitToWidth, setHbarPolicy, setHmax, setHmin, setHvalue, setMinViewportHeight, setMinViewportWidth, setPannable, setPrefViewportHeight, setPrefViewportWidth, setVbarPolicy, setViewportBounds, setVmax, setVmin, setVvalue, vbarPolicyProperty, viewportBoundsProperty, vmaxProperty, vminProperty, vvalueProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Control

        +computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getSkin, getTooltip, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.layout.Region

        +backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.Parent

        +getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.Node

        +accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GraphPlotter

        +
        public GraphPlotter()
        +
        Der Konstruktor legt sowohl Einstellungen des mxGraphen (Drag&Drop, Editable, ...) als auch des Graphen (gewichtet, gerichtet, ...) fest.
        +
        +
        Parameters:
        +
        boolean - isDirected Gibt an, ob der Graph gerichtet oder ungerichtet ist
        +
        boolean - isWeighted Gibt an, ob der Graph gewichtet oder ungewichtet ist
        +
        String - hintergrundBild Gibt den Namen eines Hintergrundbildes an
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setEditable

        +
        public void setEditable()
        +
      • +
      + + + +
        +
      • +

        setGraph

        +
        public void setGraph​(graph.Graph graph,
        +                     graph.GraphOptions options)
        +
      • +
      + + + +
        +
      • +

        setRestrictTo

        +
        public void setRestrictTo​(graph.GraphElement k)
        +
      • +
      + + + +
        +
      • +

        getRestrictTo

        +
        public graph.GraphElement getRestrictTo()
        +
      • +
      + + + +
        +
      • +

        mouseClicked

        +
        public void mouseClicked​(javafx.scene.input.MouseEvent mouseEvent)
        +
      • +
      + + + +
        +
      • +

        mouseDown

        +
        public void mouseDown​(javafx.scene.input.MouseEvent mouseEvent)
        +
      • +
      + + + +
        +
      • +

        mouseDragged

        +
        public void mouseDragged​(javafx.scene.input.MouseEvent mouseEvent)
        +
      • +
      + + + +
        +
      • +

        mouseUp

        +
        public void mouseUp​(javafx.scene.input.MouseEvent mouseEvent)
        +
      • +
      + + + +
        +
      • +

        updateImage

        +
        public void updateImage()
        +
      • +
      + + + +
        +
      • +

        getGraphOptions

        +
        public graph.GraphOptions getGraphOptions()
        +
      • +
      + + + +
        +
      • +

        getGraph

        +
        public graph.Graph getGraph()
        +
        Gibt den Graphen zurueck.
        +
        +
        Returns:
        +
        Graph
        +
        +
      • +
      + + + +
        +
      • +

        getSelectedKnoten

        +
        public graph.Knoten getSelectedKnoten()
        +
        Gibt das selektierte Knotenobjekt zurueck.
        +
        +
        Returns:
        +
        Object
        +
        +
      • +
      + + + +
        +
      • +

        getSelectedKnotenListe

        +
        public java.util.List<graph.Knoten> getSelectedKnotenListe()
        +
        Gibt die selektierte KnotenobjektListe (als Array) zurueck.
        +
        +
        Returns:
        +
        Object[]
        +
        +
      • +
      + + + +
        +
      • +

        getSelectedKante

        +
        public graph.Kante getSelectedKante()
        +
        Gibt das selektierte Kantenobjekt zurueck.
        +
        +
        Returns:
        +
        Object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Ueberschreibt die Methode toString. Eine String-Repraesentation des GraphPlotters wird ausgegeben.
        +
        +
        Overrides:
        +
        toString in class javafx.scene.Node
        +
        Returns:
        +
        String Die String-Repraesentation des GraphPlotters
        +
        +
      • +
      + + + +
        +
      • +

        ausgabe

        +
        public void ausgabe()
        +
        Gibt die String-Repraesentation des GraphPlotters auf der Konsole aus.
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/Hilfe.html b/Quellcodes/alg_ds_graphentester/doc/graph/Hilfe.html new file mode 100644 index 0000000..4d9e77b --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/Hilfe.html @@ -0,0 +1,321 @@ + + + + + +Hilfe (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package graph
+

Interface Hilfe

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    Hilfefenster
    +
    +
    +
    public interface Hilfe
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        loescheAlles

        +
        void loescheAlles()
        +
      • +
      + + + +
        +
      • +

        append

        +
        void append​(String text)
        +
      • +
      + + + +
        +
      • +

        indentMore

        +
        void indentMore()
        +
      • +
      + + + +
        +
      • +

        indentLess

        +
        void indentLess()
        +
      • +
      + + + +
        +
      • +

        setGraphPlotter

        +
        void setGraphPlotter​(GraphPlotter gp)
        +
      • +
      + + + +
        +
      • +

        setReviewAllowed

        +
        void setReviewAllowed​(boolean a)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/Kante.html b/Quellcodes/alg_ds_graphentester/doc/graph/Kante.html new file mode 100644 index 0000000..dcfe254 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/Kante.html @@ -0,0 +1,446 @@ + + + + +Kante + + + + + + + + + + + +
+
+
+ +
+
Package graph
+

Class Kante

+
+
java.lang.Object +
graph.GraphElement +
graph.Kante
+
+
+
+
+
All Implemented Interfaces:
+
Comparable<graph.GraphElement>
+
+
+
public class Kante +extends graph.GraphElement
+
Die Klasse Kante beschreibt die Datenstruktur einer Kante, bestehend aus Startknoten, Gewicht und Zielknoten. + Da Kanten innerhalb von Adjazenzlisten und -Matrizen repraesentiert werden, ist diese Klasse eigentlich unnoetig! + Sie wurde zum Zweck der Vereinfachung - sozusagen als Zwischenspeicher von Kanten - eingefuehrt. + Auch soll sie das Kantengewicht verwalten und Aufschluss darueber geben, ob sie gefaerbt/geloescht ist oder nicht.
+
+
Version:
+
28.02.2023 (v7.0) + v7.0: Die Kanteninformationen werden in einer Hashmap gespeichert. Daher können beliebige weitere Informationen abgelegt werden.
+
Author:
+
Dirk Zechnall, Thomas Schaller
+
+
+
+
    + +
  • +
    +

    Field Summary

    +
    +

    Fields inherited from class graph.GraphElement

    +daten, g, sortierKriterium, typen
    +
    +
  • + +
  • +
    +

    Constructor Summary

    +
    Constructors
    +
    +
    Constructor
    +
    Description
    +
    Kante(graph.Knoten neuerStart, + graph.Knoten neuerZiel, + double neuesGewicht)
    +
    +
    Der Konstruktor erstellt eine neue Kante mit Start- und Zielknoten und Kantengewicht.
    +
    +
    +
    +
  • + +
  • +
    +

    Method Summary

    +
    +
    +
    +
    +
    Modifier and Type
    +
    Method
    +
    Description
    +
    graph.Knoten
    +
    getAnderesEnde(graph.Knoten k)
    +
    +
    Gibt Knoten am anderen Ende der Kante zurueck
    +
    +
    int
    + +
    +
    Gibt zurueck, in welcher Farbe die Kante gezeichnet werden soll.
    +
    +
    double
    + +
    +
    Gibt das Gewicht der Kante zurueck
    +
    + + +
    +
    Liefert einen kurzen Text, der den Wert des Knotens angibt und innerhalb der Kreises + des Knotens angezeigt werden kann.
    +
    + + +
    +
    Liefert eine ausführliche Beschreibung der Werte des Knoten.
    +
    +
    graph.Knoten
    + +
    +
    Gibt den Startknoten der Kante zurueck
    +
    +
    graph.Knoten
    + +
    +
    Gibt den Zielknoten der Kante zurueck
    +
    +
    protected void
    + +
    +
    Die Methode init initialisiert die Kantenfaerbung (auf unmarkiert)
    +
    +
    boolean
    + +
    +
    Gibt den gelöscht-Wert der Kante zurueck
    +
    +
    boolean
    + +
    +
    Gibt zurück, ob die Kanten markiert ist
    +
    +
    void
    +
    setFarbe(int farbe)
    +
    +
    Setzt die Farbe auf einen bestimmten Farbindex
    +
    +
    void
    +
    setGeloescht(boolean wert)
    +
    +
    Setzt das gelöscht-Attribut der Kante
    +
    +
    void
    +
    setGewicht(double neuesGewicht)
    +
    +
    Setzt das Gewicht der Kante
    +
    +
    void
    +
    setMarkiert(boolean wert)
    +
    +
    Setzt das markiert-Attribut der Kante
    +
    +
    void
    + +
    +
    Setzt die Farbe auf die Standardfarbgebung zurück
    +
    +
    void
    +
    setStart(graph.Knoten neuerStartKnoten)
    +
    +
    Setzt den Startknoten der Kante
    +
    +
    void
    +
    setZiel(graph.Knoten neuerZielKnoten)
    +
    +
    Setzt den Zielknoten der Kante
    +
    + + +
    +
    Die Methode ueberschreibt die Methode toString() und gibt die String-Raepraesentation einer Kante zurueck
    +
    +
    +
    +
    +
    +

    Methods inherited from class graph.GraphElement

    +compareTo, getBoolean, getDouble, getInt, getStatus, getString, set, set, set, set, setGraph, setSortierkriterium, setStatus
    +
    +

    Methods inherited from class java.lang.Object

    +clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    +
    +
  • +
+
+
+
    + +
  • +
    +

    Constructor Details

    +
      +
    • +
      +

      Kante

      +
      public Kante(graph.Knoten neuerStart, + graph.Knoten neuerZiel, + double neuesGewicht)
      +
      Der Konstruktor erstellt eine neue Kante mit Start- und Zielknoten und Kantengewicht. + Die Kante ist zu Beginn ungefaerbt.
      +
      +
      Parameters:
      +
      neuerStart - Der neue Startknoten
      +
      neuerZiel - Der neue Zielknoten
      +
      neuesGewicht - Das neue Kantengewicht
      +
      +
      +
    • +
    +
    +
  • + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      init

      +
      protected void init()
      +
      Die Methode init initialisiert die Kantenfaerbung (auf unmarkiert)
      +
      +
    • +
    • +
      +

      getKurztext

      +
      public List<String> getKurztext(String[] namen)
      +
      Liefert einen kurzen Text, der den Wert des Knotens angibt und innerhalb der Kreises + des Knotens angezeigt werden kann.
      +
      +
      Specified by:
      +
      getKurztext in class graph.GraphElement
      +
      Parameters:
      +
      namen - Namen der Werte, die im Kurztext angezeigt werden sollen.
      +
      Returns:
      +
      Array von Anzeigezeilen (dürfen max. 2 sein)
      +
      +
      +
    • +
    • +
      +

      getLangtext

      +
      public List<String> getLangtext(String[] namen)
      +
      Liefert eine ausführliche Beschreibung der Werte des Knoten. Wird in dem Tooltext Fenster + angezeigt, wenn man mit der Maus über den Knoten geht.
      +
      +
      Specified by:
      +
      getLangtext in class graph.GraphElement
      +
      Parameters:
      +
      namen - Namen der Werte, die im Tooltip angezeigt werden sollen.
      +
      Returns:
      +
      Array von Anzeigezeilen
      +
      +
      +
    • +
    • +
      +

      setGewicht

      +
      public void setGewicht(double neuesGewicht)
      +
      Setzt das Gewicht der Kante
      +
      +
      Parameters:
      +
      neuesGewicht - Das neu zu setzende Gewicht
      +
      +
      +
    • +
    • +
      +

      getGewicht

      +
      public double getGewicht()
      +
      Gibt das Gewicht der Kante zurueck
      +
      +
      Returns:
      +
      Gewicht der Kante
      +
      +
      +
    • +
    • +
      +

      setStart

      +
      public void setStart(graph.Knoten neuerStartKnoten)
      +
      Setzt den Startknoten der Kante
      +
      +
      Parameters:
      +
      neuerSatrtKnoten - Der neu zu setzende Startknoten
      +
      +
      +
    • +
    • +
      +

      getStart

      +
      public graph.Knoten getStart()
      +
      Gibt den Startknoten der Kante zurueck
      +
      +
      Returns:
      +
      Startknoten
      +
      +
      +
    • +
    • +
      +

      setZiel

      +
      public void setZiel(graph.Knoten neuerZielKnoten)
      +
      Setzt den Zielknoten der Kante
      +
      +
      Parameters:
      +
      neuerZielKnoten - Der neu zu setzende Zielknoten
      +
      +
      +
    • +
    • +
      +

      getZiel

      +
      public graph.Knoten getZiel()
      +
      Gibt den Zielknoten der Kante zurueck
      +
      +
      Returns:
      +
      Zielknoten
      +
      +
      +
    • +
    • +
      +

      getAnderesEnde

      +
      public graph.Knoten getAnderesEnde(graph.Knoten k)
      +
      Gibt Knoten am anderen Ende der Kante zurueck
      +
      +
      Parameters:
      +
      k - Knoten am ersten Ende der Kante
      +
      Returns:
      +
      Knoten am anderen Ende
      +
      +
      +
    • +
    • +
      +

      setMarkiert

      +
      public void setMarkiert(boolean wert)
      +
      Setzt das markiert-Attribut der Kante
      +
      +
      Parameters:
      +
      wert - Der neu zu setzende markiert-Wert
      +
      +
      +
    • +
    • +
      +

      isMarkiert

      +
      public boolean isMarkiert()
      +
      Gibt zurück, ob die Kanten markiert ist
      +
      +
      Returns:
      +
      markiert?
      +
      +
      +
    • +
    • +
      +

      setGeloescht

      +
      public void setGeloescht(boolean wert)
      +
      Setzt das gelöscht-Attribut der Kante
      +
      +
      Parameters:
      +
      wert - Der neu zu setzende gelöscht-Wert
      +
      +
      +
    • +
    • +
      +

      isGeloescht

      +
      public boolean isGeloescht()
      +
      Gibt den gelöscht-Wert der Kante zurueck
      +
      +
      Returns:
      +
      gelöscht?
      +
      +
      +
    • +
    • +
      +

      getFarbe

      +
      public int getFarbe()
      +
      Gibt zurueck, in welcher Farbe die Kante gezeichnet werden soll. + Ist die Farbe nicht gesetzt, dann wird eine unmarkierte Kante in Farbe 1 + und eine markierte in Farbe 2 gezeichnet.
      +
      +
      Returns:
      +
      Nummer der Farbe
      +
      +
      +
    • +
    • +
      +

      setFarbe

      +
      public void setFarbe(int farbe)
      +
      Setzt die Farbe auf einen bestimmten Farbindex
      +
      +
      Parameters:
      +
      farbe - Index der Farbe (0-19)
      +
      +
      +
    • +
    • +
      +

      setStandardFarbe

      +
      public void setStandardFarbe()
      +
      Setzt die Farbe auf die Standardfarbgebung zurück
      +
      +
    • +
    • +
      +

      toString

      +
      public String toString()
      +
      Die Methode ueberschreibt die Methode toString() und gibt die String-Raepraesentation einer Kante zurueck
      +
      +
      Overrides:
      +
      toString in class Object
      +
      Returns:
      +
      String-Raepraesentation der Kante
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/Knoten.html b/Quellcodes/alg_ds_graphentester/doc/graph/Knoten.html new file mode 100644 index 0000000..23f0850 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/Knoten.html @@ -0,0 +1,830 @@ + + + + + +Knoten (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package graph
+

Class Knoten

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<GraphElement>
    +
    +
    +
    public class Knoten
    +extends GraphElement
    +
    Diese Klasse Knoten definiert einen Knoten. + Knoten haben eine Position, eine Farbe und einen Wert für sonstige Codierungszwecke und sind markiert und/oder besucht. + Im Infotext kann eine zusätzliche Information für die Anzeige gespeichert werden.
    +
    +
    Version:
    +
    22.07.2020 (v6.4)
    +
    Author:
    +
    Dirk Zechnall, Thomas Schaller
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Knoten​(int x, + int y) +
      Der Konstruktor erstellt einen neuen Knoten mit einem neuen Namen
      +
      Knoten​(int x, + int y, + double neuerWert) +
      Der Konstruktor erstellt einen neuen Knoten mit einem Startwert
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      intcompareTo​(GraphElement e) +
      Vergleicht den Knoten mit einem anderen Knoten bezüglich seines Werts
      +
      doublegetDoubleWert() +
      Gibt den Wert vom Knoten als Double-Wert zurueck
      +
      intgetFarbe() +
      Gibt den Index der Farbe des Knoten zurück.
      +
      StringgetInfotext() +
      Liefert den Infotext des Knotens
      +
      intgetIntWert() +
      Gibt den Wert vom Knoten als Integer-Wert zurueck
      +
      StringgetStatus() +
      Liefert den Status eines Knotens als Status-String + Format: wert,markiert,besucht,farbe + wobei wert eine double-Zahl, mariert und besucht ein boolean-Wert (0=false, 1 = true) und + farbe eine zahl ist.
      +
      intgetX() +
      Liefert die x-Position des Knotens
      +
      intgetY() +
      Liefert die y-Position des Knotens
      +
      protected voidinit() +
      Die Methode init initialisiert den Zustand eines Knotens
      +
      booleanisBesucht() +
      Gibt den Besuchtwert vom Knoten zurueck
      +
      booleanisFarbeAutomatisch() +
      Gibt zurück, ob die Knotenfarbe automatisch aus den Attributen ermittelt wird.
      +
      booleanisMarkiert() +
      Gibt den Markiertwert vom Knoten zurueck
      +
      voidsetBesucht​(boolean markiert) +
      Setzt das Besuchtattribut vom Knoten
      +
      voidsetFarbe​(int farbe) +
      Setzt den Index der Farbe des Knoten.
      +
      voidsetFarbeAutomatisch​(boolean auto) +
      Legt fest, ob die Knotenfarbe automatisch aus den Attributen ermittelt wird.
      +
      voidsetInfotext​(String infotext) +
      Setzt den Infotext für einen Knoten
      +
      voidsetMarkiert​(boolean markiert) +
      Setzt das Markiertattribut vom Knoten
      +
      voidsetStatus​(String status) +
      Setzt den Status eines Knotens aus einem Status-String + Format: wert,markiert,besucht,farbe + wobei wert eine double-Zahl, mariert und besucht ein boolean-Wert (0=false, 1 = true) und + farbe eine zahl ist.
      +
      voidsetWert​(double neuerWert) +
      Setzt den Wert beim Knoten
      +
      voidsetX​(int x) +
      Setzt die x-Position des Knotens
      +
      voidsetY​(int y) +
      Setzt die y-Position des Knotens
      +
      StringtoString() +
      Die Methode ueberschreibt die Methode toString() und gibt die String-Raepraesentation eines Knotens zurueck
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Knoten

        +
        public Knoten​(int x,
        +              int y)
        +
        Der Konstruktor erstellt einen neuen Knoten mit einem neuen Namen
        +
        +
        Parameters:
        +
        x - x-Position des Knotens
        +
        y - y-Position des Knotens
        +
        +
      • +
      + + + +
        +
      • +

        Knoten

        +
        public Knoten​(int x,
        +              int y,
        +              double neuerWert)
        +
        Der Konstruktor erstellt einen neuen Knoten mit einem Startwert
        +
        +
        Parameters:
        +
        x - x-Position des Knotens
        +
        y - y-Position des Knotens
        +
        neuerWert - Der neue Wert des Knotens
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setStatus

        +
        public void setStatus​(String status)
        +
        Setzt den Status eines Knotens aus einem Status-String + Format: wert,markiert,besucht,farbe + wobei wert eine double-Zahl, mariert und besucht ein boolean-Wert (0=false, 1 = true) und + farbe eine zahl ist.
        +
        +
        Specified by:
        +
        setStatus in class GraphElement
        +
        Parameters:
        +
        status - Der Statusstring
        +
        +
      • +
      + + + +
        +
      • +

        getStatus

        +
        public String getStatus()
        +
        Liefert den Status eines Knotens als Status-String + Format: wert,markiert,besucht,farbe + wobei wert eine double-Zahl, mariert und besucht ein boolean-Wert (0=false, 1 = true) und + farbe eine zahl ist.
        +
        +
        Specified by:
        +
        getStatus in class GraphElement
        +
        Returns:
        +
        Der Statusstring
        +
        +
      • +
      + + + +
        +
      • +

        init

        +
        protected void init()
        +
        Die Methode init initialisiert den Zustand eines Knotens
        +
      • +
      + + + +
        +
      • +

        setInfotext

        +
        public void setInfotext​(String infotext)
        +
        Setzt den Infotext für einen Knoten
        +
        +
        Parameters:
        +
        infotext - Der neue Text
        +
        +
      • +
      + + + +
        +
      • +

        getInfotext

        +
        public String getInfotext()
        +
        Liefert den Infotext des Knotens
        +
        +
        Returns:
        +
        Der Infotext
        +
        +
      • +
      + + + +
        +
      • +

        setWert

        +
        public void setWert​(double neuerWert)
        +
        Setzt den Wert beim Knoten
        +
        +
        Parameters:
        +
        neuerWert - Der neu zu setzende Wert
        +
        +
      • +
      + + + +
        +
      • +

        getIntWert

        +
        public int getIntWert()
        +
        Gibt den Wert vom Knoten als Integer-Wert zurueck
        +
        +
        Returns:
        +
        Wert des Knotens
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleWert

        +
        public double getDoubleWert()
        +
        Gibt den Wert vom Knoten als Double-Wert zurueck
        +
        +
        Returns:
        +
        Wert des Knotens
        +
        +
      • +
      + + + +
        +
      • +

        setMarkiert

        +
        public void setMarkiert​(boolean markiert)
        +
        Setzt das Markiertattribut vom Knoten
        +
        +
        Parameters:
        +
        markiert - Der neu zu setzende Markiertwert
        +
        +
      • +
      + + + +
        +
      • +

        isMarkiert

        +
        public boolean isMarkiert()
        +
        Gibt den Markiertwert vom Knoten zurueck
        +
        +
        Returns:
        +
        markiert?
        +
        +
      • +
      + + + +
        +
      • +

        setBesucht

        +
        public void setBesucht​(boolean markiert)
        +
        Setzt das Besuchtattribut vom Knoten
        +
        +
        Parameters:
        +
        markiert - Der neu zu setzende Besuchtwert
        +
        +
      • +
      + + + +
        +
      • +

        isBesucht

        +
        public boolean isBesucht()
        +
        Gibt den Besuchtwert vom Knoten zurueck
        +
        +
        Returns:
        +
        besucht?
        +
        +
      • +
      + + + +
        +
      • +

        getFarbe

        +
        public int getFarbe()
        +
        Gibt den Index der Farbe des Knoten zurück. + Standardmäßig hängt die Farbe von den Attributen markiert und besucht ab. + Durch Setzen der Farbe kann die Farbe gezielt gesetzt werden.
        +
        +
        Returns:
        +
        Farbe des Knotens
        +
        +
      • +
      + + + +
        +
      • +

        setFarbe

        +
        public void setFarbe​(int farbe)
        +
        Setzt den Index der Farbe des Knoten. + Standardmäßig hängt die Farbe von den Attributen markiert, besucht und beendet ab. + Durch Setzen der Farbe kann die Farbe gezielt gesetzt werden.
        +
        +
        Parameters:
        +
        farbe - Index der Farbe (0-19)
        +
        +
      • +
      + + + +
        +
      • +

        isFarbeAutomatisch

        +
        public boolean isFarbeAutomatisch()
        +
        Gibt zurück, ob die Knotenfarbe automatisch aus den Attributen ermittelt wird.
        +
        +
        Returns:
        +
        true=Farbe wird automatisch bestimmt, false=Farbe wurde explizit gesetzt.
        +
        +
      • +
      + + + +
        +
      • +

        setFarbeAutomatisch

        +
        public void setFarbeAutomatisch​(boolean auto)
        +
        Legt fest, ob die Knotenfarbe automatisch aus den Attributen ermittelt wird.
        +
        +
        Parameters:
        +
        auto - true=Farbe wird automatisch bestimmt, + false=Farbe wird explizit gesetzt.
        +
        +
      • +
      + + + +
        +
      • +

        getX

        +
        public int getX()
        +
        Liefert die x-Position des Knotens
        +
        +
        Returns:
        +
        x-Postion
        +
        +
      • +
      + + + +
        +
      • +

        getY

        +
        public int getY()
        +
        Liefert die y-Position des Knotens
        +
        +
        Returns:
        +
        y-Postion
        +
        +
      • +
      + + + +
        +
      • +

        setX

        +
        public void setX​(int x)
        +
        Setzt die x-Position des Knotens
        +
        +
        Parameters:
        +
        x - x-Postion
        +
        +
      • +
      + + + +
        +
      • +

        setY

        +
        public void setY​(int y)
        +
        Setzt die y-Position des Knotens
        +
        +
        Parameters:
        +
        y - y-Postion
        +
        +
      • +
      + + + +
        +
      • +

        compareTo

        +
        public int compareTo​(GraphElement e)
        +
        Vergleicht den Knoten mit einem anderen Knoten bezüglich seines Werts
        +
        +
        Specified by:
        +
        compareTo in interface Comparable<GraphElement>
        +
        Specified by:
        +
        compareTo in class GraphElement
        +
        Parameters:
        +
        e - anderer Knoten
        +
        Returns:
        +
        kleiner 0 der andere Knoten hat einen größeren Wert, größer 0 der andere Knoten hat einen kleineren Wert, gleich 0 beide sind gleich
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Die Methode ueberschreibt die Methode toString() und gibt die String-Raepraesentation eines Knotens zurueck
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        String-Raepraesentation des Knotens
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/package-summary.html b/Quellcodes/alg_ds_graphentester/doc/graph/package-summary.html new file mode 100644 index 0000000..810dc25 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/package-summary.html @@ -0,0 +1,48 @@ + + + + +graph + + + + + + + + + + + +
+
+
+
+

Package graph

+
+
+
package graph
+
+
    +
  • +
    +
    Classes
    +
    +
    Class
    +
    Description
    + +
    +
    Die Klasse GraphElement ist eine Oberklasse von Knoten und Kanten.
    +
    +
    +
    +
  • +
+
+
+
+
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/graph/package-tree.html b/Quellcodes/alg_ds_graphentester/doc/graph/package-tree.html new file mode 100644 index 0000000..10a9dae --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/graph/package-tree.html @@ -0,0 +1,198 @@ + + + + + +graph Class Hierarchy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package graph

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • graph.Graph
    • +
    • graph.GraphElement (implements java.lang.Comparable<T>) + +
    • +
    • graph.GraphOptions
    • +
    • javafx.scene.Node (implements javafx.event.EventTarget, javafx.css.Styleable) +
        +
      • javafx.scene.Parent +
          +
        • javafx.scene.layout.Region +
            +
          • javafx.scene.control.Control (implements javafx.scene.control.Skinnable) + +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
+

Interface Hierarchy

+ +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/help-doc.html b/Quellcodes/alg_ds_graphentester/doc/help-doc.html new file mode 100644 index 0000000..c4bb86b --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/help-doc.html @@ -0,0 +1,265 @@ + + + + + +API Help (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +
    +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
    +
  • +
  • +
    +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain six categories:

    +
      +
    • Interfaces
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
    +
  • +
  • +
    +

    Class or Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class Inheritance Diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class or Interface Declaration
    • +
    • Class or Interface Description
    • +
    +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Property Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
    +
      +
    • Field Detail
    • +
    • Property Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
    +
  • +
  • +
    +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type Declaration
    • +
    • Annotation Type Description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
    +
  • +
  • +
    +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum Declaration
    • +
    • Enum Description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
    +
  • +
  • +
    +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking on "Tree" displays the hierarchy for only that package.
    • +
    +
    +
  • +
  • +
    +

    Index

    +

    The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields, as well as lists of all packages and all classes.

    +
    +
  • +
  • +
    +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
    +
  • +
  • +
    +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
    +
  • +
  • +
    +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
    +
  • +
  • +
    +

    Search

    +

    You can search for definitions of modules, packages, types, fields, methods and other terms defined in the API, using some or all of the name. "Camel-case" abbreviations are supported: for example, "InpStr" will find "InputStream" and "InputStreamReader".

    +
    +
  • +
+
+This help file applies to API documentation generated by the standard doclet.
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/HSB.html b/Quellcodes/alg_ds_graphentester/doc/imp/HSB.html new file mode 100644 index 0000000..d10b234 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/HSB.html @@ -0,0 +1,394 @@ + + + + + +HSB (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package imp
+

Class HSB

+
+
+ +
+
    +
  • +
    +
    public class HSB
    +extends Object
    +
    Hilfsklasse für das HSB-Farbmodell
    +
    +
    Version:
    +
    V1.0 14.01.2020
    +
    Author:
    +
    Thomas Schaller
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HSB

        +
        public HSB()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getHue

        +
        public static double getHue​(Color c)
        +
        Liefert den Farbton als Winkel zwischen 0.0° und 360.0°.
        +
        +
        Parameters:
        +
        Color - c Farbe, deren Farbton bestimmt werden soll.
        +
        Returns:
        +
        Farbton
        +
        +
      • +
      + + + +
        +
      • +

        getSaturation

        +
        public static double getSaturation​(Color c)
        +
        Liefert die Sättigung als Wert zwischen 0.0 (0%) und 1.0 (100%).
        +
        +
        Parameters:
        +
        Color - c Farbe, deren Sättigung bestimmt werden soll.
        +
        Returns:
        +
        Sättigung
        +
        +
      • +
      + + + +
        +
      • +

        getBrightness

        +
        public static double getBrightness​(Color c)
        +
        Liefert die Helligkeit als Wert zwischen 0.0 (0%) und 1.0 (100%).
        +
        +
        Parameters:
        +
        Color - c Farbe, deren Helligkeit bestimmt werden soll.
        +
        Returns:
        +
        Sättigung
        +
        +
      • +
      + + + +
        +
      • +

        getColor

        +
        public static Color getColor​(double h,
        +                             double s,
        +                             double b)
        +
        Liefert ein Java-Color-Objekt mit den angegebenen HSB-Werten.
        +
        +
        Parameters:
        +
        h - Farbton (Hue)
        +
        s - Sättigung (Saturation)
        +
        b - Brightness (Helligkeit)
        +
        Returns:
        +
        Java-Color-Objekt
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/NumberField.html b/Quellcodes/alg_ds_graphentester/doc/imp/NumberField.html new file mode 100644 index 0000000..485caa7 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/NumberField.html @@ -0,0 +1,516 @@ + + + + + +NumberField (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package imp
+

Class NumberField

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javafx.scene.Node
    • +
    • +
        +
      • javafx.scene.Parent
      • +
      • +
          +
        • javafx.scene.layout.Region
        • +
        • +
            +
          • javafx.scene.control.Control
          • +
          • +
              +
            • javafx.scene.control.TextInputControl
            • +
            • +
                +
              • javafx.scene.control.TextField
              • +
              • +
                  +
                • imp.NumberField
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable
    +
    +
    +
    public class NumberField
    +extends javafx.scene.control.TextField
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javafx.scene.control.TextInputControl

        +javafx.scene.control.TextInputControl.Content
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javafx.scene.control.TextField

        +DEFAULT_PREF_COLUMN_COUNT
      • +
      +
        +
      • + + +

        Fields inherited from class javafx.scene.layout.Region

        +USE_COMPUTED_SIZE, USE_PREF_SIZE
      • +
      +
        +
      • + + +

        Fields inherited from class javafx.scene.Node

        +BASELINE_OFFSET_SAME_AS_HEIGHT
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      NumberField() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      doublegetDoubleValue() 
      intgetIntValue() 
      voidreplaceSelection​(String text) 
      voidreplaceText​(int start, + int end, + String text) 
      voidsetValue​(double v) 
      voidsetValue​(int v) 
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.TextField

        +alignmentProperty, createDefaultSkin, getAlignment, getCharacters, getClassCssMetaData, getControlCssMetaData, getOnAction, getPrefColumnCount, onActionProperty, prefColumnCountProperty, setAlignment, setOnAction, setPrefColumnCount
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.TextInputControl

        +anchorProperty, appendText, backward, cancelEdit, caretPositionProperty, clear, commitValue, copy, cut, deleteNextChar, deletePreviousChar, deleteText, deleteText, deselect, editableProperty, end, endOfNextWord, executeAccessibleAction, extendSelection, fontProperty, forward, getAnchor, getCaretPosition, getContent, getFont, getLength, getPromptText, getSelectedText, getSelection, getText, getText, getTextFormatter, home, insertText, isEditable, isRedoable, isUndoable, lengthProperty, nextWord, paste, positionCaret, previousWord, promptTextProperty, queryAccessibleAttribute, redo, redoableProperty, replaceText, selectAll, selectBackward, selectedTextProperty, selectEnd, selectEndOfNextWord, selectForward, selectHome, selectionProperty, selectNextWord, selectPositionCaret, selectPreviousWord, selectRange, setEditable, setFont, setPromptText, setText, setTextFormatter, textFormatterProperty, textProperty, undo, undoableProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Control

        +computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.layout.Region

        +backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.Parent

        +getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.Node

        +accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
      • +
      + +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NumberField

        +
        public NumberField()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        replaceText

        +
        public void replaceText​(int start,
        +                        int end,
        +                        String text)
        +
        +
        Overrides:
        +
        replaceText in class javafx.scene.control.TextInputControl
        +
        +
      • +
      + + + +
        +
      • +

        replaceSelection

        +
        public void replaceSelection​(String text)
        +
        +
        Overrides:
        +
        replaceSelection in class javafx.scene.control.TextInputControl
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleValue

        +
        public double getDoubleValue()
        +
      • +
      + + + +
        +
      • +

        getIntValue

        +
        public int getIntValue()
        +
      • +
      + + + +
        +
      • +

        setValue

        +
        public void setValue​(double v)
        +
      • +
      + + + +
        +
      • +

        setValue

        +
        public void setValue​(int v)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/Picture.html b/Quellcodes/alg_ds_graphentester/doc/imp/Picture.html new file mode 100644 index 0000000..30e75a6 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/Picture.html @@ -0,0 +1,1429 @@ + + + + + +Picture (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package imp
+

Class Picture

+
+
+ +
+
    +
  • +
    +
    public class Picture
    +extends Object
    +
    Bildklasse fuer die Simulation von Processing-Befehlen + + Diese Klasse stellt ein BufferedImage bereit, in das mit Processing-Befehlen gezeichnet + werden kann. + Zusaetzlich kann ein Bildanzeiger ueber jede Aenderung des Bildes informiert werden, + um "Zurueck"-Befehle zu ermoeglichen. Der Bildanzeiger ist entweder eine normale Java + ScrollPane oder ein Actor aus Greenfoot. + Die Dokumentation der einzelnen Zeichenmethoden ist der Processing-Reference + (https://processing.org/reference/ steht unter CC-Lizenz: https://creativecommons.org/) + entnommen und mit Deepl.com ins Deutsche uebersetzt.
    +
    +
    Version:
    +
    1.0 from 23.01.2019
    +
    Author:
    +
    Thomas Schaller (ZPG Informatik Klasse 9)
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static intCENTER 
      static intCORNER 
      static intCORNERS 
      static intRADIUS 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Picture() +
      Erzeugt ein Bild mit Standardgroesse 500x400
      +
      Picture​(int width, + int height) +
      Erzeugt ein Bild der angegeben Groesse
      +
      Picture​(int width, + int height, + String background) +
      Erzeugt ein Bild der angegebenen Groesse mit festgelegtem Hintergrund
      +
      Picture​(String filename) +
      Erzeugt ein Bild aus einer Datei
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidbackground​(int c) +
      Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird.
      +
      voidbackground​(int r, + int g, + int b) +
      Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird.
      +
      voidclear() +
      Loescht den Inhalt des Bildes.
      +
      voiddelay​(int millis) +
      Hilfsfunktion zum Verzoegern der Ausgabe
      +
      voidellipse​(int a, + int b, + int c, + int d) +
      Zeichnet eine Ellipse/Kreis auf das Bild.
      +
      voidellipseMode​(int mode) +
      Aendert den Koordinaten-Modus beim Zeichnen von Kreisen/Ellipsen.
      +
      voidfill​(int fillcolor) +
      Legt die Farbe fest, mit der Formen gefuellt werden.
      +
      voidfill​(int r, + int g, + int b) +
      Legt die Farbe fest, mit der Formen gefuellt werden.
      +
      voidfill​(String fillcolor) +
      Legt die Farbe fest, mit der Formen gefuellt werden.
      +
      voidforceRepaint() +
      Ein repaint() (das Neuzeichnen) kann manuell erzwungen werden.
      +
      intgetHeight() +
      Liefert die Hoehe des Bildes zurueck.
      +
      BufferedImagegetImage() +
      Direktes Abfragen des Bildes (fuer interne Zwecke)
      +
      PictureViewergetObserver() 
      Color[][]getPixelArray() +
      Liefert das Bild als zweidimensionales Pixel-Array.
      +
      intgetWidth() +
      Liefert die Breite des Bildes zurueck.
      +
      voidline​(int x1, + int y1, + int x2, + int y2) +
      Zeichnet eine Linie (einen direkten Weg zwischen zwei Punkten) auf den Bildschirm.
      +
      voidload​(String filename) +
      Laedt ein Bild aus dem Dateisystem.
      +
      voidnoFill() +
      Legt fest, dass die Formen nicht gefuellt werden sollen.
      +
      voidnoStroke() +
      Legt fest, dass keine Linien oder Raender um Formen gezeichnet werden soll.
      +
      voidpoint​(int x, + int y) +
      Zeichnet einen Punkt, d.h. einen Kreis in der Dimension eines Pixels.
      +
      voidpolygon​(int[] x, + int[] y) +
      Zeichnet ein Polygon auf das Bild.
      +
      voidquad​(int x1, + int y1, + int x2, + int y2, + int x3, + int y3, + int x4, + int y4) +
      Zeichnet ein Viereck auf das Bild.
      +
      voidrect​(int a, + int b, + int c, + int d) +
      Zeichnet ein Rechteck auf das Bild.
      +
      voidrectMode​(int mode) +
      Aendert den Koordinaten-Modus beim Zeichnen von Rechtecken.
      +
      voidsave​(String filename) +
      Speichert ein Bild.
      +
      voidsetAutoRefresh​(boolean autoRefresh) +
      Legt fest, ob nach jedem Zeichenbefehl automatisch das Bild auch in + der Oberflaeche aktualisiert wird.
      +
      voidsetImage​(BufferedImage b) +
      Direktes Setzen des Bildes (fuer interne Zwecke)
      +
      voidsetObserver​(PictureViewer observer) +
      Legt fest, wer das Bild anzeigt.
      +
      voidsetPixelArray​(Color[][] pixel) +
      Setzt das Bild neu auf Basis des Pixel-Arrays.
      +
      voidshowInFrame() 
      voidsize​(int width, + int height) +
      Definiert die Dimension der Breite und Hoehe des Anzeigefensters in Pixeleinheiten.
      +
      voidstroke​(int pencolor) +
      Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden.
      +
      voidstroke​(int r, + int g, + int b) +
      Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden.
      +
      voidstroke​(String pencolor) +
      Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden.
      +
      voidstrokeWeight​(double width) +
      Legt die Breite des Strichs fuer Linien, Punkte und den Rand um Formen fest.
      +
      voidtext​(String s, + int x, + int y) +
      Gibt einen Text an den gegebenen Koordinaten aus + Zur Ausgabe des Textes wird der ausgewaehlte Font verwendet.
      +
      voidtextFont​(Font font) +
      Legt die Schriftart fuer Textausgaben fest.
      +
      voidtextMode​(int mode) +
      Aendert den Koordinaten-Modus beim Zeichnen von Texten.
      +
      voidtriangle​(int x1, + int y1, + int x2, + int y2, + int x3, + int y3) +
      Zeichnet ein Dreieck auf das Bild.
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Picture

        +
        public Picture()
        +
        Erzeugt ein Bild mit Standardgroesse 500x400
        +
      • +
      + + + +
        +
      • +

        Picture

        +
        public Picture​(int width,
        +               int height)
        +
        Erzeugt ein Bild der angegeben Groesse
        +
        +
        Parameters:
        +
        width - Breite des Bildes
        +
        height - Hoehe des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        Picture

        +
        public Picture​(String filename)
        +
        Erzeugt ein Bild aus einer Datei
        +
        +
        Parameters:
        +
        filename - Dateiname des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        Picture

        +
        public Picture​(int width,
        +               int height,
        +               String background)
        +
        Erzeugt ein Bild der angegebenen Groesse mit festgelegtem Hintergrund
        +
        +
        Parameters:
        +
        width - Breite des Bildes
        +
        height - Hoehe des Bildes
        +
        background - Farbe des Hintergrunds
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        showInFrame

        +
        public void showInFrame()
        +
      • +
      + + + +
        +
      • +

        setObserver

        +
        public void setObserver​(PictureViewer observer)
        +
        Legt fest, wer das Bild anzeigt. + Diese ermoeglicht die Benachrichtung des Observers, wenn sich das Bild aendert.
        +
        +
        Parameters:
        +
        observer - Anzeiger des Bildes
        +
        +
      • +
      + + + + + + + +
        +
      • +

        setImage

        +
        public void setImage​(BufferedImage b)
        +
        Direktes Setzen des Bildes (fuer interne Zwecke)
        +
        +
        Parameters:
        +
        b - Bild, das gespeichert werden soll.
        +
        +
      • +
      + + + +
        +
      • +

        getImage

        +
        public BufferedImage getImage()
        +
        Direktes Abfragen des Bildes (fuer interne Zwecke)
        +
        +
        Returns:
        +
        Bild, das gerade gespeichert ist.
        +
        +
      • +
      + + + +
        +
      • +

        size

        +
        public void size​(int width,
        +                 int height)
        +
        Definiert die Dimension der Breite und Hoehe des Anzeigefensters in Pixeleinheiten. + Die eingebauten Variablen Breite und Hoehe werden durch die an diese Funktion uebergebenen Parameter festgelegt. So weist beispielsweise + der Befehl size(640, 480) der Variablen Breite 640 und der Variablen Hoehe 480 zu.
        +
        +
        Parameters:
        +
        width - Breite des Bildes
        +
        height - Hoehe des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        getWidth

        +
        public int getWidth()
        +
        Liefert die Breite des Bildes zurueck.
        +
        +
        Returns:
        +
        Breite des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        getHeight

        +
        public int getHeight()
        +
        Liefert die Hoehe des Bildes zurueck.
        +
        +
        Returns:
        +
        Hoehe des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        setAutoRefresh

        +
        public void setAutoRefresh​(boolean autoRefresh)
        +
        Legt fest, ob nach jedem Zeichenbefehl automatisch das Bild auch in + der Oberflaeche aktualisiert wird. Die Einstellung "false" beschleunigt + das Zeichnen aufwaendiger Bilder und verhindert "Flackern". + Das Neuzeichnen kann durch die Methode "refresh" gezielt ausgeloest werden.
        +
        +
        Parameters:
        +
        autorefresh - true = nach jedem Zeichenbefehl die Anzeige aktualisieren, false= nur durch die Methode refresh neu zeichnen
        +
        +
      • +
      + + + +
        +
      • +

        forceRepaint

        +
        public void forceRepaint()
        +
        Ein repaint() (das Neuzeichnen) kann manuell erzwungen werden.
        +
      • +
      + + + +
        +
      • +

        clear

        +
        public void clear()
        +
        Loescht den Inhalt des Bildes. + Der Hintergrund wird mit der Hintergrundfarbe neu gefuellt.
        +
      • +
      + + + +
        +
      • +

        rectMode

        +
        public void rectMode​(int mode)
        +
        Aendert den Koordinaten-Modus beim Zeichnen von Rechtecken. + Aendert die Position, von der aus Rechtecke gezeichnet werden, indem es die Art und Weise aendert, wie Parameter, die an rect() uebergeben werden, interpretiert werden. + Der Standardmodus ist rectMode(Bild.CORNER), der die ersten beiden Parameter von rect() als die linke obere Ecke der Form interpretiert, + waehrend der dritte und vierte Parameter seine Breite und Hoehe sind. + rectMode(Bild.CORNERS) interpretiert die ersten beiden Parameter von rect() als die Position einer Ecke + und die dritten und vierten Parameter als die Position der gegenueberliegenden Ecke. + rectMode(Bild.CENTER) interpretiert die ersten beiden Parameter von rect() als Mittelpunkt der Form, + waehrend der dritte und vierte Parameter seine Breite und Hoehe sind. + rectMode(RADIUS) verwendet auch die ersten beiden Parameter von rect() als Mittelpunkt der Form, + verwendet aber den dritten und vierten Parameter, um die Haelfte der Breite und Hoehe der Formen festzulegen.
        +
        +
        Parameters:
        +
        mode - Modus der Koordinateninterpretation (CORNER, CORNERS, CENTER oder RADIUS)
        +
        +
      • +
      + + + +
        +
      • +

        ellipseMode

        +
        public void ellipseMode​(int mode)
        +
        Aendert den Koordinaten-Modus beim Zeichnen von Kreisen/Ellipsen. + Aendert die Position, von der aus Kreise/Ellipsen gezeichnet werden, indem es die Art und Weise aendert, wie Parameter, die an ellipse() uebergeben werden, interpretiert werden. + Der Standardmodus ist ellipseMode(Bild.CENTER), der die ersten beiden Parameter von ellipse() als Mittelpunkt der Form interpretiert, + waehrend der dritte und vierte Parameter seine Breite und Hoehe sind. + ellipseMode(Bild.CORNER) interpretiert die ersten beiden Parameter von ellipse() als die Position einer Ecke + und die dritten und vierten Parameter als Breite und Hoehe der Form. + ellipseMode(Bild.CORNERS) interpretiert die ersten beiden Parameter von ellipse() als die Position einer Ecke + und die dritten und vierten Parameter als die Position der gegenueberliegenden Ecke. + ellipseMode(RADIUS) verwendet auch die ersten beiden Parameter von ellipse() als Mittelpunkt der Form, + verwendet aber den dritten und vierten Parameter, um die Haelfte der Breite und Hoehe der Formen festzulegen.
        +
        +
        Parameters:
        +
        mode - Modus der Koordinateninterpretation (CORNER, CORNERS, CENTER oder RADIUS)
        +
        +
      • +
      + + + +
        +
      • +

        textMode

        +
        public void textMode​(int mode)
        +
        Aendert den Koordinaten-Modus beim Zeichnen von Texten. + Aendert die Position, an der Texte gezeichnet werden, indem es die Art und Weise aendert, wie Parameter, die an text() uebergeben werden, interpretiert werden. + Der Standardmodus ist textMode(Bild.CORNER), der die Koordinaten von text() als + linke untere Ecke des Textes interpretiert. + textMode(Bild.CENTER) interpretiert sie als Koordinaten des Mittelpunktes des Textes..
        +
        +
        Parameters:
        +
        mode - Modus der Koordinateninterpretation (CORNER, CENTER)
        +
        +
      • +
      + + + +
        +
      • +

        line

        +
        public void line​(int x1,
        +                 int y1,
        +                 int x2,
        +                 int y2)
        +
        Zeichnet eine Linie (einen direkten Weg zwischen zwei Punkten) auf den Bildschirm. + Um eine Linie einzufaerben, verwenden Sie die stroke() Funktion. Eine Zeile kann nicht gefuellt werden, daher hat die Funktion fill() keinen + Einfluss auf die Farbe einer Zeile. Linien werden standardmaessig mit einer Breite von einem Pixel gezeichnet, dies kann jedoch mit der Funktion + strokeWeight() geaendert werden.
        +
        +
        Parameters:
        +
        x1 - x-Koordinate des 1. Punktes
        +
        y1 - y-Koordinate des 1. Punktes
        +
        x2 - x-Koordinate des 2. Punktes
        +
        y2 - y-Koordinate des 2. Punktes
        +
        +
      • +
      + + + +
        +
      • +

        rect

        +
        public void rect​(int a,
        +                 int b,
        +                 int c,
        +                 int d)
        +
        Zeichnet ein Rechteck auf das Bild. + Standardmaessig legen die ersten beiden Parameter die Position der linken oberen Ecke fest, der dritte die Breite und der vierte die Hoehe. + Die Art und Weise, wie diese Parameter interpretiert werden, kann jedoch mit der Funktion rectMode() geaendert werden. + Durch den Befehl fill() /noFill() kann die Fuellfarbe des Rechtecks gewaehlt werden, durch stroke()/noStroke() die Rahmenfarbe.
        +
        +
        Parameters:
        +
        a - meist die x-Koordinate der linken oberen Ecke (kann durch rectMode() geaendert werden).
        +
        b - meist die y-Koordinate der linken oberen Ecke (kann durch rectMode() geaendert werden).
        +
        c - meist die Breite des Rechtecks (kann durch rectMode() geaendert werden).
        +
        d - meist die Hoehe des Rechtecks (kann durch rectMode() geaendert werden).
        +
        +
      • +
      + + + +
        +
      • +

        ellipse

        +
        public void ellipse​(int a,
        +                    int b,
        +                    int c,
        +                    int d)
        +
        Zeichnet eine Ellipse/Kreis auf das Bild. + Standardmaessig legen die ersten beiden Parameter die Position des Mittelpunkts fest, der dritte die Breite und der vierte die Hoehe. + Die Art und Weise, wie diese Parameter interpretiert werden, kann jedoch mit der Funktion ellipseMode() geaendert werden. + Durch den Befehl fill() /noFill() kann die Fuellfarbe des Rechtecks gewaehlt werden, durch stroke()/noStroke() die Rahmenfarbe.
        +
        +
        Parameters:
        +
        a - meist die x-Koordinate des Mittelpunkts (kann durch ellipseMode() geaendert werden).
        +
        b - meist die y-Koordinate des Mittelpunkts (kann durch ellipseMode() geaendert werden).
        +
        c - meist die Breite des Rechtecks (kann durch ellipseMode() geaendert werden).
        +
        d - meist die Hoehe des Rechtecks (kann durch ellipseMode() geaendert werden).
        +
        +
      • +
      + + + +
        +
      • +

        triangle

        +
        public void triangle​(int x1,
        +                     int y1,
        +                     int x2,
        +                     int y2,
        +                     int x3,
        +                     int y3)
        +
        Zeichnet ein Dreieck auf das Bild. + Ein Dreieck ist eine Ebene, die durch die Verbindung von drei Punkten entsteht. Die ersten beiden Argumente spezifizieren den + ersten Punkt, die mittleren beiden Argumente spezifizieren den zweiten Punkt und die letzten beiden Argumente spezifizieren den dritten Punkt. + Durch den Befehl fill() /noFill() kann die Fuellfarbe des Rechtecks gewaehlt werden, durch stroke()/noStroke() die Rahmenfarbe.
        +
        +
        Parameters:
        +
        x1 - meist die x-Koordinate des 1. Punkts.
        +
        y1 - meist die y-Koordinate des 1. Punkts.
        +
        x2 - meist die x-Koordinate des 2. Punkts.
        +
        y2 - meist die y-Koordinate des 2. Punkts.
        +
        x3 - meist die x-Koordinate des 3. Punkts.
        +
        y3 - meist die y-Koordinate des 3. Punkts.
        +
        +
      • +
      + + + +
        +
      • +

        quad

        +
        public void quad​(int x1,
        +                 int y1,
        +                 int x2,
        +                 int y2,
        +                 int x3,
        +                 int y3,
        +                 int x4,
        +                 int y4)
        +
        Zeichnet ein Viereck auf das Bild. + Ein Viereck ist ein vierseitiges Polygon. Es ist aehnlich wie ein Rechteck, aber die Winkel zwischen seinen Kanten + sind nicht auf neunzig Grad beschraenkt. Das erste Paar von Parametern (x1,y1) setzt den ersten Scheitelpunkt und die nachfolgenden + Paare sollten im Uhrzeigersinn oder gegen den Uhrzeigersinn um die definierte Form herum verlaufen. + Durch den Befehl fill() /noFill() kann die Fuellfarbe des Rechtecks gewaehlt werden, durch stroke()/noStroke() die Rahmenfarbe.
        +
        +
        Parameters:
        +
        x1 - meist die x-Koordinate des 1. Punkts.
        +
        y1 - meist die y-Koordinate des 1. Punkts.
        +
        x2 - meist die x-Koordinate des 2. Punkts.
        +
        y2 - meist die y-Koordinate des 2. Punkts.
        +
        x3 - meist die x-Koordinate des 3. Punkts.
        +
        y3 - meist die y-Koordinate des 3. Punkts.
        +
        x4 - meist die x-Koordinate des 3. Punkts.
        +
        y4 - meist die y-Koordinate des 3. Punkts.
        +
        +
      • +
      + + + +
        +
      • +

        polygon

        +
        public void polygon​(int[] x,
        +                    int[] y)
        +
        Zeichnet ein Polygon auf das Bild. + Gleich lange Listen von x und y-Koordinaten bestimmen die Eckpunkte des Polygons. + Durch den Befehl fill() /noFill() kann die Fuellfarbe des Rechtecks gewaehlt werden, durch stroke()/noStroke() die Rahmenfarbe.
        +
        +
        Parameters:
        +
        x - Liste der x-Koordinaten der Punkte.
        +
        y - Liste der y-Koordinaten der Punkte.
        +
        +
      • +
      + + + +
        +
      • +

        point

        +
        public void point​(int x,
        +                  int y)
        +
        Zeichnet einen Punkt, d.h. einen Kreis in der Dimension eines Pixels. + Der erste Parameter ist der x-Wert fuer den Punkt, der zweite Wert ist der y-Wert fuer den Punkt.
        +
        +
        Parameters:
        +
        x - x-Koordinate des Punktes
        +
        y - y-Koordinate des Punktes
        +
        +
      • +
      + + + +
        +
      • +

        text

        +
        public void text​(String s,
        +                 int x,
        +                 int y)
        +
        Gibt einen Text an den gegebenen Koordinaten aus + Zur Ausgabe des Textes wird der ausgewaehlte Font verwendet. Dieser muss vorher mit textFont() festgelegt.
        +
        +
        Parameters:
        +
        s - Text, der angezeigt werden soll
        +
        x - x-Koordinate des Textanfangs
        +
        y - y-Koordinate der Grundlinie des Textes.
        +
        +
      • +
      + + + +
        +
      • +

        textFont

        +
        public void textFont​(Font font)
        +
        Legt die Schriftart fuer Textausgaben fest. + Jeder uebliche Java-Font kann verwendet werden. Er kann mit z.B. Font f = new Font( "Arial", Font.PLAIN, 14 ); definiert werden.
        +
        +
        Parameters:
        +
        font - ein Font-Objekt
        +
        +
      • +
      + + + +
        +
      • +

        stroke

        +
        public void stroke​(String pencolor)
        +
        Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden. + Diese Farbe wird hexadezimal in Form der RGB angegeben: z.B. "CCFFAA" oder "004E23". Die Syntax verwendet sechs Ziffern - je zwei fuer die roten, gruenen und blauen Komponenten, + um eine Farbe anzugeben (genau wie Farben typischerweise in HTML und CSS angegeben werden).
        +
        +
        Parameters:
        +
        pencolor - Stiftfarbe in Hexadezimaldarstellung
        +
        +
      • +
      + + + +
        +
      • +

        stroke

        +
        public void stroke​(int pencolor)
        +
        Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden. + Diese Farbe wird entweder als Graustufe (0-255) oder als 3-Byte RGB-Wert angegeben
        +
        +
        Parameters:
        +
        pencolor - Stiftfarbe (0-255: Graustufe zwischen 0 schwarz und 255 weiss, sonst: c wird als 3-Byte RGB-Wert interpretiert)
        +
        +
      • +
      + + + +
        +
      • +

        stroke

        +
        public void stroke​(int r,
        +                   int g,
        +                   int b)
        +
        Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden. + Diese Farbe wird komponentenweise als RGB-Wert angegeben
        +
        +
        Parameters:
        +
        r - Rotanteil (0-255) der Stiftfarbe
        +
        g - Gruenanteil (0-255) der Stiftfarbe
        +
        b - Blauanteil (0-255) der Stiftfarbe
        +
        +
      • +
      + + + +
        +
      • +

        noStroke

        +
        public void noStroke()
        +
        Legt fest, dass keine Linien oder Raender um Formen gezeichnet werden soll.
        +
      • +
      + + + +
        +
      • +

        strokeWeight

        +
        public void strokeWeight​(double width)
        +
        Legt die Breite des Strichs fuer Linien, Punkte und den Rand um Formen fest. + Alle Breiten werden in Pixeleinheiten angegeben.
        +
        +
        Parameters:
        +
        width - Breite in Pixel
        +
        +
      • +
      + + + +
        +
      • +

        fill

        +
        public void fill​(String fillcolor)
        +
        Legt die Farbe fest, mit der Formen gefuellt werden. + Diese Farbe wird hexadezimal in Form der RGB angegeben: z.B. "CCFFAA" oder "004E23". Die Syntax verwendet sechs Ziffern - je zwei fuer die roten, gruenen und blauen Komponenten, + um eine Farbe anzugeben (genau wie Farben typischerweise in HTML und CSS angegeben werden).
        +
        +
        Parameters:
        +
        fillcolor - Fuellfarbe in Hexadezimaldarstellung
        +
        +
      • +
      + + + +
        +
      • +

        fill

        +
        public void fill​(int fillcolor)
        +
        Legt die Farbe fest, mit der Formen gefuellt werden. + Diese Farbe wird entweder als Graustufe (0-255) oder als 3-Byte RGB-Wert angegeben.
        +
        +
        Parameters:
        +
        fillcolor - Fuellfarbe (0-255: Graustufe zwischen 0 schwarz und 255 weiss, sonst: c wird als 3-Byte RGB-Wert interpretiert)
        +
        +
      • +
      + + + +
        +
      • +

        fill

        +
        public void fill​(int r,
        +                 int g,
        +                 int b)
        +
        Legt die Farbe fest, mit der Formen gefuellt werden. + Diese Farbe wird komponentenweise als RGB-Wert angegeben.
        +
        +
        Parameters:
        +
        r - Rotanteil (0-255) der Fuellfarbe
        +
        g - Gruenanteil (0-255) der Fuellfarbe
        +
        b - Blauanteil (0-255) der Fuellfarbe
        +
        +
      • +
      + + + +
        +
      • +

        noFill

        +
        public void noFill()
        +
        Legt fest, dass die Formen nicht gefuellt werden sollen.
        +
      • +
      + + + +
        +
      • +

        background

        +
        public void background​(int c)
        +
        Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird. Der Standardhintergrund ist hellgrau. + Es ist nicht moeglich, den Alpha-Parameter Transparenz mit Hintergrundfarben auf der Hauptzeichnungsoberflaeche zu verwenden.
        +
        +
        Parameters:
        +
        c - Farbe fuer den Hintergrund (0-255: Graustufe zwischen 0 schwarz und 255 weiss, sonst: c wird als 3-Byte RGB-Wert interpretiert)
        +
        +
      • +
      + + + +
        +
      • +

        background

        +
        public void background​(int r,
        +                       int g,
        +                       int b)
        +
        Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird. Der Standardhintergrund ist hellgrau. + Es ist nicht moeglich, den Alpha-Parameter Transparenz mit Hintergrundfarben auf der Hauptzeichnungsoberflaeche zu verwenden.
        +
        +
        Parameters:
        +
        r - Rotanteil (0-255) der Hintergrundfarbe
        +
        g - Gruenanteil (0-255) der Hintergrundfarbe
        +
        b - Blauanteil (0-255) der Hintergrundfarbe
        +
        +
      • +
      + + + +
        +
      • +

        load

        +
        public void load​(String filename)
        +
        Laedt ein Bild aus dem Dateisystem. + Laedt ein Bild von einem Datentraeger und setzt Stiftfarbe und Fuellfarbe auf Standardwerte zurueck.
        +
        +
        Parameters:
        +
        filename - Dateiname des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        save

        +
        public void save​(String filename)
        +
        Speichert ein Bild. + Speichert ein Bild auf einem Datentraeger. Zulaessig sind die Dateiformate PNG und GIF. Die Dateiendung legt den Typ fest. + Standardmaessig wird die Dateiendung .png ergaenzt, wenn keine angegeben ist.
        +
        +
        Parameters:
        +
        filename - Dateiname des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        getPixelArray

        +
        public Color[][] getPixelArray()
        +
        Liefert das Bild als zweidimensionales Pixel-Array.
        +
        +
        Returns:
        +
        zweidimensionales Array von Color-Objekten, die den Pixeln des Bildes entsprechen.
        +
        +
      • +
      + + + +
        +
      • +

        setPixelArray

        +
        public void setPixelArray​(Color[][] pixel)
        +
        Setzt das Bild neu auf Basis des Pixel-Arrays. + Die Groesse des Bildes wird nicht automatisch an das Array angepasst.
        +
        +
        Parameters:
        +
        pixel - zweidimensionales Array von Color-Objekten
        +
        +
      • +
      + + + +
        +
      • +

        delay

        +
        public void delay​(int millis)
        +
        Hilfsfunktion zum Verzoegern der Ausgabe
        +
        +
        Parameters:
        +
        millis - Wartezeit in Millisekunden
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/PictureViewer.html b/Quellcodes/alg_ds_graphentester/doc/imp/PictureViewer.html new file mode 100644 index 0000000..d151c08 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/PictureViewer.html @@ -0,0 +1,673 @@ + + + + + +PictureViewer (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package imp
+

Class PictureViewer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javafx.scene.Node
    • +
    • +
        +
      • javafx.scene.Parent
      • +
      • +
          +
        • javafx.scene.layout.Region
        • +
        • +
            +
          • javafx.scene.control.Control
          • +
          • +
              +
            • javafx.scene.control.ScrollPane
            • +
            • +
                +
              • imp.PictureViewer
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable
    +
    +
    +
    Direct Known Subclasses:
    +
    GraphPlotter
    +
    +
    +
    public class PictureViewer
    +extends javafx.scene.control.ScrollPane
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javafx.scene.control.ScrollPane

        +javafx.scene.control.ScrollPane.ScrollBarPolicy
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static intFIT 
      static intNORMAL 
      +
        +
      • + + +

        Fields inherited from class javafx.scene.layout.Region

        +USE_COMPUTED_SIZE, USE_PREF_SIZE
      • +
      +
        +
      • + + +

        Fields inherited from class javafx.scene.Node

        +BASELINE_OFFSET_SAME_AS_HEIGHT
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      PictureViewer() +
      Erzeugt ein ScrollPanel mit integriertem Bild der Größe 1000x1000
      +
      PictureViewer​(int width, + int height) +
      Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe
      +
      PictureViewer​(int width, + int height, + String background) +
      Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe
      +
      PictureViewer​(Picture picture) +
      Erzeugt ein ScrollPanel und zeigt das Bild-Objekt an
      +
      PictureViewer​(String filename) +
      Erzeugt ein ScrollPanel mit integriertem Bild aus einer Bilddatei
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidback() +
      Ruft das letzte abgespeicherte Bild aus der History wieder auf.
      +
      PicturegetImage() +
      Liefert das angezeigte Bild
      +
      voidpushImage() +
      Speichert das übergebene Bild in der History.
      +
      voidrepaint() +
      Setzt das angezeigt Bild neu und beachtet dabei den Zoomfaktor.
      +
      voidsetImage​(Picture picture, + boolean saveOldImage) +
      Setzt das anzuzeigende Bild neu
      +
      voidsetZoom​(double factor) +
      Setzt den Zoom-Faktor für das Bild.
      +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.ScrollPane

        +contentProperty, createDefaultSkin, fitToHeightProperty, fitToWidthProperty, getClassCssMetaData, getContent, getControlCssMetaData, getHbarPolicy, getHmax, getHmin, getHvalue, getInitialFocusTraversable, getMinViewportHeight, getMinViewportWidth, getPrefViewportHeight, getPrefViewportWidth, getVbarPolicy, getViewportBounds, getVmax, getVmin, getVvalue, hbarPolicyProperty, hmaxProperty, hminProperty, hvalueProperty, isFitToHeight, isFitToWidth, isPannable, minViewportHeightProperty, minViewportWidthProperty, pannableProperty, prefViewportHeightProperty, prefViewportWidthProperty, queryAccessibleAttribute, setContent, setFitToHeight, setFitToWidth, setHbarPolicy, setHmax, setHmin, setHvalue, setMinViewportHeight, setMinViewportWidth, setPannable, setPrefViewportHeight, setPrefViewportWidth, setVbarPolicy, setViewportBounds, setVmax, setVmin, setVvalue, vbarPolicyProperty, viewportBoundsProperty, vmaxProperty, vminProperty, vvalueProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.control.Control

        +computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getSkin, getTooltip, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.layout.Region

        +backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.Parent

        +getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
      • +
      +
        +
      • + + +

        Methods inherited from class javafx.scene.Node

        +accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
      • +
      + +
        +
      • + + +

        Methods inherited from interface javafx.css.Styleable

        +getStyleableNode
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PictureViewer

        +
        public PictureViewer()
        +
        Erzeugt ein ScrollPanel mit integriertem Bild der Größe 1000x1000
        +
      • +
      + + + +
        +
      • +

        PictureViewer

        +
        public PictureViewer​(int width,
        +                     int height)
        +
        Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe
        +
        +
        Parameters:
        +
        width - Breite des Bildes
        +
        height - Höhe des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        PictureViewer

        +
        public PictureViewer​(int width,
        +                     int height,
        +                     String background)
        +
        Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe
        +
        +
        Parameters:
        +
        width - Breite des Bildes
        +
        height - Höhe des Bildes
        +
        background - Farbe des Hintergrunds als HEX-String (z.B. "FF3A45")
        +
        +
      • +
      + + + +
        +
      • +

        PictureViewer

        +
        public PictureViewer​(String filename)
        +
        Erzeugt ein ScrollPanel mit integriertem Bild aus einer Bilddatei
        +
        +
        Parameters:
        +
        filename - Name des Bildes
        +
        +
      • +
      + + + +
        +
      • +

        PictureViewer

        +
        public PictureViewer​(Picture picture)
        +
        Erzeugt ein ScrollPanel und zeigt das Bild-Objekt an
        +
        +
        Parameters:
        +
        picture - anzuzeigendes Bild
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setImage

        +
        public void setImage​(Picture picture,
        +                     boolean saveOldImage)
        +
        Setzt das anzuzeigende Bild neu
        +
        +
        Parameters:
        +
        picture - anzuzeigendes Bild
        +
        saveOldImage - soll das aktuelle Bild in der Historie gespeichert werden
        +
        +
      • +
      + + + +
        +
      • +

        getImage

        +
        public Picture getImage()
        +
        Liefert das angezeigte Bild
        +
        +
        Returns:
        +
        angezeigtes Bild
        +
        +
      • +
      + + + +
        +
      • +

        pushImage

        +
        public void pushImage()
        +
        Speichert das übergebene Bild in der History.
        +
        +
        Parameters:
        +
        b - zu speicherndes Bild
        +
        +
      • +
      + + + +
        +
      • +

        back

        +
        public void back()
        +
        Ruft das letzte abgespeicherte Bild aus der History wieder auf.
        +
      • +
      + + + +
        +
      • +

        repaint

        +
        public void repaint()
        +
        Setzt das angezeigt Bild neu und beachtet dabei den Zoomfaktor.
        +
      • +
      + + + +
        +
      • +

        setZoom

        +
        public void setZoom​(double factor)
        +
        Setzt den Zoom-Faktor für das Bild. + Als Zoomfaktor sind auch die Konstanten Bildanzeiger.FIT (auf Bildschirmgröße zoomen) und Bildanzeiger.NORMAL (100%) möglich.
        +
        +
        Parameters:
        +
        factor - Zoomfaktor (1.0 = 100%).
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/Table.html b/Quellcodes/alg_ds_graphentester/doc/imp/Table.html new file mode 100644 index 0000000..2cf13d8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/Table.html @@ -0,0 +1,1569 @@ + + + + + +Table (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package imp
+

Class Table

+
+
+ +
+
    +
  • +
    +
    public class Table
    +extends Object
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Table() +
      Erzeugt leeres Tabellen-Dokument.
      +
      Table​(String filename) +
      Erzeugt Tabellen-Dokument aus einer CSV-Datei.
      +
      Table​(String filename, + String options) +
      Erzeugt Tabellen-Dokument aus einer CSV-Datei.
      +
      Table​(String filename, + String options, + char separator, + char quote) +
      Erzeugt Tabellen-Dokument aus einer CSV-Datei.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidaddColumn() +
      Fügt eine neue Spalte am Ende der Tabelle an.
      +
      voidaddColumn​(String title) +
      Fügt eine neue Spalte am Ende der Tabelle an und benennt sie.
      +
      voidaddColumn​(String title, + String type) +
      Fügt eine neue Spalte am Ende der Tabelle an und benennt und typisiert sie.
      +
      TableRowaddRow() +
      Fügt eine neue Zeile an das Ende der Tabelle an.
      +
      voidclearRows() +
      Löscht alle Zeilen der Tabelle.
      +
      TableRowfindRow​(String value, + int column) +
      Sucht nach einem bestimmtem Wert in einer Zeile.
      +
      TableRowfindRow​(String value, + String name) +
      Sucht nach einem bestimmtem Wert in einer Zeile.
      +
      intgetColumnCount() +
      Liefert die Anzahl der Spalten in der Tabelle
      +
      doublegetDouble​(int row, + int column) +
      Liefert den Wert einer Zelle als Double-Zahl
      +
      doublegetDouble​(int row, + String name) +
      Liefert den Wert einer Zelle als Double-Zahl
      +
      double[]getDoubleColumn​(int column) +
      Liefert alle Werte einer Spalte als Double-Array.
      +
      double[]getDoubleColumn​(String name) +
      Liefert alle Werte einer Spalte als Double-Array.
      +
      double[]getDoubleRow​(int row) +
      Liefert alle Werte einer Spalte als Double-Array.
      +
      floatgetFloat​(int row, + int column) +
      Liefert den Wert einer Zelle als Float-Zahl
      +
      floatgetFloat​(int row, + String name) +
      Liefert den Wert einer Zelle als Float-Zahl
      +
      float[]getFloatColumn​(int column) +
      Liefert alle Werte einer Spalte als Float-Array.
      +
      float[]getFloatColumn​(String name) +
      Liefert alle Werte einer Spalte als Float-Array.
      +
      float[]getFloatRow​(int row) +
      Liefert alle Werte einer Zeile als Float-Array.
      +
      intgetInt​(int row, + int column) +
      Liefert den Wert einer Zelle als Integer-Zahl
      +
      intgetInt​(int row, + String name) +
      Liefert den Wert einer Zelle als Integer-Zahl
      +
      int[]getIntColumn​(int column) +
      Liefert alle Werte einer Spalte als Integer-Array.
      +
      int[]getIntColumn​(String name) +
      Liefert alle Werte einer Spalte als Integer-Array.
      +
      int[]getIntRow​(int row) +
      Liefert alle Werte einer Zeile als Integer-Array.
      +
      TableRowgetRow​(int i) +
      Liefert eine Zeile der Tabelle
      +
      intgetRowCount() +
      Liefert die Anzahl der Zeilen in der Tabelle
      +
      StringgetString​(int row, + int column) +
      Liefert den Wert einer Zelle als String
      +
      StringgetString​(int row, + String name) +
      Liefert den Wert einer Zelle als String
      +
      String[]getStringColumn​(int column) +
      Liefert alle Werte einer Spalte als String-Array.
      +
      String[]getStringColumn​(String name) +
      Liefert alle Werte einer Spalte als String-Array.
      +
      String[]getStringRow​(int row) +
      Liefert alle Werte einer Spalte als String-Array.
      +
      voidloadCSV​(String filename) +
      Liest den Inhalt einer CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"').
      +
      voidloadCSV​(String filename, + String options) +
      Liest den Inhalt einer CSV-Datei (Separator = ';', Kennung für Text = '"').
      +
      voidloadCSV​(String filename, + String options, + char separator, + char quote) +
      Liest den Inhalt einer CSV-Datei.
      +
      voidremoveColumn​(int i) +
      Löscht eine Spalte.
      +
      voidremoveColumn​(String name) +
      Löscht eine Spalte
      +
      voidremoveRow​(int i) +
      Löscht eine Zeile
      +
      TableRow[]rows() +
      Liefert die ganze Tabelle als Array von TableRow-Objekten
      +
      voidsaveCSV​(String filename) +
      Speichert das aktuelle Dokument als CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"').
      +
      voidsaveCSV​(String filename, + String options) +
      Speichert das aktuelle Dokument als CSV-Datei (Separator = ';', Kennung für Text = '"').
      +
      voidsaveCSV​(String filename, + String options, + char separator, + char quote) +
      Speichert das aktuelle Dokument als CSV-Datei.
      +
      voidsaveXML​(String filename) +
      Speichert die Tabelle als XML-Dokument.
      +
      voidsetDouble​(int row, + int column, + double value) +
      Setzt den Wert einer Zelle als Double-Zahl
      +
      voidsetDouble​(int row, + String name, + double value) +
      Setzt den Wert einer Zelle als Double-Zahl
      +
      voidsetFloat​(int row, + int column, + float value) +
      Setzt den Wert einer Zelle als Float-Zahl
      +
      voidsetFloat​(int row, + String name, + float value) +
      Setzt den Wert einer Zelle als Float-Zahl
      +
      voidsetInt​(int row, + int column, + int value) +
      Setzt den Wert einer Zelle als Integer-Zahl
      +
      voidsetInt​(int row, + String name, + int value) +
      Setzt den Wert einer Zelle als Integer-Zahl
      +
      voidsetString​(int row, + int column, + String text) +
      Setzt den Wert einer Zelle als String
      +
      voidsetString​(int row, + String name, + String text) +
      Setzt den Wert einer Zelle als String
      +
      voidtrim() +
      Kürzt alle Einträge der Tabelle um unnötige Leerzeichen am Anfang oder Ende
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Table

        +
        public Table()
        +
        Erzeugt leeres Tabellen-Dokument.
        +
      • +
      + + + +
        +
      • +

        Table

        +
        public Table​(String filename,
        +             String options,
        +             char separator,
        +             char quote)
        +
        Erzeugt Tabellen-Dokument aus einer CSV-Datei. + Liest den Inhalt einer Datei und erstellt ein Tabellenobjekt mit seinen Werten. + Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + dann lassen Sie einfach die Option "header" weg.
        +
        +
        Parameters:
        +
        filename - Dateiname der CSV-Datei.
        +
        options - Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält.
        +
        separator - Trennzeichen für Spalten (meist ';' oder ',' oder '\t' für Tab)
        +
        quote - Kennung für Texte (meist '"').
        +
        +
      • +
      + + + +
        +
      • +

        Table

        +
        public Table​(String filename,
        +             String options)
        +
        Erzeugt Tabellen-Dokument aus einer CSV-Datei. + Liest den Inhalt einer Datei und erstellt ein Tabellenobjekt mit seinen Werten (Separator = ';', Kennung für Text = '"'). + Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + dann lassen Sie einfach die Option "header" weg.
        +
        +
        Parameters:
        +
        filename - Dateiname der CSV-Datei.
        +
        options - Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält.
        +
        +
      • +
      + + + +
        +
      • +

        Table

        +
        public Table​(String filename)
        +
        Erzeugt Tabellen-Dokument aus einer CSV-Datei. + Liest den Inhalt einer Datei ohne Kopfzeile und erstellt ein Tabellenobjekt mit seinen Werten (Separator = ';', Kennung für Text = '"').
        +
        +
        Parameters:
        +
        filename - Dateiname der CSV-Datei.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        loadCSV

        +
        public void loadCSV​(String filename)
        +
        Liest den Inhalt einer CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"').
        +
        +
        Parameters:
        +
        filename - Dateiname der CSV-Datei.
        +
        +
      • +
      + + + +
        +
      • +

        loadCSV

        +
        public void loadCSV​(String filename,
        +                    String options)
        +
        Liest den Inhalt einer CSV-Datei (Separator = ';', Kennung für Text = '"'). + Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + dann lassen Sie einfach die Option "header" weg.
        +
        +
        Parameters:
        +
        filename - Dateiname der CSV-Datei.
        +
        options - Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält.
        +
        +
      • +
      + + + +
        +
      • +

        loadCSV

        +
        public void loadCSV​(String filename,
        +                    String options,
        +                    char separator,
        +                    char quote)
        +
        Liest den Inhalt einer CSV-Datei. + Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + dann lassen Sie einfach die Option "header" weg.
        +
        +
        Parameters:
        +
        filename - Dateiname der CSV-Datei.
        +
        options - Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält.
        +
        separator - Trennzeichen für Spalten (meist ';' oder ',' oder '\t' für Tab)
        +
        quote - Kennung für Texte (meist '"').
        +
        +
      • +
      + + + +
        +
      • +

        saveCSV

        +
        public void saveCSV​(String filename)
        +
        Speichert das aktuelle Dokument als CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"').
        +
        +
        Parameters:
        +
        filename - Dateiname der CSV-Datei.
        +
        +
      • +
      + + + +
        +
      • +

        saveCSV

        +
        public void saveCSV​(String filename,
        +                    String options)
        +
        Speichert das aktuelle Dokument als CSV-Datei (Separator = ';', Kennung für Text = '"'). + Wenn die Datei eine Kopfzeile enthalten, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile haben soll, + dann lassen Sie einfach die Option "header" weg.
        +
        +
        Parameters:
        +
        options - Geben Sie hier "header" an, wenn die Datei eine Kopfzeile haben soll.
        +
        filename - Dateiname der CSV-Datei.
        +
        +
      • +
      + + + +
        +
      • +

        saveCSV

        +
        public void saveCSV​(String filename,
        +                    String options,
        +                    char separator,
        +                    char quote)
        +
        Speichert das aktuelle Dokument als CSV-Datei. + Wenn die Datei eine Kopfzeile enthalten, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile haben soll, + dann lassen Sie einfach die Option "header" weg.
        +
        +
        Parameters:
        +
        options - Geben Sie hier "header" an, wenn die Datei eine Kopfzeile haben soll.
        +
        filename - Dateiname der CSV-Datei.
        +
        separator - Trennzeichen für Spalten (meist ';' oder ',' oder '\t' für Tab)
        +
        quote - Kennung für Texte (meist '"').
        +
        +
      • +
      + + + +
        +
      • +

        saveXML

        +
        public void saveXML​(String filename)
        +
        Speichert die Tabelle als XML-Dokument.
        +
        +
        Parameters:
        +
        filename - Dateiname des XML-Files
        +
        +
      • +
      + + + +
        +
      • +

        addColumn

        +
        public void addColumn()
        +
        Fügt eine neue Spalte am Ende der Tabelle an.
        +
      • +
      + + + +
        +
      • +

        addColumn

        +
        public void addColumn​(String title)
        +
        Fügt eine neue Spalte am Ende der Tabelle an und benennt sie.
        +
        +
        Parameters:
        +
        title - Bezeichnung der Spalte
        +
        +
      • +
      + + + +
        +
      • +

        addColumn

        +
        public void addColumn​(String title,
        +                      String type)
        +
        Fügt eine neue Spalte am Ende der Tabelle an und benennt und typisiert sie.
        +
        +
        Parameters:
        +
        title - Bezeichnung der Spalte
        +
        type - Typ der Spalte (UNKNOWN, DOUBLE, INTEGER, FLOAT)
        +
        +
      • +
      + + + +
        +
      • +

        removeColumn

        +
        public void removeColumn​(int i)
        +
        Löscht eine Spalte.
        +
        +
        Parameters:
        +
        i - Nummer der Spalte.
        +
        +
      • +
      + + + +
        +
      • +

        removeColumn

        +
        public void removeColumn​(String name)
        +
        Löscht eine Spalte
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        +
      • +
      + + + +
        +
      • +

        getColumnCount

        +
        public int getColumnCount()
        +
        Liefert die Anzahl der Spalten in der Tabelle
        +
        +
        Returns:
        +
        Anzahl der Spalten
        +
        +
      • +
      + + + +
        +
      • +

        getRowCount

        +
        public int getRowCount()
        +
        Liefert die Anzahl der Zeilen in der Tabelle
        +
        +
        Returns:
        +
        Anzahl der Zeilen
        +
        +
      • +
      + + + +
        +
      • +

        clearRows

        +
        public void clearRows()
        +
        Löscht alle Zeilen der Tabelle. + Die Spaltenüberschriften und Typen bleiben erhalten.
        +
      • +
      + + + +
        +
      • +

        addRow

        +
        public TableRow addRow()
        +
        Fügt eine neue Zeile an das Ende der Tabelle an.
        +
        +
        Returns:
        +
        ein TableRow-Objekt für diese neue Zeile
        +
        +
      • +
      + + + +
        +
      • +

        removeRow

        +
        public void removeRow​(int i)
        +
        Löscht eine Zeile
        +
        +
        Parameters:
        +
        i - Nummer der Zeile
        +
        +
      • +
      + + + +
        +
      • +

        getRow

        +
        public TableRow getRow​(int i)
        +
        Liefert eine Zeile der Tabelle
        +
        +
        Parameters:
        +
        i - Nummer der Zeile
        +
        Returns:
        +
        TableRow-Objekt für diese Zeile
        +
        +
      • +
      + + + +
        +
      • +

        rows

        +
        public TableRow[] rows()
        +
        Liefert die ganze Tabelle als Array von TableRow-Objekten
        +
        +
        Returns:
        +
        Array von TableRow-Objekten
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt​(int row,
        +                  int column)
        +
        Liefert den Wert einer Zelle als Integer-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt​(int row,
        +                  String name)
        +
        Liefert den Wert einer Zelle als Integer-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setInt

        +
        public void setInt​(int row,
        +                   int column,
        +                   int value)
        +
        Setzt den Wert einer Zelle als Integer-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setInt

        +
        public void setInt​(int row,
        +                   String name,
        +                   int value)
        +
        Setzt den Wert einer Zelle als Integer-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getIntRow

        +
        public int[] getIntRow​(int row)
        +
        Liefert alle Werte einer Zeile als Integer-Array.
        +
        +
        Parameters:
        +
        row - Nummer der Zeile
        +
        Returns:
        +
        int-Array, dass alle Werte der Zeile enthält
        +
        +
      • +
      + + + +
        +
      • +

        getIntColumn

        +
        public int[] getIntColumn​(int column)
        +
        Liefert alle Werte einer Spalte als Integer-Array.
        +
        +
        Parameters:
        +
        column - Nummer der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getIntColumn

        +
        public int[] getIntColumn​(String name)
        +
        Liefert alle Werte einer Spalte als Integer-Array.
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat​(int row,
        +                      int column)
        +
        Liefert den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat​(int row,
        +                      String name)
        +
        Liefert den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setFloat

        +
        public void setFloat​(int row,
        +                     int column,
        +                     float value)
        +
        Setzt den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setFloat

        +
        public void setFloat​(int row,
        +                     String name,
        +                     float value)
        +
        Setzt den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getFloatRow

        +
        public float[] getFloatRow​(int row)
        +
        Liefert alle Werte einer Zeile als Float-Array.
        +
        +
        Parameters:
        +
        row - Nummer der Zeile
        +
        Returns:
        +
        int-Array, dass alle Werte der Zeile enthält
        +
        +
      • +
      + + + +
        +
      • +

        getFloatColumn

        +
        public float[] getFloatColumn​(int column)
        +
        Liefert alle Werte einer Spalte als Float-Array.
        +
        +
        Parameters:
        +
        column - Nummer der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getFloatColumn

        +
        public float[] getFloatColumn​(String name)
        +
        Liefert alle Werte einer Spalte als Float-Array.
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble​(int row,
        +                        int column)
        +
        Liefert den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble​(int row,
        +                        String name)
        +
        Liefert den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setDouble

        +
        public void setDouble​(int row,
        +                      int column,
        +                      double value)
        +
        Setzt den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setDouble

        +
        public void setDouble​(int row,
        +                      String name,
        +                      double value)
        +
        Setzt den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleRow

        +
        public double[] getDoubleRow​(int row)
        +
        Liefert alle Werte einer Spalte als Double-Array.
        +
        +
        Parameters:
        +
        row - Nummer der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleColumn

        +
        public double[] getDoubleColumn​(int column)
        +
        Liefert alle Werte einer Spalte als Double-Array.
        +
        +
        Parameters:
        +
        column - Nummer der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleColumn

        +
        public double[] getDoubleColumn​(String name)
        +
        Liefert alle Werte einer Spalte als Double-Array.
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString​(int row,
        +                        int column)
        +
        Liefert den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString​(int row,
        +                        String name)
        +
        Liefert den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setString

        +
        public void setString​(int row,
        +                      int column,
        +                      String text)
        +
        Setzt den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        column - Spaltennummer
        +
        text - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setString

        +
        public void setString​(int row,
        +                      String name,
        +                      String text)
        +
        Setzt den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        row - Zeilennummer
        +
        name - Name der Spalte
        +
        text - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getStringRow

        +
        public String[] getStringRow​(int row)
        +
        Liefert alle Werte einer Spalte als String-Array.
        +
        +
        Parameters:
        +
        row - Nummer der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getStringColumn

        +
        public String[] getStringColumn​(int column)
        +
        Liefert alle Werte einer Spalte als String-Array.
        +
        +
        Parameters:
        +
        column - Nummer der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        getStringColumn

        +
        public String[] getStringColumn​(String name)
        +
        Liefert alle Werte einer Spalte als String-Array.
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        int-Array, dass alle Werte der Spalte enthält
        +
        +
      • +
      + + + +
        +
      • +

        findRow

        +
        public TableRow findRow​(String value,
        +                        int column)
        +
        Sucht nach einem bestimmtem Wert in einer Zeile.
        +
        +
        Parameters:
        +
        value - Wert der gesucht werden soll
        +
        column - Nummer der Spalte, die durchsucht werden soll
        +
        Returns:
        +
        TableRow-Objekt der Zeile, wenn der Wert gefunden wurde, sonst null
        +
        +
      • +
      + + + +
        +
      • +

        findRow

        +
        public TableRow findRow​(String value,
        +                        String name)
        +
        Sucht nach einem bestimmtem Wert in einer Zeile.
        +
        +
        Parameters:
        +
        value - Wert der gesucht werden soll
        +
        name - Name der Spalte, die durchsucht werden soll
        +
        Returns:
        +
        TableRow-Objekt der Zeile, wenn der Wert gefunden wurde, sonst null
        +
        +
      • +
      + + + +
        +
      • +

        trim

        +
        public void trim()
        +
        Kürzt alle Einträge der Tabelle um unnötige Leerzeichen am Anfang oder Ende
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/TableRow.html b/Quellcodes/alg_ds_graphentester/doc/imp/TableRow.html new file mode 100644 index 0000000..420da1d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/TableRow.html @@ -0,0 +1,785 @@ + + + + + +TableRow (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package imp
+

Class TableRow

+
+
+ +
+
    +
  • +
    +
    public class TableRow
    +extends Object
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      (package private) NumberFormatformat 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      TableRow​(org.jdom.Document doc, + org.jdom.Element row) +
      Erzeugt ein TableRow-Objekt.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      intgetColumn​(String name) +
      Liefert die Nummer einer Spalte
      +
      intgetColumnCount() +
      Liefert die Anzahl der Spalten der Zeile.
      +
      StringgetColumnTitle​(int i) +
      Liefert den Titel einer Spalte
      +
      doublegetDouble​(int i) +
      Liefert den Wert einer Zelle als Double-Zahl
      +
      doublegetDouble​(String name) +
      Liefert den Wert einer Zelle als Double-Zahl
      +
      floatgetFloat​(int i) +
      Liefert den Wert einer Zelle als Float-Zahl
      +
      floatgetFloat​(String name) +
      Liefert den Wert einer Zelle als Float-Zahl
      +
      intgetInt​(int i) +
      Liefert den Wert einer Zelle als Int-Zahl
      +
      intgetInt​(String name) +
      Liefert den Wert einer Zelle als Int-Zahl
      +
      StringgetString​(int i) +
      Liefert den Wert einer Zelle als String
      +
      StringgetString​(String name) +
      Liefert den Wert einer Zelle als String
      +
      voidsetDouble​(int i, + double value) +
      Setzt den Wert einer Zelle als Double-Zahl
      +
      voidsetDouble​(String name, + double value) +
      Setzt den Wert einer Zelle als Double-Zahl
      +
      voidsetFloat​(int i, + float value) +
      Setzt den Wert einer Zelle als Float-Zahl
      +
      voidsetFloat​(String name, + float value) +
      Setzt den Wert einer Zelle als Float-Zahl
      +
      voidsetInt​(int i, + int value) +
      Setzt den Wert einer Zelle als Int-Zahl
      +
      voidsetInt​(String name, + int value) +
      Setzt den Wert einer Zelle als Int-Zahl
      +
      voidsetString​(int i, + String text) +
      Setzt den Wert einer Zelle als String
      +
      voidsetString​(String name, + String text) +
      Setzt den Wert einer Zelle als String
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TableRow

        +
        public TableRow​(org.jdom.Document doc,
        +                org.jdom.Element row)
        +
        Erzeugt ein TableRow-Objekt. + Diese Methode ist für den internen Gebraucht. Einige Methode der Table-Klasse erzeugen mit diesem Konstruktor TableRow-Objekte.
        +
        +
        Parameters:
        +
        doc - JDOM-Dokument, das für die ganze Tabelle steht.
        +
        row - JDOM-Element, das für die aktuelle Zeile steht.
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getColumnCount

        +
        public int getColumnCount()
        +
        Liefert die Anzahl der Spalten der Zeile.
        +
        +
        Returns:
        +
        Anzahl der Spalten
        +
        +
      • +
      + + + +
        +
      • +

        getColumnTitle

        +
        public String getColumnTitle​(int i)
        +
        Liefert den Titel einer Spalte
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        Returns:
        +
        Name der Spalte
        +
        +
      • +
      + + + +
        +
      • +

        getColumn

        +
        public int getColumn​(String name)
        +
        Liefert die Nummer einer Spalte
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        Nummer der Spalte
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString​(int i)
        +
        Liefert den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString​(String name)
        +
        Liefert den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setString

        +
        public void setString​(int i,
        +                      String text)
        +
        Setzt den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        text - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setString

        +
        public void setString​(String name,
        +                      String text)
        +
        Setzt den Wert einer Zelle als String
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        text - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt​(int i)
        +
        Liefert den Wert einer Zelle als Int-Zahl
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt​(String name)
        +
        Liefert den Wert einer Zelle als Int-Zahl
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setInt

        +
        public void setInt​(int i,
        +                   int value)
        +
        Setzt den Wert einer Zelle als Int-Zahl
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setInt

        +
        public void setInt​(String name,
        +                   int value)
        +
        Setzt den Wert einer Zelle als Int-Zahl
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat​(int i)
        +
        Liefert den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat​(String name)
        +
        Liefert den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setFloat

        +
        public void setFloat​(int i,
        +                     float value)
        +
        Setzt den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setFloat

        +
        public void setFloat​(String name,
        +                     float value)
        +
        Setzt den Wert einer Zelle als Float-Zahl
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble​(int i)
        +
        Liefert den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble​(String name)
        +
        Liefert den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        Returns:
        +
        Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setDouble

        +
        public void setDouble​(int i,
        +                      double value)
        +
        Setzt den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        i - Nummer der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      + + + +
        +
      • +

        setDouble

        +
        public void setDouble​(String name,
        +                      double value)
        +
        Setzt den Wert einer Zelle als Double-Zahl
        +
        +
        Parameters:
        +
        name - Name der Spalte
        +
        value - neuer Wert der Zelle
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/XML.html b/Quellcodes/alg_ds_graphentester/doc/imp/XML.html new file mode 100644 index 0000000..d21c4fe --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/XML.html @@ -0,0 +1,1229 @@ + + + + + +XML (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+ +
+
+
Package imp
+

Class XML

+
+
+ +
+
    +
  • +
    +
    public class XML
    +extends Object
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      XML() +
      Erzeugt ein leeres XMLDokument
      +
      XML​(String filename) +
      Erzeugt ein XML-Dokument aus einer Datei
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      XMLaddChild​(String name) +
      Erzeuge neues Element nach der aktuellen Position und setze dieses als aktuelles Element
      +
      intgetAttributeCount() +
      liefert die Anzahl der Attribute eines Elements.
      +
      XMLgetChild​(int i) +
      Liefert das i.
      +
      XMLgetChild​(String name) +
      Liefert das erste Kind des Elements mit einem bestimmten Namen.
      +
      XML[]getChildren() +
      Liefert alle Kinder des Elements als Array von XML-Objekten.
      +
      XML[]getChildren​(String name) +
      Liefert bestimmte Kinder des Elements als Array von XML-Objekten.
      +
      StringgetContent() +
      Fragt den Inhalt/Text des aktuellen Elements ab
      +
      StringgetContent​(String defaultValue) +
      Fragt den Inhalt/Text des aktuellen Elements ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
      +
      doublegetDouble​(String attribute) +
      Fragt einen Attributwert des aktuellen Elements ab
      +
      doublegetDouble​(String attribute, + double defaultValue) +
      Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
      +
      doublegetDoubleContent() +
      Fragt den Inhalt des aktuellen Elements als Doublezahl ab
      +
      doublegetDoubleContent​(double defaultValue) +
      Fragt den Inhalt des aktuellen Elements als Doublezahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
      +
      floatgetFloat​(String attribute) +
      Fragt einen Attributwert des aktuellen Elements ab
      +
      floatgetFloat​(String attribute, + float defaultValue) +
      Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
      +
      floatgetFloatContent() +
      Fragt den Inhalt des aktuellen Elements als Floatzahl ab
      +
      floatgetFloatContent​(float defaultValue) +
      Fragt den Inhalt des aktuellen Elements als Floatzahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
      +
      intgetInt​(String attribute) +
      Fragt einen Attributwert des aktuellen Elements ab
      +
      intgetInt​(String attribute, + int defaultValue) +
      Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
      +
      intgetIntContent() +
      Fragt den Inhalt des aktuellen Elements als Integerzahl ab
      +
      intgetIntContent​(int defaultValue) +
      Fragt den Inhalt des aktuellen Elements als Integerzahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
      +
      StringgetName() +
      Frage den Namen des aktuellen Elements ab
      +
      XMLgetParent() +
      liefert ein XML-Objekt, das auf den Vaterknoten des aktuellen Elements zeigt.
      +
      StringgetString​(String attribute) +
      Fragt einen Attributwert des aktuellen Elements ab
      +
      StringgetString​(String attribute, + String defaultValue) +
      Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
      +
      booleanhasAttribute() +
      liefert zurück, ob das aktuelle Element Attribute hat .
      +
      booleanhasChildren() +
      Überprüft, ob das Element irgendwelche Kinder hat oder nicht, und gibt das Ergebnis als boolean zurück.
      +
      String[]listAttributes() +
      Ruft alle Attribute des angegebenen Elements ab und gibt sie als Array von Strings zurück.
      +
      String[]listChildren() +
      Ermittelt die Namen aller Kinder des Elements und gibt die Namen als ein Array von Strings zurück.
      +
      voidloadXML​(String filename) +
      Öffnet das durch den Dateinamen gegebene Dokument
      +
      voidremoveChild​(XML kid) +
      löscht ein Kind des aktuellen Knotens.
      +
      voidsaveXML​(String filename) +
      Speichert den XML-Baum im angegebenen Dateinamen
      +
      voidsetContent​(String text) +
      Setzt den Inhalt/Text des aktuellen Elements
      +
      voidsetDouble​(String attribute, + double value) +
      Setzt einen Attributwert des aktuellen Elements
      +
      voidsetDoubleContent​(double value) +
      Setzt den Inhalt des aktuellen Elements
      +
      voidsetFloat​(String attribute, + float value) +
      Setzt einen Attributwert des aktuellen Elements
      +
      voidsetFloatContent​(float value) +
      Setzt den Inhalt des aktuellen Elements
      +
      voidsetInt​(String attribute, + int value) +
      Setzt einen Attributwert des aktuellen Elements
      +
      voidsetIntContent​(int value) +
      Setzt den Inhalt des aktuellen Elements
      +
      voidsetName​(String name) +
      Setze den Namen des aktuellen Elements.
      +
      voidsetString​(String attribute, + String text) +
      Setzt einen Attributwert des aktuellen Elements
      +
      + +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        XML

        +
        public XML()
        +
        Erzeugt ein leeres XMLDokument
        +
      • +
      + + + +
        +
      • +

        XML

        +
        public XML​(String filename)
        +
        Erzeugt ein XML-Dokument aus einer Datei
        +
        +
        Parameters:
        +
        filename - Dateiname der XML-Datei
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        loadXML

        +
        public void loadXML​(String filename)
        +
        Öffnet das durch den Dateinamen gegebene Dokument
        +
        +
        Parameters:
        +
        filename - Dateiname des XML-Files
        +
        +
      • +
      + + + +
        +
      • +

        saveXML

        +
        public void saveXML​(String filename)
        +
        Speichert den XML-Baum im angegebenen Dateinamen
        +
        +
        Parameters:
        +
        filename - Dateiname des XML-Files
        +
        +
      • +
      + + + +
        +
      • +

        getParent

        +
        public XML getParent()
        +
        liefert ein XML-Objekt, das auf den Vaterknoten des aktuellen Elements zeigt.
        +
        +
        Returns:
        +
        Vater des aktuellen Objekts.
        +
        +
      • +
      + + + +
        +
      • +

        hasChildren

        +
        public boolean hasChildren()
        +
        Überprüft, ob das Element irgendwelche Kinder hat oder nicht, und gibt das Ergebnis als boolean zurück.
        +
        +
        Returns:
        +
        true, wenn Kinder vorhanden sind, sonst false
        +
        +
      • +
      + + + +
        +
      • +

        listChildren

        +
        public String[] listChildren()
        +
        Ermittelt die Namen aller Kinder des Elements und gibt die Namen als ein Array von Strings zurück. + Dies ist dasselbe wie das Durchlaufen und Aufrufen von getName() auf jedem untergeordneten Element einzeln.
        +
        +
        Returns:
        +
        Liste aller Namen der Kinder
        +
        +
      • +
      + + + +
        +
      • +

        getChildren

        +
        public XML[] getChildren()
        +
        Liefert alle Kinder des Elements als Array von XML-Objekten.
        +
        +
        Returns:
        +
        Array der Kinder als XML-Objekte
        +
        +
      • +
      + + + +
        +
      • +

        getChildren

        +
        public XML[] getChildren​(String name)
        +
        Liefert bestimmte Kinder des Elements als Array von XML-Objekten. + Die Methode gibt dabei alle Kinder zurück, die dem angegebenen Namen entsprechen.
        +
        +
        Parameters:
        +
        name - Name der gesuchten Kind-Objekte
        +
        Returns:
        +
        Array der Kinder als XML-Objekte
        +
        +
      • +
      + + + +
        +
      • +

        getChild

        +
        public XML getChild​(String name)
        +
        Liefert das erste Kind des Elements mit einem bestimmten Namen. + Die Methode gibt das erste Kind zurück, das dem angegebenen Namen entsprechen.
        +
        +
        Parameters:
        +
        name - Name des gesuchten Kind-Objektes
        +
        Returns:
        +
        Kind als XML-Objekt
        +
        +
      • +
      + + + +
        +
      • +

        getChild

        +
        public XML getChild​(int i)
        +
        Liefert das i. Kind des Elements. + Die Methode gibt das i. Kind des aktuellen Elements zurück.
        +
        +
        Parameters:
        +
        i - Nummer des Kindes
        +
        Returns:
        +
        Kind als XML-Objekt
        +
        +
      • +
      + + + +
        +
      • +

        getName

        +
        public String getName()
        +
        Frage den Namen des aktuellen Elements ab
        +
        +
        Returns:
        +
        Namen des Elements
        +
        +
      • +
      + + + +
        +
      • +

        setName

        +
        public void setName​(String name)
        +
        Setze den Namen des aktuellen Elements.
        +
        +
        Parameters:
        +
        name - Neuer Name des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getAttributeCount

        +
        public int getAttributeCount()
        +
        liefert die Anzahl der Attribute eines Elements.
        +
        +
        Returns:
        +
        Anzahl des Attribute
        +
        +
      • +
      + + + +
        +
      • +

        hasAttribute

        +
        public boolean hasAttribute()
        +
        liefert zurück, ob das aktuelle Element Attribute hat .
        +
        +
        Returns:
        +
        true, wenn es Attribute gibt
        +
        +
      • +
      + + + +
        +
      • +

        listAttributes

        +
        public String[] listAttributes()
        +
        Ruft alle Attribute des angegebenen Elements ab und gibt sie als Array von Strings zurück.
        +
        +
        Returns:
        +
        Liste der Attributnamen
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString​(String attribute)
        +
        Fragt einen Attributwert des aktuellen Elements ab
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        Returns:
        +
        Wert des Attributs
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString​(String attribute,
        +                        String defaultValue)
        +
        Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        defaultValue - Standardwert, falls es das Attribut nicht gibt
        +
        Returns:
        +
        Wert des Attributs
        +
        +
      • +
      + + + +
        +
      • +

        setString

        +
        public void setString​(String attribute,
        +                      String text)
        +
        Setzt einen Attributwert des aktuellen Elements
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        text - neuer Wert des Attributs
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt​(String attribute)
        +
        Fragt einen Attributwert des aktuellen Elements ab
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        Returns:
        +
        Wert des Attributs als Integer-Zahl
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt​(String attribute,
        +                  int defaultValue)
        +
        Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        defaultValue - Standardwert, falls es das Attribut nicht gibt
        +
        Returns:
        +
        Wert des Attributs als Integer-Zahl
        +
        +
      • +
      + + + +
        +
      • +

        setInt

        +
        public void setInt​(String attribute,
        +                   int value)
        +
        Setzt einen Attributwert des aktuellen Elements
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        value - neuer Wert des Attributs
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat​(String attribute)
        +
        Fragt einen Attributwert des aktuellen Elements ab
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        Returns:
        +
        Wert des Attributs als Float-Zahl
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat​(String attribute,
        +                      float defaultValue)
        +
        Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        defaultValue - Standardwert, falls es das Attribut nicht gibt
        +
        Returns:
        +
        Wert des Attributs als Float-Zahl
        +
        +
      • +
      + + + +
        +
      • +

        setFloat

        +
        public void setFloat​(String attribute,
        +                     float value)
        +
        Setzt einen Attributwert des aktuellen Elements
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        value - neuer Wert des Attributs
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble​(String attribute)
        +
        Fragt einen Attributwert des aktuellen Elements ab
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        Returns:
        +
        Wert des Attributs als Double-Zahl
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble​(String attribute,
        +                        double defaultValue)
        +
        Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        defaultValue - Standardwert, falls es das Attribut nicht gibt
        +
        Returns:
        +
        Wert des Attributs als double-Zahl
        +
        +
      • +
      + + + +
        +
      • +

        setDouble

        +
        public void setDouble​(String attribute,
        +                      double value)
        +
        Setzt einen Attributwert des aktuellen Elements
        +
        +
        Parameters:
        +
        attribute - Name des Attributs
        +
        value - neuer Wert des Attributs
        +
        +
      • +
      + + + +
        +
      • +

        getContent

        +
        public String getContent()
        +
        Fragt den Inhalt/Text des aktuellen Elements ab
        +
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getContent

        +
        public String getContent​(String defaultValue)
        +
        Fragt den Inhalt/Text des aktuellen Elements ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
        +
        +
        Parameters:
        +
        defaultValue - Standardtext
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        setContent

        +
        public void setContent​(String text)
        +
        Setzt den Inhalt/Text des aktuellen Elements
        +
        +
        Parameters:
        +
        text - Neuer Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getIntContent

        +
        public int getIntContent​(int defaultValue)
        +
        Fragt den Inhalt des aktuellen Elements als Integerzahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
        +
        +
        Parameters:
        +
        defaultValue - Standardwert
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getIntContent

        +
        public int getIntContent()
        +
        Fragt den Inhalt des aktuellen Elements als Integerzahl ab
        +
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        setIntContent

        +
        public void setIntContent​(int value)
        +
        Setzt den Inhalt des aktuellen Elements
        +
        +
        Parameters:
        +
        value - Neuer Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getFloatContent

        +
        public float getFloatContent​(float defaultValue)
        +
        Fragt den Inhalt des aktuellen Elements als Floatzahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
        +
        +
        Parameters:
        +
        defaultValue - Standardwert
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getFloatContent

        +
        public float getFloatContent()
        +
        Fragt den Inhalt des aktuellen Elements als Floatzahl ab
        +
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        setFloatContent

        +
        public void setFloatContent​(float value)
        +
        Setzt den Inhalt des aktuellen Elements
        +
        +
        Parameters:
        +
        value - Neuer Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleContent

        +
        public double getDoubleContent​(double defaultValue)
        +
        Fragt den Inhalt des aktuellen Elements als Doublezahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
        +
        +
        Parameters:
        +
        defaultValue - Standardwert
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        getDoubleContent

        +
        public double getDoubleContent()
        +
        Fragt den Inhalt des aktuellen Elements als Doublezahl ab
        +
        +
        Returns:
        +
        Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        setDoubleContent

        +
        public void setDoubleContent​(double value)
        +
        Setzt den Inhalt des aktuellen Elements
        +
        +
        Parameters:
        +
        value - Neuer Inhalt des Elements
        +
        +
      • +
      + + + +
        +
      • +

        addChild

        +
        public XML addChild​(String name)
        +
        Erzeuge neues Element nach der aktuellen Position und setze dieses als aktuelles Element
        +
        +
        Parameters:
        +
        name - Name des neuen Elements
        +
        Returns:
        +
        neues Element als XML-Objekt
        +
        +
      • +
      + + + +
        +
      • +

        removeChild

        +
        public void removeChild​(XML kid)
        +
        löscht ein Kind des aktuellen Knotens. + Ist kid kein Kind des aktuellen Elements passiert gar nichts.
        +
        +
        Parameters:
        +
        kid - XML-Objekt des Kindes
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/package-summary.html b/Quellcodes/alg_ds_graphentester/doc/imp/package-summary.html new file mode 100644 index 0000000..6185e1f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/package-summary.html @@ -0,0 +1,194 @@ + + + + + +imp (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package imp

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    HSB +
    Hilfsklasse für das HSB-Farbmodell
    +
    NumberField 
    Picture +
    Bildklasse fuer die Simulation von Processing-Befehlen + + Diese Klasse stellt ein BufferedImage bereit, in das mit Processing-Befehlen gezeichnet + werden kann.
    +
    PictureViewer 
    Table 
    TableRow 
    XML 
    +
  • +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/imp/package-tree.html b/Quellcodes/alg_ds_graphentester/doc/imp/package-tree.html new file mode 100644 index 0000000..96fb37d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/imp/package-tree.html @@ -0,0 +1,194 @@ + + + + + +imp Class Hierarchy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package imp

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • imp.HSB
    • +
    • javafx.scene.Node (implements javafx.event.EventTarget, javafx.css.Styleable) +
        +
      • javafx.scene.Parent +
          +
        • javafx.scene.layout.Region +
            +
          • javafx.scene.control.Control (implements javafx.scene.control.Skinnable) +
              +
            • javafx.scene.control.ScrollPane + +
            • +
            • javafx.scene.control.TextInputControl +
                +
              • javafx.scene.control.TextField + +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • imp.Picture
    • +
    • imp.Table
    • +
    • imp.TableRow
    • +
    • imp.XML
    • +
    +
  • +
+
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/index-all.html b/Quellcodes/alg_ds_graphentester/doc/index-all.html new file mode 100644 index 0000000..4516891 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/index-all.html @@ -0,0 +1,2224 @@ + + + + + +Index (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
A B C D E F G H I K L M N O P Q R S T U V X 
All Classes All Packages + + +

A

+
+
addChild(String) - Method in class imp.XML
+
+
Erzeuge neues Element nach der aktuellen Position und setze dieses als aktuelles Element
+
+
addColumn() - Method in class imp.Table
+
+
Fügt eine neue Spalte am Ende der Tabelle an.
+
+
addColumn(String) - Method in class imp.Table
+
+
Fügt eine neue Spalte am Ende der Tabelle an und benennt sie.
+
+
addColumn(String, String) - Method in class imp.Table
+
+
Fügt eine neue Spalte am Ende der Tabelle an und benennt und typisiert sie.
+
+
addRow() - Method in class imp.Table
+
+
Fügt eine neue Zeile an das Ende der Tabelle an.
+
+
algorithmen - package algorithmen
+
 
+
append(String) - Method in class control.Hilfefenster
+
 
+
append(String) - Method in interface graph.Hilfe
+
 
+
ausgabe() - Method in class graph.Graph
+
+
Konsolenausgabe der textuellen Repraesentation des Graphen.
+
+
ausgabe() - Method in class graph.GraphPlotter
+
+
Gibt die String-Repraesentation des GraphPlotters auf der Konsole aus.
+
+
auswahl - Variable in class graph.GraphOptions
+
 
+
+ + + +

B

+
+
back() - Method in class imp.PictureViewer
+
+
Ruft das letzte abgespeicherte Bild aus der History wieder auf.
+
+
background(int) - Method in class imp.Picture
+
+
Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird.
+
+
background(int, int, int) - Method in class imp.Picture
+
+
Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird.
+
+
backtracking(Knoten) - Method in class algorithmen.GraphAlgo_ZyklusBacktracking
+
 
+
bAnfang - Variable in class control.UnterTabMitController
+
 
+
bAnfang(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bBesucht(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bBildLaden(ActionEvent) - Method in class control.EditTabMitController
+
 
+
bBildLoeschen(ActionEvent) - Method in class control.EditTabMitController
+
 
+
bDistanzenBestimmen(ActionEvent) - Method in class control.EditTabMitController
+
 
+
bEnde - Variable in class control.UnterTabMitController
+
 
+
bEnde(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
beste - Variable in class algorithmen.GraphAlgo_ColoringBacktracking
+
 
+
beste - Variable in class algorithmen.GraphAlgo_DominatingSetBacktracking
+
 
+
besteAnzahl - Variable in class algorithmen.GraphAlgo_ColoringBacktracking
+
 
+
besteAnzahl - Variable in class algorithmen.GraphAlgo_DominatingSetBacktracking
+
 
+
bGehezu - Variable in class control.UnterTabMitController
+
 
+
bGeheZu(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bHinzufuegenAnfang(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bHinzufuegenEnde(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bildAnzeigen - Variable in class graph.GraphOptions
+
 
+
bildDatei - Variable in class graph.GraphOptions
+
 
+
bLoeschenAusListe(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bMarkieren(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bNaechster(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bSort(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bSortieren - Variable in class control.UnterTabMitController
+
 
+
bStatus - Variable in class control.UnterTabMitController
+
 
+
bStatusRestore(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bStatusSave(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
buildAuswahl() - Method in class control.UnterTabMitController
+
 
+
bVoheriger(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
bWertAendern(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
+ + + +

C

+
+
CENTER - Static variable in class imp.Picture
+
 
+
clear() - Method in class imp.Picture
+
+
Loescht den Inhalt des Bildes.
+
+
clearRows() - Method in class imp.Table
+
+
Löscht alle Zeilen der Tabelle.
+
+
compareTo(GraphElement) - Method in class graph.GraphElement
+
 
+
compareTo(GraphElement) - Method in class graph.Kante
+
+
Vergleicht die Kante mit einer anderen Kante bezüglich ihres Gewichts
+
+
compareTo(GraphElement) - Method in class graph.Knoten
+
+
Vergleicht den Knoten mit einem anderen Knoten bezüglich seines Werts
+
+
control - package control
+
 
+
Controller - Class in control
+
+
Die Klasse Controller stellt den Controller des Hauptfensters / Menu dar.
+
+
Controller() - Constructor for class control.Controller
+
 
+
copy() - Method in class graph.GraphOptions
+
 
+
CORNER - Static variable in class imp.Picture
+
 
+
CORNERS - Static variable in class imp.Picture
+
 
+
+ + + +

D

+
+
delay(int) - Method in class imp.Picture
+
+
Hilfsfunktion zum Verzoegern der Ausgabe
+
+
+ + + +

E

+
+
EditTabMitController - Class in control
+
+
Die Klasse EditTabMitController stellt einen Tab inclusive ihres Controllers + zur Editierung eines Graphs dar.
+
+
EditTabMitController(Graph, GraphOptions) - Constructor for class control.EditTabMitController
+
 
+
eigeneAlgorithmen - package eigeneAlgorithmen
+
 
+
ellipse(int, int, int, int) - Method in class imp.Picture
+
+
Zeichnet eine Ellipse/Kreis auf das Bild.
+
+
ellipseMode(int) - Method in class imp.Picture
+
+
Aendert den Koordinaten-Modus beim Zeichnen von Kreisen/Ellipsen.
+
+
entferneKante(int, int) - Method in class graph.Graph
+
+
Entfernt eine Kante aus dem Graphen.
+
+
entferneKante(Kante) - Method in class graph.Graph
+
+
Entfernt eine Kante aus dem Graphen.
+
+
entferneKante(Knoten, Knoten) - Method in class graph.Graph
+
+
Entfernt eine Kante aus dem Graphen.
+
+
entferneKnoten(int) - Method in class graph.Graph
+
+
Entfernt einen Knoten aus dem Graphen
+
+
entferneKnoten(Knoten) - Method in class graph.Graph
+
+
Entfernt einen Knoten aus dem Graphen
+
+
entferneMarkierungBeiAllenKnoten() - Method in class graph.Graph
+
+
Entfernt die Markierung bei allen Knoten des Graphen.
+
+
erzeugeZufaelligeRundreise() - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
erzeugeZufaelligeTeilmenge() - Method in class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
+ + + +

F

+
+
farbenKanten - Variable in class graph.GraphOptions
+
 
+
farbenKnoten - Variable in class graph.GraphOptions
+
 
+
fill(int) - Method in class imp.Picture
+
+
Legt die Farbe fest, mit der Formen gefuellt werden.
+
+
fill(int, int, int) - Method in class imp.Picture
+
+
Legt die Farbe fest, mit der Formen gefuellt werden.
+
+
fill(String) - Method in class imp.Picture
+
+
Legt die Farbe fest, mit der Formen gefuellt werden.
+
+
findRow(String, int) - Method in class imp.Table
+
+
Sucht nach einem bestimmtem Wert in einer Zeile.
+
+
findRow(String, String) - Method in class imp.Table
+
+
Sucht nach einem bestimmtem Wert in einer Zeile.
+
+
FIT - Static variable in class imp.PictureViewer
+
 
+
fokusArt - Variable in class graph.GraphOptions
+
 
+
forceRepaint() - Method in class imp.Picture
+
+
Ein repaint() (das Neuzeichnen) kann manuell erzwungen werden.
+
+
format - Variable in class imp.TableRow
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_BellmanFord
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_Breitensuche
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_ColoringBacktracking
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_ColoringGreedy
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_ColoringGreedyRandom
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_Dijkstra
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetBacktracking
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyA
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyB
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyC
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyD
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyE
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyF
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyG
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyH
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyI
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_EulerkreisExistenz
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_Moore
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_MST_Kruskal
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_MST_Prim
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_Tiefensuche
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_TiefensucheRek
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_toplogischeSortierung
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_TSPBacktracking
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_TSPGreedy
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_TSPGreedy2
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_TSPGreedyOpt
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo_ZyklusBacktracking
+
 
+
fuehreAlgorithmusAus() - Method in class algorithmen.GraphAlgo
+
 
+
fuehreAlgorithmusAus() - Method in class eigeneAlgorithmen.GraphAlgo_Coloring_Schueler
+
 
+
+ + + +

G

+
+
g - Variable in class algorithmen.GraphAlgo
+
 
+
getAdjazenzMatrix() - Method in class graph.Graph
+
+
Die Methode getAdjazenzMatrix() gibt die Adjazenzmatrix zurueck.
+
+
getAlleKanten(Predicate<Kante>...) - Method in class graph.Graph
+
+
Gibt eine Liste aller Kanten des Graphen zurück.
+
+
getAlleKnoten(Predicate<Knoten>...) - Method in class graph.Graph
+
+
Gibt eine Liste aller Knoten des Graphen zurueck.
+
+
getAnderesEnde(Knoten) - Method in class graph.Kante
+
+
Gibt Knoten am anderen Ende der Kante zurueck
+
+
getAnzahlKnoten() - Method in class graph.Graph
+
+
Gibt die Anzahl der Knoten im Graph zurueck
+
+
getAttributeCount() - Method in class imp.XML
+
+
liefert die Anzahl der Attribute eines Elements.
+
+
getAusgehendeKanten(int, Predicate<Kante>...) - Method in class graph.Graph
+
+
Gibt eine Liste der ausgehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist.
+
+
getAusgehendeKanten(Knoten, Predicate<Kante>...) - Method in class graph.Graph
+
+
Gibt eine Liste der ausgehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist.
+
+
getBewertung(int[]) - Method in class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_BellmanFord
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_Breitensuche
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_ColoringBacktracking
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_ColoringGreedy
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_ColoringGreedyRandom
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_Dijkstra
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetBacktracking
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyA
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyB
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyC
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyD
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyE
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyF
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyG
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyH
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_DominatingSetGreedyI
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_EulerkreisExistenz
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_Moore
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_MST_Kruskal
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_MST_Prim
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_Tiefensuche
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_TiefensucheRek
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_toplogischeSortierung
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_TSPBacktracking
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_TSPGreedy
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_TSPGreedy2
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_TSPGreedyOpt
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo_ZyklusBacktracking
+
 
+
getBezeichnung() - Method in class algorithmen.GraphAlgo
+
 
+
getBezeichnung() - Method in class eigeneAlgorithmen.GraphAlgo_Coloring_Schueler
+
 
+
getBrightness(Color) - Static method in class imp.HSB
+
+
Liefert die Helligkeit als Wert zwischen 0.0 (0%) und 1.0 (100%).
+
+
getChild(int) - Method in class imp.XML
+
+
Liefert das i.
+
+
getChild(String) - Method in class imp.XML
+
+
Liefert das erste Kind des Elements mit einem bestimmten Namen.
+
+
getChildren() - Method in class imp.XML
+
+
Liefert alle Kinder des Elements als Array von XML-Objekten.
+
+
getChildren(String) - Method in class imp.XML
+
+
Liefert bestimmte Kinder des Elements als Array von XML-Objekten.
+
+
getColor(double, double, double) - Static method in class imp.HSB
+
+
Liefert ein Java-Color-Objekt mit den angegebenen HSB-Werten.
+
+
getColumn(String) - Method in class imp.TableRow
+
+
Liefert die Nummer einer Spalte
+
+
getColumnCount() - Method in class imp.Table
+
+
Liefert die Anzahl der Spalten in der Tabelle
+
+
getColumnCount() - Method in class imp.TableRow
+
+
Liefert die Anzahl der Spalten der Zeile.
+
+
getColumnTitle(int) - Method in class imp.TableRow
+
+
Liefert den Titel einer Spalte
+
+
getContent() - Method in class imp.XML
+
+
Fragt den Inhalt/Text des aktuellen Elements ab
+
+
getContent(String) - Method in class imp.XML
+
+
Fragt den Inhalt/Text des aktuellen Elements ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
+
+
getDouble(int) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als Double-Zahl
+
+
getDouble(int, int) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als Double-Zahl
+
+
getDouble(int, String) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als Double-Zahl
+
+
getDouble(String) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als Double-Zahl
+
+
getDouble(String) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab
+
+
getDouble(String, double) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
+
+
getDoubleColumn(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als Double-Array.
+
+
getDoubleColumn(String) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als Double-Array.
+
+
getDoubleContent() - Method in class imp.XML
+
+
Fragt den Inhalt des aktuellen Elements als Doublezahl ab
+
+
getDoubleContent(double) - Method in class imp.XML
+
+
Fragt den Inhalt des aktuellen Elements als Doublezahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
+
+
getDoubleRow(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als Double-Array.
+
+
getDoubleValue() - Method in class imp.NumberField
+
 
+
getDoubleWert() - Method in class graph.Knoten
+
+
Gibt den Wert vom Knoten als Double-Wert zurueck
+
+
getEingehendeKanten(int, Predicate<Kante>...) - Method in class graph.Graph
+
+
Gibt eine Liste der eingehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist.
+
+
getEingehendeKanten(Knoten, Predicate<Kante>...) - Method in class graph.Graph
+
+
Gibt eine Liste der eingehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist.
+
+
getFarbe() - Method in class graph.Kante
+
+
Gibt zurueck, in welcher Farbe die Kante gezeichnet werden soll.
+
+
getFarbe() - Method in class graph.Knoten
+
+
Gibt den Index der Farbe des Knoten zurück.
+
+
getFloat(int) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als Float-Zahl
+
+
getFloat(int, int) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als Float-Zahl
+
+
getFloat(int, String) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als Float-Zahl
+
+
getFloat(String) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als Float-Zahl
+
+
getFloat(String) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab
+
+
getFloat(String, float) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
+
+
getFloatColumn(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als Float-Array.
+
+
getFloatColumn(String) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als Float-Array.
+
+
getFloatContent() - Method in class imp.XML
+
+
Fragt den Inhalt des aktuellen Elements als Floatzahl ab
+
+
getFloatContent(float) - Method in class imp.XML
+
+
Fragt den Inhalt des aktuellen Elements als Floatzahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
+
+
getFloatRow(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Zeile als Float-Array.
+
+
getGewicht() - Method in class graph.Kante
+
+
Gibt das Gewicht der Kante zurueck
+
+
getGraph() - Method in class graph.GraphPlotter
+
+
Gibt den Graphen zurueck.
+
+
getGraphOptions() - Method in class control.TabMitController
+
 
+
getGraphOptions() - Method in class graph.GraphPlotter
+
 
+
getHeight() - Method in class imp.Picture
+
+
Liefert die Hoehe des Bildes zurueck.
+
+
getHue(Color) - Static method in class imp.HSB
+
+
Liefert den Farbton als Winkel zwischen 0.0° und 360.0°.
+
+
getImage() - Method in class imp.Picture
+
+
Direktes Abfragen des Bildes (fuer interne Zwecke)
+
+
getImage() - Method in class imp.PictureViewer
+
+
Liefert das angezeigte Bild
+
+
getInfo() - Method in class algorithmen.GraphAlgo_TSPBacktracking
+
 
+
getInfo() - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
getInfo() - Method in class algorithmen.GraphAlgo_TSPGreedy
+
 
+
getInfo() - Method in class algorithmen.GraphAlgo_TSPGreedy2
+
 
+
getInfo() - Method in class algorithmen.GraphAlgo_TSPGreedyOpt
+
 
+
getInfotext() - Method in class graph.Knoten
+
+
Liefert den Infotext des Knotens
+
+
getInt(int) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als Int-Zahl
+
+
getInt(int, int) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als Integer-Zahl
+
+
getInt(int, String) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als Integer-Zahl
+
+
getInt(String) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als Int-Zahl
+
+
getInt(String) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab
+
+
getInt(String, int) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
+
+
getIntColumn(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als Integer-Array.
+
+
getIntColumn(String) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als Integer-Array.
+
+
getIntContent() - Method in class imp.XML
+
+
Fragt den Inhalt des aktuellen Elements als Integerzahl ab
+
+
getIntContent(int) - Method in class imp.XML
+
+
Fragt den Inhalt des aktuellen Elements als Integerzahl ab + Hat das Element keinen Inhalt wird der defaultValue zurückgegeben.
+
+
getIntRow(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Zeile als Integer-Array.
+
+
getIntValue() - Method in class imp.NumberField
+
 
+
getIntWert() - Method in class graph.Knoten
+
+
Gibt den Wert vom Knoten als Integer-Wert zurueck
+
+
getKante(int, int) - Method in class graph.Graph
+
+
Gibt eine gesuchte Kante aus dem Graphen zurueck.
+
+
getKante(Knoten, Knoten) - Method in class graph.Graph
+
+
Gibt eine gesuchte Kante aus dem Graphen zurueck.
+
+
getKnoten(int) - Method in class graph.Graph
+
+
Liefert einen Knoten des Graphen
+
+
getKnoteninfo(Knoten, boolean) - Method in class graph.Graph
+
+
Info über einen Knoten zurückgeben
+
+
getLaenge() - Method in class algorithmen.GraphAlgo_TSPGreedyOpt
+
 
+
getLaenge(int[]) - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
getNachbarknoten(Knoten, Predicate<Knoten>...) - Method in class graph.Graph
+
+
Gibt die Liste aller Nachbarknoten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist.
+
+
getName() - Method in class imp.XML
+
+
Frage den Namen des aktuellen Elements ab
+
+
getNummer(Kante) - Method in class graph.Graph
+
+
Gibt die Nummer einer Kante zurück
+
+
getNummer(Knoten) - Method in class graph.Graph
+
+
Gibt die Nummer eines Knotens im Graphen zurück
+
+
getObserver() - Method in class imp.Picture
+
 
+
getParent() - Method in class imp.XML
+
+
liefert ein XML-Objekt, das auf den Vaterknoten des aktuellen Elements zeigt.
+
+
getPixelArray() - Method in class imp.Picture
+
+
Liefert das Bild als zweidimensionales Pixel-Array.
+
+
getRestrictTo() - Method in class graph.GraphPlotter
+
 
+
getRow(int) - Method in class imp.Table
+
+
Liefert eine Zeile der Tabelle
+
+
getRowCount() - Method in class imp.Table
+
+
Liefert die Anzahl der Zeilen in der Tabelle
+
+
getSaturation(Color) - Static method in class imp.HSB
+
+
Liefert die Sättigung als Wert zwischen 0.0 (0%) und 1.0 (100%).
+
+
getSelectedKante() - Method in class graph.GraphPlotter
+
+
Gibt das selektierte Kantenobjekt zurueck.
+
+
getSelectedKnoten() - Method in class graph.GraphPlotter
+
+
Gibt das selektierte Knotenobjekt zurueck.
+
+
getSelectedKnotenListe() - Method in class graph.GraphPlotter
+
+
Gibt die selektierte KnotenobjektListe (als Array) zurueck.
+
+
getStart() - Method in class graph.Kante
+
+
Gibt den Startknoten der Kante zurueck
+
+
getStartKnoten() - Method in class algorithmen.GraphAlgo
+
 
+
getStatus() - Method in class graph.Graph
+
+
Speichert den Zustand des Graphen als String-List
+
+
getStatus() - Method in class graph.GraphElement
+
 
+
getStatus() - Method in class graph.Kante
+
+
Liefert den Status einer Kante als String.
+
+
getStatus() - Method in class graph.Knoten
+
+
Liefert den Status eines Knotens als Status-String + Format: wert,markiert,besucht,farbe + wobei wert eine double-Zahl, mariert und besucht ein boolean-Wert (0=false, 1 = true) und + farbe eine zahl ist.
+
+
getString(int) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als String
+
+
getString(int, int) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als String
+
+
getString(int, String) - Method in class imp.Table
+
+
Liefert den Wert einer Zelle als String
+
+
getString(String) - Method in class imp.TableRow
+
+
Liefert den Wert einer Zelle als String
+
+
getString(String) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab
+
+
getString(String, String) - Method in class imp.XML
+
+
Fragt einen Attributwert des aktuellen Elements ab + Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben
+
+
getStringColumn(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als String-Array.
+
+
getStringColumn(String) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als String-Array.
+
+
getStringRow(int) - Method in class imp.Table
+
+
Liefert alle Werte einer Spalte als String-Array.
+
+
getText() - Method in class graph.GraphOptions
+
 
+
getViewer() - Method in class control.TabMitController
+
 
+
getWaitforclick() - Method in class algorithmen.GraphAlgo
+
 
+
getWaitforrepaint() - Method in class algorithmen.GraphAlgo
+
 
+
getWidth() - Method in class imp.Picture
+
+
Liefert die Breite des Bildes zurueck.
+
+
getX() - Method in class graph.Knoten
+
+
Liefert die x-Position des Knotens
+
+
getY() - Method in class graph.Knoten
+
+
Liefert die y-Position des Knotens
+
+
getZiel() - Method in class graph.Kante
+
+
Gibt den Zielknoten der Kante zurueck
+
+
graph - package graph
+
 
+
graph - Variable in class control.TabMitController
+
 
+
Graph - Class in graph
+
+
Dies ist das Herz vom "GraphTester" - der Graph selber, gepeichert als Adjazenzliste.
+
+
Graph() - Constructor for class graph.Graph
+
+
Der Konstruktor erstellt einen neuen ungerichteten, ungewichteten Graphen (genauer eine neue Adjazenzliste)
+
+
Graph(boolean, boolean) - Constructor for class graph.Graph
+
+
Der Konstruktor erstellt einen neuen Graphen (genauer eine neue Adjazenzliste)
+
+
GraphAlgo - Class in algorithmen
+
+
description
+
+
GraphAlgo() - Constructor for class algorithmen.GraphAlgo
+
 
+
GraphAlgo_BellmanFord - Class in algorithmen
+
+
Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
+
+
GraphAlgo_BellmanFord() - Constructor for class algorithmen.GraphAlgo_BellmanFord
+
 
+
GraphAlgo_Breitensuche - Class in algorithmen
+
+
Dieser Algorithmus nummeriert alle Knoten des Graphen.
+
+
GraphAlgo_Breitensuche() - Constructor for class algorithmen.GraphAlgo_Breitensuche
+
 
+
GraphAlgo_Coloring_Schueler - Class in eigeneAlgorithmen
+
+
Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
+
+
GraphAlgo_Coloring_Schueler() - Constructor for class eigeneAlgorithmen.GraphAlgo_Coloring_Schueler
+
 
+
GraphAlgo_ColoringBacktracking - Class in algorithmen
+
+
Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
+
+
GraphAlgo_ColoringBacktracking() - Constructor for class algorithmen.GraphAlgo_ColoringBacktracking
+
 
+
GraphAlgo_ColoringGreedy - Class in algorithmen
+
+
Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
+
+
GraphAlgo_ColoringGreedy() - Constructor for class algorithmen.GraphAlgo_ColoringGreedy
+
 
+
GraphAlgo_ColoringGreedyRandom - Class in algorithmen
+
+
Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + die gleiche Farbe haben und möglichst wenige Farben benutzt werden.
+
+
GraphAlgo_ColoringGreedyRandom() - Constructor for class algorithmen.GraphAlgo_ColoringGreedyRandom
+
 
+
GraphAlgo_Dijkstra - Class in algorithmen
+
+
Dieser Algorithmus findet die kürzesten Pfade in einem gewichteten Graphen.
+
+
GraphAlgo_Dijkstra() - Constructor for class algorithmen.GraphAlgo_Dijkstra
+
 
+
GraphAlgo_DominatingSetBacktracking - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetBacktracking() - Constructor for class algorithmen.GraphAlgo_DominatingSetBacktracking
+
 
+
GraphAlgo_DominatingSetGenetisch - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGenetisch() - Constructor for class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
GraphAlgo_DominatingSetGreedyA - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyA() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyA
+
 
+
GraphAlgo_DominatingSetGreedyB - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyB() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyB
+
 
+
GraphAlgo_DominatingSetGreedyC - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyC() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyC
+
 
+
GraphAlgo_DominatingSetGreedyD - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyD() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyD
+
 
+
GraphAlgo_DominatingSetGreedyE - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyE() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyE
+
 
+
GraphAlgo_DominatingSetGreedyF - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyF() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyF
+
 
+
GraphAlgo_DominatingSetGreedyG - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyG() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyG
+
 
+
GraphAlgo_DominatingSetGreedyH - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyH() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyH
+
 
+
GraphAlgo_DominatingSetGreedyI - Class in algorithmen
+
+
Dieser Algorithmus bestimmt die kleinste dominierende Menge in einem Graphen + und bestimmt den Zeitbedarf.
+
+
GraphAlgo_DominatingSetGreedyI() - Constructor for class algorithmen.GraphAlgo_DominatingSetGreedyI
+
 
+
GraphAlgo_EulerkreisExistenz - Class in algorithmen
+
+
Dieser Algorithmus testet, ob ein Eulerkreis existiert.
+
+
GraphAlgo_EulerkreisExistenz() - Constructor for class algorithmen.GraphAlgo_EulerkreisExistenz
+
 
+
GraphAlgo_Moore - Class in algorithmen
+
+
Dieser Algorithmus findet die kürzesten Pfade in einem ungewichteten Graphen.
+
+
GraphAlgo_Moore() - Constructor for class algorithmen.GraphAlgo_Moore
+
 
+
GraphAlgo_MST_Kruskal - Class in algorithmen
+
+
Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Kruskal
+
+
GraphAlgo_MST_Kruskal() - Constructor for class algorithmen.GraphAlgo_MST_Kruskal
+
 
+
GraphAlgo_MST_Prim - Class in algorithmen
+
+
Dieser Algorithmus sucht einen minimal Spanning Tree + Algorithmus: Prim
+
+
GraphAlgo_MST_Prim() - Constructor for class algorithmen.GraphAlgo_MST_Prim
+
 
+
GraphAlgo_Tiefensuche - Class in algorithmen
+
+
Dieser Algorithmus nummeriert alle Knoten des Graphen.
+
+
GraphAlgo_Tiefensuche() - Constructor for class algorithmen.GraphAlgo_Tiefensuche
+
 
+
GraphAlgo_TiefensucheRek - Class in algorithmen
+
+
Dieser Algorithmus nummeriert alle Knoten des Graphen.
+
+
GraphAlgo_TiefensucheRek() - Constructor for class algorithmen.GraphAlgo_TiefensucheRek
+
 
+
GraphAlgo_toplogischeSortierung - Class in algorithmen
+
+
Dieser Algorithmus findet eine topologische Sortierung des Graphen.
+
+
GraphAlgo_toplogischeSortierung() - Constructor for class algorithmen.GraphAlgo_toplogischeSortierung
+
 
+
GraphAlgo_TSPBacktracking - Class in algorithmen
+
+
Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
+
+
GraphAlgo_TSPBacktracking() - Constructor for class algorithmen.GraphAlgo_TSPBacktracking
+
 
+
GraphAlgo_TSPGenetisch - Class in algorithmen
+
+
description
+
+
GraphAlgo_TSPGenetisch() - Constructor for class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
GraphAlgo_TSPGreedy - Class in algorithmen
+
+
Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
+
+
GraphAlgo_TSPGreedy() - Constructor for class algorithmen.GraphAlgo_TSPGreedy
+
 
+
GraphAlgo_TSPGreedy2 - Class in algorithmen
+
+
Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
+
+
GraphAlgo_TSPGreedy2() - Constructor for class algorithmen.GraphAlgo_TSPGreedy2
+
 
+
GraphAlgo_TSPGreedyOpt - Class in algorithmen
+
+
Dieser Algorithmus sucht einen möglichst kurzen Hamilton-Kreis (Traveling + Salesman Problem).
+
+
GraphAlgo_TSPGreedyOpt() - Constructor for class algorithmen.GraphAlgo_TSPGreedyOpt
+
 
+
GraphAlgo_ZyklusBacktracking - Class in algorithmen
+
+
Dieser Algorithmus ist ein Beispiel für einen Backtracking-Algorithmus.
+
+
GraphAlgo_ZyklusBacktracking() - Constructor for class algorithmen.GraphAlgo_ZyklusBacktracking
+
 
+
graphClicked(MouseEvent) - Method in class control.EditTabMitController
+
 
+
graphClicked(MouseEvent) - Method in class control.UnterTabMitController
+
 
+
GraphElement - Class in graph
+
+
Die Klasse GraphElement ist eine Oberklasse von Knoten und Kanten.
+
+
GraphElement() - Constructor for class graph.GraphElement
+
 
+
GraphenTester - Class in <Unnamed>
+
 
+
GraphenTester() - Constructor for class GraphenTester
+
 
+
graphLaden(String) - Method in class control.Controller
+
 
+
GraphOptions - Class in graph
+
+
Die Klasse GraphOptions speichert, wie ein Graph in einem Fenster vom + GraphPlotter angezeigt wird.
+
+
GraphOptions() - Constructor for class graph.GraphOptions
+
 
+
GraphPlotter - Class in graph
+
+
Der GraphPlotter ist das Herzstueck der Visualisierung und dient als Schnittstelle zur GUI.
+
+
GraphPlotter() - Constructor for class graph.GraphPlotter
+
+
Der Konstruktor legt sowohl Einstellungen des mxGraphen (Drag&Drop, Editable, ...) als auch des Graphen (gewichtet, gerichtet, ...) fest.
+
+
+ + + +

H

+
+
hasAttribute() - Method in class imp.XML
+
+
liefert zurück, ob das aktuelle Element Attribute hat .
+
+
hasChildren() - Method in class imp.XML
+
+
Überprüft, ob das Element irgendwelche Kinder hat oder nicht, und gibt das Ergebnis als boolean zurück.
+
+
HauptTabMitController - Class in control
+
+
Die Klasse HauptTabMitController stellt einen Tab inclusive ihres Controllers + für das Hauptfenster des Graphentesters dar.
+
+
HauptTabMitController(Graph, GraphOptions) - Constructor for class control.HauptTabMitController
+
 
+
Hilfe - Interface in graph
+
 
+
Hilfefenster - Class in control
+
+
Die Klasse Hilfefenster stellt ein Hilfefenster für die Simulation eines + Algorithmus bereit.
+
+
Hilfefenster() - Constructor for class control.Hilfefenster
+
 
+
HSB - Class in imp
+
+
Hilfsklasse für das HSB-Farbmodell
+
+
HSB() - Constructor for class imp.HSB
+
 
+
+ + + +

I

+
+
imp - package imp
+
 
+
inArbeit - Variable in class algorithmen.GraphAlgo
+
 
+
indentLess() - Method in class control.Hilfefenster
+
 
+
indentLess() - Method in interface graph.Hilfe
+
 
+
indentMore() - Method in class control.Hilfefenster
+
 
+
indentMore() - Method in interface graph.Hilfe
+
 
+
info(String) - Method in class algorithmen.GraphAlgo
+
 
+
infoIndentLess() - Method in class algorithmen.GraphAlgo
+
 
+
infoIndentMore() - Method in class algorithmen.GraphAlgo
+
 
+
init() - Method in class graph.Kante
+
+
Die Methode init initialisiert die Kantenfaerbung (auf unmarkiert)
+
+
init() - Method in class graph.Knoten
+
+
Die Methode init initialisiert den Zustand eines Knotens
+
+
initialisiereAlleKanten() - Method in class graph.Graph
+
+
Initialisiert alle Kanten des Graphen.
+
+
initialisiereAlleKnoten() - Method in class graph.Graph
+
+
Initialisiert alle Knoten des Graphen.
+
+
initialize() - Method in class control.Controller
+
 
+
initialize() - Method in class control.EditTabMitController
+
 
+
initialize() - Method in class control.HauptTabMitController
+
 
+
initialize() - Method in class control.Hilfefenster
+
 
+
initialize() - Method in class control.SimulationTabMitController
+
 
+
initialize() - Method in class control.TabMitController
+
 
+
initialize() - Method in class control.UnterTabMitController
+
 
+
isBesucht() - Method in class graph.Knoten
+
+
Gibt den Besuchtwert vom Knoten zurueck
+
+
isFarbeAutomatisch() - Method in class graph.Knoten
+
+
Gibt zurück, ob die Knotenfarbe automatisch aus den Attributen ermittelt wird.
+
+
isGeloescht() - Method in class graph.Kante
+
+
Gibt den gelöscht-Wert der Kante zurueck
+
+
isGerichtet() - Method in class graph.Graph
+
+
Gibt zurueck, ob der Graph gerichtet oder ungerichtet ist.
+
+
isGewichtet() - Method in class graph.Graph
+
+
Gibt zurueck, ob der Graph gewichtet oder ungewichtet ist
+
+
isKanteEnthalten(int, int) - Method in class graph.Graph
+
+
Ueberprueft, ob eine Kante im Graphen enthalten ist.
+
+
isKanteEnthalten(Kante) - Method in class graph.Graph
+
+
Ueberprueft, ob eine Kante im Graphen enthalten ist.
+
+
isKanteEnthalten(Knoten, Knoten) - Method in class graph.Graph
+
+
Ueberprueft, ob eine Kante im Graphen enthalten ist.
+
+
isKnotenEnthalten(Knoten) - Method in class graph.Graph
+
+
Ueberprueft, ob ein Knoten in der Knotenliste enthalten ist.
+
+
isLeer() - Method in class graph.Graph
+
+
Ueberprueft, ob die Adjazenzliste leer ist, d.h. keine Knoten im Graphen enthalten sind.
+
+
isMarkiert() - Method in class graph.Kante
+
+
Gibt zurück, ob die Kanten markiert ist
+
+
isMarkiert() - Method in class graph.Knoten
+
+
Gibt den Markiertwert vom Knoten zurueck
+
+
+ + + +

K

+
+
Kante - Class in graph
+
+
Die Klasse Kante beschreibt die Datenstruktur einer Kante, bestehend aus Startknoten, Gewicht und Zielknoten.
+
+
Kante(Knoten, Knoten, double) - Constructor for class graph.Kante
+
+
Der Konstruktor erstellt eine neue Kante mit Start- und Zielknoten und Kantengewicht.
+
+
Knoten - Class in graph
+
+
Diese Klasse Knoten definiert einen Knoten.
+
+
Knoten(int, int) - Constructor for class graph.Knoten
+
+
Der Konstruktor erstellt einen neuen Knoten mit einem neuen Namen
+
+
Knoten(int, int, double) - Constructor for class graph.Knoten
+
+
Der Konstruktor erstellt einen neuen Knoten mit einem Startwert
+
+
knotenFarbe(MouseEvent) - Method in class control.UnterTabMitController
+
 
+
kreuze(int[], int[]) - Method in class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
kreuze(int[], int[]) - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
+ + + +

L

+
+
ladeGraph(Table) - Method in class graph.Graph
+
+
Ein Graph wird aus einer csv-Datei erstellt, die entweder + eine Matrix oder eine Adjazenzliste enthält, die den Graph beschreibt.
+
+
ladeGraph(Table) - Method in class graph.GraphOptions
+
 
+
line(int, int, int, int) - Method in class imp.Picture
+
+
Zeichnet eine Linie (einen direkten Weg zwischen zwei Punkten) auf den Bildschirm.
+
+
listAttributes() - Method in class imp.XML
+
+
Ruft alle Attribute des angegebenen Elements ab und gibt sie als Array von Strings zurück.
+
+
listChildren() - Method in class imp.XML
+
+
Ermittelt die Namen aller Kinder des Elements und gibt die Namen als ein Array von Strings zurück.
+
+
load(String) - Method in class imp.Picture
+
+
Laedt ein Bild aus dem Dateisystem.
+
+
loadCSV(String) - Method in class imp.Table
+
+
Liest den Inhalt einer CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"').
+
+
loadCSV(String, String) - Method in class imp.Table
+
+
Liest den Inhalt einer CSV-Datei (Separator = ';', Kennung für Text = '"').
+
+
loadCSV(String, String, char, char) - Method in class imp.Table
+
+
Liest den Inhalt einer CSV-Datei.
+
+
loadXML(String) - Method in class imp.XML
+
+
Öffnet das durch den Dateinamen gegebene Dokument
+
+
loescheAlles() - Method in class control.Hilfefenster
+
 
+
loescheAlles() - Method in class graph.Graph
+
+
Loescht den gesamten Graphen
+
+
loescheAlles() - Method in interface graph.Hilfe
+
 
+
loescheGraph() - Method in class graph.Graph
+
+
Löscht alle Knoten und Kanten eines Graphen und stellt auf ungerichtet und ungewichtet zurück.
+
+
+ + + +

M

+
+
main(String[]) - Static method in class GraphenTester
+
 
+
mBearbeiten(MouseEvent) - Method in class control.Controller
+
 
+
mBeenden(ActionEvent) - Method in class control.Controller
+
 
+
mBeenden(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mBesucheKnoten(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mBesuchtLoeschen(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mBreak(ActionEvent) - Method in class control.SimulationTabMitController
+
 
+
mChangeHilfefenster(ActionEvent) - Method in class control.Controller
+
 
+
mChangeOptionBild(ActionEvent) - Method in class control.Controller
+
 
+
mChangeOptionKantengewichte(ActionEvent) - Method in class control.Controller
+
 
+
mChangeOptionKnoteninfo(ActionEvent) - Method in class control.Controller
+
 
+
mChangeOptionKnotenname(ActionEvent) - Method in class control.Controller
+
 
+
mChangeOptionKnotenwerte(ActionEvent) - Method in class control.Controller
+
 
+
melde(String) - Method in class algorithmen.GraphAlgo
+
 
+
menuChangeAnsicht() - Method in class control.Controller
+
 
+
mExperimentiereAuswahl(ActionEvent) - Method in class control.Controller
+
 
+
mExperimentiereKanten(ActionEvent) - Method in class control.Controller
+
 
+
mExperimentiereKnoten(ActionEvent) - Method in class control.Controller
+
 
+
mFaerbeKnoten(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mInfotextAendern() - Method in class control.EditTabMitController
+
 
+
mLoesche() - Method in class control.EditTabMitController
+
 
+
mMarkiereKnoten(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mMarkierungenLoeschen(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mNeuerGraph(ActionEvent) - Method in class control.Controller
+
 
+
mOeffnen(ActionEvent) - Method in class control.Controller
+
 
+
mOeffnen(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mouseClicked(MouseEvent) - Method in class graph.GraphPlotter
+
 
+
mouseDown(MouseEvent) - Method in class graph.GraphPlotter
+
 
+
mouseDragged(MouseEvent) - Method in class graph.GraphPlotter
+
 
+
mouseUp(MouseEvent) - Method in class graph.GraphPlotter
+
 
+
mReset(ActionEvent) - Method in class control.SimulationTabMitController
+
 
+
mResetAlles(ActionEvent) - Method in class control.Controller
+
 
+
mResetBesucht(ActionEvent) - Method in class control.Controller
+
 
+
mResetFarbe(ActionEvent) - Method in class control.Controller
+
 
+
mResetGeloescht(ActionEvent) - Method in class control.Controller
+
 
+
mResetKantenmarkierung(ActionEvent) - Method in class control.Controller
+
 
+
mResetMarkierung(ActionEvent) - Method in class control.Controller
+
 
+
mResetWert(ActionEvent) - Method in class control.Controller
+
 
+
mSchliessen(ActionEvent) - Method in class control.Controller
+
 
+
mSchliessen(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mSimuliere(MouseEvent) - Method in class control.Controller
+
 
+
mSpeichern(ActionEvent) - Method in class control.Controller
+
 
+
mSpeichern(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mStart(ActionEvent) - Method in class control.SimulationTabMitController
+
 
+
mStep(ActionEvent) - Method in class control.SimulationTabMitController
+
 
+
mUeber(ActionEvent) - Method in class control.Controller
+
 
+
mUeber(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mutiere(int[]) - Method in class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
mutiere(int[]) - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
mutiere2(int[]) - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
mWertAendern() - Method in class control.EditTabMitController
+
 
+
mWertSetzen(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
mZurueck(ActionEvent) - Method in class control.UnterTabMitController
+
 
+
+ + + +

N

+
+
neueKante(Kante) - Method in class graph.Graph
+
+
Fuegt eine Kante dem Graphen hinzu.
+
+
neueKante(Knoten, Knoten, double) - Method in class graph.Graph
+
+
Fuegt eine Kante dem Graphen hinzu.
+
+
neuerKnoten(Knoten) - Method in class graph.Graph
+
+
Fügt einen Knoten dem Graph hinzu.
+
+
noFill() - Method in class imp.Picture
+
+
Legt fest, dass die Formen nicht gefuellt werden sollen.
+
+
NORMAL - Static variable in class imp.PictureViewer
+
 
+
noStroke() - Method in class imp.Picture
+
+
Legt fest, dass keine Linien oder Raender um Formen gezeichnet werden soll.
+
+
NumberField - Class in imp
+
 
+
NumberField() - Constructor for class imp.NumberField
+
 
+
+ + + +

O

+
+
options - Variable in class control.TabMitController
+
 
+
+ + + +

P

+
+
parent - Variable in class graph.GraphOptions
+
 
+
Picture - Class in imp
+
+
Bildklasse fuer die Simulation von Processing-Befehlen + + Diese Klasse stellt ein BufferedImage bereit, in das mit Processing-Befehlen gezeichnet + werden kann.
+
+
Picture() - Constructor for class imp.Picture
+
+
Erzeugt ein Bild mit Standardgroesse 500x400
+
+
Picture(int, int) - Constructor for class imp.Picture
+
+
Erzeugt ein Bild der angegeben Groesse
+
+
Picture(int, int, String) - Constructor for class imp.Picture
+
+
Erzeugt ein Bild der angegebenen Groesse mit festgelegtem Hintergrund
+
+
Picture(String) - Constructor for class imp.Picture
+
+
Erzeugt ein Bild aus einer Datei
+
+
PictureViewer - Class in imp
+
 
+
PictureViewer() - Constructor for class imp.PictureViewer
+
+
Erzeugt ein ScrollPanel mit integriertem Bild der Größe 1000x1000
+
+
PictureViewer(int, int) - Constructor for class imp.PictureViewer
+
+
Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe
+
+
PictureViewer(int, int, String) - Constructor for class imp.PictureViewer
+
+
Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe
+
+
PictureViewer(Picture) - Constructor for class imp.PictureViewer
+
+
Erzeugt ein ScrollPanel und zeigt das Bild-Objekt an
+
+
PictureViewer(String) - Constructor for class imp.PictureViewer
+
+
Erzeugt ein ScrollPanel mit integriertem Bild aus einer Bilddatei
+
+
point(int, int) - Method in class imp.Picture
+
+
Zeichnet einen Punkt, d.h. einen Kreis in der Dimension eines Pixels.
+
+
polygon(int[], int[]) - Method in class imp.Picture
+
+
Zeichnet ein Polygon auf das Bild.
+
+
probiere(Knoten) - Method in class algorithmen.GraphAlgo_TSPBacktracking
+
 
+
pushImage() - Method in class imp.PictureViewer
+
+
Speichert das übergebene Bild in der History.
+
+
+ + + +

Q

+
+
quad(int, int, int, int, int, int, int, int) - Method in class imp.Picture
+
+
Zeichnet ein Viereck auf das Bild.
+
+
+ + + +

R

+
+
RADIUS - Static variable in class imp.Picture
+
 
+
rect(int, int, int, int) - Method in class imp.Picture
+
+
Zeichnet ein Rechteck auf das Bild.
+
+
rectMode(int) - Method in class imp.Picture
+
+
Aendert den Koordinaten-Modus beim Zeichnen von Rechtecken.
+
+
removeChild(XML) - Method in class imp.XML
+
+
löscht ein Kind des aktuellen Knotens.
+
+
removeColumn(int) - Method in class imp.Table
+
+
Löscht eine Spalte.
+
+
removeColumn(String) - Method in class imp.Table
+
+
Löscht eine Spalte
+
+
removeRow(int) - Method in class imp.Table
+
+
Löscht eine Zeile
+
+
repaint() - Method in class imp.PictureViewer
+
+
Setzt das angezeigt Bild neu und beachtet dabei den Zoomfaktor.
+
+
replaceSelection(String) - Method in class imp.NumberField
+
 
+
replaceText(int, int, String) - Method in class imp.NumberField
+
 
+
resetInfo() - Method in class algorithmen.GraphAlgo
+
 
+
rows() - Method in class imp.Table
+
+
Liefert die ganze Tabelle als Array von TableRow-Objekten
+
+
run() - Method in class algorithmen.GraphAlgo
+
 
+
+ + + +

S

+
+
save(String) - Method in class imp.Picture
+
+
Speichert ein Bild.
+
+
saveAsMatrix - Variable in class graph.GraphOptions
+
 
+
saveCSV(String) - Method in class imp.Table
+
+
Speichert das aktuelle Dokument als CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"').
+
+
saveCSV(String, String) - Method in class imp.Table
+
+
Speichert das aktuelle Dokument als CSV-Datei (Separator = ';', Kennung für Text = '"').
+
+
saveCSV(String, String, char, char) - Method in class imp.Table
+
+
Speichert das aktuelle Dokument als CSV-Datei.
+
+
saveXML(String) - Method in class imp.Table
+
+
Speichert die Tabelle als XML-Dokument.
+
+
saveXML(String) - Method in class imp.XML
+
+
Speichert den XML-Baum im angegebenen Dateinamen
+
+
schliesseTabs() - Method in class control.Controller
+
 
+
setAuswahl(List<GraphElement>) - Method in class control.UnterTabMitController
+
 
+
setAutoRefresh(boolean) - Method in class imp.Picture
+
+
Legt fest, ob nach jedem Zeichenbefehl automatisch das Bild auch in + der Oberflaeche aktualisiert wird.
+
+
setBesucht(boolean) - Method in class graph.Knoten
+
+
Setzt das Besuchtattribut vom Knoten
+
+
setContent(String) - Method in class imp.XML
+
+
Setzt den Inhalt/Text des aktuellen Elements
+
+
setDouble(int, double) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als Double-Zahl
+
+
setDouble(int, int, double) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als Double-Zahl
+
+
setDouble(int, String, double) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als Double-Zahl
+
+
setDouble(String, double) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als Double-Zahl
+
+
setDouble(String, double) - Method in class imp.XML
+
+
Setzt einen Attributwert des aktuellen Elements
+
+
setDoubleContent(double) - Method in class imp.XML
+
+
Setzt den Inhalt des aktuellen Elements
+
+
setEditable() - Method in class graph.GraphPlotter
+
 
+
setFarbe(int) - Method in class graph.Kante
+
+
Setzt die Farbe auf einen bestimmten Farbindex
+
+
setFarbe(int) - Method in class graph.Knoten
+
+
Setzt den Index der Farbe des Knoten.
+
+
setFarbeAutomatisch(boolean) - Method in class graph.Knoten
+
+
Legt fest, ob die Knotenfarbe automatisch aus den Attributen ermittelt wird.
+
+
setFloat(int, float) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als Float-Zahl
+
+
setFloat(int, int, float) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als Float-Zahl
+
+
setFloat(int, String, float) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als Float-Zahl
+
+
setFloat(String, float) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als Float-Zahl
+
+
setFloat(String, float) - Method in class imp.XML
+
+
Setzt einen Attributwert des aktuellen Elements
+
+
setFloatContent(float) - Method in class imp.XML
+
+
Setzt den Inhalt des aktuellen Elements
+
+
setGeloescht(boolean) - Method in class graph.Kante
+
+
Setzt das gelöscht-Attribut der Kante
+
+
setGerichtet(boolean) - Method in class control.EditTabMitController
+
 
+
setGerichtet(boolean) - Method in class graph.Graph
+
+
Legt fest, ob der Graph gerichtet oder ungerichtet ist.
+
+
setGewicht(double) - Method in class graph.Kante
+
+
Setzt das Gewicht der Kante
+
+
setGewichtet(boolean) - Method in class control.EditTabMitController
+
 
+
setGewichtet(boolean) - Method in class graph.Graph
+
+
Legt fest, ob der Graph gewichtet oder ungewichtet ist.
+
+
setGraph(Graph) - Method in class algorithmen.GraphAlgo
+
 
+
setGraph(Graph, GraphOptions) - Method in class control.SimulationTabMitController
+
 
+
setGraph(Graph, GraphOptions) - Method in class control.TabMitController
+
 
+
setGraph(Graph, GraphOptions) - Method in class control.UnterTabMitController
+
 
+
setGraph(Graph, GraphOptions) - Method in class graph.GraphPlotter
+
 
+
setGraphPlotter(GraphPlotter) - Method in class control.Hilfefenster
+
 
+
setGraphPlotter(GraphPlotter) - Method in interface graph.Hilfe
+
 
+
setGUIElemente(GraphPlotter, Hilfe) - Method in class algorithmen.GraphAlgo
+
 
+
setImage(Picture, boolean) - Method in class imp.PictureViewer
+
+
Setzt das anzuzeigende Bild neu
+
+
setImage(BufferedImage) - Method in class imp.Picture
+
+
Direktes Setzen des Bildes (fuer interne Zwecke)
+
+
setInfotext(boolean) - Method in class control.EditTabMitController
+
 
+
setInfotext(String) - Method in class graph.Knoten
+
+
Setzt den Infotext für einen Knoten
+
+
setInt(int, int) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als Int-Zahl
+
+
setInt(int, int, int) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als Integer-Zahl
+
+
setInt(int, String, int) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als Integer-Zahl
+
+
setInt(String, int) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als Int-Zahl
+
+
setInt(String, int) - Method in class imp.XML
+
+
Setzt einen Attributwert des aktuellen Elements
+
+
setIntContent(int) - Method in class imp.XML
+
+
Setzt den Inhalt des aktuellen Elements
+
+
setKnotenTyp(Toggle) - Method in class control.EditTabMitController
+
 
+
setMarkiert(boolean) - Method in class graph.Kante
+
+
Setzt das markiert-Attribut der Kante
+
+
setMarkiert(boolean) - Method in class graph.Knoten
+
+
Setzt das Markiertattribut vom Knoten
+
+
setName(String) - Method in class imp.XML
+
+
Setze den Namen des aktuellen Elements.
+
+
setObserver(PictureViewer) - Method in class imp.Picture
+
+
Legt fest, wer das Bild anzeigt.
+
+
setPixelArray(Color[][]) - Method in class imp.Picture
+
+
Setzt das Bild neu auf Basis des Pixel-Arrays.
+
+
setRestrictTo(GraphElement) - Method in class graph.GraphPlotter
+
 
+
setReviewAllowed(boolean) - Method in class control.Hilfefenster
+
 
+
setReviewAllowed(boolean) - Method in interface graph.Hilfe
+
 
+
setSpeed(int) - Method in class algorithmen.GraphAlgo
+
 
+
setStandardFarbe() - Method in class graph.Kante
+
+
Setzt die Farbe auf die Standardfarbgebung zurück
+
+
setStart(Knoten) - Method in class graph.Kante
+
+
Setzt den Startknoten der Kante
+
+
setStartKnoten(Knoten) - Method in class algorithmen.GraphAlgo
+
 
+
setStatus(String) - Method in class graph.GraphElement
+
 
+
setStatus(String) - Method in class graph.Kante
+
+
Setzt den Status einer Kante, der in einem String gespeichert ist.
+
+
setStatus(String) - Method in class graph.Knoten
+
+
Setzt den Status eines Knotens aus einem Status-String + Format: wert,markiert,besucht,farbe + wobei wert eine double-Zahl, mariert und besucht ein boolean-Wert (0=false, 1 = true) und + farbe eine zahl ist.
+
+
setStatus(List<String>) - Method in class graph.Graph
+
+
Stellt den Zustand des Graphen aus String-List wieder her
+
+
setStepping(boolean) - Method in class algorithmen.GraphAlgo
+
 
+
setString(int, int, String) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als String
+
+
setString(int, String) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als String
+
+
setString(int, String, String) - Method in class imp.Table
+
+
Setzt den Wert einer Zelle als String
+
+
setString(String, String) - Method in class imp.TableRow
+
+
Setzt den Wert einer Zelle als String
+
+
setString(String, String) - Method in class imp.XML
+
+
Setzt einen Attributwert des aktuellen Elements
+
+
setValue(double) - Method in class imp.NumberField
+
 
+
setValue(int) - Method in class imp.NumberField
+
 
+
setWaitforclick(boolean) - Method in class algorithmen.GraphAlgo
+
 
+
setWaitforrepaint(boolean) - Method in class algorithmen.GraphAlgo
+
 
+
setWert(double) - Method in class graph.Knoten
+
+
Setzt den Wert beim Knoten
+
+
setX(int) - Method in class graph.Knoten
+
+
Setzt die x-Position des Knotens
+
+
setY(int) - Method in class graph.Knoten
+
+
Setzt die y-Position des Knotens
+
+
setZiel(Knoten) - Method in class graph.Kante
+
+
Setzt den Zielknoten der Kante
+
+
setZoom(double) - Method in class imp.PictureViewer
+
+
Setzt den Zoom-Faktor für das Bild.
+
+
sGroesseAendern(Number) - Method in class control.EditTabMitController
+
 
+
showEdgeWeights - Variable in class graph.GraphOptions
+
 
+
showHilfe(boolean) - Method in class control.SimulationTabMitController
+
 
+
showInFrame() - Method in class imp.Picture
+
 
+
showRundreise(int[]) - Method in class algorithmen.GraphAlgo_TSPGenetisch
+
 
+
showState() - Method in class control.Hilfefenster
+
 
+
showTeilmenge(int[]) - Method in class algorithmen.GraphAlgo_DominatingSetGenetisch
+
 
+
showVertexInfo - Variable in class graph.GraphOptions
+
 
+
showVertexText - Variable in class graph.GraphOptions
+
 
+
showVertexValue - Variable in class graph.GraphOptions
+
 
+
SimulationTabMitController - Class in control
+
+
Die Klasse SimulationTabMitController stellt einen Tab inclusive ihres Controllers + zur Simulation eines Algorithmus dar.
+
+
SimulationTabMitController(Graph, GraphOptions) - Constructor for class control.SimulationTabMitController
+
 
+
size(int, int) - Method in class imp.Picture
+
+
Definiert die Dimension der Breite und Hoehe des Anzeigefensters in Pixeleinheiten.
+
+
start(Stage) - Method in class GraphenTester
+
 
+
stdFarbenKanten - Variable in class graph.GraphOptions
+
 
+
stdFarbenKnoten - Variable in class graph.GraphOptions
+
 
+
step() - Method in class algorithmen.GraphAlgo
+
 
+
stroke(int) - Method in class imp.Picture
+
+
Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden.
+
+
stroke(int, int, int) - Method in class imp.Picture
+
+
Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden.
+
+
stroke(String) - Method in class imp.Picture
+
+
Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden.
+
+
strokeWeight(double) - Method in class imp.Picture
+
+
Legt die Breite des Strichs fuer Linien, Punkte und den Rand um Formen fest.
+
+
+ + + +

T

+
+
Table - Class in imp
+
 
+
Table() - Constructor for class imp.Table
+
+
Erzeugt leeres Tabellen-Dokument.
+
+
Table(String) - Constructor for class imp.Table
+
+
Erzeugt Tabellen-Dokument aus einer CSV-Datei.
+
+
Table(String, String) - Constructor for class imp.Table
+
+
Erzeugt Tabellen-Dokument aus einer CSV-Datei.
+
+
Table(String, String, char, char) - Constructor for class imp.Table
+
+
Erzeugt Tabellen-Dokument aus einer CSV-Datei.
+
+
TableRow - Class in imp
+
 
+
TableRow(Document, Element) - Constructor for class imp.TableRow
+
+
Erzeugt ein TableRow-Objekt.
+
+
TabMitController - Class in control
+
+
Die Klasse TabMitController stellt die Oberklasse für alle Tabs des Graphentesters + dar.
+
+
TabMitController() - Constructor for class control.TabMitController
+
 
+
tabOeffnen(GraphOptions) - Method in class control.TabMitController
+
 
+
text(String, int, int) - Method in class imp.Picture
+
+
Gibt einen Text an den gegebenen Koordinaten aus + Zur Ausgabe des Textes wird der ausgewaehlte Font verwendet.
+
+
textFont(Font) - Method in class imp.Picture
+
+
Legt die Schriftart fuer Textausgaben fest.
+
+
textMode(int) - Method in class imp.Picture
+
+
Aendert den Koordinaten-Modus beim Zeichnen von Texten.
+
+
toCSVString(boolean) - Method in class graph.Graph
+
+
Die Methode erstellt eine CSV-Ausgabe des Graphen entweder als Adjazenzliste oder als Adjazenzmatrix.
+
+
toString() - Method in class graph.Graph
+
+
Textuelle Repraesentation des Graphen.
+
+
toString() - Method in class graph.GraphPlotter
+
+
Ueberschreibt die Methode toString.
+
+
toString() - Method in class graph.Kante
+
+
Die Methode ueberschreibt die Methode toString() und gibt die String-Raepraesentation einer Kante zurueck
+
+
toString() - Method in class graph.Knoten
+
+
Die Methode ueberschreibt die Methode toString() und gibt die String-Raepraesentation eines Knotens zurueck
+
+
triangle(int, int, int, int, int, int) - Method in class imp.Picture
+
+
Zeichnet ein Dreieck auf das Bild.
+
+
trim() - Method in class imp.Table
+
+
Kürzt alle Einträge der Tabelle um unnötige Leerzeichen am Anfang oder Ende
+
+
+ + + +

U

+
+
UnterTabMitController - Class in control
+
+
Die Klasse UnterTabMitController stellt einen Tab inclusive ihres Controllers + zur händischen Erforschung eines Algorithmus.
+
+
UnterTabMitController(Graph, GraphOptions) - Constructor for class control.UnterTabMitController
+
 
+
update() - Method in class control.TabMitController
+
 
+
update() - Method in class control.UnterTabMitController
+
 
+
updateImage() - Method in class graph.GraphPlotter
+
 
+
updateInfofeld() - Method in class control.UnterTabMitController
+
 
+
+ + + +

V

+
+
vertexSize - Variable in class graph.GraphOptions
+
 
+
viewer - Variable in class control.TabMitController
+
 
+
+ + + +

X

+
+
XML - Class in imp
+
 
+
XML() - Constructor for class imp.XML
+
+
Erzeugt ein leeres XMLDokument
+
+
XML(String) - Constructor for class imp.XML
+
+
Erzeugt ein XML-Dokument aus einer Datei
+
+
+A B C D E F G H I K L M N O P Q R S T U V X 
All Classes All Packages
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/index.html b/Quellcodes/alg_ds_graphentester/doc/index.html new file mode 100644 index 0000000..f808aa9 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/index.html @@ -0,0 +1,26 @@ + + + + +Generated Documentation (Untitled) + + + + + + + + + + + +
+ +

graph/package-summary.html

+
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/jquery/external/jquery/jquery.js b/Quellcodes/alg_ds_graphentester/doc/jquery/external/jquery/jquery.js new file mode 100644 index 0000000..9b5206b --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/jquery/external/jquery/jquery.js @@ -0,0 +1,10364 @@ +/*! + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2018-01-20T17:24Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var document = window.document; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + + + + var preservedScriptAttributes = { + type: true, + src: true, + noModule: true + }; + + function DOMEval( code, doc, node ) { + doc = doc || document; + + var i, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + if ( node[ i ] ) { + script[ i ] = node[ i ]; + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.3.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android <=4.0 only + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && Array.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.3 + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-08-08 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true && ("form" in elem || "label" in elem); + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement("fieldset"); + + try { + return !!fn( el ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + disabledAncestor( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( preferredDoc !== document && + (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( el ) { + el.className = "i"; + return !el.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( el ) { + el.appendChild( document.createComment("") ); + return !el.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID filter and find + if ( support.getById ) { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( (elem = elems[i++]) ) { + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( el ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll(":enabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll(":disabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( el ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return (sel + "").replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( (oldCache = uniqueCache[ key ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( el ) { + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( el ) { + return el.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( nodeName( elem, "iframe" ) ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + jQuery.contains( elem.ownerDocument, elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + +var swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE <=9 only + option: [ 1, "" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +// Support: IE <=9 only +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); +var documentElement = document.documentElement; + + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 only +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + // Make a writable jQuery.Event from the native event object + var event = jQuery.event.fix( nativeEvent ); + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + /* eslint-disable max-len */ + + // See https://github.com/eslint/eslint/issues/3229 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + + /* eslint-enable */ + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), doc, node ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + div.style.position = "absolute"; + scrollboxSizeVal = div.offsetWidth === 36 || "absolute"; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }, + + cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style; + +// Return a css property mapped to a potentially vendor prefixed property +function vendorPropName( name ) { + + // Shortcut for names that are not vendor prefixed + if ( name in emptyStyle ) { + return name; + } + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a property mapped along what jQuery.cssProps suggests or to +// a vendor prefixed property. +function finalPropName( name ) { + var ret = jQuery.cssProps[ name ]; + if ( !ret ) { + ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; + } + return ret; +} + +function setPositiveNumber( elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + ) ); + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + val = curCSS( elem, dimension, styles ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox; + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + // Check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = valueIsBorderBox && + ( support.boxSizingReliable() || val === elem.style[ dimension ] ); + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + if ( val === "auto" || + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) { + + val = elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ]; + + // offsetWidth/offsetHeight provide border-box values + valueIsBorderBox = true; + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + if ( type === "number" ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra && boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ); + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && support.scrollboxSize() === styles.position ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && + ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || + jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = Date.now(); + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + + +jQuery._evalUrl = function( url ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + "throws": true + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( "\r\n"; + +// inject VBScript +document.write(IEBinaryToArray_ByteStr_Script); + +global.JSZipUtils._getBinaryFromXHR = function (xhr) { + var binary = xhr.responseBody; + var byteMapping = {}; + for ( var i = 0; i < 256; i++ ) { + for ( var j = 0; j < 256; j++ ) { + byteMapping[ String.fromCharCode( i + (j << 8) ) ] = + String.fromCharCode(i) + String.fromCharCode(j); + } + } + var rawBytes = IEBinaryToArray_ByteStr(binary); + var lastChr = IEBinaryToArray_ByteStr_Last(binary); + return rawBytes.replace(/[\s\S]/g, function( match ) { + return byteMapping[match]; + }) + lastChr; +}; + +// enforcing Stuk's coding style +// vim: set shiftwidth=4 softtabstop=4: + +},{}]},{},[1]) +; diff --git a/Quellcodes/alg_ds_graphentester/doc/jquery/jszip-utils/dist/jszip-utils-ie.min.js b/Quellcodes/alg_ds_graphentester/doc/jquery/jszip-utils/dist/jszip-utils-ie.min.js new file mode 100644 index 0000000..93d8bc8 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/jquery/jszip-utils/dist/jszip-utils-ie.min.js @@ -0,0 +1,10 @@ +/*! + +JSZipUtils - A collection of cross-browser utilities to go along with JSZip. + + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); diff --git a/Quellcodes/alg_ds_graphentester/doc/jquery/jszip-utils/dist/jszip-utils.js b/Quellcodes/alg_ds_graphentester/doc/jquery/jszip-utils/dist/jszip-utils.js new file mode 100644 index 0000000..775895e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/jquery/jszip-utils/dist/jszip-utils.js @@ -0,0 +1,118 @@ +/*! + +JSZipUtils - A collection of cross-browser utilities to go along with JSZip. + + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/master/LICENSE +*/ + +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JSZip = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = remainingBytes > 1 ? (((chr2 & 15) << 2) | (chr3 >> 6)) : 64; + enc4 = remainingBytes > 2 ? (chr3 & 63) : 64; + + output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4)); + + } + + return output.join(""); +}; + +// public method for decoding +exports.decode = function(input) { + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0, resultIndex = 0; + + var dataUrlPrefix = "data:"; + + if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) { + // This is a common error: people give a data url + // (data:image/png;base64,iVBOR...) with a {base64: true} and + // wonders why things don't work. + // We can detect that the string input looks like a data url but we + // *can't* be sure it is one: removing everything up to the comma would + // be too dangerous. + throw new Error("Invalid base64 input, it looks like a data url."); + } + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + var totalLength = input.length * 3 / 4; + if(input.charAt(input.length - 1) === _keyStr.charAt(64)) { + totalLength--; + } + if(input.charAt(input.length - 2) === _keyStr.charAt(64)) { + totalLength--; + } + if (totalLength % 1 !== 0) { + // totalLength is not an integer, the length does not match a valid + // base64 content. That can happen if: + // - the input is not a base64 content + // - the input is *almost* a base64 content, with a extra chars at the + // beginning or at the end + // - the input uses a base64 variant (base64url for example) + throw new Error("Invalid base64 input, bad content length."); + } + var output; + if (support.uint8array) { + output = new Uint8Array(totalLength|0); + } else { + output = new Array(totalLength|0); + } + + while (i < input.length) { + + enc1 = _keyStr.indexOf(input.charAt(i++)); + enc2 = _keyStr.indexOf(input.charAt(i++)); + enc3 = _keyStr.indexOf(input.charAt(i++)); + enc4 = _keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output[resultIndex++] = chr1; + + if (enc3 !== 64) { + output[resultIndex++] = chr2; + } + if (enc4 !== 64) { + output[resultIndex++] = chr3; + } + + } + + return output; +}; + +},{"./support":30,"./utils":32}],2:[function(require,module,exports){ +'use strict'; + +var external = require("./external"); +var DataWorker = require('./stream/DataWorker'); +var DataLengthProbe = require('./stream/DataLengthProbe'); +var Crc32Probe = require('./stream/Crc32Probe'); +var DataLengthProbe = require('./stream/DataLengthProbe'); + +/** + * Represent a compressed object, with everything needed to decompress it. + * @constructor + * @param {number} compressedSize the size of the data compressed. + * @param {number} uncompressedSize the size of the data after decompression. + * @param {number} crc32 the crc32 of the decompressed file. + * @param {object} compression the type of compression, see lib/compressions.js. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the compressed data. + */ +function CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) { + this.compressedSize = compressedSize; + this.uncompressedSize = uncompressedSize; + this.crc32 = crc32; + this.compression = compression; + this.compressedContent = data; +} + +CompressedObject.prototype = { + /** + * Create a worker to get the uncompressed content. + * @return {GenericWorker} the worker. + */ + getContentWorker : function () { + var worker = new DataWorker(external.Promise.resolve(this.compressedContent)) + .pipe(this.compression.uncompressWorker()) + .pipe(new DataLengthProbe("data_length")); + + var that = this; + worker.on("end", function () { + if(this.streamInfo['data_length'] !== that.uncompressedSize) { + throw new Error("Bug : uncompressed data size mismatch"); + } + }); + return worker; + }, + /** + * Create a worker to get the compressed content. + * @return {GenericWorker} the worker. + */ + getCompressedWorker : function () { + return new DataWorker(external.Promise.resolve(this.compressedContent)) + .withStreamInfo("compressedSize", this.compressedSize) + .withStreamInfo("uncompressedSize", this.uncompressedSize) + .withStreamInfo("crc32", this.crc32) + .withStreamInfo("compression", this.compression) + ; + } +}; + +/** + * Chain the given worker with other workers to compress the content with the + * given compresion. + * @param {GenericWorker} uncompressedWorker the worker to pipe. + * @param {Object} compression the compression object. + * @param {Object} compressionOptions the options to use when compressing. + * @return {GenericWorker} the new worker compressing the content. + */ +CompressedObject.createWorkerFrom = function (uncompressedWorker, compression, compressionOptions) { + return uncompressedWorker + .pipe(new Crc32Probe()) + .pipe(new DataLengthProbe("uncompressedSize")) + .pipe(compression.compressWorker(compressionOptions)) + .pipe(new DataLengthProbe("compressedSize")) + .withStreamInfo("compression", compression); +}; + +module.exports = CompressedObject; + +},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(require,module,exports){ +'use strict'; + +var GenericWorker = require("./stream/GenericWorker"); + +exports.STORE = { + magic: "\x00\x00", + compressWorker : function (compressionOptions) { + return new GenericWorker("STORE compression"); + }, + uncompressWorker : function () { + return new GenericWorker("STORE decompression"); + } +}; +exports.DEFLATE = require('./flate'); + +},{"./flate":7,"./stream/GenericWorker":28}],4:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); + +/** + * The following functions come from pako, from pako/lib/zlib/crc32.js + * released under the MIT license, see pako https://github.com/nodeca/pako/ + */ + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for(var n =0; n < 256; n++){ + c = n; + for(var k =0; k < 8; k++){ + c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, end = pos + len; + + crc = crc ^ (-1); + + for (var i = pos; i < end; i++ ) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + +// That's all for the pako functions. + +/** + * Compute the crc32 of a string. + * This is almost the same as the function crc32, but for strings. Using the + * same function for the two use cases leads to horrible performances. + * @param {Number} crc the starting value of the crc. + * @param {String} str the string to use. + * @param {Number} len the length of the string. + * @param {Number} pos the starting position for the crc32 computation. + * @return {Number} the computed crc32. + */ +function crc32str(crc, str, len, pos) { + var t = crcTable, end = pos + len; + + crc = crc ^ (-1); + + for (var i = pos; i < end; i++ ) { + crc = (crc >>> 8) ^ t[(crc ^ str.charCodeAt(i)) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + +module.exports = function crc32wrapper(input, crc) { + if (typeof input === "undefined" || !input.length) { + return 0; + } + + var isArray = utils.getTypeOf(input) !== "string"; + + if(isArray) { + return crc32(crc|0, input, input.length, 0); + } else { + return crc32str(crc|0, input, input.length, 0); + } +}; + +},{"./utils":32}],5:[function(require,module,exports){ +'use strict'; +exports.base64 = false; +exports.binary = false; +exports.dir = false; +exports.createFolders = true; +exports.date = null; +exports.compression = null; +exports.compressionOptions = null; +exports.comment = null; +exports.unixPermissions = null; +exports.dosPermissions = null; + +},{}],6:[function(require,module,exports){ +/* global Promise */ +'use strict'; + +// load the global object first: +// - it should be better integrated in the system (unhandledRejection in node) +// - the environment may have a custom Promise implementation (see zone.js) +var ES6Promise = null; +if (typeof Promise !== "undefined") { + ES6Promise = Promise; +} else { + ES6Promise = require("lie"); +} + +/** + * Let the user use/change some implementations. + */ +module.exports = { + Promise: ES6Promise +}; + +},{"lie":58}],7:[function(require,module,exports){ +'use strict'; +var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined'); + +var pako = require("pako"); +var utils = require("./utils"); +var GenericWorker = require("./stream/GenericWorker"); + +var ARRAY_TYPE = USE_TYPEDARRAY ? "uint8array" : "array"; + +exports.magic = "\x08\x00"; + +/** + * Create a worker that uses pako to inflate/deflate. + * @constructor + * @param {String} action the name of the pako function to call : either "Deflate" or "Inflate". + * @param {Object} options the options to use when (de)compressing. + */ +function FlateWorker(action, options) { + GenericWorker.call(this, "FlateWorker/" + action); + + this._pako = null; + this._pakoAction = action; + this._pakoOptions = options; + // the `meta` object from the last chunk received + // this allow this worker to pass around metadata + this.meta = {}; +} + +utils.inherits(FlateWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +FlateWorker.prototype.processChunk = function (chunk) { + this.meta = chunk.meta; + if (this._pako === null) { + this._createPako(); + } + this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false); +}; + +/** + * @see GenericWorker.flush + */ +FlateWorker.prototype.flush = function () { + GenericWorker.prototype.flush.call(this); + if (this._pako === null) { + this._createPako(); + } + this._pako.push([], true); +}; +/** + * @see GenericWorker.cleanUp + */ +FlateWorker.prototype.cleanUp = function () { + GenericWorker.prototype.cleanUp.call(this); + this._pako = null; +}; + +/** + * Create the _pako object. + * TODO: lazy-loading this object isn't the best solution but it's the + * quickest. The best solution is to lazy-load the worker list. See also the + * issue #446. + */ +FlateWorker.prototype._createPako = function () { + this._pako = new pako[this._pakoAction]({ + raw: true, + level: this._pakoOptions.level || -1 // default compression + }); + var self = this; + this._pako.onData = function(data) { + self.push({ + data : data, + meta : self.meta + }); + }; +}; + +exports.compressWorker = function (compressionOptions) { + return new FlateWorker("Deflate", compressionOptions); +}; +exports.uncompressWorker = function () { + return new FlateWorker("Inflate", {}); +}; + +},{"./stream/GenericWorker":28,"./utils":32,"pako":59}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var GenericWorker = require('../stream/GenericWorker'); +var utf8 = require('../utf8'); +var crc32 = require('../crc32'); +var signature = require('../signature'); + +/** + * Transform an integer into a string in hexadecimal. + * @private + * @param {number} dec the number to convert. + * @param {number} bytes the number of bytes to generate. + * @returns {string} the result. + */ +var decToHex = function(dec, bytes) { + var hex = "", i; + for (i = 0; i < bytes; i++) { + hex += String.fromCharCode(dec & 0xff); + dec = dec >>> 8; + } + return hex; +}; + +/** + * Generate the UNIX part of the external file attributes. + * @param {Object} unixPermissions the unix permissions or null. + * @param {Boolean} isDir true if the entry is a directory, false otherwise. + * @return {Number} a 32 bit integer. + * + * adapted from http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute : + * + * TTTTsstrwxrwxrwx0000000000ADVSHR + * ^^^^____________________________ file type, see zipinfo.c (UNX_*) + * ^^^_________________________ setuid, setgid, sticky + * ^^^^^^^^^________________ permissions + * ^^^^^^^^^^______ not used ? + * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only + */ +var generateUnixExternalFileAttr = function (unixPermissions, isDir) { + + var result = unixPermissions; + if (!unixPermissions) { + // I can't use octal values in strict mode, hence the hexa. + // 040775 => 0x41fd + // 0100664 => 0x81b4 + result = isDir ? 0x41fd : 0x81b4; + } + return (result & 0xFFFF) << 16; +}; + +/** + * Generate the DOS part of the external file attributes. + * @param {Object} dosPermissions the dos permissions or null. + * @param {Boolean} isDir true if the entry is a directory, false otherwise. + * @return {Number} a 32 bit integer. + * + * Bit 0 Read-Only + * Bit 1 Hidden + * Bit 2 System + * Bit 3 Volume Label + * Bit 4 Directory + * Bit 5 Archive + */ +var generateDosExternalFileAttr = function (dosPermissions, isDir) { + + // the dir flag is already set for compatibility + return (dosPermissions || 0) & 0x3F; +}; + +/** + * Generate the various parts used in the construction of the final zip file. + * @param {Object} streamInfo the hash with informations about the compressed file. + * @param {Boolean} streamedContent is the content streamed ? + * @param {Boolean} streamingEnded is the stream finished ? + * @param {number} offset the current offset from the start of the zip file. + * @param {String} platform let's pretend we are this platform (change platform dependents fields) + * @param {Function} encodeFileName the function to encode the file name / comment. + * @return {Object} the zip parts. + */ +var generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) { + var file = streamInfo['file'], + compression = streamInfo['compression'], + useCustomEncoding = encodeFileName !== utf8.utf8encode, + encodedFileName = utils.transformTo("string", encodeFileName(file.name)), + utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)), + comment = file.comment, + encodedComment = utils.transformTo("string", encodeFileName(comment)), + utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)), + useUTF8ForFileName = utfEncodedFileName.length !== file.name.length, + useUTF8ForComment = utfEncodedComment.length !== comment.length, + dosTime, + dosDate, + extraFields = "", + unicodePathExtraField = "", + unicodeCommentExtraField = "", + dir = file.dir, + date = file.date; + + + var dataInfo = { + crc32 : 0, + compressedSize : 0, + uncompressedSize : 0 + }; + + // if the content is streamed, the sizes/crc32 are only available AFTER + // the end of the stream. + if (!streamedContent || streamingEnded) { + dataInfo.crc32 = streamInfo['crc32']; + dataInfo.compressedSize = streamInfo['compressedSize']; + dataInfo.uncompressedSize = streamInfo['uncompressedSize']; + } + + var bitflag = 0; + if (streamedContent) { + // Bit 3: the sizes/crc32 are set to zero in the local header. + // The correct values are put in the data descriptor immediately + // following the compressed data. + bitflag |= 0x0008; + } + if (!useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment)) { + // Bit 11: Language encoding flag (EFS). + bitflag |= 0x0800; + } + + + var extFileAttr = 0; + var versionMadeBy = 0; + if (dir) { + // dos or unix, we set the dos dir flag + extFileAttr |= 0x00010; + } + if(platform === "UNIX") { + versionMadeBy = 0x031E; // UNIX, version 3.0 + extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir); + } else { // DOS or other, fallback to DOS + versionMadeBy = 0x0014; // DOS, version 2.0 + extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir); + } + + // date + // @see http://www.delorie.com/djgpp/doc/rbinter/it/52/13.html + // @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html + // @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html + + dosTime = date.getUTCHours(); + dosTime = dosTime << 6; + dosTime = dosTime | date.getUTCMinutes(); + dosTime = dosTime << 5; + dosTime = dosTime | date.getUTCSeconds() / 2; + + dosDate = date.getUTCFullYear() - 1980; + dosDate = dosDate << 4; + dosDate = dosDate | (date.getUTCMonth() + 1); + dosDate = dosDate << 5; + dosDate = dosDate | date.getUTCDate(); + + if (useUTF8ForFileName) { + // set the unicode path extra field. unzip needs at least one extra + // field to correctly handle unicode path, so using the path is as good + // as any other information. This could improve the situation with + // other archive managers too. + // This field is usually used without the utf8 flag, with a non + // unicode path in the header (winrar, winzip). This helps (a bit) + // with the messy Windows' default compressed folders feature but + // breaks on p7zip which doesn't seek the unicode path extra field. + // So for now, UTF-8 everywhere ! + unicodePathExtraField = + // Version + decToHex(1, 1) + + // NameCRC32 + decToHex(crc32(encodedFileName), 4) + + // UnicodeName + utfEncodedFileName; + + extraFields += + // Info-ZIP Unicode Path Extra Field + "\x75\x70" + + // size + decToHex(unicodePathExtraField.length, 2) + + // content + unicodePathExtraField; + } + + if(useUTF8ForComment) { + + unicodeCommentExtraField = + // Version + decToHex(1, 1) + + // CommentCRC32 + decToHex(crc32(encodedComment), 4) + + // UnicodeName + utfEncodedComment; + + extraFields += + // Info-ZIP Unicode Path Extra Field + "\x75\x63" + + // size + decToHex(unicodeCommentExtraField.length, 2) + + // content + unicodeCommentExtraField; + } + + var header = ""; + + // version needed to extract + header += "\x0A\x00"; + // general purpose bit flag + header += decToHex(bitflag, 2); + // compression method + header += compression.magic; + // last mod file time + header += decToHex(dosTime, 2); + // last mod file date + header += decToHex(dosDate, 2); + // crc-32 + header += decToHex(dataInfo.crc32, 4); + // compressed size + header += decToHex(dataInfo.compressedSize, 4); + // uncompressed size + header += decToHex(dataInfo.uncompressedSize, 4); + // file name length + header += decToHex(encodedFileName.length, 2); + // extra field length + header += decToHex(extraFields.length, 2); + + + var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields; + + var dirRecord = signature.CENTRAL_FILE_HEADER + + // version made by (00: DOS) + decToHex(versionMadeBy, 2) + + // file header (common to file and central directory) + header + + // file comment length + decToHex(encodedComment.length, 2) + + // disk number start + "\x00\x00" + + // internal file attributes TODO + "\x00\x00" + + // external file attributes + decToHex(extFileAttr, 4) + + // relative offset of local header + decToHex(offset, 4) + + // file name + encodedFileName + + // extra field + extraFields + + // file comment + encodedComment; + + return { + fileRecord: fileRecord, + dirRecord: dirRecord + }; +}; + +/** + * Generate the EOCD record. + * @param {Number} entriesCount the number of entries in the zip file. + * @param {Number} centralDirLength the length (in bytes) of the central dir. + * @param {Number} localDirLength the length (in bytes) of the local dir. + * @param {String} comment the zip file comment as a binary string. + * @param {Function} encodeFileName the function to encode the comment. + * @return {String} the EOCD record. + */ +var generateCentralDirectoryEnd = function (entriesCount, centralDirLength, localDirLength, comment, encodeFileName) { + var dirEnd = ""; + var encodedComment = utils.transformTo("string", encodeFileName(comment)); + + // end of central dir signature + dirEnd = signature.CENTRAL_DIRECTORY_END + + // number of this disk + "\x00\x00" + + // number of the disk with the start of the central directory + "\x00\x00" + + // total number of entries in the central directory on this disk + decToHex(entriesCount, 2) + + // total number of entries in the central directory + decToHex(entriesCount, 2) + + // size of the central directory 4 bytes + decToHex(centralDirLength, 4) + + // offset of start of central directory with respect to the starting disk number + decToHex(localDirLength, 4) + + // .ZIP file comment length + decToHex(encodedComment.length, 2) + + // .ZIP file comment + encodedComment; + + return dirEnd; +}; + +/** + * Generate data descriptors for a file entry. + * @param {Object} streamInfo the hash generated by a worker, containing informations + * on the file entry. + * @return {String} the data descriptors. + */ +var generateDataDescriptors = function (streamInfo) { + var descriptor = ""; + descriptor = signature.DATA_DESCRIPTOR + + // crc-32 4 bytes + decToHex(streamInfo['crc32'], 4) + + // compressed size 4 bytes + decToHex(streamInfo['compressedSize'], 4) + + // uncompressed size 4 bytes + decToHex(streamInfo['uncompressedSize'], 4); + + return descriptor; +}; + + +/** + * A worker to concatenate other workers to create a zip file. + * @param {Boolean} streamFiles `true` to stream the content of the files, + * `false` to accumulate it. + * @param {String} comment the comment to use. + * @param {String} platform the platform to use, "UNIX" or "DOS". + * @param {Function} encodeFileName the function to encode file names and comments. + */ +function ZipFileWorker(streamFiles, comment, platform, encodeFileName) { + GenericWorker.call(this, "ZipFileWorker"); + // The number of bytes written so far. This doesn't count accumulated chunks. + this.bytesWritten = 0; + // The comment of the zip file + this.zipComment = comment; + // The platform "generating" the zip file. + this.zipPlatform = platform; + // the function to encode file names and comments. + this.encodeFileName = encodeFileName; + // Should we stream the content of the files ? + this.streamFiles = streamFiles; + // If `streamFiles` is false, we will need to accumulate the content of the + // files to calculate sizes / crc32 (and write them *before* the content). + // This boolean indicates if we are accumulating chunks (it will change a lot + // during the lifetime of this worker). + this.accumulate = false; + // The buffer receiving chunks when accumulating content. + this.contentBuffer = []; + // The list of generated directory records. + this.dirRecords = []; + // The offset (in bytes) from the beginning of the zip file for the current source. + this.currentSourceOffset = 0; + // The total number of entries in this zip file. + this.entriesCount = 0; + // the name of the file currently being added, null when handling the end of the zip file. + // Used for the emited metadata. + this.currentFile = null; + + + + this._sources = []; +} +utils.inherits(ZipFileWorker, GenericWorker); + +/** + * @see GenericWorker.push + */ +ZipFileWorker.prototype.push = function (chunk) { + + var currentFilePercent = chunk.meta.percent || 0; + var entriesCount = this.entriesCount; + var remainingFiles = this._sources.length; + + if(this.accumulate) { + this.contentBuffer.push(chunk); + } else { + this.bytesWritten += chunk.data.length; + + GenericWorker.prototype.push.call(this, { + data : chunk.data, + meta : { + currentFile : this.currentFile, + percent : entriesCount ? (currentFilePercent + 100 * (entriesCount - remainingFiles - 1)) / entriesCount : 100 + } + }); + } +}; + +/** + * The worker started a new source (an other worker). + * @param {Object} streamInfo the streamInfo object from the new source. + */ +ZipFileWorker.prototype.openedSource = function (streamInfo) { + this.currentSourceOffset = this.bytesWritten; + this.currentFile = streamInfo['file'].name; + + var streamedContent = this.streamFiles && !streamInfo['file'].dir; + + // don't stream folders (because they don't have any content) + if(streamedContent) { + var record = generateZipParts(streamInfo, streamedContent, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); + this.push({ + data : record.fileRecord, + meta : {percent:0} + }); + } else { + // we need to wait for the whole file before pushing anything + this.accumulate = true; + } +}; + +/** + * The worker finished a source (an other worker). + * @param {Object} streamInfo the streamInfo object from the finished source. + */ +ZipFileWorker.prototype.closedSource = function (streamInfo) { + this.accumulate = false; + var streamedContent = this.streamFiles && !streamInfo['file'].dir; + var record = generateZipParts(streamInfo, streamedContent, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); + + this.dirRecords.push(record.dirRecord); + if(streamedContent) { + // after the streamed file, we put data descriptors + this.push({ + data : generateDataDescriptors(streamInfo), + meta : {percent:100} + }); + } else { + // the content wasn't streamed, we need to push everything now + // first the file record, then the content + this.push({ + data : record.fileRecord, + meta : {percent:0} + }); + while(this.contentBuffer.length) { + this.push(this.contentBuffer.shift()); + } + } + this.currentFile = null; +}; + +/** + * @see GenericWorker.flush + */ +ZipFileWorker.prototype.flush = function () { + + var localDirLength = this.bytesWritten; + for(var i = 0; i < this.dirRecords.length; i++) { + this.push({ + data : this.dirRecords[i], + meta : {percent:100} + }); + } + var centralDirLength = this.bytesWritten - localDirLength; + + var dirEnd = generateCentralDirectoryEnd(this.dirRecords.length, centralDirLength, localDirLength, this.zipComment, this.encodeFileName); + + this.push({ + data : dirEnd, + meta : {percent:100} + }); +}; + +/** + * Prepare the next source to be read. + */ +ZipFileWorker.prototype.prepareNextSource = function () { + this.previous = this._sources.shift(); + this.openedSource(this.previous.streamInfo); + if (this.isPaused) { + this.previous.pause(); + } else { + this.previous.resume(); + } +}; + +/** + * @see GenericWorker.registerPrevious + */ +ZipFileWorker.prototype.registerPrevious = function (previous) { + this._sources.push(previous); + var self = this; + + previous.on('data', function (chunk) { + self.processChunk(chunk); + }); + previous.on('end', function () { + self.closedSource(self.previous.streamInfo); + if(self._sources.length) { + self.prepareNextSource(); + } else { + self.end(); + } + }); + previous.on('error', function (e) { + self.error(e); + }); + return this; +}; + +/** + * @see GenericWorker.resume + */ +ZipFileWorker.prototype.resume = function () { + if(!GenericWorker.prototype.resume.call(this)) { + return false; + } + + if (!this.previous && this._sources.length) { + this.prepareNextSource(); + return true; + } + if (!this.previous && !this._sources.length && !this.generatedError) { + this.end(); + return true; + } +}; + +/** + * @see GenericWorker.error + */ +ZipFileWorker.prototype.error = function (e) { + var sources = this._sources; + if(!GenericWorker.prototype.error.call(this, e)) { + return false; + } + for(var i = 0; i < sources.length; i++) { + try { + sources[i].error(e); + } catch(e) { + // the `error` exploded, nothing to do + } + } + return true; +}; + +/** + * @see GenericWorker.lock + */ +ZipFileWorker.prototype.lock = function () { + GenericWorker.prototype.lock.call(this); + var sources = this._sources; + for(var i = 0; i < sources.length; i++) { + sources[i].lock(); + } +}; + +module.exports = ZipFileWorker; + +},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(require,module,exports){ +'use strict'; + +var compressions = require('../compressions'); +var ZipFileWorker = require('./ZipFileWorker'); + +/** + * Find the compression to use. + * @param {String} fileCompression the compression defined at the file level, if any. + * @param {String} zipCompression the compression defined at the load() level. + * @return {Object} the compression object to use. + */ +var getCompression = function (fileCompression, zipCompression) { + + var compressionName = fileCompression || zipCompression; + var compression = compressions[compressionName]; + if (!compression) { + throw new Error(compressionName + " is not a valid compression method !"); + } + return compression; +}; + +/** + * Create a worker to generate a zip file. + * @param {JSZip} zip the JSZip instance at the right root level. + * @param {Object} options to generate the zip file. + * @param {String} comment the comment to use. + */ +exports.generateWorker = function (zip, options, comment) { + + var zipFileWorker = new ZipFileWorker(options.streamFiles, comment, options.platform, options.encodeFileName); + var entriesCount = 0; + try { + + zip.forEach(function (relativePath, file) { + entriesCount++; + var compression = getCompression(file.options.compression, options.compression); + var compressionOptions = file.options.compressionOptions || options.compressionOptions || {}; + var dir = file.dir, date = file.date; + + file._compressWorker(compression, compressionOptions) + .withStreamInfo("file", { + name : relativePath, + dir : dir, + date : date, + comment : file.comment || "", + unixPermissions : file.unixPermissions, + dosPermissions : file.dosPermissions + }) + .pipe(zipFileWorker); + }); + zipFileWorker.entriesCount = entriesCount; + } catch (e) { + zipFileWorker.error(e); + } + + return zipFileWorker; +}; + +},{"../compressions":3,"./ZipFileWorker":8}],10:[function(require,module,exports){ +'use strict'; + +/** + * Representation a of zip file in js + * @constructor + */ +function JSZip() { + // if this constructor is used without `new`, it adds `new` before itself: + if(!(this instanceof JSZip)) { + return new JSZip(); + } + + if(arguments.length) { + throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide."); + } + + // object containing the files : + // { + // "folder/" : {...}, + // "folder/data.txt" : {...} + // } + this.files = {}; + + this.comment = null; + + // Where we are in the hierarchy + this.root = ""; + this.clone = function() { + var newObj = new JSZip(); + for (var i in this) { + if (typeof this[i] !== "function") { + newObj[i] = this[i]; + } + } + return newObj; + }; +} +JSZip.prototype = require('./object'); +JSZip.prototype.loadAsync = require('./load'); +JSZip.support = require('./support'); +JSZip.defaults = require('./defaults'); + +// TODO find a better way to handle this version, +// a require('package.json').version doesn't work with webpack, see #327 +JSZip.version = "3.1.5"; + +JSZip.loadAsync = function (content, options) { + return new JSZip().loadAsync(content, options); +}; + +JSZip.external = require("./external"); +module.exports = JSZip; + +},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(require,module,exports){ +'use strict'; +var utils = require('./utils'); +var external = require("./external"); +var utf8 = require('./utf8'); +var utils = require('./utils'); +var ZipEntries = require('./zipEntries'); +var Crc32Probe = require('./stream/Crc32Probe'); +var nodejsUtils = require("./nodejsUtils"); + +/** + * Check the CRC32 of an entry. + * @param {ZipEntry} zipEntry the zip entry to check. + * @return {Promise} the result. + */ +function checkEntryCRC32(zipEntry) { + return new external.Promise(function (resolve, reject) { + var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe()); + worker.on("error", function (e) { + reject(e); + }) + .on("end", function () { + if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) { + reject(new Error("Corrupted zip : CRC32 mismatch")); + } else { + resolve(); + } + }) + .resume(); + }); +} + +module.exports = function(data, options) { + var zip = this; + options = utils.extend(options || {}, { + base64: false, + checkCRC32: false, + optimizedBinaryString: false, + createFolders: false, + decodeFileName: utf8.utf8decode + }); + + if (nodejsUtils.isNode && nodejsUtils.isStream(data)) { + return external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")); + } + + return utils.prepareContent("the loaded zip file", data, true, options.optimizedBinaryString, options.base64) + .then(function(data) { + var zipEntries = new ZipEntries(options); + zipEntries.load(data); + return zipEntries; + }).then(function checkCRC32(zipEntries) { + var promises = [external.Promise.resolve(zipEntries)]; + var files = zipEntries.files; + if (options.checkCRC32) { + for (var i = 0; i < files.length; i++) { + promises.push(checkEntryCRC32(files[i])); + } + } + return external.Promise.all(promises); + }).then(function addFiles(results) { + var zipEntries = results.shift(); + var files = zipEntries.files; + for (var i = 0; i < files.length; i++) { + var input = files[i]; + zip.file(input.fileNameStr, input.decompressed, { + binary: true, + optimizedBinaryString: true, + date: input.date, + dir: input.dir, + comment : input.fileCommentStr.length ? input.fileCommentStr : null, + unixPermissions : input.unixPermissions, + dosPermissions : input.dosPermissions, + createFolders: options.createFolders + }); + } + if (zipEntries.zipComment.length) { + zip.comment = zipEntries.zipComment; + } + + return zip; + }); +}; + +},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(require,module,exports){ +"use strict"; + +var utils = require('../utils'); +var GenericWorker = require('../stream/GenericWorker'); + +/** + * A worker that use a nodejs stream as source. + * @constructor + * @param {String} filename the name of the file entry for this stream. + * @param {Readable} stream the nodejs stream. + */ +function NodejsStreamInputAdapter(filename, stream) { + GenericWorker.call(this, "Nodejs stream input adapter for " + filename); + this._upstreamEnded = false; + this._bindStream(stream); +} + +utils.inherits(NodejsStreamInputAdapter, GenericWorker); + +/** + * Prepare the stream and bind the callbacks on it. + * Do this ASAP on node 0.10 ! A lazy binding doesn't always work. + * @param {Stream} stream the nodejs stream to use. + */ +NodejsStreamInputAdapter.prototype._bindStream = function (stream) { + var self = this; + this._stream = stream; + stream.pause(); + stream + .on("data", function (chunk) { + self.push({ + data: chunk, + meta : { + percent : 0 + } + }); + }) + .on("error", function (e) { + if(self.isPaused) { + this.generatedError = e; + } else { + self.error(e); + } + }) + .on("end", function () { + if(self.isPaused) { + self._upstreamEnded = true; + } else { + self.end(); + } + }); +}; +NodejsStreamInputAdapter.prototype.pause = function () { + if(!GenericWorker.prototype.pause.call(this)) { + return false; + } + this._stream.pause(); + return true; +}; +NodejsStreamInputAdapter.prototype.resume = function () { + if(!GenericWorker.prototype.resume.call(this)) { + return false; + } + + if(this._upstreamEnded) { + this.end(); + } else { + this._stream.resume(); + } + + return true; +}; + +module.exports = NodejsStreamInputAdapter; + +},{"../stream/GenericWorker":28,"../utils":32}],13:[function(require,module,exports){ +'use strict'; + +var Readable = require('readable-stream').Readable; + +var utils = require('../utils'); +utils.inherits(NodejsStreamOutputAdapter, Readable); + +/** +* A nodejs stream using a worker as source. +* @see the SourceWrapper in http://nodejs.org/api/stream.html +* @constructor +* @param {StreamHelper} helper the helper wrapping the worker +* @param {Object} options the nodejs stream options +* @param {Function} updateCb the update callback. +*/ +function NodejsStreamOutputAdapter(helper, options, updateCb) { + Readable.call(this, options); + this._helper = helper; + + var self = this; + helper.on("data", function (data, meta) { + if (!self.push(data)) { + self._helper.pause(); + } + if(updateCb) { + updateCb(meta); + } + }) + .on("error", function(e) { + self.emit('error', e); + }) + .on("end", function () { + self.push(null); + }); +} + + +NodejsStreamOutputAdapter.prototype._read = function() { + this._helper.resume(); +}; + +module.exports = NodejsStreamOutputAdapter; + +},{"../utils":32,"readable-stream":16}],14:[function(require,module,exports){ +'use strict'; + +module.exports = { + /** + * True if this is running in Nodejs, will be undefined in a browser. + * In a browser, browserify won't include this file and the whole module + * will be resolved an empty object. + */ + isNode : typeof Buffer !== "undefined", + /** + * Create a new nodejs Buffer from an existing content. + * @param {Object} data the data to pass to the constructor. + * @param {String} encoding the encoding to use. + * @return {Buffer} a new Buffer. + */ + newBufferFrom: function(data, encoding) { + // XXX We can't use `Buffer.from` which comes from `Uint8Array.from` + // in nodejs v4 (< v.4.5). It's not the expected implementation (and + // has a different signature). + // see https://github.com/nodejs/node/issues/8053 + // A condition on nodejs' version won't solve the issue as we don't + // control the Buffer polyfills that may or may not be used. + return new Buffer(data, encoding); + }, + /** + * Create a new nodejs Buffer with the specified size. + * @param {Integer} size the size of the buffer. + * @return {Buffer} a new Buffer. + */ + allocBuffer: function (size) { + if (Buffer.alloc) { + return Buffer.alloc(size); + } else { + return new Buffer(size); + } + }, + /** + * Find out if an object is a Buffer. + * @param {Object} b the object to test. + * @return {Boolean} true if the object is a Buffer, false otherwise. + */ + isBuffer : function(b){ + return Buffer.isBuffer(b); + }, + + isStream : function (obj) { + return obj && + typeof obj.on === "function" && + typeof obj.pause === "function" && + typeof obj.resume === "function"; + } +}; + +},{}],15:[function(require,module,exports){ +'use strict'; +var utf8 = require('./utf8'); +var utils = require('./utils'); +var GenericWorker = require('./stream/GenericWorker'); +var StreamHelper = require('./stream/StreamHelper'); +var defaults = require('./defaults'); +var CompressedObject = require('./compressedObject'); +var ZipObject = require('./zipObject'); +var generate = require("./generate"); +var nodejsUtils = require("./nodejsUtils"); +var NodejsStreamInputAdapter = require("./nodejs/NodejsStreamInputAdapter"); + + +/** + * Add a file in the current folder. + * @private + * @param {string} name the name of the file + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file + * @param {Object} originalOptions the options of the file + * @return {Object} the new file. + */ +var fileAdd = function(name, data, originalOptions) { + // be sure sub folders exist + var dataType = utils.getTypeOf(data), + parent; + + + /* + * Correct options. + */ + + var o = utils.extend(originalOptions || {}, defaults); + o.date = o.date || new Date(); + if (o.compression !== null) { + o.compression = o.compression.toUpperCase(); + } + + if (typeof o.unixPermissions === "string") { + o.unixPermissions = parseInt(o.unixPermissions, 8); + } + + // UNX_IFDIR 0040000 see zipinfo.c + if (o.unixPermissions && (o.unixPermissions & 0x4000)) { + o.dir = true; + } + // Bit 4 Directory + if (o.dosPermissions && (o.dosPermissions & 0x0010)) { + o.dir = true; + } + + if (o.dir) { + name = forceTrailingSlash(name); + } + if (o.createFolders && (parent = parentFolder(name))) { + folderAdd.call(this, parent, true); + } + + var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false; + if (!originalOptions || typeof originalOptions.binary === "undefined") { + o.binary = !isUnicodeString; + } + + + var isCompressedEmpty = (data instanceof CompressedObject) && data.uncompressedSize === 0; + + if (isCompressedEmpty || o.dir || !data || data.length === 0) { + o.base64 = false; + o.binary = true; + data = ""; + o.compression = "STORE"; + dataType = "string"; + } + + /* + * Convert content to fit. + */ + + var zipObjectContent = null; + if (data instanceof CompressedObject || data instanceof GenericWorker) { + zipObjectContent = data; + } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) { + zipObjectContent = new NodejsStreamInputAdapter(name, data); + } else { + zipObjectContent = utils.prepareContent(name, data, o.binary, o.optimizedBinaryString, o.base64); + } + + var object = new ZipObject(name, zipObjectContent, o); + this.files[name] = object; + /* + TODO: we can't throw an exception because we have async promises + (we can have a promise of a Date() for example) but returning a + promise is useless because file(name, data) returns the JSZip + object for chaining. Should we break that to allow the user + to catch the error ? + + return external.Promise.resolve(zipObjectContent) + .then(function () { + return object; + }); + */ +}; + +/** + * Find the parent folder of the path. + * @private + * @param {string} path the path to use + * @return {string} the parent folder, or "" + */ +var parentFolder = function (path) { + if (path.slice(-1) === '/') { + path = path.substring(0, path.length - 1); + } + var lastSlash = path.lastIndexOf('/'); + return (lastSlash > 0) ? path.substring(0, lastSlash) : ""; +}; + +/** + * Returns the path with a slash at the end. + * @private + * @param {String} path the path to check. + * @return {String} the path with a trailing slash. + */ +var forceTrailingSlash = function(path) { + // Check the name ends with a / + if (path.slice(-1) !== "/") { + path += "/"; // IE doesn't like substr(-1) + } + return path; +}; + +/** + * Add a (sub) folder in the current folder. + * @private + * @param {string} name the folder's name + * @param {boolean=} [createFolders] If true, automatically create sub + * folders. Defaults to false. + * @return {Object} the new folder. + */ +var folderAdd = function(name, createFolders) { + createFolders = (typeof createFolders !== 'undefined') ? createFolders : defaults.createFolders; + + name = forceTrailingSlash(name); + + // Does this folder already exist? + if (!this.files[name]) { + fileAdd.call(this, name, null, { + dir: true, + createFolders: createFolders + }); + } + return this.files[name]; +}; + +/** +* Cross-window, cross-Node-context regular expression detection +* @param {Object} object Anything +* @return {Boolean} true if the object is a regular expression, +* false otherwise +*/ +function isRegExp(object) { + return Object.prototype.toString.call(object) === "[object RegExp]"; +} + +// return the actual prototype of JSZip +var out = { + /** + * @see loadAsync + */ + load: function() { + throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); + }, + + + /** + * Call a callback function for each entry at this folder level. + * @param {Function} cb the callback function: + * function (relativePath, file) {...} + * It takes 2 arguments : the relative path and the file. + */ + forEach: function(cb) { + var filename, relativePath, file; + for (filename in this.files) { + if (!this.files.hasOwnProperty(filename)) { + continue; + } + file = this.files[filename]; + relativePath = filename.slice(this.root.length, filename.length); + if (relativePath && filename.slice(0, this.root.length) === this.root) { // the file is in the current root + cb(relativePath, file); // TODO reverse the parameters ? need to be clean AND consistent with the filter search fn... + } + } + }, + + /** + * Filter nested files/folders with the specified function. + * @param {Function} search the predicate to use : + * function (relativePath, file) {...} + * It takes 2 arguments : the relative path and the file. + * @return {Array} An array of matching elements. + */ + filter: function(search) { + var result = []; + this.forEach(function (relativePath, entry) { + if (search(relativePath, entry)) { // the file matches the function + result.push(entry); + } + + }); + return result; + }, + + /** + * Add a file to the zip file, or search a file. + * @param {string|RegExp} name The name of the file to add (if data is defined), + * the name of the file to find (if no data) or a regex to match files. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded + * @param {Object} o File options + * @return {JSZip|Object|Array} this JSZip object (when adding a file), + * a file (when searching by string) or an array of files (when searching by regex). + */ + file: function(name, data, o) { + if (arguments.length === 1) { + if (isRegExp(name)) { + var regexp = name; + return this.filter(function(relativePath, file) { + return !file.dir && regexp.test(relativePath); + }); + } + else { // text + var obj = this.files[this.root + name]; + if (obj && !obj.dir) { + return obj; + } else { + return null; + } + } + } + else { // more than one argument : we have data ! + name = this.root + name; + fileAdd.call(this, name, data, o); + } + return this; + }, + + /** + * Add a directory to the zip file, or search. + * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders. + * @return {JSZip} an object with the new directory as the root, or an array containing matching folders. + */ + folder: function(arg) { + if (!arg) { + return this; + } + + if (isRegExp(arg)) { + return this.filter(function(relativePath, file) { + return file.dir && arg.test(relativePath); + }); + } + + // else, name is a new folder + var name = this.root + arg; + var newFolder = folderAdd.call(this, name); + + // Allow chaining by returning a new object with this folder as the root + var ret = this.clone(); + ret.root = newFolder.name; + return ret; + }, + + /** + * Delete a file, or a directory and all sub-files, from the zip + * @param {string} name the name of the file to delete + * @return {JSZip} this JSZip object + */ + remove: function(name) { + name = this.root + name; + var file = this.files[name]; + if (!file) { + // Look for any folders + if (name.slice(-1) !== "/") { + name += "/"; + } + file = this.files[name]; + } + + if (file && !file.dir) { + // file + delete this.files[name]; + } else { + // maybe a folder, delete recursively + var kids = this.filter(function(relativePath, file) { + return file.name.slice(0, name.length) === name; + }); + for (var i = 0; i < kids.length; i++) { + delete this.files[kids[i].name]; + } + } + + return this; + }, + + /** + * Generate the complete zip file + * @param {Object} options the options to generate the zip file : + * - compression, "STORE" by default. + * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob. + * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file + */ + generate: function(options) { + throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); + }, + + /** + * Generate the complete zip file as an internal stream. + * @param {Object} options the options to generate the zip file : + * - compression, "STORE" by default. + * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob. + * @return {StreamHelper} the streamed zip file. + */ + generateInternalStream: function(options) { + var worker, opts = {}; + try { + opts = utils.extend(options || {}, { + streamFiles: false, + compression: "STORE", + compressionOptions : null, + type: "", + platform: "DOS", + comment: null, + mimeType: 'application/zip', + encodeFileName: utf8.utf8encode + }); + + opts.type = opts.type.toLowerCase(); + opts.compression = opts.compression.toUpperCase(); + + // "binarystring" is prefered but the internals use "string". + if(opts.type === "binarystring") { + opts.type = "string"; + } + + if (!opts.type) { + throw new Error("No output type specified."); + } + + utils.checkSupport(opts.type); + + // accept nodejs `process.platform` + if( + opts.platform === 'darwin' || + opts.platform === 'freebsd' || + opts.platform === 'linux' || + opts.platform === 'sunos' + ) { + opts.platform = "UNIX"; + } + if (opts.platform === 'win32') { + opts.platform = "DOS"; + } + + var comment = opts.comment || this.comment || ""; + worker = generate.generateWorker(this, opts, comment); + } catch (e) { + worker = new GenericWorker("error"); + worker.error(e); + } + return new StreamHelper(worker, opts.type || "string", opts.mimeType); + }, + /** + * Generate the complete zip file asynchronously. + * @see generateInternalStream + */ + generateAsync: function(options, onUpdate) { + return this.generateInternalStream(options).accumulate(onUpdate); + }, + /** + * Generate the complete zip file asynchronously. + * @see generateInternalStream + */ + generateNodeStream: function(options, onUpdate) { + options = options || {}; + if (!options.type) { + options.type = "nodebuffer"; + } + return this.generateInternalStream(options).toNodejsStream(onUpdate); + } +}; +module.exports = out; + +},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(require,module,exports){ +/* + * This file is used by module bundlers (browserify/webpack/etc) when + * including a stream implementation. We use "readable-stream" to get a + * consistent behavior between nodejs versions but bundlers often have a shim + * for "stream". Using this shim greatly improve the compatibility and greatly + * reduce the final size of the bundle (only one stream implementation, not + * two). + */ +module.exports = require("stream"); + +},{"stream":undefined}],17:[function(require,module,exports){ +'use strict'; +var DataReader = require('./DataReader'); +var utils = require('../utils'); + +function ArrayReader(data) { + DataReader.call(this, data); + for(var i = 0; i < this.data.length; i++) { + data[i] = data[i] & 0xFF; + } +} +utils.inherits(ArrayReader, DataReader); +/** + * @see DataReader.byteAt + */ +ArrayReader.prototype.byteAt = function(i) { + return this.data[this.zero + i]; +}; +/** + * @see DataReader.lastIndexOfSignature + */ +ArrayReader.prototype.lastIndexOfSignature = function(sig) { + var sig0 = sig.charCodeAt(0), + sig1 = sig.charCodeAt(1), + sig2 = sig.charCodeAt(2), + sig3 = sig.charCodeAt(3); + for (var i = this.length - 4; i >= 0; --i) { + if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) { + return i - this.zero; + } + } + + return -1; +}; +/** + * @see DataReader.readAndCheckSignature + */ +ArrayReader.prototype.readAndCheckSignature = function (sig) { + var sig0 = sig.charCodeAt(0), + sig1 = sig.charCodeAt(1), + sig2 = sig.charCodeAt(2), + sig3 = sig.charCodeAt(3), + data = this.readData(4); + return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3]; +}; +/** + * @see DataReader.readData + */ +ArrayReader.prototype.readData = function(size) { + this.checkOffset(size); + if(size === 0) { + return []; + } + var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = ArrayReader; + +},{"../utils":32,"./DataReader":18}],18:[function(require,module,exports){ +'use strict'; +var utils = require('../utils'); + +function DataReader(data) { + this.data = data; // type : see implementation + this.length = data.length; + this.index = 0; + this.zero = 0; +} +DataReader.prototype = { + /** + * Check that the offset will not go too far. + * @param {string} offset the additional offset to check. + * @throws {Error} an Error if the offset is out of bounds. + */ + checkOffset: function(offset) { + this.checkIndex(this.index + offset); + }, + /** + * Check that the specified index will not be too far. + * @param {string} newIndex the index to check. + * @throws {Error} an Error if the index is out of bounds. + */ + checkIndex: function(newIndex) { + if (this.length < this.zero + newIndex || newIndex < 0) { + throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?"); + } + }, + /** + * Change the index. + * @param {number} newIndex The new index. + * @throws {Error} if the new index is out of the data. + */ + setIndex: function(newIndex) { + this.checkIndex(newIndex); + this.index = newIndex; + }, + /** + * Skip the next n bytes. + * @param {number} n the number of bytes to skip. + * @throws {Error} if the new index is out of the data. + */ + skip: function(n) { + this.setIndex(this.index + n); + }, + /** + * Get the byte at the specified index. + * @param {number} i the index to use. + * @return {number} a byte. + */ + byteAt: function(i) { + // see implementations + }, + /** + * Get the next number with a given byte size. + * @param {number} size the number of bytes to read. + * @return {number} the corresponding number. + */ + readInt: function(size) { + var result = 0, + i; + this.checkOffset(size); + for (i = this.index + size - 1; i >= this.index; i--) { + result = (result << 8) + this.byteAt(i); + } + this.index += size; + return result; + }, + /** + * Get the next string with a given byte size. + * @param {number} size the number of bytes to read. + * @return {string} the corresponding string. + */ + readString: function(size) { + return utils.transformTo("string", this.readData(size)); + }, + /** + * Get raw data without conversion, bytes. + * @param {number} size the number of bytes to read. + * @return {Object} the raw data, implementation specific. + */ + readData: function(size) { + // see implementations + }, + /** + * Find the last occurence of a zip signature (4 bytes). + * @param {string} sig the signature to find. + * @return {number} the index of the last occurence, -1 if not found. + */ + lastIndexOfSignature: function(sig) { + // see implementations + }, + /** + * Read the signature (4 bytes) at the current position and compare it with sig. + * @param {string} sig the expected signature + * @return {boolean} true if the signature matches, false otherwise. + */ + readAndCheckSignature: function(sig) { + // see implementations + }, + /** + * Get the next date. + * @return {Date} the date. + */ + readDate: function() { + var dostime = this.readInt(4); + return new Date(Date.UTC( + ((dostime >> 25) & 0x7f) + 1980, // year + ((dostime >> 21) & 0x0f) - 1, // month + (dostime >> 16) & 0x1f, // day + (dostime >> 11) & 0x1f, // hour + (dostime >> 5) & 0x3f, // minute + (dostime & 0x1f) << 1)); // second + } +}; +module.exports = DataReader; + +},{"../utils":32}],19:[function(require,module,exports){ +'use strict'; +var Uint8ArrayReader = require('./Uint8ArrayReader'); +var utils = require('../utils'); + +function NodeBufferReader(data) { + Uint8ArrayReader.call(this, data); +} +utils.inherits(NodeBufferReader, Uint8ArrayReader); + +/** + * @see DataReader.readData + */ +NodeBufferReader.prototype.readData = function(size) { + this.checkOffset(size); + var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = NodeBufferReader; + +},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(require,module,exports){ +'use strict'; +var DataReader = require('./DataReader'); +var utils = require('../utils'); + +function StringReader(data) { + DataReader.call(this, data); +} +utils.inherits(StringReader, DataReader); +/** + * @see DataReader.byteAt + */ +StringReader.prototype.byteAt = function(i) { + return this.data.charCodeAt(this.zero + i); +}; +/** + * @see DataReader.lastIndexOfSignature + */ +StringReader.prototype.lastIndexOfSignature = function(sig) { + return this.data.lastIndexOf(sig) - this.zero; +}; +/** + * @see DataReader.readAndCheckSignature + */ +StringReader.prototype.readAndCheckSignature = function (sig) { + var data = this.readData(4); + return sig === data; +}; +/** + * @see DataReader.readData + */ +StringReader.prototype.readData = function(size) { + this.checkOffset(size); + // this will work because the constructor applied the "& 0xff" mask. + var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = StringReader; + +},{"../utils":32,"./DataReader":18}],21:[function(require,module,exports){ +'use strict'; +var ArrayReader = require('./ArrayReader'); +var utils = require('../utils'); + +function Uint8ArrayReader(data) { + ArrayReader.call(this, data); +} +utils.inherits(Uint8ArrayReader, ArrayReader); +/** + * @see DataReader.readData + */ +Uint8ArrayReader.prototype.readData = function(size) { + this.checkOffset(size); + if(size === 0) { + // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of []. + return new Uint8Array(0); + } + var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size); + this.index += size; + return result; +}; +module.exports = Uint8ArrayReader; + +},{"../utils":32,"./ArrayReader":17}],22:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var support = require('../support'); +var ArrayReader = require('./ArrayReader'); +var StringReader = require('./StringReader'); +var NodeBufferReader = require('./NodeBufferReader'); +var Uint8ArrayReader = require('./Uint8ArrayReader'); + +/** + * Create a reader adapted to the data. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data to read. + * @return {DataReader} the data reader. + */ +module.exports = function (data) { + var type = utils.getTypeOf(data); + utils.checkSupport(type); + if (type === "string" && !support.uint8array) { + return new StringReader(data); + } + if (type === "nodebuffer") { + return new NodeBufferReader(data); + } + if (support.uint8array) { + return new Uint8ArrayReader(utils.transformTo("uint8array", data)); + } + return new ArrayReader(utils.transformTo("array", data)); +}; + +},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(require,module,exports){ +'use strict'; +exports.LOCAL_FILE_HEADER = "PK\x03\x04"; +exports.CENTRAL_FILE_HEADER = "PK\x01\x02"; +exports.CENTRAL_DIRECTORY_END = "PK\x05\x06"; +exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07"; +exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06"; +exports.DATA_DESCRIPTOR = "PK\x07\x08"; + +},{}],24:[function(require,module,exports){ +'use strict'; + +var GenericWorker = require('./GenericWorker'); +var utils = require('../utils'); + +/** + * A worker which convert chunks to a specified type. + * @constructor + * @param {String} destType the destination type. + */ +function ConvertWorker(destType) { + GenericWorker.call(this, "ConvertWorker to " + destType); + this.destType = destType; +} +utils.inherits(ConvertWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +ConvertWorker.prototype.processChunk = function (chunk) { + this.push({ + data : utils.transformTo(this.destType, chunk.data), + meta : chunk.meta + }); +}; +module.exports = ConvertWorker; + +},{"../utils":32,"./GenericWorker":28}],25:[function(require,module,exports){ +'use strict'; + +var GenericWorker = require('./GenericWorker'); +var crc32 = require('../crc32'); +var utils = require('../utils'); + +/** + * A worker which calculate the crc32 of the data flowing through. + * @constructor + */ +function Crc32Probe() { + GenericWorker.call(this, "Crc32Probe"); + this.withStreamInfo("crc32", 0); +} +utils.inherits(Crc32Probe, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +Crc32Probe.prototype.processChunk = function (chunk) { + this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0); + this.push(chunk); +}; +module.exports = Crc32Probe; + +},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var GenericWorker = require('./GenericWorker'); + +/** + * A worker which calculate the total length of the data flowing through. + * @constructor + * @param {String} propName the name used to expose the length + */ +function DataLengthProbe(propName) { + GenericWorker.call(this, "DataLengthProbe for " + propName); + this.propName = propName; + this.withStreamInfo(propName, 0); +} +utils.inherits(DataLengthProbe, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +DataLengthProbe.prototype.processChunk = function (chunk) { + if(chunk) { + var length = this.streamInfo[this.propName] || 0; + this.streamInfo[this.propName] = length + chunk.data.length; + } + GenericWorker.prototype.processChunk.call(this, chunk); +}; +module.exports = DataLengthProbe; + + +},{"../utils":32,"./GenericWorker":28}],27:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var GenericWorker = require('./GenericWorker'); + +// the size of the generated chunks +// TODO expose this as a public variable +var DEFAULT_BLOCK_SIZE = 16 * 1024; + +/** + * A worker that reads a content and emits chunks. + * @constructor + * @param {Promise} dataP the promise of the data to split + */ +function DataWorker(dataP) { + GenericWorker.call(this, "DataWorker"); + var self = this; + this.dataIsReady = false; + this.index = 0; + this.max = 0; + this.data = null; + this.type = ""; + + this._tickScheduled = false; + + dataP.then(function (data) { + self.dataIsReady = true; + self.data = data; + self.max = data && data.length || 0; + self.type = utils.getTypeOf(data); + if(!self.isPaused) { + self._tickAndRepeat(); + } + }, function (e) { + self.error(e); + }); +} + +utils.inherits(DataWorker, GenericWorker); + +/** + * @see GenericWorker.cleanUp + */ +DataWorker.prototype.cleanUp = function () { + GenericWorker.prototype.cleanUp.call(this); + this.data = null; +}; + +/** + * @see GenericWorker.resume + */ +DataWorker.prototype.resume = function () { + if(!GenericWorker.prototype.resume.call(this)) { + return false; + } + + if (!this._tickScheduled && this.dataIsReady) { + this._tickScheduled = true; + utils.delay(this._tickAndRepeat, [], this); + } + return true; +}; + +/** + * Trigger a tick a schedule an other call to this function. + */ +DataWorker.prototype._tickAndRepeat = function() { + this._tickScheduled = false; + if(this.isPaused || this.isFinished) { + return; + } + this._tick(); + if(!this.isFinished) { + utils.delay(this._tickAndRepeat, [], this); + this._tickScheduled = true; + } +}; + +/** + * Read and push a chunk. + */ +DataWorker.prototype._tick = function() { + + if(this.isPaused || this.isFinished) { + return false; + } + + var size = DEFAULT_BLOCK_SIZE; + var data = null, nextIndex = Math.min(this.max, this.index + size); + if (this.index >= this.max) { + // EOF + return this.end(); + } else { + switch(this.type) { + case "string": + data = this.data.substring(this.index, nextIndex); + break; + case "uint8array": + data = this.data.subarray(this.index, nextIndex); + break; + case "array": + case "nodebuffer": + data = this.data.slice(this.index, nextIndex); + break; + } + this.index = nextIndex; + return this.push({ + data : data, + meta : { + percent : this.max ? this.index / this.max * 100 : 0 + } + }); + } +}; + +module.exports = DataWorker; + +},{"../utils":32,"./GenericWorker":28}],28:[function(require,module,exports){ +'use strict'; + +/** + * A worker that does nothing but passing chunks to the next one. This is like + * a nodejs stream but with some differences. On the good side : + * - it works on IE 6-9 without any issue / polyfill + * - it weights less than the full dependencies bundled with browserify + * - it forwards errors (no need to declare an error handler EVERYWHERE) + * + * A chunk is an object with 2 attributes : `meta` and `data`. The former is an + * object containing anything (`percent` for example), see each worker for more + * details. The latter is the real data (String, Uint8Array, etc). + * + * @constructor + * @param {String} name the name of the stream (mainly used for debugging purposes) + */ +function GenericWorker(name) { + // the name of the worker + this.name = name || "default"; + // an object containing metadata about the workers chain + this.streamInfo = {}; + // an error which happened when the worker was paused + this.generatedError = null; + // an object containing metadata to be merged by this worker into the general metadata + this.extraStreamInfo = {}; + // true if the stream is paused (and should not do anything), false otherwise + this.isPaused = true; + // true if the stream is finished (and should not do anything), false otherwise + this.isFinished = false; + // true if the stream is locked to prevent further structure updates (pipe), false otherwise + this.isLocked = false; + // the event listeners + this._listeners = { + 'data':[], + 'end':[], + 'error':[] + }; + // the previous worker, if any + this.previous = null; +} + +GenericWorker.prototype = { + /** + * Push a chunk to the next workers. + * @param {Object} chunk the chunk to push + */ + push : function (chunk) { + this.emit("data", chunk); + }, + /** + * End the stream. + * @return {Boolean} true if this call ended the worker, false otherwise. + */ + end : function () { + if (this.isFinished) { + return false; + } + + this.flush(); + try { + this.emit("end"); + this.cleanUp(); + this.isFinished = true; + } catch (e) { + this.emit("error", e); + } + return true; + }, + /** + * End the stream with an error. + * @param {Error} e the error which caused the premature end. + * @return {Boolean} true if this call ended the worker with an error, false otherwise. + */ + error : function (e) { + if (this.isFinished) { + return false; + } + + if(this.isPaused) { + this.generatedError = e; + } else { + this.isFinished = true; + + this.emit("error", e); + + // in the workers chain exploded in the middle of the chain, + // the error event will go downward but we also need to notify + // workers upward that there has been an error. + if(this.previous) { + this.previous.error(e); + } + + this.cleanUp(); + } + return true; + }, + /** + * Add a callback on an event. + * @param {String} name the name of the event (data, end, error) + * @param {Function} listener the function to call when the event is triggered + * @return {GenericWorker} the current object for chainability + */ + on : function (name, listener) { + this._listeners[name].push(listener); + return this; + }, + /** + * Clean any references when a worker is ending. + */ + cleanUp : function () { + this.streamInfo = this.generatedError = this.extraStreamInfo = null; + this._listeners = []; + }, + /** + * Trigger an event. This will call registered callback with the provided arg. + * @param {String} name the name of the event (data, end, error) + * @param {Object} arg the argument to call the callback with. + */ + emit : function (name, arg) { + if (this._listeners[name]) { + for(var i = 0; i < this._listeners[name].length; i++) { + this._listeners[name][i].call(this, arg); + } + } + }, + /** + * Chain a worker with an other. + * @param {Worker} next the worker receiving events from the current one. + * @return {worker} the next worker for chainability + */ + pipe : function (next) { + return next.registerPrevious(this); + }, + /** + * Same as `pipe` in the other direction. + * Using an API with `pipe(next)` is very easy. + * Implementing the API with the point of view of the next one registering + * a source is easier, see the ZipFileWorker. + * @param {Worker} previous the previous worker, sending events to this one + * @return {Worker} the current worker for chainability + */ + registerPrevious : function (previous) { + if (this.isLocked) { + throw new Error("The stream '" + this + "' has already been used."); + } + + // sharing the streamInfo... + this.streamInfo = previous.streamInfo; + // ... and adding our own bits + this.mergeStreamInfo(); + this.previous = previous; + var self = this; + previous.on('data', function (chunk) { + self.processChunk(chunk); + }); + previous.on('end', function () { + self.end(); + }); + previous.on('error', function (e) { + self.error(e); + }); + return this; + }, + /** + * Pause the stream so it doesn't send events anymore. + * @return {Boolean} true if this call paused the worker, false otherwise. + */ + pause : function () { + if(this.isPaused || this.isFinished) { + return false; + } + this.isPaused = true; + + if(this.previous) { + this.previous.pause(); + } + return true; + }, + /** + * Resume a paused stream. + * @return {Boolean} true if this call resumed the worker, false otherwise. + */ + resume : function () { + if(!this.isPaused || this.isFinished) { + return false; + } + this.isPaused = false; + + // if true, the worker tried to resume but failed + var withError = false; + if(this.generatedError) { + this.error(this.generatedError); + withError = true; + } + if(this.previous) { + this.previous.resume(); + } + + return !withError; + }, + /** + * Flush any remaining bytes as the stream is ending. + */ + flush : function () {}, + /** + * Process a chunk. This is usually the method overridden. + * @param {Object} chunk the chunk to process. + */ + processChunk : function(chunk) { + this.push(chunk); + }, + /** + * Add a key/value to be added in the workers chain streamInfo once activated. + * @param {String} key the key to use + * @param {Object} value the associated value + * @return {Worker} the current worker for chainability + */ + withStreamInfo : function (key, value) { + this.extraStreamInfo[key] = value; + this.mergeStreamInfo(); + return this; + }, + /** + * Merge this worker's streamInfo into the chain's streamInfo. + */ + mergeStreamInfo : function () { + for(var key in this.extraStreamInfo) { + if (!this.extraStreamInfo.hasOwnProperty(key)) { + continue; + } + this.streamInfo[key] = this.extraStreamInfo[key]; + } + }, + + /** + * Lock the stream to prevent further updates on the workers chain. + * After calling this method, all calls to pipe will fail. + */ + lock: function () { + if (this.isLocked) { + throw new Error("The stream '" + this + "' has already been used."); + } + this.isLocked = true; + if (this.previous) { + this.previous.lock(); + } + }, + + /** + * + * Pretty print the workers chain. + */ + toString : function () { + var me = "Worker " + this.name; + if (this.previous) { + return this.previous + " -> " + me; + } else { + return me; + } + } +}; + +module.exports = GenericWorker; + +},{}],29:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils'); +var ConvertWorker = require('./ConvertWorker'); +var GenericWorker = require('./GenericWorker'); +var base64 = require('../base64'); +var support = require("../support"); +var external = require("../external"); + +var NodejsStreamOutputAdapter = null; +if (support.nodestream) { + try { + NodejsStreamOutputAdapter = require('../nodejs/NodejsStreamOutputAdapter'); + } catch(e) {} +} + +/** + * Apply the final transformation of the data. If the user wants a Blob for + * example, it's easier to work with an U8intArray and finally do the + * ArrayBuffer/Blob conversion. + * @param {String} type the name of the final type + * @param {String|Uint8Array|Buffer} content the content to transform + * @param {String} mimeType the mime type of the content, if applicable. + * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format. + */ +function transformZipOutput(type, content, mimeType) { + switch(type) { + case "blob" : + return utils.newBlob(utils.transformTo("arraybuffer", content), mimeType); + case "base64" : + return base64.encode(content); + default : + return utils.transformTo(type, content); + } +} + +/** + * Concatenate an array of data of the given type. + * @param {String} type the type of the data in the given array. + * @param {Array} dataArray the array containing the data chunks to concatenate + * @return {String|Uint8Array|Buffer} the concatenated data + * @throws Error if the asked type is unsupported + */ +function concat (type, dataArray) { + var i, index = 0, res = null, totalLength = 0; + for(i = 0; i < dataArray.length; i++) { + totalLength += dataArray[i].length; + } + switch(type) { + case "string": + return dataArray.join(""); + case "array": + return Array.prototype.concat.apply([], dataArray); + case "uint8array": + res = new Uint8Array(totalLength); + for(i = 0; i < dataArray.length; i++) { + res.set(dataArray[i], index); + index += dataArray[i].length; + } + return res; + case "nodebuffer": + return Buffer.concat(dataArray); + default: + throw new Error("concat : unsupported type '" + type + "'"); + } +} + +/** + * Listen a StreamHelper, accumulate its content and concatenate it into a + * complete block. + * @param {StreamHelper} helper the helper to use. + * @param {Function} updateCallback a callback called on each update. Called + * with one arg : + * - the metadata linked to the update received. + * @return Promise the promise for the accumulation. + */ +function accumulate(helper, updateCallback) { + return new external.Promise(function (resolve, reject){ + var dataArray = []; + var chunkType = helper._internalType, + resultType = helper._outputType, + mimeType = helper._mimeType; + helper + .on('data', function (data, meta) { + dataArray.push(data); + if(updateCallback) { + updateCallback(meta); + } + }) + .on('error', function(err) { + dataArray = []; + reject(err); + }) + .on('end', function (){ + try { + var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType); + resolve(result); + } catch (e) { + reject(e); + } + dataArray = []; + }) + .resume(); + }); +} + +/** + * An helper to easily use workers outside of JSZip. + * @constructor + * @param {Worker} worker the worker to wrap + * @param {String} outputType the type of data expected by the use + * @param {String} mimeType the mime type of the content, if applicable. + */ +function StreamHelper(worker, outputType, mimeType) { + var internalType = outputType; + switch(outputType) { + case "blob": + case "arraybuffer": + internalType = "uint8array"; + break; + case "base64": + internalType = "string"; + break; + } + + try { + // the type used internally + this._internalType = internalType; + // the type used to output results + this._outputType = outputType; + // the mime type + this._mimeType = mimeType; + utils.checkSupport(internalType); + this._worker = worker.pipe(new ConvertWorker(internalType)); + // the last workers can be rewired without issues but we need to + // prevent any updates on previous workers. + worker.lock(); + } catch(e) { + this._worker = new GenericWorker("error"); + this._worker.error(e); + } +} + +StreamHelper.prototype = { + /** + * Listen a StreamHelper, accumulate its content and concatenate it into a + * complete block. + * @param {Function} updateCb the update callback. + * @return Promise the promise for the accumulation. + */ + accumulate : function (updateCb) { + return accumulate(this, updateCb); + }, + /** + * Add a listener on an event triggered on a stream. + * @param {String} evt the name of the event + * @param {Function} fn the listener + * @return {StreamHelper} the current helper. + */ + on : function (evt, fn) { + var self = this; + + if(evt === "data") { + this._worker.on(evt, function (chunk) { + fn.call(self, chunk.data, chunk.meta); + }); + } else { + this._worker.on(evt, function () { + utils.delay(fn, arguments, self); + }); + } + return this; + }, + /** + * Resume the flow of chunks. + * @return {StreamHelper} the current helper. + */ + resume : function () { + utils.delay(this._worker.resume, [], this._worker); + return this; + }, + /** + * Pause the flow of chunks. + * @return {StreamHelper} the current helper. + */ + pause : function () { + this._worker.pause(); + return this; + }, + /** + * Return a nodejs stream for this helper. + * @param {Function} updateCb the update callback. + * @return {NodejsStreamOutputAdapter} the nodejs stream. + */ + toNodejsStream : function (updateCb) { + utils.checkSupport("nodestream"); + if (this._outputType !== "nodebuffer") { + // an object stream containing blob/arraybuffer/uint8array/string + // is strange and I don't know if it would be useful. + // I you find this comment and have a good usecase, please open a + // bug report ! + throw new Error(this._outputType + " is not supported by this method"); + } + + return new NodejsStreamOutputAdapter(this, { + objectMode : this._outputType !== "nodebuffer" + }, updateCb); + } +}; + + +module.exports = StreamHelper; + +},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(require,module,exports){ +'use strict'; + +exports.base64 = true; +exports.array = true; +exports.string = true; +exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined"; +exports.nodebuffer = typeof Buffer !== "undefined"; +// contains true if JSZip can read/generate Uint8Array, false otherwise. +exports.uint8array = typeof Uint8Array !== "undefined"; + +if (typeof ArrayBuffer === "undefined") { + exports.blob = false; +} +else { + var buffer = new ArrayBuffer(0); + try { + exports.blob = new Blob([buffer], { + type: "application/zip" + }).size === 0; + } + catch (e) { + try { + var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder; + var builder = new Builder(); + builder.append(buffer); + exports.blob = builder.getBlob('application/zip').size === 0; + } + catch (e) { + exports.blob = false; + } + } +} + +try { + exports.nodestream = !!require('readable-stream').Readable; +} catch(e) { + exports.nodestream = false; +} + +},{"readable-stream":16}],31:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); +var support = require('./support'); +var nodejsUtils = require('./nodejsUtils'); +var GenericWorker = require('./stream/GenericWorker'); + +/** + * The following functions come from pako, from pako/lib/utils/strings + * released under the MIT license, see pako https://github.com/nodeca/pako/ + */ + +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new Array(256); +for (var i=0; i<256; i++) { + _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1); +} +_utf8len[254]=_utf8len[254]=1; // Invalid sequence start + +// convert string to array (typed, when possible) +var string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + if (support.uint8array) { + buf = new Uint8Array(buf_len); + } else { + buf = new Array(buf_len); + } + + // convert + for (i=0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +var utf8border = function(buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max-1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +// convert array to string +var buf2string = function (buf) { + var str, i, out, c, c_len; + var len = buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len*2); + + for (out=0, i=0; i 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + // shrinkBuf(utf16buf, out) + if (utf16buf.length !== out) { + if(utf16buf.subarray) { + utf16buf = utf16buf.subarray(0, out); + } else { + utf16buf.length = out; + } + } + + // return String.fromCharCode.apply(null, utf16buf); + return utils.applyFromCharCode(utf16buf); +}; + + +// That's all for the pako functions. + + +/** + * Transform a javascript string into an array (typed if possible) of bytes, + * UTF-8 encoded. + * @param {String} str the string to encode + * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string. + */ +exports.utf8encode = function utf8encode(str) { + if (support.nodebuffer) { + return nodejsUtils.newBufferFrom(str, "utf-8"); + } + + return string2buf(str); +}; + + +/** + * Transform a bytes array (or a representation) representing an UTF-8 encoded + * string into a javascript string. + * @param {Array|Uint8Array|Buffer} buf the data de decode + * @return {String} the decoded string. + */ +exports.utf8decode = function utf8decode(buf) { + if (support.nodebuffer) { + return utils.transformTo("nodebuffer", buf).toString("utf-8"); + } + + buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf); + + return buf2string(buf); +}; + +/** + * A worker to decode utf8 encoded binary chunks into string chunks. + * @constructor + */ +function Utf8DecodeWorker() { + GenericWorker.call(this, "utf-8 decode"); + // the last bytes if a chunk didn't end with a complete codepoint. + this.leftOver = null; +} +utils.inherits(Utf8DecodeWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +Utf8DecodeWorker.prototype.processChunk = function (chunk) { + + var data = utils.transformTo(support.uint8array ? "uint8array" : "array", chunk.data); + + // 1st step, re-use what's left of the previous chunk + if (this.leftOver && this.leftOver.length) { + if(support.uint8array) { + var previousData = data; + data = new Uint8Array(previousData.length + this.leftOver.length); + data.set(this.leftOver, 0); + data.set(previousData, this.leftOver.length); + } else { + data = this.leftOver.concat(data); + } + this.leftOver = null; + } + + var nextBoundary = utf8border(data); + var usableData = data; + if (nextBoundary !== data.length) { + if (support.uint8array) { + usableData = data.subarray(0, nextBoundary); + this.leftOver = data.subarray(nextBoundary, data.length); + } else { + usableData = data.slice(0, nextBoundary); + this.leftOver = data.slice(nextBoundary, data.length); + } + } + + this.push({ + data : exports.utf8decode(usableData), + meta : chunk.meta + }); +}; + +/** + * @see GenericWorker.flush + */ +Utf8DecodeWorker.prototype.flush = function () { + if(this.leftOver && this.leftOver.length) { + this.push({ + data : exports.utf8decode(this.leftOver), + meta : {} + }); + this.leftOver = null; + } +}; +exports.Utf8DecodeWorker = Utf8DecodeWorker; + +/** + * A worker to endcode string chunks into utf8 encoded binary chunks. + * @constructor + */ +function Utf8EncodeWorker() { + GenericWorker.call(this, "utf-8 encode"); +} +utils.inherits(Utf8EncodeWorker, GenericWorker); + +/** + * @see GenericWorker.processChunk + */ +Utf8EncodeWorker.prototype.processChunk = function (chunk) { + this.push({ + data : exports.utf8encode(chunk.data), + meta : chunk.meta + }); +}; +exports.Utf8EncodeWorker = Utf8EncodeWorker; + +},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(require,module,exports){ +'use strict'; + +var support = require('./support'); +var base64 = require('./base64'); +var nodejsUtils = require('./nodejsUtils'); +var setImmediate = require('core-js/library/fn/set-immediate'); +var external = require("./external"); + + +/** + * Convert a string that pass as a "binary string": it should represent a byte + * array but may have > 255 char codes. Be sure to take only the first byte + * and returns the byte array. + * @param {String} str the string to transform. + * @return {Array|Uint8Array} the string in a binary format. + */ +function string2binary(str) { + var result = null; + if (support.uint8array) { + result = new Uint8Array(str.length); + } else { + result = new Array(str.length); + } + return stringToArrayLike(str, result); +} + +/** + * Create a new blob with the given content and the given type. + * @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use + * an Uint8Array because the stock browser of android 4 won't accept it (it + * will be silently converted to a string, "[object Uint8Array]"). + * + * Use only ONE part to build the blob to avoid a memory leak in IE11 / Edge: + * when a large amount of Array is used to create the Blob, the amount of + * memory consumed is nearly 100 times the original data amount. + * + * @param {String} type the mime type of the blob. + * @return {Blob} the created blob. + */ +exports.newBlob = function(part, type) { + exports.checkSupport("blob"); + + try { + // Blob constructor + return new Blob([part], { + type: type + }); + } + catch (e) { + + try { + // deprecated, browser only, old way + var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder; + var builder = new Builder(); + builder.append(part); + return builder.getBlob(type); + } + catch (e) { + + // well, fuck ?! + throw new Error("Bug : can't construct the Blob."); + } + } + + +}; +/** + * The identity function. + * @param {Object} input the input. + * @return {Object} the same input. + */ +function identity(input) { + return input; +} + +/** + * Fill in an array with a string. + * @param {String} str the string to use. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated). + * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array. + */ +function stringToArrayLike(str, array) { + for (var i = 0; i < str.length; ++i) { + array[i] = str.charCodeAt(i) & 0xFF; + } + return array; +} + +/** + * An helper for the function arrayLikeToString. + * This contains static informations and functions that + * can be optimized by the browser JIT compiler. + */ +var arrayToStringHelper = { + /** + * Transform an array of int into a string, chunk by chunk. + * See the performances notes on arrayLikeToString. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform. + * @param {String} type the type of the array. + * @param {Integer} chunk the chunk size. + * @return {String} the resulting string. + * @throws Error if the chunk is too big for the stack. + */ + stringifyByChunk: function(array, type, chunk) { + var result = [], k = 0, len = array.length; + // shortcut + if (len <= chunk) { + return String.fromCharCode.apply(null, array); + } + while (k < len) { + if (type === "array" || type === "nodebuffer") { + result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len)))); + } + else { + result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len)))); + } + k += chunk; + } + return result.join(""); + }, + /** + * Call String.fromCharCode on every item in the array. + * This is the naive implementation, which generate A LOT of intermediate string. + * This should be used when everything else fail. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform. + * @return {String} the result. + */ + stringifyByChar: function(array){ + var resultStr = ""; + for(var i = 0; i < array.length; i++) { + resultStr += String.fromCharCode(array[i]); + } + return resultStr; + }, + applyCanBeUsed : { + /** + * true if the browser accepts to use String.fromCharCode on Uint8Array + */ + uint8array : (function () { + try { + return support.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1; + } catch (e) { + return false; + } + })(), + /** + * true if the browser accepts to use String.fromCharCode on nodejs Buffer. + */ + nodebuffer : (function () { + try { + return support.nodebuffer && String.fromCharCode.apply(null, nodejsUtils.allocBuffer(1)).length === 1; + } catch (e) { + return false; + } + })() + } +}; + +/** + * Transform an array-like object to a string. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform. + * @return {String} the result. + */ +function arrayLikeToString(array) { + // Performances notes : + // -------------------- + // String.fromCharCode.apply(null, array) is the fastest, see + // see http://jsperf.com/converting-a-uint8array-to-a-string/2 + // but the stack is limited (and we can get huge arrays !). + // + // result += String.fromCharCode(array[i]); generate too many strings ! + // + // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2 + // TODO : we now have workers that split the work. Do we still need that ? + var chunk = 65536, + type = exports.getTypeOf(array), + canUseApply = true; + if (type === "uint8array") { + canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array; + } else if (type === "nodebuffer") { + canUseApply = arrayToStringHelper.applyCanBeUsed.nodebuffer; + } + + if (canUseApply) { + while (chunk > 1) { + try { + return arrayToStringHelper.stringifyByChunk(array, type, chunk); + } catch (e) { + chunk = Math.floor(chunk / 2); + } + } + } + + // no apply or chunk error : slow and painful algorithm + // default browser on android 4.* + return arrayToStringHelper.stringifyByChar(array); +} + +exports.applyFromCharCode = arrayLikeToString; + + +/** + * Copy the data from an array-like to an other array-like. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated. + * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array. + */ +function arrayLikeToArrayLike(arrayFrom, arrayTo) { + for (var i = 0; i < arrayFrom.length; i++) { + arrayTo[i] = arrayFrom[i]; + } + return arrayTo; +} + +// a matrix containing functions to transform everything into everything. +var transform = {}; + +// string to ? +transform["string"] = { + "string": identity, + "array": function(input) { + return stringToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return transform["string"]["uint8array"](input).buffer; + }, + "uint8array": function(input) { + return stringToArrayLike(input, new Uint8Array(input.length)); + }, + "nodebuffer": function(input) { + return stringToArrayLike(input, nodejsUtils.allocBuffer(input.length)); + } +}; + +// array to ? +transform["array"] = { + "string": arrayLikeToString, + "array": identity, + "arraybuffer": function(input) { + return (new Uint8Array(input)).buffer; + }, + "uint8array": function(input) { + return new Uint8Array(input); + }, + "nodebuffer": function(input) { + return nodejsUtils.newBufferFrom(input); + } +}; + +// arraybuffer to ? +transform["arraybuffer"] = { + "string": function(input) { + return arrayLikeToString(new Uint8Array(input)); + }, + "array": function(input) { + return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength)); + }, + "arraybuffer": identity, + "uint8array": function(input) { + return new Uint8Array(input); + }, + "nodebuffer": function(input) { + return nodejsUtils.newBufferFrom(new Uint8Array(input)); + } +}; + +// uint8array to ? +transform["uint8array"] = { + "string": arrayLikeToString, + "array": function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return input.buffer; + }, + "uint8array": identity, + "nodebuffer": function(input) { + return nodejsUtils.newBufferFrom(input); + } +}; + +// nodebuffer to ? +transform["nodebuffer"] = { + "string": arrayLikeToString, + "array": function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return transform["nodebuffer"]["uint8array"](input).buffer; + }, + "uint8array": function(input) { + return arrayLikeToArrayLike(input, new Uint8Array(input.length)); + }, + "nodebuffer": identity +}; + +/** + * Transform an input into any type. + * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer. + * If no output type is specified, the unmodified input will be returned. + * @param {String} outputType the output type. + * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert. + * @throws {Error} an Error if the browser doesn't support the requested output type. + */ +exports.transformTo = function(outputType, input) { + if (!input) { + // undefined, null, etc + // an empty string won't harm. + input = ""; + } + if (!outputType) { + return input; + } + exports.checkSupport(outputType); + var inputType = exports.getTypeOf(input); + var result = transform[inputType][outputType](input); + return result; +}; + +/** + * Return the type of the input. + * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer. + * @param {Object} input the input to identify. + * @return {String} the (lowercase) type of the input. + */ +exports.getTypeOf = function(input) { + if (typeof input === "string") { + return "string"; + } + if (Object.prototype.toString.call(input) === "[object Array]") { + return "array"; + } + if (support.nodebuffer && nodejsUtils.isBuffer(input)) { + return "nodebuffer"; + } + if (support.uint8array && input instanceof Uint8Array) { + return "uint8array"; + } + if (support.arraybuffer && input instanceof ArrayBuffer) { + return "arraybuffer"; + } +}; + +/** + * Throw an exception if the type is not supported. + * @param {String} type the type to check. + * @throws {Error} an Error if the browser doesn't support the requested type. + */ +exports.checkSupport = function(type) { + var supported = support[type.toLowerCase()]; + if (!supported) { + throw new Error(type + " is not supported by this platform"); + } +}; + +exports.MAX_VALUE_16BITS = 65535; +exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1 + +/** + * Prettify a string read as binary. + * @param {string} str the string to prettify. + * @return {string} a pretty string. + */ +exports.pretty = function(str) { + var res = '', + code, i; + for (i = 0; i < (str || "").length; i++) { + code = str.charCodeAt(i); + res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase(); + } + return res; +}; + +/** + * Defer the call of a function. + * @param {Function} callback the function to call asynchronously. + * @param {Array} args the arguments to give to the callback. + */ +exports.delay = function(callback, args, self) { + setImmediate(function () { + callback.apply(self || null, args || []); + }); +}; + +/** + * Extends a prototype with an other, without calling a constructor with + * side effects. Inspired by nodejs' `utils.inherits` + * @param {Function} ctor the constructor to augment + * @param {Function} superCtor the parent constructor to use + */ +exports.inherits = function (ctor, superCtor) { + var Obj = function() {}; + Obj.prototype = superCtor.prototype; + ctor.prototype = new Obj(); +}; + +/** + * Merge the objects passed as parameters into a new one. + * @private + * @param {...Object} var_args All objects to merge. + * @return {Object} a new object with the data of the others. + */ +exports.extend = function() { + var result = {}, i, attr; + for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers + for (attr in arguments[i]) { + if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") { + result[attr] = arguments[i][attr]; + } + } + } + return result; +}; + +/** + * Transform arbitrary content into a Promise. + * @param {String} name a name for the content being processed. + * @param {Object} inputData the content to process. + * @param {Boolean} isBinary true if the content is not an unicode string + * @param {Boolean} isOptimizedBinaryString true if the string content only has one byte per character. + * @param {Boolean} isBase64 true if the string content is encoded with base64. + * @return {Promise} a promise in a format usable by JSZip. + */ +exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) { + + // if inputData is already a promise, this flatten it. + var promise = external.Promise.resolve(inputData).then(function(data) { + + + var isBlob = support.blob && (data instanceof Blob || ['[object File]', '[object Blob]'].indexOf(Object.prototype.toString.call(data)) !== -1); + + if (isBlob && typeof FileReader !== "undefined") { + return new external.Promise(function (resolve, reject) { + var reader = new FileReader(); + + reader.onload = function(e) { + resolve(e.target.result); + }; + reader.onerror = function(e) { + reject(e.target.error); + }; + reader.readAsArrayBuffer(data); + }); + } else { + return data; + } + }); + + return promise.then(function(data) { + var dataType = exports.getTypeOf(data); + + if (!dataType) { + return external.Promise.reject( + new Error("Can't read the data of '" + name + "'. Is it " + + "in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?") + ); + } + // special case : it's way easier to work with Uint8Array than with ArrayBuffer + if (dataType === "arraybuffer") { + data = exports.transformTo("uint8array", data); + } else if (dataType === "string") { + if (isBase64) { + data = base64.decode(data); + } + else if (isBinary) { + // optimizedBinaryString === true means that the file has already been filtered with a 0xFF mask + if (isOptimizedBinaryString !== true) { + // this is a string, not in a base64 format. + // Be sure that this is a correct "binary string" + data = string2binary(data); + } + } + } + return data; + }); +}; + +},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"core-js/library/fn/set-immediate":36}],33:[function(require,module,exports){ +'use strict'; +var readerFor = require('./reader/readerFor'); +var utils = require('./utils'); +var sig = require('./signature'); +var ZipEntry = require('./zipEntry'); +var utf8 = require('./utf8'); +var support = require('./support'); +// class ZipEntries {{{ +/** + * All the entries in the zip file. + * @constructor + * @param {Object} loadOptions Options for loading the stream. + */ +function ZipEntries(loadOptions) { + this.files = []; + this.loadOptions = loadOptions; +} +ZipEntries.prototype = { + /** + * Check that the reader is on the specified signature. + * @param {string} expectedSignature the expected signature. + * @throws {Error} if it is an other signature. + */ + checkSignature: function(expectedSignature) { + if (!this.reader.readAndCheckSignature(expectedSignature)) { + this.reader.index -= 4; + var signature = this.reader.readString(4); + throw new Error("Corrupted zip or bug: unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")"); + } + }, + /** + * Check if the given signature is at the given index. + * @param {number} askedIndex the index to check. + * @param {string} expectedSignature the signature to expect. + * @return {boolean} true if the signature is here, false otherwise. + */ + isSignature: function(askedIndex, expectedSignature) { + var currentIndex = this.reader.index; + this.reader.setIndex(askedIndex); + var signature = this.reader.readString(4); + var result = signature === expectedSignature; + this.reader.setIndex(currentIndex); + return result; + }, + /** + * Read the end of the central directory. + */ + readBlockEndOfCentral: function() { + this.diskNumber = this.reader.readInt(2); + this.diskWithCentralDirStart = this.reader.readInt(2); + this.centralDirRecordsOnThisDisk = this.reader.readInt(2); + this.centralDirRecords = this.reader.readInt(2); + this.centralDirSize = this.reader.readInt(4); + this.centralDirOffset = this.reader.readInt(4); + + this.zipCommentLength = this.reader.readInt(2); + // warning : the encoding depends of the system locale + // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded. + // On a windows machine, this field is encoded with the localized windows code page. + var zipComment = this.reader.readData(this.zipCommentLength); + var decodeParamType = support.uint8array ? "uint8array" : "array"; + // To get consistent behavior with the generation part, we will assume that + // this is utf8 encoded unless specified otherwise. + var decodeContent = utils.transformTo(decodeParamType, zipComment); + this.zipComment = this.loadOptions.decodeFileName(decodeContent); + }, + /** + * Read the end of the Zip 64 central directory. + * Not merged with the method readEndOfCentral : + * The end of central can coexist with its Zip64 brother, + * I don't want to read the wrong number of bytes ! + */ + readBlockZip64EndOfCentral: function() { + this.zip64EndOfCentralSize = this.reader.readInt(8); + this.reader.skip(4); + // this.versionMadeBy = this.reader.readString(2); + // this.versionNeeded = this.reader.readInt(2); + this.diskNumber = this.reader.readInt(4); + this.diskWithCentralDirStart = this.reader.readInt(4); + this.centralDirRecordsOnThisDisk = this.reader.readInt(8); + this.centralDirRecords = this.reader.readInt(8); + this.centralDirSize = this.reader.readInt(8); + this.centralDirOffset = this.reader.readInt(8); + + this.zip64ExtensibleData = {}; + var extraDataSize = this.zip64EndOfCentralSize - 44, + index = 0, + extraFieldId, + extraFieldLength, + extraFieldValue; + while (index < extraDataSize) { + extraFieldId = this.reader.readInt(2); + extraFieldLength = this.reader.readInt(4); + extraFieldValue = this.reader.readData(extraFieldLength); + this.zip64ExtensibleData[extraFieldId] = { + id: extraFieldId, + length: extraFieldLength, + value: extraFieldValue + }; + } + }, + /** + * Read the end of the Zip 64 central directory locator. + */ + readBlockZip64EndOfCentralLocator: function() { + this.diskWithZip64CentralDirStart = this.reader.readInt(4); + this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8); + this.disksCount = this.reader.readInt(4); + if (this.disksCount > 1) { + throw new Error("Multi-volumes zip are not supported"); + } + }, + /** + * Read the local files, based on the offset read in the central part. + */ + readLocalFiles: function() { + var i, file; + for (i = 0; i < this.files.length; i++) { + file = this.files[i]; + this.reader.setIndex(file.localHeaderOffset); + this.checkSignature(sig.LOCAL_FILE_HEADER); + file.readLocalPart(this.reader); + file.handleUTF8(); + file.processAttributes(); + } + }, + /** + * Read the central directory. + */ + readCentralDir: function() { + var file; + + this.reader.setIndex(this.centralDirOffset); + while (this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER)) { + file = new ZipEntry({ + zip64: this.zip64 + }, this.loadOptions); + file.readCentralPart(this.reader); + this.files.push(file); + } + + if (this.centralDirRecords !== this.files.length) { + if (this.centralDirRecords !== 0 && this.files.length === 0) { + // We expected some records but couldn't find ANY. + // This is really suspicious, as if something went wrong. + throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length); + } else { + // We found some records but not all. + // Something is wrong but we got something for the user: no error here. + // console.warn("expected", this.centralDirRecords, "records in central dir, got", this.files.length); + } + } + }, + /** + * Read the end of central directory. + */ + readEndOfCentral: function() { + var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END); + if (offset < 0) { + // Check if the content is a truncated zip or complete garbage. + // A "LOCAL_FILE_HEADER" is not required at the beginning (auto + // extractible zip for example) but it can give a good hint. + // If an ajax request was used without responseType, we will also + // get unreadable data. + var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER); + + if (isGarbage) { + throw new Error("Can't find end of central directory : is this a zip file ? " + + "If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"); + } else { + throw new Error("Corrupted zip: can't find end of central directory"); + } + + } + this.reader.setIndex(offset); + var endOfCentralDirOffset = offset; + this.checkSignature(sig.CENTRAL_DIRECTORY_END); + this.readBlockEndOfCentral(); + + + /* extract from the zip spec : + 4) If one of the fields in the end of central directory + record is too small to hold required data, the field + should be set to -1 (0xFFFF or 0xFFFFFFFF) and the + ZIP64 format record should be created. + 5) The end of central directory record and the + Zip64 end of central directory locator record must + reside on the same disk when splitting or spanning + an archive. + */ + if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) { + this.zip64 = true; + + /* + Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from + the zip file can fit into a 32bits integer. This cannot be solved : JavaScript represents + all numbers as 64-bit double precision IEEE 754 floating point numbers. + So, we have 53bits for integers and bitwise operations treat everything as 32bits. + see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators + and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5 + */ + + // should look for a zip64 EOCD locator + offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + if (offset < 0) { + throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator"); + } + this.reader.setIndex(offset); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + this.readBlockZip64EndOfCentralLocator(); + + // now the zip64 EOCD record + if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) { + // console.warn("ZIP64 end of central directory not where expected."); + this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); + if (this.relativeOffsetEndOfZip64CentralDir < 0) { + throw new Error("Corrupted zip: can't find the ZIP64 end of central directory"); + } + } + this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); + this.readBlockZip64EndOfCentral(); + } + + var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize; + if (this.zip64) { + expectedEndOfCentralDirOffset += 20; // end of central dir 64 locator + expectedEndOfCentralDirOffset += 12 /* should not include the leading 12 bytes */ + this.zip64EndOfCentralSize; + } + + var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset; + + if (extraBytes > 0) { + // console.warn(extraBytes, "extra bytes at beginning or within zipfile"); + if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) { + // The offsets seem wrong, but we have something at the specified offset. + // So… we keep it. + } else { + // the offset is wrong, update the "zero" of the reader + // this happens if data has been prepended (crx files for example) + this.reader.zero = extraBytes; + } + } else if (extraBytes < 0) { + throw new Error("Corrupted zip: missing " + Math.abs(extraBytes) + " bytes."); + } + }, + prepareReader: function(data) { + this.reader = readerFor(data); + }, + /** + * Read a zip file and create ZipEntries. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file. + */ + load: function(data) { + this.prepareReader(data); + this.readEndOfCentral(); + this.readCentralDir(); + this.readLocalFiles(); + } +}; +// }}} end of ZipEntries +module.exports = ZipEntries; + +},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(require,module,exports){ +'use strict'; +var readerFor = require('./reader/readerFor'); +var utils = require('./utils'); +var CompressedObject = require('./compressedObject'); +var crc32fn = require('./crc32'); +var utf8 = require('./utf8'); +var compressions = require('./compressions'); +var support = require('./support'); + +var MADE_BY_DOS = 0x00; +var MADE_BY_UNIX = 0x03; + +/** + * Find a compression registered in JSZip. + * @param {string} compressionMethod the method magic to find. + * @return {Object|null} the JSZip compression object, null if none found. + */ +var findCompression = function(compressionMethod) { + for (var method in compressions) { + if (!compressions.hasOwnProperty(method)) { + continue; + } + if (compressions[method].magic === compressionMethod) { + return compressions[method]; + } + } + return null; +}; + +// class ZipEntry {{{ +/** + * An entry in the zip file. + * @constructor + * @param {Object} options Options of the current file. + * @param {Object} loadOptions Options for loading the stream. + */ +function ZipEntry(options, loadOptions) { + this.options = options; + this.loadOptions = loadOptions; +} +ZipEntry.prototype = { + /** + * say if the file is encrypted. + * @return {boolean} true if the file is encrypted, false otherwise. + */ + isEncrypted: function() { + // bit 1 is set + return (this.bitFlag & 0x0001) === 0x0001; + }, + /** + * say if the file has utf-8 filename/comment. + * @return {boolean} true if the filename/comment is in utf-8, false otherwise. + */ + useUTF8: function() { + // bit 11 is set + return (this.bitFlag & 0x0800) === 0x0800; + }, + /** + * Read the local part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readLocalPart: function(reader) { + var compression, localExtraFieldsLength; + + // we already know everything from the central dir ! + // If the central dir data are false, we are doomed. + // On the bright side, the local part is scary : zip64, data descriptors, both, etc. + // The less data we get here, the more reliable this should be. + // Let's skip the whole header and dash to the data ! + reader.skip(22); + // in some zip created on windows, the filename stored in the central dir contains \ instead of /. + // Strangely, the filename here is OK. + // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes + // or APPNOTE#4.4.17.1, "All slashes MUST be forward slashes '/'") but there are a lot of bad zip generators... + // Search "unzip mismatching "local" filename continuing with "central" filename version" on + // the internet. + // + // I think I see the logic here : the central directory is used to display + // content and the local directory is used to extract the files. Mixing / and \ + // may be used to display \ to windows users and use / when extracting the files. + // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394 + this.fileNameLength = reader.readInt(2); + localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir + // the fileName is stored as binary data, the handleUTF8 method will take care of the encoding. + this.fileName = reader.readData(this.fileNameLength); + reader.skip(localExtraFieldsLength); + + if (this.compressedSize === -1 || this.uncompressedSize === -1) { + throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize === -1 || uncompressedSize === -1)"); + } + + compression = findCompression(this.compressionMethod); + if (compression === null) { // no compression found + throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")"); + } + this.decompressed = new CompressedObject(this.compressedSize, this.uncompressedSize, this.crc32, compression, reader.readData(this.compressedSize)); + }, + + /** + * Read the central part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readCentralPart: function(reader) { + this.versionMadeBy = reader.readInt(2); + reader.skip(2); + // this.versionNeeded = reader.readInt(2); + this.bitFlag = reader.readInt(2); + this.compressionMethod = reader.readString(2); + this.date = reader.readDate(); + this.crc32 = reader.readInt(4); + this.compressedSize = reader.readInt(4); + this.uncompressedSize = reader.readInt(4); + var fileNameLength = reader.readInt(2); + this.extraFieldsLength = reader.readInt(2); + this.fileCommentLength = reader.readInt(2); + this.diskNumberStart = reader.readInt(2); + this.internalFileAttributes = reader.readInt(2); + this.externalFileAttributes = reader.readInt(4); + this.localHeaderOffset = reader.readInt(4); + + if (this.isEncrypted()) { + throw new Error("Encrypted zip are not supported"); + } + + // will be read in the local part, see the comments there + reader.skip(fileNameLength); + this.readExtraFields(reader); + this.parseZIP64ExtraField(reader); + this.fileComment = reader.readData(this.fileCommentLength); + }, + + /** + * Parse the external file attributes and get the unix/dos permissions. + */ + processAttributes: function () { + this.unixPermissions = null; + this.dosPermissions = null; + var madeBy = this.versionMadeBy >> 8; + + // Check if we have the DOS directory flag set. + // We look for it in the DOS and UNIX permissions + // but some unknown platform could set it as a compatibility flag. + this.dir = this.externalFileAttributes & 0x0010 ? true : false; + + if(madeBy === MADE_BY_DOS) { + // first 6 bits (0 to 5) + this.dosPermissions = this.externalFileAttributes & 0x3F; + } + + if(madeBy === MADE_BY_UNIX) { + this.unixPermissions = (this.externalFileAttributes >> 16) & 0xFFFF; + // the octal permissions are in (this.unixPermissions & 0x01FF).toString(8); + } + + // fail safe : if the name ends with a / it probably means a folder + if (!this.dir && this.fileNameStr.slice(-1) === '/') { + this.dir = true; + } + }, + + /** + * Parse the ZIP64 extra field and merge the info in the current ZipEntry. + * @param {DataReader} reader the reader to use. + */ + parseZIP64ExtraField: function(reader) { + + if (!this.extraFields[0x0001]) { + return; + } + + // should be something, preparing the extra reader + var extraReader = readerFor(this.extraFields[0x0001].value); + + // I really hope that these 64bits integer can fit in 32 bits integer, because js + // won't let us have more. + if (this.uncompressedSize === utils.MAX_VALUE_32BITS) { + this.uncompressedSize = extraReader.readInt(8); + } + if (this.compressedSize === utils.MAX_VALUE_32BITS) { + this.compressedSize = extraReader.readInt(8); + } + if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) { + this.localHeaderOffset = extraReader.readInt(8); + } + if (this.diskNumberStart === utils.MAX_VALUE_32BITS) { + this.diskNumberStart = extraReader.readInt(4); + } + }, + /** + * Read the central part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readExtraFields: function(reader) { + var end = reader.index + this.extraFieldsLength, + extraFieldId, + extraFieldLength, + extraFieldValue; + + if (!this.extraFields) { + this.extraFields = {}; + } + + while (reader.index < end) { + extraFieldId = reader.readInt(2); + extraFieldLength = reader.readInt(2); + extraFieldValue = reader.readData(extraFieldLength); + + this.extraFields[extraFieldId] = { + id: extraFieldId, + length: extraFieldLength, + value: extraFieldValue + }; + } + }, + /** + * Apply an UTF8 transformation if needed. + */ + handleUTF8: function() { + var decodeParamType = support.uint8array ? "uint8array" : "array"; + if (this.useUTF8()) { + this.fileNameStr = utf8.utf8decode(this.fileName); + this.fileCommentStr = utf8.utf8decode(this.fileComment); + } else { + var upath = this.findExtraFieldUnicodePath(); + if (upath !== null) { + this.fileNameStr = upath; + } else { + // ASCII text or unsupported code page + var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName); + this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray); + } + + var ucomment = this.findExtraFieldUnicodeComment(); + if (ucomment !== null) { + this.fileCommentStr = ucomment; + } else { + // ASCII text or unsupported code page + var commentByteArray = utils.transformTo(decodeParamType, this.fileComment); + this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray); + } + } + }, + + /** + * Find the unicode path declared in the extra field, if any. + * @return {String} the unicode path, null otherwise. + */ + findExtraFieldUnicodePath: function() { + var upathField = this.extraFields[0x7075]; + if (upathField) { + var extraReader = readerFor(upathField.value); + + // wrong version + if (extraReader.readInt(1) !== 1) { + return null; + } + + // the crc of the filename changed, this field is out of date. + if (crc32fn(this.fileName) !== extraReader.readInt(4)) { + return null; + } + + return utf8.utf8decode(extraReader.readData(upathField.length - 5)); + } + return null; + }, + + /** + * Find the unicode comment declared in the extra field, if any. + * @return {String} the unicode comment, null otherwise. + */ + findExtraFieldUnicodeComment: function() { + var ucommentField = this.extraFields[0x6375]; + if (ucommentField) { + var extraReader = readerFor(ucommentField.value); + + // wrong version + if (extraReader.readInt(1) !== 1) { + return null; + } + + // the crc of the comment changed, this field is out of date. + if (crc32fn(this.fileComment) !== extraReader.readInt(4)) { + return null; + } + + return utf8.utf8decode(extraReader.readData(ucommentField.length - 5)); + } + return null; + } +}; +module.exports = ZipEntry; + +},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(require,module,exports){ +'use strict'; + +var StreamHelper = require('./stream/StreamHelper'); +var DataWorker = require('./stream/DataWorker'); +var utf8 = require('./utf8'); +var CompressedObject = require('./compressedObject'); +var GenericWorker = require('./stream/GenericWorker'); + +/** + * A simple object representing a file in the zip file. + * @constructor + * @param {string} name the name of the file + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data + * @param {Object} options the options of the file + */ +var ZipObject = function(name, data, options) { + this.name = name; + this.dir = options.dir; + this.date = options.date; + this.comment = options.comment; + this.unixPermissions = options.unixPermissions; + this.dosPermissions = options.dosPermissions; + + this._data = data; + this._dataBinary = options.binary; + // keep only the compression + this.options = { + compression : options.compression, + compressionOptions : options.compressionOptions + }; +}; + +ZipObject.prototype = { + /** + * Create an internal stream for the content of this object. + * @param {String} type the type of each chunk. + * @return StreamHelper the stream. + */ + internalStream: function (type) { + var result = null, outputType = "string"; + try { + if (!type) { + throw new Error("No output type specified."); + } + outputType = type.toLowerCase(); + var askUnicodeString = outputType === "string" || outputType === "text"; + if (outputType === "binarystring" || outputType === "text") { + outputType = "string"; + } + result = this._decompressWorker(); + + var isUnicodeString = !this._dataBinary; + + if (isUnicodeString && !askUnicodeString) { + result = result.pipe(new utf8.Utf8EncodeWorker()); + } + if (!isUnicodeString && askUnicodeString) { + result = result.pipe(new utf8.Utf8DecodeWorker()); + } + } catch (e) { + result = new GenericWorker("error"); + result.error(e); + } + + return new StreamHelper(result, outputType, ""); + }, + + /** + * Prepare the content in the asked type. + * @param {String} type the type of the result. + * @param {Function} onUpdate a function to call on each internal update. + * @return Promise the promise of the result. + */ + async: function (type, onUpdate) { + return this.internalStream(type).accumulate(onUpdate); + }, + + /** + * Prepare the content as a nodejs stream. + * @param {String} type the type of each chunk. + * @param {Function} onUpdate a function to call on each internal update. + * @return Stream the stream. + */ + nodeStream: function (type, onUpdate) { + return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate); + }, + + /** + * Return a worker for the compressed content. + * @private + * @param {Object} compression the compression object to use. + * @param {Object} compressionOptions the options to use when compressing. + * @return Worker the worker. + */ + _compressWorker: function (compression, compressionOptions) { + if ( + this._data instanceof CompressedObject && + this._data.compression.magic === compression.magic + ) { + return this._data.getCompressedWorker(); + } else { + var result = this._decompressWorker(); + if(!this._dataBinary) { + result = result.pipe(new utf8.Utf8EncodeWorker()); + } + return CompressedObject.createWorkerFrom(result, compression, compressionOptions); + } + }, + /** + * Return a worker for the decompressed content. + * @private + * @return Worker the worker. + */ + _decompressWorker : function () { + if (this._data instanceof CompressedObject) { + return this._data.getContentWorker(); + } else if (this._data instanceof GenericWorker) { + return this._data; + } else { + return new DataWorker(this._data); + } + } +}; + +var removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"]; +var removedFn = function () { + throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); +}; + +for(var i = 0; i < removedMethods.length; i++) { + ZipObject.prototype[removedMethods[i]] = removedFn; +} +module.exports = ZipObject; + +},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(require,module,exports){ +require('../modules/web.immediate'); +module.exports = require('../modules/_core').setImmediate; +},{"../modules/_core":40,"../modules/web.immediate":56}],37:[function(require,module,exports){ +module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; +}; +},{}],38:[function(require,module,exports){ +var isObject = require('./_is-object'); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; +},{"./_is-object":51}],39:[function(require,module,exports){ +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; +},{}],40:[function(require,module,exports){ +var core = module.exports = {version: '2.3.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef +},{}],41:[function(require,module,exports){ +// optional / simple context binding +var aFunction = require('./_a-function'); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; +},{"./_a-function":37}],42:[function(require,module,exports){ +// Thank's IE8 for his funny defineProperty +module.exports = !require('./_fails')(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"./_fails":45}],43:[function(require,module,exports){ +var isObject = require('./_is-object') + , document = require('./_global').document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; +},{"./_global":46,"./_is-object":51}],44:[function(require,module,exports){ +var global = require('./_global') + , core = require('./_core') + , ctx = require('./_ctx') + , hide = require('./_hide') + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; +},{"./_core":40,"./_ctx":41,"./_global":46,"./_hide":47}],45:[function(require,module,exports){ +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; +},{}],46:[function(require,module,exports){ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef +},{}],47:[function(require,module,exports){ +var dP = require('./_object-dp') + , createDesc = require('./_property-desc'); +module.exports = require('./_descriptors') ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; +},{"./_descriptors":42,"./_object-dp":52,"./_property-desc":53}],48:[function(require,module,exports){ +module.exports = require('./_global').document && document.documentElement; +},{"./_global":46}],49:[function(require,module,exports){ +module.exports = !require('./_descriptors') && !require('./_fails')(function(){ + return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"./_descriptors":42,"./_dom-create":43,"./_fails":45}],50:[function(require,module,exports){ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; +},{}],51:[function(require,module,exports){ +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; +},{}],52:[function(require,module,exports){ +var anObject = require('./_an-object') + , IE8_DOM_DEFINE = require('./_ie8-dom-define') + , toPrimitive = require('./_to-primitive') + , dP = Object.defineProperty; + +exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; +},{"./_an-object":38,"./_descriptors":42,"./_ie8-dom-define":49,"./_to-primitive":55}],53:[function(require,module,exports){ +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; +},{}],54:[function(require,module,exports){ +var ctx = require('./_ctx') + , invoke = require('./_invoke') + , html = require('./_html') + , cel = require('./_dom-create') + , global = require('./_global') + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(require('./_cof')(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; +},{"./_cof":39,"./_ctx":41,"./_dom-create":43,"./_global":46,"./_html":48,"./_invoke":50}],55:[function(require,module,exports){ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = require('./_is-object'); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; +},{"./_is-object":51}],56:[function(require,module,exports){ +var $export = require('./_export') + , $task = require('./_task'); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); +},{"./_export":44,"./_task":54}],57:[function(require,module,exports){ +(function (global){ +'use strict'; +var Mutation = global.MutationObserver || global.WebKitMutationObserver; + +var scheduleDrain; + +{ + if (Mutation) { + var called = 0; + var observer = new Mutation(nextTick); + var element = global.document.createTextNode(''); + observer.observe(element, { + characterData: true + }); + scheduleDrain = function () { + element.data = (called = ++called % 2); + }; + } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') { + var channel = new global.MessageChannel(); + channel.port1.onmessage = nextTick; + scheduleDrain = function () { + channel.port2.postMessage(0); + }; + } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) { + scheduleDrain = function () { + + // Create a + + + + + +
+ +

index.html

+
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/overview-tree.html b/Quellcodes/alg_ds_graphentester/doc/overview-tree.html new file mode 100644 index 0000000..880a115 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/overview-tree.html @@ -0,0 +1,282 @@ + + + + + +Class Hierarchy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/package-search-index.js b/Quellcodes/alg_ds_graphentester/doc/package-search-index.js new file mode 100644 index 0000000..c68d55e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/package-search-index.js @@ -0,0 +1 @@ +packageSearchIndex = [{"l":"algorithmen"},{"l":"All Packages","url":"allpackages-index.html"},{"l":"control"},{"l":"eigeneAlgorithmen"},{"l":"graph"},{"l":"imp"}] \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/doc/package-search-index.zip b/Quellcodes/alg_ds_graphentester/doc/package-search-index.zip new file mode 100644 index 0000000..d034a01 Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/doc/package-search-index.zip differ diff --git a/Quellcodes/alg_ds_graphentester/doc/package-summary.html b/Quellcodes/alg_ds_graphentester/doc/package-summary.html new file mode 100644 index 0000000..71c1d29 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/package-summary.html @@ -0,0 +1,163 @@ + + + + + +<Unnamed> (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package <Unnamed>

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    GraphenTester 
    +
  • +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/package-tree.html b/Quellcodes/alg_ds_graphentester/doc/package-tree.html new file mode 100644 index 0000000..d63a204 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/package-tree.html @@ -0,0 +1,164 @@ + + + + + + Class Hierarchy (1_graphentester) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package <Unnamed>

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+
+ +
+ + diff --git a/Quellcodes/alg_ds_graphentester/doc/resources/glass.png b/Quellcodes/alg_ds_graphentester/doc/resources/glass.png new file mode 100644 index 0000000..a7f591f Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/doc/resources/glass.png differ diff --git a/Quellcodes/alg_ds_graphentester/doc/resources/x.png b/Quellcodes/alg_ds_graphentester/doc/resources/x.png new file mode 100644 index 0000000..30548a7 Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/doc/resources/x.png differ diff --git a/Quellcodes/alg_ds_graphentester/doc/script.js b/Quellcodes/alg_ds_graphentester/doc/script.js new file mode 100644 index 0000000..864989c --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/script.js @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var moduleSearchIndex; +var packageSearchIndex; +var typeSearchIndex; +var memberSearchIndex; +var tagSearchIndex; +function loadScripts(doc, tag) { + createElem(doc, tag, 'search.js'); + + createElem(doc, tag, 'module-search-index.js'); + createElem(doc, tag, 'package-search-index.js'); + createElem(doc, tag, 'type-search-index.js'); + createElem(doc, tag, 'member-search-index.js'); + createElem(doc, tag, 'tag-search-index.js'); +} + +function createElem(doc, tag, path) { + var script = doc.createElement(tag); + var scriptElement = doc.getElementsByTagName(tag)[0]; + script.src = pathtoroot + path; + scriptElement.parentNode.insertBefore(script, scriptElement); +} + +function show(tableId, selected, columns) { + if (tableId !== selected) { + document.querySelectorAll('div.' + tableId + ':not(.' + selected + ')') + .forEach(function(elem) { + elem.style.display = 'none'; + }); + } + document.querySelectorAll('div.' + selected) + .forEach(function(elem, index) { + elem.style.display = ''; + var isEvenRow = index % (columns * 2) < columns; + elem.classList.remove(isEvenRow ? oddRowColor : evenRowColor); + elem.classList.add(isEvenRow ? evenRowColor : oddRowColor); + }); + updateTabs(tableId, selected); +} + +function updateTabs(tableId, selected) { + document.querySelector('div#' + tableId +' .summary-table') + .setAttribute('aria-labelledby', selected); + document.querySelectorAll('button[id^="' + tableId + '"]') + .forEach(function(tab, index) { + if (selected === tab.id || (tableId === selected && index === 0)) { + tab.className = activeTableTab; + tab.setAttribute('aria-selected', true); + tab.setAttribute('tabindex',0); + } else { + tab.className = tableTab; + tab.setAttribute('aria-selected', false); + tab.setAttribute('tabindex',-1); + } + }); +} + +function switchTab(e) { + var selected = document.querySelector('[aria-selected=true]'); + if (selected) { + if ((e.keyCode === 37 || e.keyCode === 38) && selected.previousSibling) { + // left or up arrow key pressed: move focus to previous tab + selected.previousSibling.click(); + selected.previousSibling.focus(); + e.preventDefault(); + } else if ((e.keyCode === 39 || e.keyCode === 40) && selected.nextSibling) { + // right or down arrow key pressed: move focus to next tab + selected.nextSibling.click(); + selected.nextSibling.focus(); + e.preventDefault(); + } + } +} + +var updateSearchResults = function() {}; + +function indexFilesLoaded() { + return moduleSearchIndex + && packageSearchIndex + && typeSearchIndex + && memberSearchIndex + && tagSearchIndex; +} + +// Workaround for scroll position not being included in browser history (8249133) +document.addEventListener("DOMContentLoaded", function(e) { + var contentDiv = document.querySelector("div.flex-content"); + window.addEventListener("popstate", function(e) { + if (e.state !== null) { + contentDiv.scrollTop = e.state; + } + }); + window.addEventListener("hashchange", function(e) { + history.replaceState(contentDiv.scrollTop, document.title); + }); + contentDiv.addEventListener("scroll", function(e) { + var timeoutID; + if (!timeoutID) { + timeoutID = setTimeout(function() { + history.replaceState(contentDiv.scrollTop, document.title); + timeoutID = null; + }, 100); + } + }); + if (!location.hash) { + history.replaceState(contentDiv.scrollTop, document.title); + } +}); diff --git a/Quellcodes/alg_ds_graphentester/doc/search.js b/Quellcodes/alg_ds_graphentester/doc/search.js new file mode 100644 index 0000000..9d3fb81 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/search.js @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var noResult = {l: "No results found"}; +var catModules = "Modules"; +var catPackages = "Packages"; +var catTypes = "Types"; +var catMembers = "Members"; +var catSearchTags = "SearchTags"; +var highlight = "$&"; +var camelCaseRegexp = ""; +var secondaryMatcher = ""; +function getHighlightedText(item) { + var ccMatcher = new RegExp(camelCaseRegexp); + var label = item.replace(ccMatcher, highlight); + if (label === item) { + label = item.replace(secondaryMatcher, highlight); + } + return label; +} +function getURLPrefix(ui) { + var urlPrefix=""; + if (useModuleDirectories) { + var slash = "/"; + if (ui.item.category === catModules) { + return ui.item.l + slash; + } else if (ui.item.category === catPackages && ui.item.m) { + return ui.item.m + slash; + } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) { + $.each(packageSearchIndex, function(index, item) { + if (ui.item.p == item.l) { + urlPrefix = item.m + slash; + } + }); + return urlPrefix; + } else { + return urlPrefix; + } + } + return urlPrefix; +} +var watermark = 'Search'; +$(function() { + $("#search").val(''); + $("#search").prop("disabled", false); + $("#reset").prop("disabled", false); + $("#search").val(watermark).addClass('watermark'); + $("#search").blur(function() { + if ($(this).val().length == 0) { + $(this).val(watermark).addClass('watermark'); + } + }); + $("#search").on('click keydown', function() { + if ($(this).val() == watermark) { + $(this).val('').removeClass('watermark'); + } + }); + $("#reset").click(function() { + $("#search").val(''); + $("#search").focus(); + }); + $("#search").focus(); + $("#search")[0].setSelectionRange(0, 0); +}); +$.widget("custom.catcomplete", $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); + }, + _renderMenu: function(ul, items) { + var rMenu = this, + currentCategory = ""; + $.each(items, function(index, item) { + var li; + if (item.l !== noResult.l && item.category !== currentCategory) { + ul.append("
  • " + item.category + "
  • "); + currentCategory = item.category; + } + li = rMenu._renderItemData(ul, item); + if (item.category) { + li.attr("aria-label", item.category + " : " + item.l); + li.attr("class", "resultItem"); + } else { + li.attr("aria-label", item.l); + li.attr("class", "resultItem"); + } + }); + }, + _renderItem: function(ul, item) { + var label = ""; + if (item.category === catModules) { + label = getHighlightedText(item.l); + } else if (item.category === catPackages) { + label = (item.m) + ? getHighlightedText(item.m + "/" + item.l) + : getHighlightedText(item.l); + } else if (item.category === catTypes) { + label = (item.p) + ? getHighlightedText(item.p + "." + item.l) + : getHighlightedText(item.l); + } else if (item.category === catMembers) { + label = getHighlightedText(item.p + "." + (item.c + "." + item.l)); + } else if (item.category === catSearchTags) { + label = getHighlightedText(item.l); + } else { + label = item.l; + } + $li = $("
  • ").appendTo(ul); + if (item.category === catSearchTags) { + if (item.d) { + $("").attr("href", "#") + .html(label + " (" + item.h + ")
    " + + item.d + "
    ") + .appendTo($li); + } else { + $("
    ").attr("href", "#") + .html(label + " (" + item.h + ")") + .appendTo($li); + } + } else { + $("").attr("href", "#") + .html(label) + .appendTo($li); + } + return $li; + } +}); +$(function() { + $("#search").catcomplete({ + minLength: 1, + delay: 100, + source: function(request, response) { + var result = new Array(); + var presult = new Array(); + var tresult = new Array(); + var mresult = new Array(); + var tgresult = new Array(); + var secondaryresult = new Array(); + var displayCount = 0; + var exactMatcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term) + "$", "i"); + camelCaseRegexp = ($.ui.autocomplete.escapeRegex(request.term)).split(/(?=[A-Z])/).join("([a-z0-9_$]*?)"); + var camelCaseMatcher = new RegExp("^" + camelCaseRegexp); + secondaryMatcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); + + // Return the nested innermost name from the specified object + function nestedName(e) { + return e.l.substring(e.l.lastIndexOf(".") + 1); + } + + function concatResults(a1, a2) { + a1 = a1.concat(a2); + a2.length = 0; + return a1; + } + + if (moduleSearchIndex) { + var mdleCount = 0; + $.each(moduleSearchIndex, function(index, item) { + item.category = catModules; + if (exactMatcher.test(item.l)) { + result.push(item); + mdleCount++; + } else if (camelCaseMatcher.test(item.l)) { + result.push(item); + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + displayCount = mdleCount; + result = concatResults(result, secondaryresult); + } + if (packageSearchIndex) { + var pCount = 0; + var pkg = ""; + $.each(packageSearchIndex, function(index, item) { + item.category = catPackages; + pkg = (item.m) + ? (item.m + "/" + item.l) + : item.l; + if (exactMatcher.test(item.l)) { + presult.push(item); + pCount++; + } else if (camelCaseMatcher.test(pkg)) { + presult.push(item); + } else if (secondaryMatcher.test(pkg)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(presult, secondaryresult)); + displayCount = (pCount > displayCount) ? pCount : displayCount; + } + if (typeSearchIndex) { + var tCount = 0; + $.each(typeSearchIndex, function(index, item) { + item.category = catTypes; + var s = nestedName(item); + if (exactMatcher.test(s)) { + tresult.push(item); + tCount++; + } else if (camelCaseMatcher.test(s)) { + tresult.push(item); + } else if (secondaryMatcher.test(item.p + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tresult, secondaryresult)); + displayCount = (tCount > displayCount) ? tCount : displayCount; + } + if (memberSearchIndex) { + var mCount = 0; + $.each(memberSearchIndex, function(index, item) { + item.category = catMembers; + var s = nestedName(item); + if (exactMatcher.test(s)) { + mresult.push(item); + mCount++; + } else if (camelCaseMatcher.test(s)) { + mresult.push(item); + } else if (secondaryMatcher.test(item.c + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(mresult, secondaryresult)); + displayCount = (mCount > displayCount) ? mCount : displayCount; + } + if (tagSearchIndex) { + var tgCount = 0; + $.each(tagSearchIndex, function(index, item) { + item.category = catSearchTags; + if (exactMatcher.test(item.l)) { + tgresult.push(item); + tgCount++; + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tgresult, secondaryresult)); + displayCount = (tgCount > displayCount) ? tgCount : displayCount; + } + displayCount = (displayCount > 500) ? displayCount : 500; + var counter = function() { + var count = {Modules: 0, Packages: 0, Types: 0, Members: 0, SearchTags: 0}; + var f = function(item) { + count[item.category] += 1; + return (count[item.category] <= displayCount); + }; + return f; + }(); + response(result.filter(counter)); + }, + response: function(event, ui) { + if (!ui.content.length) { + ui.content.push(noResult); + } else { + $("#search").empty(); + } + }, + autoFocus: true, + position: { + collision: "flip" + }, + select: function(event, ui) { + if (ui.item.l !== noResult.l) { + var url = getURLPrefix(ui); + if (ui.item.category === catModules) { + if (useModuleDirectories) { + url += "module-summary.html"; + } else { + url = ui.item.l + "-summary.html"; + } + } else if (ui.item.category === catPackages) { + if (ui.item.url) { + url = ui.item.url; + } else { + url += ui.item.l.replace(/\./g, '/') + "/package-summary.html"; + } + } else if (ui.item.category === catTypes) { + if (ui.item.url) { + url = ui.item.url; + } else if (ui.item.p === "") { + url += ui.item.l + ".html"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html"; + } + } else if (ui.item.category === catMembers) { + if (ui.item.p === "") { + url += ui.item.c + ".html" + "#"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#"; + } + if (ui.item.url) { + url += ui.item.url; + } else { + url += ui.item.l; + } + } else if (ui.item.category === catSearchTags) { + url += ui.item.u; + } + if (top !== window) { + parent.classFrame.location = pathtoroot + url; + } else { + window.location.href = pathtoroot + url; + } + } + } + }); +}); diff --git a/Quellcodes/alg_ds_graphentester/doc/serialized-form.html b/Quellcodes/alg_ds_graphentester/doc/serialized-form.html new file mode 100644 index 0000000..f855eeb --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/serialized-form.html @@ -0,0 +1,179 @@ + + + + + +Serialized Form (GraphTester_v6.7) + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Serialized Form

    +
    +
    + +
    +
    +
    + +
    + + diff --git a/Quellcodes/alg_ds_graphentester/doc/stylesheet.css b/Quellcodes/alg_ds_graphentester/doc/stylesheet.css new file mode 100644 index 0000000..836c62d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/stylesheet.css @@ -0,0 +1,865 @@ +/* + * Javadoc style sheet + */ + +@import url('resources/fonts/dejavu.css'); + +/* + * Styles for individual HTML elements. + * + * These are styles that are specific to individual HTML elements. Changing them affects the style of a particular + * HTML element throughout the page. + */ + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; + padding:0; + height:100%; + width:100%; +} +iframe { + margin:0; + padding:0; + height:100%; + width:100%; + overflow-y:scroll; + border:none; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a[href]:hover, a[href]:focus { + text-decoration:none; + color:#bb7a2a; +} +a[name] { + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; +} +h4 { + font-size:15px; +} +h5 { + font-size:14px; +} +h6 { + font-size:13px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; +} +:not(h1, h2, h3, h4, h5, h6) > code, +:not(h1, h2, h3, h4, h5, h6) > tt { + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +.summary-table dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +button { + font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size: 14px; +} +/* + * Styles for HTML generated by javadoc. + * + * These are style classes that are used by the standard doclet to generate HTML documentation. + */ + +/* + * Styles for document title and copyright. + */ +.clear { + clear:both; + height:0; + overflow:hidden; +} +.about-language { + float:right; + padding:0 21px 8px 8px; + font-size:11px; + margin-top:-9px; + height:2.9em; +} +.legal-copy { + margin-left:.5em; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* + * Styles for navigation bar. + */ +@media screen { + .flex-box { + position:fixed; + display:flex; + flex-direction:column; + height: 100%; + width: 100%; + } + .flex-header { + flex: 0 0 auto; + } + .flex-content { + flex: 1 1 auto; + overflow-y: auto; + } +} +.top-nav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + min-height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.sub-nav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.sub-nav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +.sub-nav .nav-list { + padding-top:5px; +} +ul.nav-list { + display:block; + margin:0 25px 0 0; + padding:0; +} +ul.sub-nav-list { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.nav-list li { + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +.sub-nav .nav-list-search { + float:right; + margin:0 0 0 0; + padding:5px 6px; + clear:none; +} +.nav-list-search label { + position:relative; + right:-16px; +} +ul.sub-nav-list li { + list-style:none; + float:left; + padding-top:10px; +} +.top-nav a:link, .top-nav a:active, .top-nav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.top-nav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.nav-bar-cell1-rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skip-nav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* + * Hide navigation links and search box in print layout + */ +@media print { + ul.nav-list, div.sub-nav { + display:none; + } +} +/* + * Styles for page header and footer. + */ +.title { + color:#2c4557; + margin:10px 0; +} +.sub-title { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* + * Styles for headings. + */ +body.class-declaration-page .summary h2, +body.class-declaration-page .details h2, +body.class-use-page h2, +body.module-declaration-page .block-list h2 { + font-style: italic; + padding:0; + margin:15px 0; +} +body.class-declaration-page .summary h3, +body.class-declaration-page .details h3, +body.class-declaration-page .summary .inherited-list h2 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +/* + * Styles for page layout containers. + */ +main { + clear:both; + padding:10px 20px; + position:relative; +} +dl.notes > dt { + font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +dl.notes > dd { + margin:5px 10px 10px 0; + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +dl.name-value > dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +dl.name-value > dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* + * Styles for lists. + */ +li.circle { + list-style:circle; +} +ul.horizontal li { + display:inline; + font-size:0.9em; +} +div.inheritance { + margin:0; + padding:0; +} +div.inheritance div.inheritance { + margin-left:2em; +} +ul.block-list, +ul.details-list, +ul.member-list, +ul.summary-list { + margin:10px 0 10px 0; + padding:0; +} +ul.block-list > li, +ul.details-list > li, +ul.member-list > li, +ul.summary-list > li { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +.summary-table dl, .summary-table dl dt, .summary-table dl dd { + margin-top:0; + margin-bottom:1px; +} +ul.see-list, ul.see-list-long { + padding-left: 0; + list-style: none; +} +ul.see-list li { + display: inline; +} +ul.see-list li:not(:last-child):after, +ul.see-list-long li:not(:last-child):after { + content: ", "; + white-space: pre-wrap; +} +/* + * Styles for tables. + */ +.summary-table, .details-table { + width:100%; + border-spacing:0; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; + padding:0; +} +.caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0; + padding-top:10px; + padding-left:1px; + margin:0; + white-space:pre; +} +.caption a:link, .caption a:visited { + color:#1f389c; +} +.caption a:hover, +.caption a:active { + color:#FFFFFF; +} +.caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +div.table-tabs { + padding:10px 0 0 1px; + margin:0; +} +div.table-tabs > button { + border: none; + cursor: pointer; + padding: 5px 12px 7px 12px; + font-weight: bold; + margin-right: 3px; +} +div.table-tabs > button.active-table-tab { + background: #F8981D; + color: #253441; +} +div.table-tabs > button.table-tab { + background: #4D7A97; + color: #FFFFFF; +} +.two-column-summary { + display: grid; + grid-template-columns: minmax(15%, max-content) minmax(15%, auto); +} +.three-column-summary { + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(15%, max-content) minmax(15%, auto); +} +.four-column-summary { + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(10%, max-content) minmax(10%, max-content) minmax(10%, auto); +} +@media screen and (max-width: 600px) { + .two-column-summary { + display: grid; + grid-template-columns: 1fr; + } +} +@media screen and (max-width: 800px) { + .three-column-summary { + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(25%, auto); + } + .three-column-summary .col-last { + grid-column-end: span 2; + } +} +@media screen and (max-width: 1000px) { + .four-column-summary { + display: grid; + grid-template-columns: minmax(15%, max-content) minmax(15%, auto); + } +} +.summary-table > div, .details-table > div { + text-align:left; + padding: 8px 3px 3px 7px; +} +.col-first, .col-second, .col-last, .col-constructor-name, .col-summary-item-name { + vertical-align:top; + padding-right:0; + padding-top:8px; + padding-bottom:3px; +} +.table-header { + background:#dee3e9; + font-weight: bold; +} +.col-first, .col-first { + font-size:13px; +} +.col-second, .col-second, .col-last, .col-constructor-name, .col-summary-item-name, .col-last { + font-size:13px; +} +.col-first, .col-second, .col-constructor-name { + vertical-align:top; + overflow: auto; +} +.col-last { + white-space:normal; +} +.col-first a:link, .col-first a:visited, +.col-second a:link, .col-second a:visited, +.col-first a:link, .col-first a:visited, +.col-second a:link, .col-second a:visited, +.col-constructor-name a:link, .col-constructor-name a:visited, +.col-summary-item-name a:link, .col-summary-item-name a:visited, +.constant-values-container a:link, .constant-values-container a:visited, +.all-classes-container a:link, .all-classes-container a:visited, +.all-packages-container a:link, .all-packages-container a:visited { + font-weight:bold; +} +.table-sub-heading-color { + background-color:#EEEEFF; +} +.even-row-color, .even-row-color .table-header { + background-color:#FFFFFF; +} +.odd-row-color, .odd-row-color .table-header { + background-color:#EEEEEF; +} +/* + * Styles for contents. + */ +.deprecated-content { + margin:0; + padding:10px 0; +} +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +.col-last div { + padding-top:0; +} +.col-last a { + padding-bottom:3px; +} +.module-signature, +.package-signature, +.type-signature, +.member-signature { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + margin:14px 0; + white-space: pre-wrap; +} +.module-signature, +.package-signature, +.type-signature { + margin-top: 0; +} +.member-signature .type-parameters-long, +.member-signature .parameters, +.member-signature .exceptions { + display: inline-block; + vertical-align: top; + white-space: pre; +} +.member-signature .type-parameters { + white-space: normal; +} +/* + * Styles for formatting effect. + */ +.source-line-no { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:0 10px 5px 0; + color:#474747; +} +.deprecated-label, .descfrm-type-label, .implementation-label, .member-name-label, .member-name-link, +.module-label-in-package, .module-label-in-type, .override-specify-label, .package-label-in-type, +.package-hierarchy-label, .type-name-label, .type-name-link, .search-tag-link, .preview-label { + font-weight:bold; +} +.deprecation-comment, .help-footnote, .preview-comment { + font-style:italic; +} +.deprecation-block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + border-style:solid; + border-width:thin; + border-radius:10px; + padding:10px; + margin-bottom:10px; + margin-right:10px; + display:inline-block; +} +.preview-block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + border-style:solid; + border-width:thin; + border-radius:10px; + padding:10px; + margin-bottom:10px; + margin-right:10px; + display:inline-block; +} +div.block div.deprecation-comment { + font-style:normal; +} +/* + * Styles specific to HTML5 elements. + */ +main, nav, header, footer, section { + display:block; +} +/* + * Styles for javadoc search. + */ +.ui-autocomplete-category { + font-weight:bold; + font-size:15px; + padding:7px 0 7px 3px; + background-color:#4D7A97; + color:#FFFFFF; +} +.result-item { + font-size:13px; +} +.ui-autocomplete { + max-height:85%; + max-width:65%; + overflow-y:scroll; + overflow-x:scroll; + white-space:nowrap; + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} +ul.ui-autocomplete { + position:fixed; + z-index:999999; +} +ul.ui-autocomplete li { + float:left; + clear:both; + width:100%; +} +.result-highlight { + font-weight:bold; +} +#search-input { + background-image:url('resources/glass.png'); + background-size:13px; + background-repeat:no-repeat; + background-position:2px 3px; + padding-left:20px; + position:relative; + right:-18px; + width:400px; +} +#reset-button { + background-color: rgb(255,255,255); + background-image:url('resources/x.png'); + background-position:center; + background-repeat:no-repeat; + background-size:12px; + border:0 none; + width:16px; + height:16px; + position:relative; + left:-4px; + top:-4px; + font-size:0px; +} +.watermark { + color:#545454; +} +.search-tag-desc-result { + font-style:italic; + font-size:11px; +} +.search-tag-holder-result { + font-style:italic; + font-size:12px; +} +.search-tag-result:target { + background-color:yellow; +} +.module-graph span { + display:none; + position:absolute; +} +.module-graph:hover span { + display:block; + margin: -100px 0 0 100px; + z-index: 1; +} +.inherited-list { + margin: 10px 0 10px 0; +} +section.class-description { + line-height: 1.4; +} +.summary section[class$="-summary"], .details section[class$="-details"], +.class-uses .detail, .serialized-class-details { + padding: 0px 20px 5px 10px; + border: 1px solid #ededed; + background-color: #f8f8f8; +} +.inherited-list, section[class$="-details"] .detail { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +.vertical-separator { + padding: 0 5px; +} +ul.help-section-list { + margin: 0; +} +ul.help-subtoc > li { + display: inline-block; + padding-right: 5px; + font-size: smaller; +} +ul.help-subtoc > li::before { + content: "\2022" ; + padding-right:2px; +} +span.help-note { + font-style: italic; +} +/* + * Indicator icon for external links. + */ +main a[href*="://"]::after { + content:""; + display:inline-block; + background-image:url('data:image/svg+xml; utf8, \ + \ + \ + '); + background-size:100% 100%; + width:7px; + height:7px; + margin-left:2px; + margin-bottom:4px; +} +main a[href*="://"]:hover::after, +main a[href*="://"]:focus::after { + background-image:url('data:image/svg+xml; utf8, \ + \ + \ + '); +} + +/* + * Styles for user-provided tables. + * + * borderless: + * No borders, vertical margins, styled caption. + * This style is provided for use with existing doc comments. + * In general, borderless tables should not be used for layout purposes. + * + * plain: + * Plain borders around table and cells, vertical margins, styled caption. + * Best for small tables or for complex tables for tables with cells that span + * rows and columns, when the "striped" style does not work well. + * + * striped: + * Borders around the table and vertical borders between cells, striped rows, + * vertical margins, styled caption. + * Best for tables that have a header row, and a body containing a series of simple rows. + */ + +table.borderless, +table.plain, +table.striped { + margin-top: 10px; + margin-bottom: 10px; +} +table.borderless > caption, +table.plain > caption, +table.striped > caption { + font-weight: bold; + font-size: smaller; +} +table.borderless th, table.borderless td, +table.plain th, table.plain td, +table.striped th, table.striped td { + padding: 2px 5px; +} +table.borderless, +table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th, +table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td { + border: none; +} +table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr { + background-color: transparent; +} +table.plain { + border-collapse: collapse; + border: 1px solid black; +} +table.plain > thead > tr, table.plain > tbody tr, table.plain > tr { + background-color: transparent; +} +table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th, +table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td { + border: 1px solid black; +} +table.striped { + border-collapse: collapse; + border: 1px solid black; +} +table.striped > thead { + background-color: #E3E3E3; +} +table.striped > thead > tr > th, table.striped > thead > tr > td { + border: 1px solid black; +} +table.striped > tbody > tr:nth-child(even) { + background-color: #EEE +} +table.striped > tbody > tr:nth-child(odd) { + background-color: #FFF +} +table.striped > tbody > tr > th, table.striped > tbody > tr > td { + border-left: 1px solid black; + border-right: 1px solid black; +} +table.striped > tbody > tr > th { + font-weight: normal; +} +/** + * Tweak font sizes and paddings for small screens. + */ +@media screen and (max-width: 1050px) { + #search-input { + width: 300px; + } +} +@media screen and (max-width: 800px) { + #search-input { + width: 200px; + } + .top-nav, + .bottom-nav { + font-size: 11px; + padding-top: 6px; + } + .sub-nav { + font-size: 11px; + } + .about-language { + padding-right: 16px; + } + ul.nav-list li, + .sub-nav .nav-list-search { + padding: 6px; + } + ul.sub-nav-list li { + padding-top: 5px; + } + main { + padding: 10px; + } + .summary section[class$="-summary"], .details section[class$="-details"], + .class-uses .detail, .serialized-class-details { + padding: 0 8px 5px 8px; + } + body { + -webkit-text-size-adjust: none; + } +} +@media screen and (max-width: 500px) { + #search-input { + width: 150px; + } + .top-nav, + .bottom-nav { + font-size: 10px; + } + .sub-nav { + font-size: 10px; + } + .about-language { + font-size: 10px; + padding-right: 12px; + } +} diff --git a/Quellcodes/alg_ds_graphentester/doc/type-search-index.js b/Quellcodes/alg_ds_graphentester/doc/type-search-index.js new file mode 100644 index 0000000..cf46c33 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/doc/type-search-index.js @@ -0,0 +1 @@ +typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"control","l":"Controller"},{"p":"control","l":"EditTabMitController"},{"p":"graph","l":"Graph"},{"p":"algorithmen","l":"GraphAlgo"},{"p":"algorithmen","l":"GraphAlgo_BellmanFord"},{"p":"algorithmen","l":"GraphAlgo_Breitensuche"},{"p":"eigeneAlgorithmen","l":"GraphAlgo_Coloring_Schueler"},{"p":"algorithmen","l":"GraphAlgo_ColoringBacktracking"},{"p":"algorithmen","l":"GraphAlgo_ColoringGreedy"},{"p":"algorithmen","l":"GraphAlgo_ColoringGreedyRandom"},{"p":"algorithmen","l":"GraphAlgo_Dijkstra"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetBacktracking"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGenetisch"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyA"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyB"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyC"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyD"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyE"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyF"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyG"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyH"},{"p":"algorithmen","l":"GraphAlgo_DominatingSetGreedyI"},{"p":"algorithmen","l":"GraphAlgo_EulerkreisExistenz"},{"p":"algorithmen","l":"GraphAlgo_Moore"},{"p":"algorithmen","l":"GraphAlgo_MST_Kruskal"},{"p":"algorithmen","l":"GraphAlgo_MST_Prim"},{"p":"algorithmen","l":"GraphAlgo_Tiefensuche"},{"p":"algorithmen","l":"GraphAlgo_TiefensucheRek"},{"p":"algorithmen","l":"GraphAlgo_toplogischeSortierung"},{"p":"algorithmen","l":"GraphAlgo_TSPBacktracking"},{"p":"algorithmen","l":"GraphAlgo_TSPGenetisch"},{"p":"algorithmen","l":"GraphAlgo_TSPGreedy"},{"p":"algorithmen","l":"GraphAlgo_TSPGreedy2"},{"p":"algorithmen","l":"GraphAlgo_TSPGreedyOpt"},{"p":"algorithmen","l":"GraphAlgo_ZyklusBacktracking"},{"p":"graph","l":"GraphElement"},{"p":"","l":"GraphenTester"},{"p":"graph","l":"GraphOptions"},{"p":"graph","l":"GraphPlotter"},{"p":"control","l":"HauptTabMitController"},{"p":"graph","l":"Hilfe"},{"p":"control","l":"Hilfefenster"},{"p":"imp","l":"HSB"},{"p":"graph","l":"Kante"},{"p":"graph","l":"Knoten"},{"p":"imp","l":"NumberField"},{"p":"imp","l":"Picture"},{"p":"imp","l":"PictureViewer"},{"p":"control","l":"SimulationTabMitController"},{"p":"imp","l":"Table"},{"p":"imp","l":"TableRow"},{"p":"control","l":"TabMitController"},{"p":"control","l":"UnterTabMitController"},{"p":"imp","l":"XML"}] \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/doc/type-search-index.zip b/Quellcodes/alg_ds_graphentester/doc/type-search-index.zip new file mode 100644 index 0000000..45eaa6f Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/doc/type-search-index.zip differ diff --git a/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/GraphAlgo_Coloring_Schueler.java b/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/GraphAlgo_Coloring_Schueler.java new file mode 100644 index 0000000..e6e8822 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/GraphAlgo_Coloring_Schueler.java @@ -0,0 +1,58 @@ +package eigeneAlgorithmen; + + + +import java.util.List; +import java.nio.file.*; + +import graph.*; +import algorithmen.*; + +/** + * Dieser Algorithmus färbt einen Graphen, so dass keine benachbarten Knoten + * die gleiche Farbe haben und möglichst wenige Farben benutzt werden. + * Algorithmus: Beispieldatei, in der Schüler den Algorithmus selbst umsetzen können + * + * @version 1.0 from 10.12.2020 + * @author Thomas Schaller + */ + +public class GraphAlgo_Coloring_Schueler extends GraphAlgo { + + Graph gr; + + public String getBezeichnung() { + return "Greedy-Coloring (toDo)"; + } + + // Ende Attribute + + // Anfang Methoden + public void fuehreAlgorithmusAus() { + gr = getGraph(); + getStartKnoten().setFarbe(3); + + // Hole alle Knoten vom Graph g + + // Schleife über alle Knoten + + // Erzeuge Liste (Größe #Knoten +1) in der die Farben der adjazenten Knoten abgehakt werden. Die Farben + // sind von 1 bis n (# Knoten) kodiert und werden spaeter in Farben decodiert + + // Hole alle Nachbarknoten vom aktuellen Knoten + + // Gehe alle Nachbarn durch und markiere die Farben des Knoten in dem Array farbenliste[] als benutzt + + // suche die erste Position (>0) aus der Farbliste, die noch nicht benutzt wurden und faerbe den Knoten k mit dieser Farbe (setze den Farbwert des Knotens auf die Position im Array) + + // Unterbreche die Ausführung + step(); + + // Ende der Schleife über alle Knoten + + } + + // Ende Methoden + +} + diff --git a/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/GraphAlgo_Dijkstra_Eigener.java b/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/GraphAlgo_Dijkstra_Eigener.java new file mode 100644 index 0000000..55aaedf --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/GraphAlgo_Dijkstra_Eigener.java @@ -0,0 +1,34 @@ +package eigeneAlgorithmen; + +import java.util.List; +import java.nio.file.*; + +import graph.*; +import algorithmen.*; + +/** + * Beschreibung des Algos + * + * @version 1.0 from ??? + * @author Schueler + */ + +public class GraphAlgo_Dijkstra_Eigener extends GraphAlgo { + + Graph gr; + + public String getBezeichnung() { + return "02_Dijkstra_Eigener"; + } + + public void fuehreAlgorithmusAus() { + gr = getGraph(); + //# Hier kommt dein Quelltext zum loesen des Graphenproblems hin: + + //# Schreibe Text in das Hilfefenster: + info("Hilfetext"); + + //# Unterbreche die Ausführung: + step(); + } +} \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/package.bluej b/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/package.bluej new file mode 100644 index 0000000..76ea15d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/eigeneAlgorithmen/package.bluej @@ -0,0 +1,34 @@ +#BlueJ package file +objectbench.height=66 +objectbench.width=776 +package.divider.horizontal=0.599476439790576 +package.divider.vertical=0.8537074148296593 +package.editor.height=419 +package.editor.width=654 +package.editor.x=565 +package.editor.y=369 +package.frame.height=600 +package.frame.width=800 +package.numDependencies=0 +package.numTargets=2 +package.showExtends=true +package.showUses=true +readme.height=60 +readme.name=@README +readme.width=49 +readme.x=10 +readme.y=10 +target1.height=50 +target1.name=GraphAlgo_Dijkstra_Eigener +target1.showInterface=false +target1.type=ClassTarget +target1.width=220 +target1.x=140 +target1.y=80 +target2.height=50 +target2.name=GraphAlgo_Coloring_Schueler +target2.showInterface=false +target2.type=ClassTarget +target2.width=220 +target2.x=140 +target2.y=20 diff --git a/Quellcodes/alg_ds_graphentester/graph/Graph.java b/Quellcodes/alg_ds_graphentester/graph/Graph.java new file mode 100644 index 0000000..2f104bf --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/Graph.java @@ -0,0 +1,807 @@ +package graph; +import imp.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +/** + * Dies ist das Herz vom "GraphTester" - der Graph selber, gepeichert als Adjazenzliste. + * Die Klasse erlaubt durch geeignete Methoden: + * - die Speicherung als Adjazenzmatrix, + * - das Hinzufuegen und Loeschen von knoten und Kanten, + * - das Markieren von Knoten und Kanten, + * - eine Aussage darueber, ob Knoten oder Kanten enthalten sind und + * - eine Ausgabe des Graphen in textueller Form sowie als csv-Datei. + * + * + * @author Dirk Zechnall, Thomas Schaller + * @version 31.01.2021 (v6.5) + */ + +public class Graph +{ + + private ArrayList kList; // Liste aller Knoten + private ArrayList kaList; // Liste aller Kanten + private ArrayList> adList; //Adjazenzliste + private boolean gerichtet; + private boolean gewichtet; + + /** + * Der Konstruktor erstellt einen neuen Graphen (genauer eine neue Adjazenzliste) + * @param isGerichtet gibt an, ob es sich um einen gerichteten Graphen handelt + * @param isGewichtet gibt an, ob die Kanten gewichtet sind. + */ + public Graph (boolean isGerichtet, boolean isGewichtet) { + loescheGraph(); + gerichtet = isGerichtet; + gewichtet = isGewichtet; + } + + /** + * Der Konstruktor erstellt einen neuen ungerichteten, ungewichteten Graphen (genauer eine neue Adjazenzliste) + */ + public Graph() { + loescheGraph(); + } + + /** + * Löscht alle Knoten und Kanten eines Graphen und stellt auf ungerichtet und ungewichtet zurück. + */ + public void loescheGraph() { + gerichtet = false; + gewichtet = false; + kList = new ArrayList(); + kaList = new ArrayList(); + adList = new ArrayList>(); + } + + /** + * Ein Graph wird aus einer csv-Datei erstellt, die entweder + * eine Matrix oder eine Adjazenzliste enthält, die den Graph beschreibt. + * + * @param csvParser Eine CSV-Datei als Table-Objekt + * @return gibt zurück, ob das Laden erfolgreich war + */ + public boolean ladeGraph(Table csvParser) { + boolean geschafft = false; + try { + int knotenAnzahl = 0; + boolean hasInfotext = false; + boolean hasStatus = false; + geschafft = true; + int start; + int posx = 0; + + for(start = 0; start < csvParser.getRowCount(); start++) { + TableRow row = csvParser.getRow(start); + String m = row.getString(0); + if(row.getString(0).equals("directed")) { + setGerichtet(row.getInt(1) == 1); + } + if(row.getString(0).equals("weighted")) { + setGewichtet(row.getInt(1) == 1); + } + if(row.getString(0).equals("matrix") || row.getString(0).equals("list")) { + String n = row.getString(1); + if(n.equals("infotext")) { + hasInfotext = true; + posx++; + + } + break; + } + } + + // Knoten erstellen + for(int i=start+1; i < csvParser.getRowCount(); i++) { + TableRow row = csvParser.getRow(i); + if(row.getString(0).isEmpty() || row.getString(0).charAt(0) != '#') { + Knoten k = new Knoten(row.getInt(posx), row.getInt(posx+1)); + if(hasInfotext) k.setInfotext(row.getString(0)); + + neuerKnoten(k); + knotenAnzahl++; + } + } + + // Kanten erstellen + int k=0; + if(csvParser.getString(start,0).equals("matrix")){ + + for(int i = start+1; i < csvParser.getRowCount(); i++) { + TableRow row = csvParser.getRow(i); + if(row.getString(0).isEmpty() || row.getString(0).charAt(0) != '#') { //Ueberpruefung auf Kommentare # + for(int j = posx+2; j < row.getColumnCount(); j+=1) { + if(!(row.getString(j).equals("-"))) { + neueKante(getKnoten(k), getKnoten(j - 2 -posx), row.getDouble(j)); + } + } + k++; + } + } + + } else { + + for(int i = start+1; i < csvParser.getRowCount(); i++) { + + TableRow row = csvParser.getRow(i); + if(row.getString(0).isEmpty() || row.getString(0).charAt(0) != '#') { // Ueberpruefung auf Kommentare # + int z = row.getColumnCount(); + z++; + + for(int j = posx+2; j < row.getColumnCount(); j+= 1) { + if(isGewichtet()){ + neueKante(getKnoten(k), getKnoten(row.getInt(j)), row.getDouble(j + 1)); + j++; + } else { + neueKante(getKnoten(k), getKnoten(row.getInt(j)), 0); + } + + } + k++; + } + } + } + + } catch(Exception e) { + geschafft=false; + } + return geschafft; + } + + /** + * Legt fest, ob der Graph gewichtet oder ungewichtet ist. + * + * @param isGewichtet neuer Wert + */ + public void setGewichtet(boolean isGewichtet) { + gewichtet = isGewichtet; + } + + /** + * Gibt zurueck, ob der Graph gewichtet oder ungewichtet ist + * + * @return gewichtet? (true/false) + */ + public boolean isGewichtet() { + return gewichtet; + } + + /** + * Legt fest, ob der Graph gerichtet oder ungerichtet ist. + * + * @param isGerichtet neuer Wert + */ + public void setGerichtet(boolean isGerichtet) { + gerichtet = isGerichtet; + if(gerichtet) { + for(Kante k: kaList) { + adList.get(kList.indexOf(k.getZiel())).remove(k); + } + } + + } + + /** + * Gibt zurueck, ob der Graph gerichtet oder ungerichtet ist. + * + * @return gerichtet? (true/false) + */ + public boolean isGerichtet() { + return gerichtet; + } + + /** Gibt die Nummer eines Knotens im Graphen zurück + * @param k gesuchter Knoten + * @return Nummer des Knotens (mit 0 beginnend) + */ + public int getNummer(Knoten k) { + return kList.indexOf(k); + } + + /** Gibt die Nummer einer Kante zurück + * @param k gesuchte Kante + * @return Nummer der Kante (mit 0 beginnend) + */ + public int getNummer(Kante k) { + return kaList.indexOf(k); + } + + /** + * Die Methode getAdjazenzMatrix() gibt die Adjazenzmatrix zurueck. + * + * @return double[][] Die AdjazenzMatrix als zweidimensionales Array + */ + public double[][] getAdjazenzMatrix() { + double[][] matrix = new double[getAnzahlKnoten()][getAnzahlKnoten()]; + for (int i=0; i hat jedoch einen deutlich groeßeren Speicheraufwand! + if(gewichtet) matrix[startKnotenNummer][zielKnotenNummer] = k.getGewicht(); + else matrix[startKnotenNummer][zielKnotenNummer] = 0; + + } + return matrix; + } + + /** + * Gibt eine Liste aller Kanten des Graphen zurück. + * @param filter optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()} + * @return Liste aller Kanten + */ + public List getAlleKanten(Predicate... filter) { + List kanten = new ArrayList(kaList); + if(filter.length>0) { + kanten = kanten.stream() // convert list to stream + .filter(filter[0]) + .collect(Collectors.toCollection(ArrayList::new)); + } + return kanten; + } + + /** + * Entfernt die Markierung bei allen Knoten des Graphen. + */ + public void entferneMarkierungBeiAllenKnoten() { + for (Knoten k : kList) { + k.setMarkiert(false); + } + } + + /** + * Initialisiert alle Knoten des Graphen. + */ + public void initialisiereAlleKnoten() { + for (Knoten k : kList) { + k.init(); + } + } + + /** + * Initialisiert alle Kanten des Graphen. + */ + public void initialisiereAlleKanten() { + for (Kante k: kaList) { + k.init(); + } + } + + /** + * Ueberprueft, ob ein Knoten in der Knotenliste enthalten ist. + * Sobald in der Knotenliste der Knoten k gefunden wird, wird true ausgegeben. + * + * @param k Der gesuchte Knoten + * @return true= ist enthalten, false = ist nicht enthalten + */ + public boolean isKnotenEnthalten (Knoten k) { + return kList.contains(k); + } + + /** + * Gibt die Anzahl der Knoten im Graph zurueck + * + * @return Anzahl der Knoten + */ + public int getAnzahlKnoten() { + return kList.size(); + } + + /** + * Gibt eine Liste aller Knoten des Graphen zurueck. + * @param filter optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()} + * @return Die Knotenliste. Falls leer wird eine leere Liste zurueckgegeben + */ + public List getAlleKnoten(Predicate... filter) { + List knoten = new ArrayList(); + knoten.addAll(kList); + if(filter.length>0) { + knoten = knoten.stream() // convert list to stream + .filter(filter[0]) + .collect(Collectors.toCollection(ArrayList::new)); + } + return knoten; + } + + /** + * Gibt die Liste aller Nachbarknoten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + * + * @param k Der Knoten, zu dem die Adjazenzliste gesucht wird + * @param filter optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()} + * @return Liste der Nachbarknoten + */ + public List getNachbarknoten (Knoten k, Predicate... filter) { + if(kList.contains(k)) { + List nachbarn = new ArrayList(); + for (Kante e : adList.get(kList.indexOf(k))) { + nachbarn.add(e.getAnderesEnde(k)); + } // end of for + if(filter.length>0) { + nachbarn = nachbarn.stream() // convert list to stream + .filter(filter[0]) + .collect(Collectors.toCollection(ArrayList::new)); + } + return nachbarn; + } else { + return null; + } + } + + /** + * Gibt eine Liste der ausgehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + * Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + * unterschieden. + * + * @param k Der Knoten, zu dem die Kanten gesucht werden + * @param filter optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()} + * @return Liste der ausgehenden Kanten. + */ + public List getAusgehendeKanten (Knoten k, Predicate... filter) { + if(kList.contains(k)) { + List kanten = new ArrayList(); + kanten.addAll(adList.get(kList.indexOf(k))); + if(filter.length>0) { + kanten = kanten.stream() // convert list to stream + .filter(filter[0]) + .collect(Collectors.toCollection(ArrayList::new)); + } + return kanten; + } else { + return null; + } + } + + /** + * Gibt eine Liste der ausgehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + * Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + * unterschieden. + * + * @param knotennr Nummer des Knoten, zu dem die Kanten gesucht werden + * @param filter optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()} + * @return Liste der ausgehenden Kanten. + */ + public List getAusgehendeKanten (int knotennr, Predicate... filter) { + if(knotennr < getAnzahlKnoten()) { + List kanten = new ArrayList(); + kanten.addAll(adList.get(knotennr)); + if(filter.length>0) { + kanten = kanten.stream() // convert list to stream + .filter(filter[0]) + .collect(Collectors.toCollection(ArrayList::new)); + } + return kanten; + } else { + return null; + } + } + + /** + * Gibt eine Liste der eingehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + * Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + * unterschieden. + * + * @param knotennr Die Nummer des Knotens, zu dem die Kanten gesucht werden + * @param filter optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()} + * @return Liste der eingehenden Kanten. + */ + public List getEingehendeKanten (int knotennr, Predicate... filter) { + if(knotennr >= getAnzahlKnoten()) { + return null; + } + return getEingehendeKanten(this.getKnoten(knotennr),filter); + } + + /** + * Gibt eine Liste der eingehenden Kanten eines Knotens k zurueck, falls k in der Knotenliste vorhanden ist. + * Bei ungerichteten Graphen wird nicht zwischen eingehenden und ausgehenden Kanten + * unterschieden. + * + * @param k Knoten, zu dem die Kanten gesucht werden + * @param filter optionaler Filter, der auf die Liste angewendet wird. Er muss einen boolean-Wert zurückgeben: z.B. @literal{k->k.isMarkiert() && k.isBesucht()} + * @return Liste der eingehenden Kanten. + */ + + public List getEingehendeKanten (Knoten k, Predicate... filter) { + if(!kList.contains(k)) { + return null; + } + List kanten = new ArrayList(); + if(this.isGerichtet()) { + for (Kante e: kaList) { + if(e.getZiel()== k) { + kanten.add(e); + } + } // end of for + } else { + kanten = getAusgehendeKanten(k); + } // end of if-else + + if(filter.length>0) { + kanten = kanten.stream() // convert list to stream + .filter(filter[0]) + .collect(Collectors.toCollection(ArrayList::new)); + } + + return kanten; + } + + /** + * Liefert einen Knoten des Graphen + * @param knotennr Nummer der Knoten (beginnend mit 0) + * @return liefert den Knoten mit dieser Nummer + */ + public Knoten getKnoten(int knotennr) { + if(knotennr < getAnzahlKnoten()) { + return kList.get(knotennr); + } else { + return null; + } + } + + /** + * Fügt einen Knoten dem Graph hinzu. + * @param k Der Knoten, der hinzugefuegt werden soll + */ + public void neuerKnoten (Knoten k) { + if (!isKnotenEnthalten(k)){ + kList.add(k); + adList.add(new ArrayList()); + k.setGraph(this); + } + } + + /** + * Entfernt einen Knoten aus dem Graphen + * + * @param knotennr Nummer des Knotens, der geloescht werden soll + */ + public void entferneKnoten (int knotennr) { + entferneKnoten(getKnoten(knotennr)); + } + + /** + * Entfernt einen Knoten aus dem Graphen + * + * @param k Knoten, der geloescht werden soll + * @return gibt zurück, ob der Knoten erfolgreich entfernt wurde. + */ + + public boolean entferneKnoten (Knoten k) { + if (!kList.contains(k)) return false; + + int index = kList.indexOf(k); + for (List a : adList) { + int index2 = 0; + while(index2 < a.size()){ + Kante ka = a.get(index2); + if(ka.getStart()==k || ka.getZiel()==k){ + if(kaList.contains(ka)) kaList.remove(ka); + a.remove(index2); + } else { + index2++; + } + } + } + adList.remove(index); + kList.remove(k); + k.setGraph(null); + + return true; + } + + /** + * Ueberprueft, ob eine Kante im Graphen enthalten ist. + * + * @param e Die zu suchende Kante + * @return Kante enthalten (true) oder nicht (false) + */ + public boolean isKanteEnthalten (Kante e) { + return kaList.contains(e); + } + + /** + * Ueberprueft, ob eine Kante im Graphen enthalten ist. + * In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden + * + * @param startNr Nummer des Startknotens + * @param zielNr Nummer des Zielknotens + * @return boolean Kante enthalten (true) oder nicht (false) + */ + public boolean isKanteEnthalten (int startNr, int zielNr) { + return getKante(startNr, zielNr)!=null; + } + + /** + * Ueberprueft, ob eine Kante im Graphen enthalten ist. + * In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden + * + * @param start Startknoten + * @param ziel Zielknoten + * @return boolean Kante enthalten (true) oder nicht (false) + */ + + public boolean isKanteEnthalten (Knoten start, Knoten ziel) { + return getKante(start, ziel)!=null; + } + + /** + * Gibt eine gesuchte Kante aus dem Graphen zurueck. + * In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden + * + * @param start Der StartKnoten + * @param ziel Der StartKnoten + * @return Die gesuchte Kante + */ + public Kante getKante (Knoten start, Knoten ziel) { + + for(Kante k: adList.get(kList.indexOf(start))) { + if(k.getStart()==start && k.getZiel() == ziel) { + return k; + } + if(!gerichtet && k.getStart()==ziel && k.getZiel() == start) { + return k; + } + } + return null; + } + + /** + * Gibt eine gesuchte Kante aus dem Graphen zurueck. + * In ungerichteten Graphen wird nicht zwischen Start- und Zielknoten unterschieden + * + * @param startnr Der Nummer des StartKnoten + * @param zielnr Die Nummer des Zielknoten + * @return Die gesuchte Kante + */ + public Kante getKante (int startnr, int zielnr) { + return getKante(getKnoten(startnr), getKnoten(zielnr)); + } + + /** + * Fuegt eine Kante dem Graphen hinzu. + * Dabei wird ueberprueft, ob die Kante schon im Graphen enthalten ist. + * + * Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" erstellt. + * + * @param e Die Kante, die hinzugefuegt werden soll + */ + public void neueKante(Kante e) { + adList.get(kList.indexOf(e.getStart())).add(e); + if(!gerichtet) adList.get(kList.indexOf(e.getZiel())).add(e); + kaList.add(e); + e.setGraph(this); + } + + /** + * Fuegt eine Kante dem Graphen hinzu. + * Dabei wird ueberprueft, ob die Kante schon im Graphen enthalten ist. + * + * Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" erstellt. + * + * @param start Der StartKnoten der Kante, die hinzugefuegt werden soll + * @param ziel Der ZielKnoten der Kante, die hinzugefuegt werden soll + * @param gewicht Das Gewicht der Kante, die hinzugefuegt werden soll + */ + public void neueKante(Knoten start, Knoten ziel, double gewicht) { + if(!kList.contains(start) || !kList.contains(ziel) || getKante(start,ziel) != null) return; + neueKante(new Kante(start,ziel, gewicht)); + } + + /** + * Entfernt eine Kante aus dem Graphen. + * Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" entfernt. + * + * @param e Die zu entfernende Kante + */ + public void entferneKante (Kante e) { + entferneKante(e.getStart(), e.getZiel()); + + } + + /** + * Entfernt eine Kante aus dem Graphen. + * Dabei wird ueberprueft, ob die Kante ueberhaupt im Graphen enthalten ist. + * + * Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" entfernt. + * + * @param start StartKnotens + * @param ziel ZielKnotens + */ + public void entferneKante (Knoten start, Knoten ziel) { + Kante e1 = getKante(start, ziel); + Kante e2 = getKante(ziel, start); + + for(List a: adList) { + a.remove(e1); + if(!gerichtet) { + a.remove(e2); + } + } + kaList.remove(e1); + e1.setGraph(null); + if(!gerichtet) { + kaList.remove(e2); + e2.setGraph(null); + } + } + + /** + * Entfernt eine Kante aus dem Graphen. + * Ist der Graph ungerichtet, werden sowohl "Hin-" und "RueckKante" entfernt. + * + * @param startnr Nummer des StartKnotens + * @param zielnr Nummer des ZielKnotens + */ + public void entferneKante (int startnr, int zielnr) { + entferneKante(getKnoten(startnr), getKnoten(zielnr)); + } + + /** + * Ueberprueft, ob die Adjazenzliste leer ist, d.h. keine Knoten im Graphen enthalten sind. + * + * @return true, wenn die Liste leer ist, sonst false + */ + public boolean isLeer() { + return adList.isEmpty(); + } + + /** + * Loescht den gesamten Graphen + */ + public void loescheAlles() { + for(Kante k : kaList) k.setGraph(null); + for(Knoten k : kList) k.setGraph(null); + adList.clear(); + kList.clear(); + kaList.clear(); + } + + /** + * Die Methode erstellt eine CSV-Ausgabe des Graphen entweder als Adjazenzliste oder als Adjazenzmatrix. + * + * @param asMatrix true, falls die CSV-Ausgabe eine AdjazenzMatrix sein soll, sonst false + * @return CSV-Ausgabe + */ + + public String toCSVString(boolean asMatrix) { + String s=""; + //if(adList.isLeer()) return s; + s += "# gewichtet 1, ungewichtet 0\n"; + s += "weighted,"+(isGewichtet() ? "1" : "0")+"\n"; + s += "# gerichtet 1, ungerichtet 0\n"; + s += "directed,"+(isGerichtet() ? "1" : "0")+"\n"; + + // Kontrollieren, ob irgendwo ein Infotext vorhanden ist. + boolean hasInfotext = false; + for(Knoten k: kList) { + if(!k.getInfotext().equals("")) hasInfotext = true; + } + + if(asMatrix){ + s += "# Der Graph liegt hier in Form einer Adjazenzmatrix vor. \n"; + s += "# Jede Zeile steht fuer einen Knoten, durch Kommas getrennt stehen die Kantengewicht zu jedem anderen Knoten.\n"; + + s += "matrix"; + if(hasInfotext) s+=",infotext"; + double[][] matrix = getAdjazenzMatrix(); + // hier muss ueberprueft werden, ob matrixinhalt ist NaN --> '-' speichern + for (int i=0; i a = adList.get(knr); + if(hasInfotext) s+=k.getInfotext()+","; + s+=(k.getX())+","+(k.getY()); + if (a.size()>0) s+=","; + for (Kante ka : a) { + s+=""+(getNummer(ka.getAnderesEnde(k))); + if (isGewichtet()) s+=","+ka.getGewicht(); + if (a.get(a.size()-1)!=ka) s+=","; + } + } + } + return s; + } + + /** + * Textuelle Repraesentation des Graphen. + * + * @return Der Graph als Stringrepraesentation + */ + @Override + public String toString() { + String s=""; + s+="Adjazenzliste:\n"; + if(adList.isEmpty()) return "Liste ist leer!\n"; + for(int i=0; i< kList.size(); i++) { + s+="K"+i+kList.get(i).toString()+": "; + List a =adList.get(i); + for (Kante k : a) { + s+=k.toString()+"K"+(kList.indexOf(k.getAnderesEnde(kList.get(i))))+" | "; + } + s=s.substring(0,s.length()-3)+"\n"; + } + return s; + } + + /** + * Konsolenausgabe der textuellen Repraesentation des Graphen. + */ + public void ausgabe() { + System.out.println(toString()); + } + + /** + * Info über einen Knoten zurückgeben + * @param k Knoten, des Info ermittelt werden soll + * @param zeigeWert Soll der Wert des Knoten in der Info enthalten sein + * @return Infotext oder Nummer des Knoten und ggf. sein Wert + */ + public String getKnoteninfo(Knoten k, boolean zeigeWert) { + String info = ""; + if (!k.getInfotext().equals("")) { + info += k.getInfotext(); + } else { + info += "Knoten Nr. "+getNummer(k); + } + if( zeigeWert) { + info += " (Wert "+k.getDoubleWert()+")"; + } + return info; + } + + /** Speichert den Zustand des Graphen als String-List + * @return List mit Zustand + */ + public List getStatus() { + List status = new ArrayList(); + for(Knoten k : getAlleKnoten()) { + status.add(k.getStatus()); + } + for(Kante k : getAlleKanten()) { + status.add(k.getStatus()); + } + return status; + } + + /** Stellt den Zustand des Graphen aus String-List wieder her + * @param status List mit Zustand + */ + public void setStatus(List status) { + int i=0; + for(Knoten k : getAlleKnoten()) { + k.setStatus(status.get(i++)); + } + for(Kante k : getAlleKanten()) { + k.setStatus(status.get(i++)); + } + + } +} diff --git a/Quellcodes/alg_ds_graphentester/graph/Graph.uml b/Quellcodes/alg_ds_graphentester/graph/Graph.uml new file mode 100644 index 0000000..10d13d4 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/Graph.uml @@ -0,0 +1,16 @@ +[Diagram] +comments=0 +OffsetX=0 +OffsetY=0 +Visibility=0 +ShowParameter=4 +SortOrder=0 +ShowIcons=0 +ShowConnections=0 +Fontname=Segoe UI +Fontsize=10 +ShowObjectDiagram=0 + +[Interactive] +I0= + diff --git a/Quellcodes/alg_ds_graphentester/graph/GraphElement.java b/Quellcodes/alg_ds_graphentester/graph/GraphElement.java new file mode 100644 index 0000000..e96d0fb --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/GraphElement.java @@ -0,0 +1,229 @@ +package graph; +import java.util.HashMap; +import java.util.List; +import java.util.Arrays; + +/** + * Die Klasse GraphElement ist eine Oberklasse von Knoten und Kanten. + * Sie ist nur für die interne Verarbeitung wichtig. + * + * @author Thomas Schaller + * @version 28.02.2023 (v7.0) + * v7.0: Die am Element gespeicherten Informationen werden in einer Hashmap gespeichert. Daher können beliebige weitere Informationen abgelegt werden. + * Es wird auch gespeichert, als welcher Typ die Information übergeben wurde. + */ +public abstract class GraphElement implements Comparable +{ + protected HashMap daten; + protected HashMap typen; + protected Graph g; + protected String sortierKriterium; + + public GraphElement() { + daten = new HashMap(); + typen = new HashMap(); + } + + /** + * Setzt den Status einer Kante, der in einem String gespeichert ist. + * Form: markiert,geloescht,farbe + * Dabei sind markiert und geloescht boolsche Werte (0 = false, 1 = true) und + * die farbe eine Zahl + * @param status Statusstring + */ + public void setStatus(String status) { + List items = Arrays.asList(status.split("\\s*,\\s*")); + for(int i=0; i< items.size(); i++) { + String[] pair = items.get(i).split(":"); + daten.put(pair[0], pair[1]); + } + } + + /** + * Liefert den Status einer Kante als String. + * Form: markiert,geloescht,farbe + * Dabei sind markiert und geloescht boolsche Werte (0 = false, 1 = true) und + * die farbe eine Zahl + * @return Statusstring + */ + public String getStatus() { + String s = ""; + for (String i : daten.keySet()) { + s = s + ","+i+":"+daten.get(i); + } + s = s.substring(1); + return s; + } + + + /** Setzt das Sortierkriterium des Knoten/der Kante. + * @param name Bezeichnung des Wertes nach dem sortiert werden soll + */ + public void setSortierkriterium(String name) { + sortierKriterium = name; + } + + /** Gibt die Beschreibung des Knoten / der Kante als Kurztext für die Anzeige im + * Kreis bzw. Kasten zurück. Dabei wird jeder Eintrag der Liste als eigene Zeile + * dargestellt. Es werden nur die Werte angezeigt. Es sind max. 2 Zeilen zulässig. + * @param namen Namen der Werte, die im Kurztext angezeigt werden sollen. + */ + public abstract List getKurztext(String[] namen); + + /** Gibt die Beschreibung des Knoten / der Kante als Langtext für die Anzeige im + * Tooltip-Fenster zurück. Dabei wird jeder Eintrag der Liste als eigene Zeile + * dargestellt. Es wird jeweils die Bezeichnung und der Wert ausgegeben. + * @param namen Namen der Werte, die im Tooltip angezeigt werden sollen. + */ + public abstract List getLangtext(String[] namen); + + /** Speichert den Graphen, in den Knoten/Kante eingefügt wurde. Damit kann er selbst seine Nummer + * ermitteln. + * @param g Graph + */ + public void setGraph(Graph g) { + this.g = g; + } + + /** Speichert zusätzliche Daten am Knoten oder der Kante + * @param name Bezeichnung der Art der Daten + * @param wert Wert der zu speichernden Daten + */ + public void set(String name, String wert) { + wert = wert.replaceAll(":", ""); + wert = wert.replaceAll(",", ""); + daten.put(name.toLowerCase(), wert); + typen.put(name.toLowerCase(), "String"); + } + + /** Speichert zusätzliche Daten am Knoten oder der Kante + * Double.POSITIVE_INFINITY bzw. NEGATIVE_INFINITY wird als +/- unendlich dargestellt + * @param name Bezeichnung der Art der Daten + * @param wert Wert der zu speichernden Daten + */ + public void set(String name, double wert) { + if(wert == Double.POSITIVE_INFINITY) { + daten.put(name.toLowerCase(), "\u221e"); + + } else { + if(wert == Double.NEGATIVE_INFINITY) { + daten.put(name.toLowerCase(), "-\u221e"); + + } else { + if((int) wert == wert) { + daten.put(name.toLowerCase(), ""+(int) wert); + } else { + daten.put(name.toLowerCase(), ""+wert); + } + } + } + typen.put(name.toLowerCase(), "Number"); + } + + /** Speichert zusätzliche Daten am Knoten oder der Kante + * Integer.MAX_VALUE bzw. MIN_VALUE werden als +/- unendlich dargestellt. + * @param name Bezeichnung der Art der Daten + * @param wert Wert der zu speichernden Daten + */ + public void set(String name, int wert) { + typen.put(name.toLowerCase(), "Number"); + + if(wert == Integer.MAX_VALUE) { + daten.put(name.toLowerCase(), "\u221e"); + return; + } + if(wert == Integer.MIN_VALUE) { + daten.put(name.toLowerCase(), "-\u221e"); + return; + } + daten.put(name.toLowerCase(), ""+wert); + } + + /** Speichert zusätzliche Daten am Knoten oder der Kante + * @param name Bezeichnung der Art der Daten + * @param wert Wert der zu speichernden Daten + */ + public void set(String name, boolean wert) { + typen.put(name.toLowerCase(), "Boolean"); + daten.put(name.toLowerCase(), ""+wert); + } + + /** Gibt zusätzliche Daten als String zurück + * @param name Bezeichnung der zusätzlichen Daten + * @return Wert von "name" oder "", wenn name nicht gespeichert ist + */ + public String getString(String name) { + if(daten.containsKey(name.toLowerCase())) { + return daten.get(name.toLowerCase()); + } else { + return ""; + } + } + + /** Gibt zusätzliche Daten als int zurück + * @param name Bezeichnung der zusätzlichen Daten + * @return Wert von "name" oder 0, wenn name nicht gespeichert ist oder keine Zahl ist + */ + public int getInt(String name) { + try{ + if(daten.get(name.toLowerCase()).equals("\u221e")) return Integer.MAX_VALUE; + if(daten.get(name.toLowerCase()).equals("-\u221e")) return Integer.MIN_VALUE; + return Integer.parseInt(daten.get(name.toLowerCase())); + } catch(Exception e) { + return 0; + } + } + + /** Gibt zusätzliche Daten als int zurück + * @param name Bezeichnung der zusätzlichen Daten + * @return Wert von "name" oder 0, wenn name nicht gespeichert ist oder keine Zahl ist + */ + public double getDouble(String name) { + try{ + if(daten.get(name.toLowerCase()).equals("\u221e")) return Double.POSITIVE_INFINITY; + if(daten.get(name.toLowerCase()).equals("-\u221e")) return Double.NEGATIVE_INFINITY; + return Double.parseDouble(daten.get(name.toLowerCase())); + } catch(Exception e) { + return 0.0; + } + } + + /** Gibt zusätzliche Daten als int zurück + * @param name Bezeichnung der zusätzlichen Daten + * @return Wert von "name" oder false, wenn name nicht gespeichert ist oder kein Boolean ist + */ + public boolean getBoolean(String name) { + try{ + return Boolean.parseBoolean(daten.get(name.toLowerCase())); + } catch(Exception e) { + return false; + } + } + + /** Vergleicht den Knoten/Kante mit einem anderen Knoten/Kante bezüglich seines Sortierkriteriums + * Das Sortierkriterium ist normalerweise der "Wert", kann aber mit setSortierkriterium gesetzt werden. + * @param e anderer Knoten + * @return kleiner 0 der andere Knoten hat einen größeren Wert, größer 0 der andere Knoten hat einen kleineren Wert, gleich 0 beide sind gleich + */ + public int compareTo(GraphElement e) { + double w1, w2; + String s1 = sortierKriterium.toLowerCase(); + String s2 = e.sortierKriterium.toLowerCase(); + if(!typen.get(s1).equals(e.typen.get(s2))) return 0; + + if(typen.get(s1).equals("String")){ + return getString(s1).compareTo(e.getString(s2)); + } + if(typen.get(s1).equals("Number")){ + return (int) (getDouble(s1) - e.getDouble(s2)); + } + if(typen.get(s1).equals("Boolean")){ + if(getBoolean(s1) == e.getBoolean(s2)) return 0; + if(getBoolean(s1)) return 1; else return -1; + } + + return 0; + } + + +} diff --git a/Quellcodes/alg_ds_graphentester/graph/GraphOptions.java b/Quellcodes/alg_ds_graphentester/graph/GraphOptions.java new file mode 100644 index 0000000..f20477e --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/GraphOptions.java @@ -0,0 +1,190 @@ +package graph; +import imp.*; +import java.util.Arrays; + +/** + * Die Klasse GraphOptions speichert, wie ein Graph in einem Fenster vom + * GraphPlotter angezeigt wird. + * + * @author Thomas Schaller + * @version v7.0 (28.02.2023) + * v7.0 Angezeigte Informationen bei Knoten/Kanten können ausgewählt werden + * + */ +public class GraphOptions +{ + // Graph + Graph g; + + // Bild + public String bildDatei = ""; + public boolean bildAnzeigen = false; + + // Anzeigeeinstellungen + public int vertexSize = 30; + public boolean showEdgeWeights = true; + public boolean showVertexValue = true; + public boolean showVertexText = false; + public boolean showVertexInfo = false; + + // Welche Informationen sollen bei Knoten und Kanten angezeigt werden + public String[] kanteKurztext; + public String[] kanteLangtext; + public String[] knotenKurztext = {"Wert"}; + public String[] knotenLangtext = {"Infotext","Wert","Markiert","Besucht"}; + + // Speicheroption + public boolean saveAsMatrix = false; + + // Farben der Anzeige + public String[] stdFarbenKnoten = {"D0D0D0", "ACFFAB", "ACFFED", "ACC5ED", "ACC582", "E5C582", "E5C5C2", "D19FFD", "FF9F8E","FF6158", "FF61D4", "FFDE6E", "770000", "007700", "000077", "777700", "77a0e0", "9912E4", "783410", "12a94e"}; + public String[] stdFarbenKanten = {"606060", "5080FF", "D0D0D0"}; + public String[] farbenKnoten = stdFarbenKnoten; + public String[] farbenKanten = stdFarbenKanten; + + // Auswahl der anzuzeigenden Knoten + public int fokusArt = 0; // 0 = Knoten, 1 = Kanten + public GraphElement parent = null; + public int auswahl = 0; // 0 = alle, 1 = Nachbarn, 2 = Single + + public GraphOptions(Graph g) { + this.g = g; + if(g.isGewichtet()) { + kanteKurztext = new String[]{"Gewicht"}; + kanteLangtext = new String[]{"Gewicht","Markiert","Gelöscht"}; + } else { + kanteKurztext = new String[]{}; + kanteLangtext = new String[]{"Markiert","Gelöscht"}; + } + } + + public void ladeGraph(Table csvParser) { + farbenKnoten = stdFarbenKnoten; + farbenKanten = stdFarbenKanten; + vertexSize = 30; + + showEdgeWeights = true; + showVertexText = true; + showVertexValue = false; + showVertexInfo = false; + bildDatei = ""; + + fokusArt = 0; // 0 = Knoten, 1 = Kanten + parent = null; + auswahl = 0; + + for(int i = 0; i < csvParser.getRowCount(); i++) { + TableRow row = csvParser.getRow(i); + + if(row.getString(0).equals("showWeights")) { + showEdgeWeights = (row.getInt(1) == 1); + } + if(row.getString(0).equals("showInfoText")) { + showVertexInfo = (row.getInt(1) == 1); + } + + if(row.getString(0).equals("vertexSize")) { + vertexSize = row.getInt(1); + } + if(row.getString(0).equals("vertexStyle")) { + showVertexText = (row.getInt(1) == 1); + showVertexValue = (row.getInt(1) == 2); + } + if(row.getString(0).equals("image")) { + if(row.getString(1).charAt(0) == '0'){ + bildDatei = ""; + bildAnzeigen = false; + } else { + bildDatei = row.getString(1); + bildAnzeigen = true; + } + } + if(row.getString(0).equals("vertexColor")) { + farbenKnoten = Arrays.copyOfRange(csvParser.getStringRow(i), 1, row.getColumnCount()); + } + if(row.getString(0).equals("edgeColor")) { + farbenKanten = Arrays.copyOfRange(csvParser.getStringRow(i), 1, row.getColumnCount()); + } + if(row.getString(0).equals("matrix") || row.getString(0).equals("list")) { + if(row.getString(0).equals("matrix")) + saveAsMatrix = true; + else + saveAsMatrix = false; + break; + } + + } + } + + public String getText() { + String gesamtText = "# Anzeigeoptionen:"; + gesamtText += "# Gewichte anzeigen 1, Gewichte nicht anzeigen 0\n"; + if(showEdgeWeights) + gesamtText += "showWeights,1\n"; + else + gesamtText += "showWeights,0\n"; + if(vertexSize != 30) { + gesamtText += "# Größe der Knoten\n"; + gesamtText += "vertexSize,"+vertexSize+"\n"; + } + gesamtText += "# Knoteninfo anzeigen 1,Knoteninfo nicht anzeigen 0\n"; + if(showVertexInfo) + gesamtText += "showInfoText,1\n"; + else + gesamtText += "showInfoText,0\n"; + + gesamtText += "# Knoten leer 0, Knotenname anzeigen 1, Wert des Knoten anzeigen 2\n"; + if(!showVertexText && !showVertexValue) gesamtText += "vertexStyle,0\n"; + else { + if(showVertexText) gesamtText += "vertexStyle,1\n"; + else + gesamtText += "vertexStyle,2\n"; + } + if(farbenKanten!=stdFarbenKanten) { + gesamtText += "# Kantenfarben: RGB-Hexcode (z.B. FF0000) oder invisible\n"; + gesamtText += "# Reihenfolge: normale Kanten, markierte Kanten, gelöschte Kanten\n"; + gesamtText += "edgeColor"; + for(String f : farbenKanten) gesamtText+=","+f; + gesamtText += "\n"; + } + if(farbenKnoten!=stdFarbenKnoten) { + gesamtText += "# Knotenfarben: RGB-Hexcode (z.B. FF0000) oder invisible\n"; + gesamtText += "# Reihenfolge: nichts, markiert, besucht, besucht und markiert\n"; + gesamtText += "# mind. 12 Farben müssen angegeben werden."; + gesamtText += "vertexColor"; + for(String f : farbenKnoten) gesamtText+=","+f; + gesamtText += "\n"; + } + gesamtText += "# Bild im Hintergrund (bitte im \"images\"-Ordner ablegen) --> Dateiname angeben. Fall kein Bild bitte 0 schreiben!\n"; + if(bildDatei.equals("")) + gesamtText += "image,0\n"; + else + gesamtText += "image,"+bildDatei + "\n"; + return gesamtText; + } + + public GraphOptions copy() { + GraphOptions kopie = new GraphOptions(g); + kopie.bildDatei= bildDatei; + kopie.bildAnzeigen = bildAnzeigen; + kopie.vertexSize = vertexSize; + kopie.showEdgeWeights = showEdgeWeights; + kopie.showVertexValue = showVertexValue; + kopie.showVertexText = showVertexText; + kopie.showVertexInfo = showVertexInfo; + kopie.saveAsMatrix = saveAsMatrix; + kopie.stdFarbenKnoten = stdFarbenKnoten.clone(); + kopie.stdFarbenKanten = stdFarbenKanten.clone(); + kopie.farbenKnoten = farbenKnoten.clone(); + kopie.farbenKanten = farbenKanten.clone(); + kopie.fokusArt = fokusArt; + kopie.auswahl = auswahl; + kopie.parent = parent; + kopie.kanteKurztext = kanteKurztext.clone(); + kopie.knotenKurztext = knotenKurztext.clone(); + kopie.kanteLangtext = kanteLangtext.clone(); + kopie.knotenLangtext = knotenLangtext.clone(); + return kopie; + } + +} diff --git a/Quellcodes/alg_ds_graphentester/graph/GraphPlotter.java b/Quellcodes/alg_ds_graphentester/graph/GraphPlotter.java new file mode 100644 index 0000000..eb933f9 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/GraphPlotter.java @@ -0,0 +1,678 @@ +package graph; + +import imp.*; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.SimpleBooleanProperty; +import java.awt.Graphics2D; + +import javafx.geometry.Point2D; +import javafx.geometry.Pos; +import javafx.scene.input.MouseEvent; +import javafx.scene.input.MouseButton; +import java.nio.file.*; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import javafx.scene.control.Tooltip; +import javafx.util.Duration; +import javafx.animation.AnimationTimer; +import java.awt.image.*; + +import org.apache.commons.io.FileUtils; +/** + * Der GraphPlotter ist das Herzstueck der Visualisierung und dient als Schnittstelle zur GUI. + * + * @author Thomas Schaller + * @version 07.02.2023 (v7.0) + * v6.9: Context-Menü schließt, wenn an andere Stelle geklickt wird + * v7.0: MouseOver - Infos für Knoten und Kanten, Infos können ausgewählt werden. + * + */ +public class GraphPlotter extends PictureViewer { + // Anfang Attribute + private Graph graph; + private GraphOptions options; + + private boolean multiselect = false; + private boolean editable = false; + private ArrayList selected=new ArrayList(); + private Knoten dragKnoten = null; + private int dragMode = 0; + + // Tooltip + private double mouseX, mouseY; + private Tooltip t; + + private GraphElement restrictTo = null; + private Point2D offset = new Point2D(0,0); + + private ObjectProperty mouseLocation = new SimpleObjectProperty(new Point2D(0, 0)); + private BooleanProperty mouseMoving = new SimpleBooleanProperty(); + + // private JTextArea jTAMeldungen = new JTextArea(""); + // private JScrollPane jTAMeldungenScrollPane = new JScrollPane(jTAMeldungen); + + // Ende Attribute + + /** + * Der Konstruktor legt sowohl Einstellungen des mxGraphen (Drag&Drop, Editable, ...) als auch des Graphen (gewichtet, gerichtet, ...) fest. + * + * @param boolean isDirected Gibt an, ob der Graph gerichtet oder ungerichtet ist + * @param boolean isWeighted Gibt an, ob der Graph gewichtet oder ungewichtet ist + * @param String hintergrundBild Gibt den Namen eines Hintergrundbildes an + */ + public GraphPlotter() { + graph = new Graph(); + options = new GraphOptions(graph); + + this.setStyle("-fx-background:#FFFFE8"); + + // add(jTAMeldungenScrollPane, BorderLayout.SOUTH); + setOnMouseClicked(mouseEvent -> mouseClicked(mouseEvent)); + this.widthProperty().addListener((value, oldWidth, newWidth) -> updateImage()); + this.heightProperty().addListener((value, oldWidth, newWidth) -> updateImage()); + + setOnMouseMoved(e -> mouseLocation.set(new Point2D(e.getSceneX(), e.getSceneY()))); + mouseMoving.addListener((obs, wasMoving, isNowMoving) -> { + updateImage(); + }); + + AnimationTimer timer = new AnimationTimer() { + private double lastMouseX ; + private double lastMouseY ; + long lastMouseMovement ; + long MIN_STATIONARY_TIME = 2000; + @Override + public void handle(long timestamp) { + double x = mouseLocation.get().getX(); + double y = mouseLocation.get().getY(); + if (Math.abs(lastMouseX-x) > 5 || Math.abs(lastMouseY-y)>5) { + lastMouseMovement = timestamp ; + lastMouseX = x; + lastMouseY = y; + } + + mouseMoving.set(timestamp - lastMouseMovement < MIN_STATIONARY_TIME); + + } + }; + timer.start(); + + } + + public void setEditable() { + editable = true; + //setOnMousePressed(mouseEvent -> mouseDown(mouseEvent)); // wird durch MousePressed in EditTab realisiert und dann hier aufgerufen + setOnMouseReleased(mouseEvent -> mouseUp(mouseEvent)); + setOnDragDetected(mouseEvent -> startFullDrag()); + setOnMouseDragOver(mouseEvent-> mouseDragged(mouseEvent)); + setOnMouseClicked(null); + } + + public void setGraph(Graph graph, GraphOptions options) { + this.graph = graph; + this.options = options; + updateImage(); + } + + public void setRestrictTo(GraphElement k) { + if(restrictTo != k) { + restrictTo = k; + selected.clear(); + if (k!= null) selected.add(k); + updateImage(); + } + } + + public GraphElement getRestrictTo() { + return restrictTo; + } + + public void mouseClicked(MouseEvent mouseEvent) { + + Point2D local = this.getContent().sceneToLocal(mouseEvent.getSceneX(), mouseEvent.getSceneY()); + GraphElement k = getKnotenAt((int) local.getX(), (int) local.getY()); + if(k!=null && mouseEvent.isShiftDown() && restrictTo != null && restrictTo instanceof Knoten) { // mit Shift-Knotenklick Kante auswählen, damit unsichtbare Kanten gewählt werden können (für TSP) + k = graph.getKante((Knoten) restrictTo, (Knoten) k); + } + if(k!=null && mouseEvent.isShiftDown() && selected.size() == 1 && selected.get(0) instanceof Knoten) { // mit Shift-Knotenklick Kante auswählen, damit unsichtbare Kanten gewählt werden können (für TSP) + k = graph.getKante((Knoten) (selected.get(0)), (Knoten) k); + } + if(k==null) k = getKanteAt((int) local.getX(), (int) local.getY()); + if(!multiselect) { + selected.clear(); + } + if(k != null) { + if(selected.contains(k)) selected.remove(k); + else selected.add(k); + } + updateImage(); + } + + public void mouseDown(MouseEvent mouseEvent) { + + if(mouseEvent.isPrimaryButtonDown()) { + Point2D local = this.getContent().sceneToLocal(mouseEvent.getSceneX(), mouseEvent.getSceneY()); + dragKnoten = getKnotenAt((int) local.getX(), (int) local.getY()); + dragMode = 3; // Linksclick aber nicht auf Knoten + if(dragKnoten != null) { + mouseEvent.setDragDetect(true); + double distance = Math.sqrt(Math.pow(local.getX()-dragKnoten.getX(),2)+Math.pow(local.getY()-dragKnoten.getY(),2)); + if(distance < options.vertexSize/4) + dragMode = 1; // Knoten verschieben + else + dragMode = 2; // Kante ziehen + } + } + } + + public void mouseDragged(MouseEvent mouseEvent) { + + if(dragKnoten != null) { + Point2D local = this.getContent().sceneToLocal(mouseEvent.getSceneX(), mouseEvent.getSceneY()); + if(dragMode == 1) { + dragKnoten.setX((int) (local.getX())); + dragKnoten.setY((int) (local.getY())); + } + updateImage(); + if(dragMode == 2) { + Picture p = getImage(); + p.stroke(0); + p.strokeWeight(3); + //p.line(dragKnoten.getX(), dragKnoten.getY(), (int) local.getX(), (int) local.getY()); + drawArrow(p,dragKnoten.getX(), dragKnoten.getY(), (int) local.getX(), (int) local.getY()); + setImage(p,false); + } + } + } + + public void mouseUp(MouseEvent mouseEvent) { + + Point2D local = this.getContent().sceneToLocal(mouseEvent.getSceneX(), mouseEvent.getSceneY()); + Knoten k = getKnotenAt((int) local.getX(), (int) local.getY()); + if(dragMode == 3 && k==null && getKanteAt((int) local.getX(), (int) local.getY())==null) { // neuer Knoten + if(getContextMenu() == null) { + graph.neuerKnoten(new Knoten((int)local.getX(), (int) local.getY())) ; + } else { setContextMenu(null); } + } else { + if(dragMode == 2 && k != null && k != dragKnoten) { + graph.neueKante(dragKnoten, k, 0.0); + } + } + dragKnoten = null; + dragMode = 0; + mouseEvent.setDragDetect(false); + updateImage(); + + } + + private Knoten getKnotenAt(int x, int y) { + List knoten = graph.getAlleKnoten(); + if(restrictTo != null) { + knoten.clear(); + if(restrictTo instanceof Knoten) { + knoten = graph.getNachbarknoten((Knoten) restrictTo); + knoten.add((Knoten) restrictTo); + } + if(restrictTo instanceof Kante) { + knoten.add(((Kante) restrictTo).getStart()); + knoten.add(((Kante) restrictTo).getZiel()); + } + + } + + for(Knoten k : knoten) { + if(Math.sqrt(Math.pow(k.getX()-x,2)+Math.pow(k.getY()-y,2)) < options.vertexSize/2+1) { + return k; + } + } + return null; + } + + private Kante getKanteAt(int x, int y) { + List kanten = graph.getAlleKanten(); + if(restrictTo != null) { + kanten.clear(); + if(restrictTo instanceof Knoten) { + kanten = graph.getAusgehendeKanten((Knoten) restrictTo); + } + if(restrictTo instanceof Kante) { + kanten.add(((Kante) restrictTo)); + } + + } + + for (Kante k: kanten) { + if (x>=Math.min(k.getStart().getX(), k.getZiel().getX())-2 && + x<=Math.max(k.getStart().getX(), k.getZiel().getX())+2 && + y>=Math.min(k.getStart().getY(), k.getZiel().getY())-2 && + y<=Math.max(k.getStart().getY(), k.getZiel().getY())+2) { + double startX = k.getStart().getX(); + double startY = k.getStart().getY(); + double endX = k.getZiel().getX(); + double endY = k.getZiel().getY(); + double dy = (endY-startY); + double dx = (endX-startX); + double l = Math.sqrt(dx*dx+dy*dy); + dy = dy /l; dx = dx / l; + startX += dx * (options.vertexSize/2+1); + startY += dy * (options.vertexSize/2+1); + endX -= dx * (options.vertexSize/2+1); + endY -= dy * (options.vertexSize/2+1); + double dx2 = dy*5; + double dy2 = -dx*5; + if (graph.isGerichtet() && graph.getKante(k.getZiel(), k.getStart())!=null){ + startX += dx2; + startY += dy2; + endX += dx2; + endY += dy2; + } + double nx = dy; + double ny = -dx; + double abx = x - startX; + double aby = y - startY; + double abs = Math.abs(abx*nx+aby*ny); + if (abs < 3) return k; + } + } + return null; + } + + private void drawArrow(Picture p, int startx, int starty, int endx, int endy) { + + double deltax = startx - endx; + double result; + + if (deltax == 0.0d) { + result = (starty > endy ? Math.PI / 2 : -Math.PI / 2); + } + else { + result = Math.atan((starty - endy) / deltax) + (startx < endx ? Math.PI : 0); + } + + double angle = result; + double arrowAngle = Math.PI / 8.0d; + double arrowSize = 10; + double x1 = arrowSize * Math.cos(angle - arrowAngle); + double y1 = arrowSize * Math.sin(angle - arrowAngle); + double x2 = arrowSize * Math.cos(angle + arrowAngle); + double y2 = arrowSize * Math.sin(angle + arrowAngle); + double cx = (arrowSize / 2.0f) * Math.cos(angle); + double cy = (arrowSize / 2.0f) * Math.sin(angle); + int x[] = {(int) endx, (int) (endx+x1), (int) (endx+x2), (int) endx}; + int y[] = {(int) endy, (int) (endy+y1), (int) (endy+y2), (int) endy}; + p.line(startx, starty, endx, endy); + p.polygon(x,y); + + } + + private String darker(String color) { + String red = color.substring(0, 2); + String green = color.substring(2,4); + String blue = color.substring(4,6); + long r = Long.parseLong(red,16)/2; + long g = Long.parseLong(green,16) /2; + long b = Long.parseLong(blue,16) / 2; + String sr = "0"+Long.toHexString(r); + String sg = "0"+Long.toHexString(g); + String sb = "0"+Long.toHexString(b); + return sr.substring(sr.length()-2)+sg.substring(sg.length()-2)+sb.substring(sb.length()-2); + } + + private String brighter(String color) { + String red = color.substring(0, 2); + String green = color.substring(2,4); + String blue = color.substring(4,6); + long r = (Long.parseLong(red,16)+255)/2; + long g = (Long.parseLong(green,16)) /2; + long b = (Long.parseLong(blue,16)) / 2; + String sr = "0"+Long.toHexString(r); + String sg = "0"+Long.toHexString(g); + String sb = "0"+Long.toHexString(b); + return sr.substring(sr.length()-2)+sg.substring(sg.length()-2)+sb.substring(sb.length()-2); + } + + private String format(double d) { + if((int) d == d) { + return ""+(int) d; + } else { + return ""+d; + } + } + + public Picture updateImage() { + Picture p = new Picture(2000,2000,"FFFFE8"); + Graphics2D g = (Graphics2D) p.getImage().getGraphics(); + + Knoten restrictToKnoten = null; + Kante restrictToKante = null; + if(restrictTo != null && restrictTo instanceof Knoten) restrictToKnoten = (Knoten) restrictTo; + if(restrictTo != null && restrictTo instanceof Kante) restrictToKante = (Kante) restrictTo; + + List knoten = graph.getAlleKnoten(); + List kanten = graph.getAlleKanten(); + + int maxx = Integer.MIN_VALUE; int maxy = Integer.MIN_VALUE; + int minx = Integer.MAX_VALUE; int miny = Integer.MAX_VALUE; + for(Knoten k: knoten) { + maxx = Math.max(maxx,k.getX()); + minx = Math.min(minx,k.getX()); + maxy = Math.max(maxy,k.getY()); + miny = Math.min(miny,k.getY()); + } + + if(restrictToKnoten != null) { + knoten = graph.getNachbarknoten(restrictToKnoten); + kanten = graph.getAusgehendeKanten(restrictToKnoten); + knoten.add(restrictToKnoten); + // this.getContent().setTranslateY(this.getHeight()/2-restrictToKnoten.getY()); + // this.getContent().setTranslateX(this.getWidth()/2-restrictToKnoten.getX()); + this.getContent().setTranslateY(1000-(restrictToKnoten.getY())); + this.getContent().setTranslateX(1000-(restrictToKnoten.getX())); + } else if (restrictToKante != null ) { + kanten.clear(); + kanten.add(restrictToKante); + knoten.clear(); + knoten.add(restrictToKante.getStart()); + knoten.add(restrictToKante.getZiel()); + // this.getContent().setTranslateY(this.getHeight()/2-restrictToKnoten.getY()); + // this.getContent().setTranslateX(this.getWidth()/2-restrictToKnoten.getX()); + this.getContent().setTranslateX(1000-(restrictToKante.getStart().getX()+restrictToKante.getZiel().getX())/2); + this.getContent().setTranslateY(1000-(restrictToKante.getStart().getY()+restrictToKante.getZiel().getY())/2); + } + else + { + /*this.getContent().setTranslateX(1000-(minx+maxx)/2); + this.getContent().setTranslateY(1000-(miny+maxy)/2);*/ + } + p.textMode(Picture.CENTER); + + if(options.bildAnzeigen && !options.bildDatei.isEmpty()) { + Picture p2 = new Picture("./images/"+options.bildDatei); + p.getImage().getGraphics().drawImage(p2.getImage(), 0, 0, null); + minx = options.vertexSize; + miny = options.vertexSize; + maxx = p2.getWidth()-options.vertexSize; + maxy = p2.getHeight()-options.vertexSize; + } + + // Zone in der Mitte markieren + if(restrictToKnoten!=null) { + p.fill("FFE8E8"); + p.stroke("FFE8E8"); + p.ellipse(restrictToKnoten.getX(), restrictToKnoten.getY(), options.vertexSize*2, options.vertexSize*2); + } + if(restrictToKante!=null) { + p.fill("FFE8E8"); + p.stroke("FFE8E8"); + p.strokeWeight(30); + p.line(restrictToKante.getStart().getX(), restrictToKante.getStart().getY(), restrictToKante.getZiel().getX(),restrictToKante.getZiel().getY()); + } + + for (Kante k : kanten) { + if (!options.farbenKanten[k.getFarbe()].equals("invisible") || selected.contains(k)) { + + double startX = k.getStart().getX(); + double startY = k.getStart().getY(); + double endX = k.getZiel().getX(); + double endY = k.getZiel().getY(); + double dy = (endY-startY); + double dx = (endX-startX); + double l = Math.sqrt(dx*dx+dy*dy); + dy = dy /l; dx = dx / l; + startX += dx * (options.vertexSize/2+1); + startY += dy * (options.vertexSize/2+1); + endX -= dx * (options.vertexSize/2+1); + endY -= dy * (options.vertexSize/2+1); + double dx2 = dy*5; + double dy2 = -dx*5; + if (graph.isGerichtet() && graph.getKante(k.getZiel(), k.getStart())!=null){ + startX += dx2; + startY += dy2; + endX += dx2; + endY += dy2; + } + + if(selected.contains(k)) { + p.stroke("FF0000"); + p.strokeWeight(4); + p.line((int) startX, (int) startY, (int) endX, (int) endY); + } + if (!options.farbenKanten[k.getFarbe()].equals("invisible")){ + p.stroke(options.farbenKanten[k.getFarbe()]); + p.fill(options.farbenKanten[k.getFarbe()]); + } + else + { + p.stroke("505050"); + p.fill("505050"); + } + + p.strokeWeight(2); + + if(graph.isGerichtet()) { + drawArrow(p, (int) startX, (int) startY, (int) endX, (int) endY); + } else { + p.line((int) startX, (int) startY, (int) endX, (int) endY); + } + } + } + for (Kante k : kanten) { + if (!options.farbenKanten[k.getFarbe()].equals("invisible") || selected.contains(k)) { + double startX = k.getStart().getX(); + double startY = k.getStart().getY(); + double endX = k.getZiel().getX(); + double endY = k.getZiel().getY(); + double dy = (endY-startY); + double dx = (endX-startX); + double l = Math.sqrt(dx*dx+dy*dy); + dy = dy /l; dx = dx / l; + startX += dx * (options.vertexSize/2+1); + startY += dy * (options.vertexSize/2+1); + endX -= dx * (options.vertexSize/2+1); + endY -= dy * (options.vertexSize/2+1); + double dx2 = dy*5; + double dy2 = -dx*5; + + if(graph.isGerichtet()) { + if (graph.getKante(k.getZiel(), k.getStart())!=null){ + startX += dx2; + startY += dy2; + endX += dx2; + endY += dy2; + } + + } + if(options.showEdgeWeights) { + + double my = (startY+startY+endY)/3; + double mx = (startX+startX+endX)/3; + + p.fill(255); + p.stroke(0); + p.strokeWeight(1); + + int lh = g.getFontMetrics().getAscent(); + List t = k.getKurztext(options.kanteKurztext); + if(t.size() == 1) { + p.rect((int) mx-15, (int) my-(lh+4)/2, 30, lh+4); + p.fill(0); + p.text(t.get(0), (int) mx, (int) my); + } + if(t.size() > 1) { + p.rect((int) mx-15, (int) my-(lh+2), 30, lh*2+4); + p.fill(0); + p.text(t.get(0), (int) mx, (int) my-lh/2); + p.text(t.get(1), (int) mx, (int) my+lh/2); + } + } + } + } + + for (Knoten k : knoten) { + + p.fill(options.farbenKnoten[k.getFarbe()]); + + p.stroke(darker(options.farbenKnoten[k.getFarbe()])); + p.strokeWeight(3); + p.ellipse(k.getX(), k.getY(), options.vertexSize, options.vertexSize); + if(selected.contains(k)) { + p.noFill(); + p.strokeWeight(2); + p.stroke(255,0,0); + p.ellipse(k.getX(), k.getY(), options.vertexSize+2, options.vertexSize+2); + } + + p.fill(0); + p.stroke(0); + p.strokeWeight(0); + p.textMode(Picture.CENTER); + if (options.showVertexText) { + p.text(""+graph.getNummer(k), k.getX(), k.getY()); + } else { + if (options.showVertexValue) { + List t = k.getKurztext(options.knotenKurztext); + if(t.size() == 1) { + p.text(t.get(0), k.getX(), k.getY()); + } else { + int lh = g.getFontMetrics().getAscent(); + p.text(t.get(0), k.getX(), k.getY()-lh/2); + p.text(t.get(1), k.getX(), k.getY()+lh/2); + } + } + } + + // Knotenbezeichnung + p.textMode(Picture.CORNER); + p.fill("000080"); + if(options.showVertexInfo && !k.getInfotext().equals("")) { + p.text(k.getInfotext(), k.getX()+options.vertexSize/2+5,k.getY()); + } + + } + // Tooltip anzeigen, aber nicht wenn im Editiermodus + if(!mouseMoving.get() && !editable) { + Point2D local = this.getContent().sceneToLocal(mouseLocation.get().getX(), mouseLocation.get().getY()); + + int x = (int) local.getX(); + int y = (int) local.getY(); + + // sowohl bei Kante wie auch Knoten + GraphElement k = getKnotenAt(x,y); + if(k == null) { k = getKanteAt(x,y);} + if(k != null) { + p.fill(200); + p.stroke(0); + p.strokeWeight(2); + + List t; + if(k instanceof Knoten) t = k.getLangtext(options.knotenLangtext); + else t = k.getLangtext(options.kanteLangtext); + + // Größe des Kastens berechnen + int w = 0; + int lh = g.getFontMetrics().getAscent(); + int h = t.size() * lh; + for(int i = 0; i w) w = w2; + } + + // Rechteck mit Text ausgeben + p.rect(x, y, w+16, h+10); + p.fill("303030"); + for(int i = 0; i getSelectedKnotenListe() { + List l = new ArrayList(); + for(GraphElement g : selected) { + if(g instanceof Knoten) l.add((Knoten) g); + } + return l; + } + + /** + * Gibt das selektierte Kantenobjekt zurueck. + * + * @return Object + */ + public Kante getSelectedKante() { + if(selected.size()==1 && selected.get(0) instanceof Kante) + return ((Kante) (selected.get(0))); + else + return null; + } + + /** + * Ueberschreibt die Methode toString. Eine String-Repraesentation des GraphPlotters wird ausgegeben. + * + * @return String Die String-Repraesentation des GraphPlotters + */ + public String toString() { + String s = ""; + if(graph.isGerichtet()) + s += "Gerichteter, "; + else + s += "Ungerichteter, "; + if(graph.isGewichtet()) + s += "gewichteter Graph mit Hintergrundbild: "; + else + s += "ungewichteter Graph mit Hintergrundbild: "; + if(options.bildDatei.equals("")) + s += " kein Bild!"; + else + s += options.bildDatei + "!"; + return s; + } + + /** + * Gibt die String-Repraesentation des GraphPlotters auf der Konsole aus. + */ + public void ausgabe() { + System.out.println(toString() + "\n"+graph.toString()); + } + // Ende Methoden +} diff --git a/Quellcodes/alg_ds_graphentester/graph/Hilfe.java b/Quellcodes/alg_ds_graphentester/graph/Hilfe.java new file mode 100644 index 0000000..116789d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/Hilfe.java @@ -0,0 +1,17 @@ +package graph; + + +public interface Hilfe { + + public abstract void loescheAlles(); + + public abstract void append(String text); + + public void indentMore() ; + + public void indentLess() ; + + public void setGraphPlotter(GraphPlotter gp); + + public void setReviewAllowed(boolean a); +} \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/graph/Kante.java b/Quellcodes/alg_ds_graphentester/graph/Kante.java new file mode 100644 index 0000000..94ec6c7 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/Kante.java @@ -0,0 +1,236 @@ +package graph; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; + +/** + * Die Klasse Kante beschreibt die Datenstruktur einer Kante, bestehend aus Startknoten, Gewicht und Zielknoten. + * Da Kanten innerhalb von Adjazenzlisten und -Matrizen repraesentiert werden, ist diese Klasse eigentlich unnoetig! + * Sie wurde zum Zweck der Vereinfachung - sozusagen als Zwischenspeicher von Kanten - eingefuehrt. + * Auch soll sie das Kantengewicht verwalten und Aufschluss darueber geben, ob sie gefaerbt/geloescht ist oder nicht. + * + * @author Dirk Zechnall, Thomas Schaller + * @version 28.02.2023 (v7.0) + * v7.0: Die Kanteninformationen werden in einer Hashmap gespeichert. Daher können beliebige weitere Informationen abgelegt werden. + + */ +public class Kante extends GraphElement +{ + private Knoten start; + private Knoten ziel; + + + /** + * Der Konstruktor erstellt eine neue Kante mit Start- und Zielknoten und Kantengewicht. + * Die Kante ist zu Beginn ungefaerbt. + * + * @param neuerStart Der neue Startknoten + * @param neuerZiel Der neue Zielknoten + * @param neuesGewicht Das neue Kantengewicht + */ + public Kante (Knoten neuerStart, Knoten neuerZiel, double neuesGewicht) { + super(); + set("Gewicht",neuesGewicht); + set("Markiert", false); + set("Gelöscht", false); + set("Farbe", -1); + setSortierkriterium("Gewicht"); + start = neuerStart; + ziel = neuerZiel; + } + + /** + * Die Methode init initialisiert die Kantenfaerbung (auf unmarkiert) + */ + protected void init() { + set("Markiert", false); + set("Gelöscht", false); + set("Farbe", -1); + } + + /** + * Liefert einen kurzen Text, der den Wert des Knotens angibt und innerhalb der Kreises + * des Knotens angezeigt werden kann. + * @return Array von Anzeigezeilen (dürfen max. 2 sein) + */ + public List getKurztext(String[] namen) { + int l = Math.min(namen.length,2); + List t = new ArrayList(); + for(int i = 0; i getLangtext(String[] namen) { + int l = namen.length; + List t = new ArrayList(); + + String symbol = "<->"; + if(g.isGerichtet()) symbol = "->"; + if(!start.getInfotext().equals("") && !ziel.getInfotext().equals("")) { + t.add(start.getInfotext()+" "+symbol+" "+ziel.getInfotext()); + } else { + t.add("Knoten Nr."+g.getNummer(start)+" "+symbol+" Knoten Nr."+g.getNummer(ziel)); + } + + for(int i = 0; i=0 && farbe < 20) + set("Farbe",farbe); + } + + /** + * Setzt die Farbe auf die Standardfarbgebung zurück + */ + + public void setStandardFarbe() { + setFarbe(-1); + } + + + + /** + * Die Methode ueberschreibt die Methode toString() und gibt die String-Raepraesentation einer Kante zurueck + * + * @return String-Raepraesentation der Kante + */ + @Override + public String toString() { + return " --("+getGewicht()+")--> "; + } + +} diff --git a/Quellcodes/alg_ds_graphentester/graph/Knoten.java b/Quellcodes/alg_ds_graphentester/graph/Knoten.java new file mode 100644 index 0000000..3df00cb --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/graph/Knoten.java @@ -0,0 +1,262 @@ +package graph; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; + +/** + * Diese Klasse Knoten definiert einen Knoten. + * Knoten haben eine Position, eine Farbe und einen Wert für sonstige Codierungszwecke und sind markiert und/oder besucht. + * Im Infotext kann eine zusätzliche Information für die Anzeige gespeichert werden. + * + * @author Dirk Zechnall, Thomas Schaller + * @version 28.02.2023 (v7.0) + * v7.0: Die Knoteninformationen werden in einer Hashmap gespeichert. Daher können beliebige weitere Informationen abgelegt werden. + */ +public class Knoten extends GraphElement +{ + + + private int x; + private int y; + + /** + * Der Konstruktor erstellt einen neuen Knoten mit einem neuen Namen + * + * @param x x-Position des Knotens + * @param y y-Position des Knotens + */ + public Knoten(int x, int y) { + this(x,y,0); + } + + /** + * Der Konstruktor erstellt einen neuen Knoten mit einem Startwert + * + * @param x x-Position des Knotens + * @param y y-Position des Knotens + * @param neuerWert Der neue Wert des Knotens + */ + public Knoten(int x, int y, double neuerWert) { + super(); + this.x = x; + this.y = y; + set("Wert",neuerWert); + set("Markiert", false); + set("Geloescht", false); + set("Farbe", -1); + setSortierkriterium("Wert"); + } + + /** + * Die Methode init initialisiert den Zustand eines Knotens + */ + protected void init() { + set("Wert", 0.0); + set("Farbe", -1); + set("Markiert", false); + set("Besucht", false); + } + + /** + * Liefert einen kurzen Text, der den Wert des Knotens angibt und innerhalb der Kreises + * des Knotens angezeigt werden kann. + * @return Array von Anzeigezeilen (dürfen max. 2 sein) + */ + public List getKurztext(String[] namen) { + int l = Math.min(namen.length,2); + List t = new ArrayList(); + for(int i = 0; i3) + t.add(text.substring(0,3)); + else + t.add(text); + } + return t; + } + + /** + * Liefert eine ausführliche Beschreibung der Werte des Knoten. Wird in dem Tooltext Fenster + * angezeigt, wenn man mit der Maus über den Knoten geht. + * @return Array von Anzeigezeilen + */ + public List getLangtext(String[] namen) { + int l = namen.length; + List t = new ArrayList(); + t.add("Knoten Nr. "+g.getNummer(this)); + for(int i = 0; i 0) { + g.setColor(pencolor); + g.setStroke(new BasicStroke((float) stroke)); + g.drawLine(x1, y1, x2, y2); + } + repaint(); + } + + /** + * Zeichnet ein Rechteck auf das Bild. + * Standardmaessig legen die ersten beiden Parameter die Position der linken oberen Ecke fest, der dritte die Breite und der vierte die Hoehe. + * Die Art und Weise, wie diese Parameter interpretiert werden, kann jedoch mit der Funktion {@link #rectMode(int) rectMode()} geaendert werden. + * Durch den Befehl {@link #fill(int,int,int) fill()} /{@link #noFill() noFill()} kann die Fuellfarbe des Rechtecks gewaehlt werden, durch {@link #stroke(int, int, int) stroke()}/{@link #noStroke() noStroke()} die Rahmenfarbe. + * @param a meist die x-Koordinate der linken oberen Ecke (kann durch rectMode() geaendert werden). + * @param b meist die y-Koordinate der linken oberen Ecke (kann durch rectMode() geaendert werden). + * @param c meist die Breite des Rechtecks (kann durch rectMode() geaendert werden). + * @param d meist die Hoehe des Rechtecks (kann durch rectMode() geaendert werden). + * + */ + public void rect(int a, int b, int c, int d) { + pushImage(); + Graphics2D g = (Graphics2D) image.getGraphics(); + int[] coord = {a,b,c,d}; + convert(coord, rectMode); + if(fillcolor != null) { + g.setColor(fillcolor); + g.fillRect(coord[0], coord[1], coord[2], coord[3]); + } + if(pencolor != null) { + g.setColor(pencolor); + g.setStroke(new BasicStroke((float) stroke)); + g.drawRect(coord[0], coord[1], coord[2], coord[3]); + } + repaint(); + } + + /** + * Zeichnet eine Ellipse/Kreis auf das Bild. + * Standardmaessig legen die ersten beiden Parameter die Position des Mittelpunkts fest, der dritte die Breite und der vierte die Hoehe. + * Die Art und Weise, wie diese Parameter interpretiert werden, kann jedoch mit der Funktion {@link #ellipseMode(int) ellipseMode()} geaendert werden. + * Durch den Befehl {@link #fill(int,int,int) fill()} /{@link #noFill() noFill()} kann die Fuellfarbe des Rechtecks gewaehlt werden, durch {@link #stroke(int, int, int) stroke()}/{@link #noStroke() noStroke()} die Rahmenfarbe. + * @param a meist die x-Koordinate des Mittelpunkts (kann durch ellipseMode() geaendert werden). + * @param b meist die y-Koordinate des Mittelpunkts (kann durch ellipseMode() geaendert werden). + * @param c meist die Breite des Rechtecks (kann durch ellipseMode() geaendert werden). + * @param d meist die Hoehe des Rechtecks (kann durch ellipseMode() geaendert werden). + * + */ + public void ellipse(int a, int b, int c, int d) { + pushImage(); + Graphics2D g = (Graphics2D) image.getGraphics(); + int[] coord = {a,b,c,d}; + convert(coord, ellipseMode); + if(fillcolor != null) { + g.setColor(fillcolor); + g.fillOval(coord[0], coord[1], coord[2], coord[3]); + } + if(pencolor != null) { + g.setColor(pencolor); + g.setStroke(new BasicStroke((float) stroke)); + g.drawOval(coord[0], coord[1], coord[2], coord[3]); + } + repaint(); + } + + /** + * Zeichnet ein Dreieck auf das Bild. + * Ein Dreieck ist eine Ebene, die durch die Verbindung von drei Punkten entsteht. Die ersten beiden Argumente spezifizieren den + * ersten Punkt, die mittleren beiden Argumente spezifizieren den zweiten Punkt und die letzten beiden Argumente spezifizieren den dritten Punkt. + * Durch den Befehl {@link #fill(int,int,int) fill()} /{@link #noFill() noFill()} kann die Fuellfarbe des Rechtecks gewaehlt werden, durch {@link #stroke(int, int, int) stroke()}/{@link #noStroke() noStroke()} die Rahmenfarbe. + * @param x1 meist die x-Koordinate des 1. Punkts. + * @param y1 meist die y-Koordinate des 1. Punkts. + * @param x2 meist die x-Koordinate des 2. Punkts. + * @param y2 meist die y-Koordinate des 2. Punkts. + * @param x3 meist die x-Koordinate des 3. Punkts. + * @param y3 meist die y-Koordinate des 3. Punkts. + */ + public void triangle(int x1, int y1, int x2, int y2, int x3, int y3) { + int px[] = {x1, x2, x3}; + int py[] = {y1, y2, y3}; + polygon(px, py); + } + + /** + * Zeichnet ein Viereck auf das Bild. + * Ein Viereck ist ein vierseitiges Polygon. Es ist aehnlich wie ein Rechteck, aber die Winkel zwischen seinen Kanten + * sind nicht auf neunzig Grad beschraenkt. Das erste Paar von Parametern (x1,y1) setzt den ersten Scheitelpunkt und die nachfolgenden + * Paare sollten im Uhrzeigersinn oder gegen den Uhrzeigersinn um die definierte Form herum verlaufen. + * Durch den Befehl {@link #fill(int,int,int) fill()} /{@link #noFill() noFill()} kann die Fuellfarbe des Rechtecks gewaehlt werden, durch {@link #stroke(int, int, int) stroke()}/{@link #noStroke() noStroke()} die Rahmenfarbe. + * @param x1 meist die x-Koordinate des 1. Punkts. + * @param y1 meist die y-Koordinate des 1. Punkts. + * @param x2 meist die x-Koordinate des 2. Punkts. + * @param y2 meist die y-Koordinate des 2. Punkts. + * @param x3 meist die x-Koordinate des 3. Punkts. + * @param y3 meist die y-Koordinate des 3. Punkts. + * @param x4 meist die x-Koordinate des 3. Punkts. + * @param y4 meist die y-Koordinate des 3. Punkts. + */ + public void quad(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { + int px[] = {x1, x2, x3, x4}; + int py[] = {y1, y2, y3, y4}; + polygon(px, py); + } + + /** + * Zeichnet ein Polygon auf das Bild. + * Gleich lange Listen von x und y-Koordinaten bestimmen die Eckpunkte des Polygons. + * Durch den Befehl {@link #fill(int,int,int) fill()} /{@link #noFill() noFill()} kann die Fuellfarbe des Rechtecks gewaehlt werden, durch {@link #stroke(int, int, int) stroke()}/{@link #noStroke() noStroke()} die Rahmenfarbe. + * @param x Liste der x-Koordinaten der Punkte. + * @param y Liste der y-Koordinaten der Punkte. + */ + + public void polygon(int[] x, int[] y) { + pushImage(); + Graphics2D g = (Graphics2D) image.getGraphics(); + + if(fillcolor != null) { + + g.setColor(fillcolor); + g.fillPolygon(x,y, y.length); + } + if(pencolor != null) { + g.setColor(pencolor); + g.setStroke(new BasicStroke((float) stroke)); + g.drawPolygon(x, y, x.length); + } + repaint(); + } + + /** + * Zeichnet einen Punkt, d.h. einen Kreis in der Dimension eines Pixels. + * Der erste Parameter ist der x-Wert fuer den Punkt, der zweite Wert ist der y-Wert fuer den Punkt. + * @param x x-Koordinate des Punktes + * @param y y-Koordinate des Punktes + */ + public void point(int x, int y) { + ellipse(x,y,1, 1); + } + + // ----------------------------------------- Schriftdarstellung ----------------------------------------------- + + /** + * Gibt einen Text an den gegebenen Koordinaten aus + * Zur Ausgabe des Textes wird der ausgewaehlte Font verwendet. Dieser muss vorher mit {@link #textFont(Font) textFont() } festgelegt. + * @param s Text, der angezeigt werden soll + * @param x x-Koordinate des Textanfangs + * @param y y-Koordinate der Grundlinie des Textes. + */ + public void text(String s, int x, int y) { + pushImage(); + Graphics2D g = (Graphics2D) image.getGraphics(); + if(pencolor != null) { + g.setColor(fillcolor); + g.setStroke(new BasicStroke((float) stroke)); + g.setFont(textfont); + if(textMode == CORNER) { + g.drawString(s, x, y); + } else { // textMode == CENTER + int dx = g.getFontMetrics().stringWidth(s)/2; + int dy = g.getFontMetrics().getAscent()/2; + g.drawString(s, x-dx, y+dy); + } + } + repaint(); + } + + /** + * Legt die Schriftart fuer Textausgaben fest. + * Jeder uebliche Java-Font kann verwendet werden. Er kann mit z.B. Font f = new Font( "Arial", Font.PLAIN, 14 ); definiert werden. + * @param font ein Font-Objekt + */ + public void textFont(Font font) { + this.textfont = font; + } + + // ----------------------------------------- Farbfestlegungen ----------------------------------------------- + /** + * Hilfsfunktion zur Interpretation von Farben + */ + private Color decode(String color) { + try{ + return new Color( + Integer.valueOf( color.substring( 0, 2 ), 16 ), + Integer.valueOf( color.substring( 2, 4 ), 16 ), + Integer.valueOf( color.substring( 4, 6 ), 16 ) ); + } catch (Exception e) { + System.out.println("Falscher Farbcode:"+color); + e.printStackTrace(); + return Color.BLACK; + } + } + + /** + * Hilfsfunktion zur Interpretation von Farben + */ + private Color decode(int color) { + try{ + if(color >=0 && color < 256) { + return new Color(color,color,color); + } else { + int r = color / 0x010000 % 0xFF; + int g = color / 0x000100 % 0xFF; + int b = color % 0xFF; + // System.out.println(""+r+","+g+","+b); + return new Color(r, g, b ); + } + } catch (Exception e) { + System.out.println("Falscher Farbcode:"+color); + e.printStackTrace(); + return Color.BLACK; + } + } + + /** + * Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden. + * Diese Farbe wird hexadezimal in Form der RGB angegeben: z.B. "CCFFAA" oder "004E23". Die Syntax verwendet sechs Ziffern - je zwei fuer die roten, gruenen und blauen Komponenten, + * um eine Farbe anzugeben (genau wie Farben typischerweise in HTML und CSS angegeben werden). + * @param pencolor Stiftfarbe in Hexadezimaldarstellung + */ + public void stroke(String pencolor) { + this.pencolor = decode(pencolor); + } + + /** + * Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden. + * Diese Farbe wird entweder als Graustufe (0-255) oder als 3-Byte RGB-Wert angegeben + * @param pencolor Stiftfarbe (0-255: Graustufe zwischen 0 schwarz und 255 weiss, sonst: c wird als 3-Byte RGB-Wert interpretiert) + */ + public void stroke(int pencolor) { + this.pencolor=decode(pencolor); + } + + /** + * Legt die Farbe fest, mit der Linien und Raender um Formen gezeichnet werden. + * Diese Farbe wird komponentenweise als RGB-Wert angegeben + * @param r Rotanteil (0-255) der Stiftfarbe + * @param g Gruenanteil (0-255) der Stiftfarbe + * @param b Blauanteil (0-255) der Stiftfarbe + */ + public void stroke(int r, int g, int b) { + this.pencolor = new Color(r,g,b); + } + + /** + * Legt fest, dass keine Linien oder Raender um Formen gezeichnet werden soll. + */ + public void noStroke() { + this.pencolor = null; + } + + /** + * Legt die Breite des Strichs fuer Linien, Punkte und den Rand um Formen fest. + * Alle Breiten werden in Pixeleinheiten angegeben. + * @param width Breite in Pixel + */ + public void strokeWeight(double width) { + this.stroke = width; + } + + /** + * Legt die Farbe fest, mit der Formen gefuellt werden. + * Diese Farbe wird hexadezimal in Form der RGB angegeben: z.B. "CCFFAA" oder "004E23". Die Syntax verwendet sechs Ziffern - je zwei fuer die roten, gruenen und blauen Komponenten, + * um eine Farbe anzugeben (genau wie Farben typischerweise in HTML und CSS angegeben werden). + * @param fillcolor Fuellfarbe in Hexadezimaldarstellung + */ + public void fill(String fillcolor) { + this.fillcolor = decode(fillcolor); + } + + /** + * Legt die Farbe fest, mit der Formen gefuellt werden. + * Diese Farbe wird entweder als Graustufe (0-255) oder als 3-Byte RGB-Wert angegeben. + * @param fillcolor Fuellfarbe (0-255: Graustufe zwischen 0 schwarz und 255 weiss, sonst: c wird als 3-Byte RGB-Wert interpretiert) + */ + public void fill(int fillcolor) { + this.fillcolor=decode(fillcolor); + } + + /** + * Legt die Farbe fest, mit der Formen gefuellt werden. + * Diese Farbe wird komponentenweise als RGB-Wert angegeben. + * @param r Rotanteil (0-255) der Fuellfarbe + * @param g Gruenanteil (0-255) der Fuellfarbe + * @param b Blauanteil (0-255) der Fuellfarbe + */ + public void fill(int r, int g, int b) { + this.fillcolor = new Color(r,g,b); + } + + /** Legt fest, dass die Formen nicht gefuellt werden sollen. + */ + public void noFill() { + this.fillcolor = null; + } + + /** + * Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird. Der Standardhintergrund ist hellgrau. + * Es ist nicht moeglich, den Alpha-Parameter Transparenz mit Hintergrundfarben auf der Hauptzeichnungsoberflaeche zu verwenden. + * @param c Farbe fuer den Hintergrund (0-255: Graustufe zwischen 0 schwarz und 255 weiss, sonst: c wird als 3-Byte RGB-Wert interpretiert) + */ + public void background(int c) { + if(c < 256) { + this.background=new Color(c,c,c); + } else { + int r = c / 0x010000; + int g = c / 0x000100 % 0xFF; + int b = c % 0xFF; + this.background= new Color(r, g, b ); + } + + this.clear(); + } + + /** + * Die Funktion background() setzt die Farbe, die fuer den Hintergrund des Bildes verwendet wird. Der Standardhintergrund ist hellgrau. + * Es ist nicht moeglich, den Alpha-Parameter Transparenz mit Hintergrundfarben auf der Hauptzeichnungsoberflaeche zu verwenden. + * @param r Rotanteil (0-255) der Hintergrundfarbe + * @param g Gruenanteil (0-255) der Hintergrundfarbe + * @param b Blauanteil (0-255) der Hintergrundfarbe + */ + public void background(int r, int g, int b) { + this.background=new Color(r,g,b); + this.clear(); + } + + // ----------------------------------------- Dateioperationen ----------------------------------------------- + /** + * Laedt ein Bild aus dem Dateisystem. + * Laedt ein Bild von einem Datentraeger und setzt Stiftfarbe und Fuellfarbe auf Standardwerte zurueck. + * @param filename Dateiname des Bildes + */ + public void load(String filename) { + try{ + this.image = ImageIO.read(new File(filename)); + this.background = decode("D0D0D0"); + this.pencolor = new Color(0,0,0); + this.fillcolor = null; + this.stroke = 1; + this.repaint(); + } catch(Exception e) { + System.out.println("Fehler beim Einlesen der Bilddatei"); + } + } + + /** + * Speichert ein Bild. + * Speichert ein Bild auf einem Datentraeger. Zulaessig sind die Dateiformate PNG und GIF. Die Dateiendung legt den Typ fest. + * Standardmaessig wird die Dateiendung .png ergaenzt, wenn keine angegeben ist. + * @param filename Dateiname des Bildes + */ + public void save(String filename) { + try{ + String[] fn = filename.split("\\."); + if (fn.length== 1) { + ImageIO.write(image, "PNG", new File(filename+".png")); + } else { + + if (fn.length == 2 && (fn[1].toUpperCase().equals("PNG") || + fn[1].toUpperCase().equals("GIF"))){ + ImageIO.write(image, fn[1], new File(filename)); + }else { + System.out.println("Unbekanntes Bildformat"); + } + } + } catch(Exception e) { + System.out.println("Fehler beim Speichern"); + } + } + + // ----------------------------------------- Sonstiges ----------------------------------------------- + /** + * Liefert das Bild als zweidimensionales Pixel-Array. + * @return zweidimensionales Array von Color-Objekten, die den Pixeln des Bildes entsprechen. + */ + + public Color[][] getPixelArray() { + Color[][] pixel = new Color[image.getWidth()][image.getHeight()]; + for(int x=0; x < image.getWidth(); x++){ + for(int y=0; y < image.getHeight(); y++) { + pixel[x][y] = new Color(image.getRGB(x,y)); + } + } + return pixel; + } + + /** + * Setzt das Bild neu auf Basis des Pixel-Arrays. + * Die Groesse des Bildes wird nicht automatisch an das Array angepasst. + * @param pixel zweidimensionales Array von Color-Objekten + */ + public void setPixelArray(Color[][] pixel) { + size(pixel.length,pixel[0].length); + Graphics2D g = (Graphics2D) image.getGraphics(); + for(int x=0; x < image.getWidth(); x++){ + for(int y=0; y < image.getHeight(); y++) { + g.setColor(pixel[x][y]); + g.fillRect(x, y, 1, 1); + } + } + repaint(); + } + + /** + * Hilfsfunktion zum Verzoegern der Ausgabe + * @param millis Wartezeit in Millisekunden + */ + public void delay(int millis) { + try{ + Thread.sleep(millis); + } catch(Exception e) { + System.out.println("Fehler beim Verzoegern der Ausgabe"); + } + } +} \ No newline at end of file diff --git a/Quellcodes/alg_ds_graphentester/imp/PictureViewer.java b/Quellcodes/alg_ds_graphentester/imp/PictureViewer.java new file mode 100644 index 0000000..b39164d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/imp/PictureViewer.java @@ -0,0 +1,207 @@ +package imp; + +/** + * Zeigt ein Bild in einem Scrollbereich an. + * Es ist möglich das Bild zu zoomen und mehrere Versionen des Bildes zu speichern, um eine "Rückgängig" Operation durchzuführen. + * @author Thomas Schaller + * @version 1.0 vom 01.02.2019 + */ + +import javafx.scene.control.ScrollPane; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.embed.swing.SwingFXUtils; +import java.util.Vector; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.WritableRaster; +import javafx.geometry.Pos; + +public class PictureViewer extends ScrollPane +{ + + // das aktuelle Bild + private Picture picture; + + // Bilder für den Züruck-Modus speichern + private static final int ANZ_BACK = 20; + private Vector history; + + // Zeichenfläche + private Image scrollImageIcon; + private ImageView imageLabel; + + // Zoom Faktor + private double zoomFactor; + public static final int FIT = -1; + public static final int NORMAL = 1; + + + + /** + * Erzeugt ein ScrollPanel mit integriertem Bild der Größe 1000x1000 + */ + public PictureViewer() { + this(1000,1000); + } + + /** + * Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe + * @param width Breite des Bildes + * @param height Höhe des Bildes + */ + public PictureViewer(int width, int height) { + this(width,height, "D0D0D0"); + } + + /** + * Erzeugt ein ScrollPanel mit integriertem Bild der angegebenen Größe + * @param width Breite des Bildes + * @param height Höhe des Bildes + * @param background Farbe des Hintergrunds als HEX-String (z.B. "FF3A45") + */ + public PictureViewer(int width, int height, String background) { + this(new Picture(width,height, background)); + } + + /** + * Erzeugt ein ScrollPanel mit integriertem Bild aus einer Bilddatei + * @param filename Name des Bildes + */ + public PictureViewer(String filename) { + this(new Picture(filename)); + } + + /** + * Erzeugt ein ScrollPanel und zeigt das Bild-Objekt an + * @param picture anzuzeigendes Bild + */ + public PictureViewer(Picture picture) + { + this.picture=picture; + + zoomFactor=1; + + scrollImageIcon = SwingFXUtils.toFXImage(picture.getImage(), null); + //new Image(picture.getImage().getScaledInstance(picture.getImage().getWidth(), picture.getImage().getHeight(), Image.SCALE_FAST)); + imageLabel = new ImageView(scrollImageIcon); + imageLabel.setPreserveRatio(true); + //imageLabel.setsetAlignment(Pos.TOP_CENTER); + //imageLabel.setHorizontalAlignment(JLabel.CENTER); + setContent(imageLabel); + +// this.setBorder(BorderFactory.createLineBorder(Color.black)); + picture.setObserver(this); + history = new Vector(); + + } + + + /** + * Setzt das anzuzeigende Bild neu + * @param picture anzuzeigendes Bild + * @param saveOldImage soll das aktuelle Bild in der Historie gespeichert werden + */ + public void setImage(Picture picture, boolean saveOldImage) { + if (saveOldImage) pushImage(); + this.picture = picture; + repaint(); + } + + /** + * Liefert das angezeigte Bild + * @return angezeigtes Bild + */ + public Picture getImage() { + return this.picture; + } + + + + + /** + * Erzeugt eine Kopie eines BufferedImage. + * @param Originalbild + * @return Kopie des Bildes + */ + private BufferedImage deepCopy(BufferedImage bi) { + ColorModel cm = bi.getColorModel(); + boolean isAlphaPremultiplied = cm.isAlphaPremultiplied(); + WritableRaster raster = bi.copyData(null); + return new BufferedImage(cm, raster, isAlphaPremultiplied, null).getSubimage(0, 0, bi.getWidth(), bi.getHeight()); + } + + + /** + * Speichert das übergebene Bild in der History. + * @param b zu speicherndes Bild + */ + public void pushImage() { + if( this.ANZ_BACK > 0) { + if(history.size() == this.ANZ_BACK) { + history.removeElementAt(0); + } + + history.add(deepCopy(picture.getImage())); + } + } + + /** + * Ruft das letzte abgespeicherte Bild aus der History wieder auf. + */ + public void back() { + int anz = history.size(); + if(anz>0) { + BufferedImage img = history.get(anz-1); + history.removeElementAt(anz-1); + picture.setImage(img); + repaint(); + } + } + + + + /** + * Setzt das angezeigt Bild neu und beachtet dabei den Zoomfaktor. + */ + public void repaint() { + if( picture != null) { + double factor= zoomFactor; + if (zoomFactor == FIT) { + double factorw = ((double) getWidth()-2) / picture.getWidth(); + double factorh = ((double) getHeight()-2) / picture.getHeight(); + factor = Math.min(factorw, factorh); + } + int width = (int) (picture.getWidth()*factor); + int height = (int) (picture.getHeight()*factor); + + scrollImageIcon = SwingFXUtils.toFXImage(picture.getImage(), null); + imageLabel.setFitWidth(width); + imageLabel.setFitHeight(height); + imageLabel.setImage(scrollImageIcon); + + //new Image(picture.getImage().getScaledInstance(picture.getImage().getWidth(), picture.getImage().getHeight(), Image.SCALE_FAST)); +// imageLabel = new ImageView(scrollImageIcon); + + // scrollImageIcon.setImage(picture.getImage().getScaledInstance(width, height, Image.SCALE_DEFAULT)); + // revalidate(); + } + } + + /** + * Setzt den Zoom-Faktor für das Bild. + * Als Zoomfaktor sind auch die Konstanten Bildanzeiger.FIT (auf Bildschirmgröße zoomen) und Bildanzeiger.NORMAL (100%) möglich. + * @param factor Zoomfaktor (1.0 = 100%). + */ + public void setZoom(double factor) + { + zoomFactor = factor; + repaint(); + } + + + + + + +} diff --git a/Quellcodes/alg_ds_graphentester/imp/Table.java b/Quellcodes/alg_ds_graphentester/imp/Table.java new file mode 100644 index 0000000..48126b1 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/imp/Table.java @@ -0,0 +1,898 @@ +package imp; + + + +/** + * Die Klasse Table vereinfacht den Zugriff auf CSV-Dateien. + * Die Klassen Table und TableRow ermöglichen einen einfachen Zugriff auf tabellenbasierte + * Dokumente. + * + * @author Thomas Schaller + * @version 1.0 vom 01.02.2019 + */ + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.ArrayList; +import java.io.*; +import java.util.Scanner; + +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.Attribute; +import org.jdom.JDOMException; +import org.jdom.input.SAXBuilder; +import org.jdom.output.XMLOutputter; +import org.jdom.output.Format; + +public class Table +{ + // Standardtrennzeichen für Spalten + private static final char DEFAULT_SEPARATOR = ';'; + // Standardmarkierung für Texte + private static final char DEFAULT_QUOTE = '"'; + // Standardtrennzeichen für Dezimalzahlen + private static final char DEFAULT_COMMA = ','; + + // mögliche Spaltentypen + private static final String UNKNOWN ="UNKOWN"; + private static final String INT = "INTEGER"; + private static final String DOUBLE = "DOUBLE"; + private static final String FLOAT = "FLOAT"; + + // interne Verwaltung des Dokuments als JDOM-Document-Objekt + private Document doc; + // Verweis auf Element für Kopfzeile + private Element header; + // Ende Attribute + + /** + * Erzeugt leeres Tabellen-Dokument. + */ + public Table() { + this.doc = new Document(); + doc.setRootElement(new Element("CSV-Data")); + this.header = new Element("Header"); + doc.getRootElement().addContent(header); + } + + + /** + * Erzeugt Tabellen-Dokument aus einer CSV-Datei. + * Liest den Inhalt einer Datei und erstellt ein Tabellenobjekt mit seinen Werten. + * Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + * dann lassen Sie einfach die Option "header" weg. + * @param filename Dateiname der CSV-Datei. + * @param options Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält. + * @param separator Trennzeichen für Spalten (meist ';' oder ',' oder '\t' für Tab) + * @param quote Kennung für Texte (meist '"'). + */ + public Table(String filename, String options, char separator, char quote) { + loadCSV(filename, options, separator, quote); + } + + /** + * Erzeugt Tabellen-Dokument aus einer CSV-Datei. + * Liest den Inhalt einer Datei und erstellt ein Tabellenobjekt mit seinen Werten (Separator = ';', Kennung für Text = '"'). + * Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + * dann lassen Sie einfach die Option "header" weg. + * @param filename Dateiname der CSV-Datei. + * @param options Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält. + */ + public Table(String filename, String options) { + loadCSV(filename, options); + } + + /** + * Erzeugt Tabellen-Dokument aus einer CSV-Datei. + * Liest den Inhalt einer Datei ohne Kopfzeile und erstellt ein Tabellenobjekt mit seinen Werten (Separator = ';', Kennung für Text = '"'). + * @param filename Dateiname der CSV-Datei. + */ + public Table(String filename) { + loadCSV(filename); + } + + // Anfang Methoden + /** + * Liest den Inhalt einer CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"'). + * @param filename Dateiname der CSV-Datei. + */ + public void loadCSV(String filename) { + loadCSV(filename, ""); + } + + /** + * Liest den Inhalt einer CSV-Datei (Separator = ';', Kennung für Text = '"'). + * Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + * dann lassen Sie einfach die Option "header" weg. + * @param filename Dateiname der CSV-Datei. + * @param options Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält. + */ + public void loadCSV(String filename, String options) { + loadCSV(filename, options, DEFAULT_SEPARATOR, DEFAULT_QUOTE); + } + + /** + * Liest den Inhalt einer CSV-Datei. + * Wenn die Datei eine Kopfzeile enthält, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile hat, + * dann lassen Sie einfach die Option "header" weg. + * @param filename Dateiname der CSV-Datei. + * @param options Geben Sie hier "header" an, wenn die Datei eine Kopfzeile enthält. + * @param separator Trennzeichen für Spalten (meist ';' oder ',' oder '\t' für Tab) + * @param quote Kennung für Texte (meist '"'). + */ + public void loadCSV(String filename, String options, char separator, char quote) { + doc = new Document(); + doc.setRootElement(new Element("CSV-Data")); + header = new Element("Header"); + doc.getRootElement().addContent(header); + try { + File f = new File(filename); + Scanner scanner = new Scanner(new File(filename)); + if(options.toLowerCase().contains("header") && scanner.hasNext()) { + List entries = parseLine(scanner.nextLine(), separator, quote); + int i= 0; + for(String s : entries) { + Element entry = new Element("Column"); + header.addContent(entry); + entry.setText(s); + entry.setAttribute("type", "unknown"); + i++; + } + } + + List cols = header.getChildren(); + + while (scanner.hasNext()) { + Element line = new Element("Row"); + doc.getRootElement().addContent(line); + List entries = parseLine(scanner.nextLine(), separator, quote); + int i= 0; + + for(String s : entries) { + + if(i==cols.size()) { + Element entry = new Element("Column"); + entry.setAttribute("type", "unknown"); + header.addContent(entry); + cols = header.getChildren(); + } + + Element entry = new Element("Entry"); + entry.setText(s); + line.addContent(entry); + i++; + } + } + scanner.close(); + + } catch (Exception e) { + System.out.println("Fehler beim Lesen der CSV-Datei"); + } + } + + /** + * Speichert das aktuelle Dokument als CSV-Datei ohne Kopfzeile (Separator = ';', Kennung für Text = '"'). + * @param filename Dateiname der CSV-Datei. + */ + public void saveCSV(String filename) { + saveCSV(filename, ""); + } + + /** + * Speichert das aktuelle Dokument als CSV-Datei (Separator = ';', Kennung für Text = '"'). + * Wenn die Datei eine Kopfzeile enthalten, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile haben soll, + * dann lassen Sie einfach die Option "header" weg. + * @param options Geben Sie hier "header" an, wenn die Datei eine Kopfzeile haben soll. + * @param filename Dateiname der CSV-Datei. + */ + public void saveCSV(String filename, String options) { + saveCSV(filename, options, DEFAULT_SEPARATOR, DEFAULT_QUOTE); + } + + /** + * Speichert das aktuelle Dokument als CSV-Datei. + * Wenn die Datei eine Kopfzeile enthalten, fügen Sie "header" in den Parameter options ein. Wenn die Datei keine Kopfzeile haben soll, + * dann lassen Sie einfach die Option "header" weg. + * @param options Geben Sie hier "header" an, wenn die Datei eine Kopfzeile haben soll. + * @param filename Dateiname der CSV-Datei. + * @param separator Trennzeichen für Spalten (meist ';' oder ',' oder '\t' für Tab) + * @param quote Kennung für Texte (meist '"'). + */ + public void saveCSV(String filename, String options, char separator, char quote){ + try{ + File f = new File(filename); + PrintStream outputFile = new PrintStream (f); + System.out.println("Speicher in : "+f.getAbsolutePath()); + List columns = header.getChildren(); + String sq = ""+quote; + String ss = ""+separator; + if(quote =='"') sq = "\""; + if(separator =='"') ss = "\""; + + if(options.toLowerCase().contains("header")) { + String h = ""; + for(Element c : columns) { + h += ss + sq + c.getText()+sq; + } + outputFile.println(h.substring(1)); + } + for(int i = 0; i parseLine(String cvsLine) { + return parseLine(cvsLine, DEFAULT_SEPARATOR, DEFAULT_QUOTE); + } + + /** HIlfsfunktion für die Analyse einer Dateizeile + * @param cvsLine Zeile aus der Datei + * @param sparator Trennzeichen für die Spalten + * @return Liste von String für die einzelnen Spalten + */ + private List parseLine(String cvsLine, char separator) { + return parseLine(cvsLine, separator, DEFAULT_QUOTE); + } + + /** HIlfsfunktion für die Analyse einer Dateizeile + * @param cvsLine Zeile aus der Datei + * @param sparator Trennzeichen für die Spalten + * @param customQuote Kennung für Strings + * @return Liste von String für die einzelnen Spalten + */ + private List parseLine(String cvsLine, char separator, char customQuote) { + + List result = new ArrayList<>(); + + //if empty, return! + if (cvsLine == null && cvsLine.isEmpty()) { + return result; + } + + //ggf. Default-Value laden + if (customQuote == ' ') { + customQuote = DEFAULT_QUOTE; + } + + if (separator == ' ') { + separator = DEFAULT_SEPARATOR; + } + + StringBuffer curVal = new StringBuffer(); + boolean inQuotes = false; + boolean startCollectChar = false; + boolean doubleQuotesInColumn = false; + + char[] chars = cvsLine.toCharArray(); + + for (char ch : chars) { + + if (inQuotes) { // aktueller Text ist in Quotes eingeschlossen + startCollectChar = true; + + if (ch == customQuote) { // Quotes werden beendet, aber Achtung bei "" => Metazeichen + inQuotes = false; + if (ch == '\"') { + doubleQuotesInColumn = true; + } + + } else { + + if (ch == '\"' && !doubleQuotesInColumn) { + doubleQuotesInColumn = true; + } else { + curVal.append(ch); + doubleQuotesInColumn = false; + } + + } + } else { + if (ch == customQuote) { + + inQuotes = true; + + //Fixed : allow "" in empty quote enclosed + if (ch == '\"'){ + if(doubleQuotesInColumn) { + curVal.append('"'); + doubleQuotesInColumn = false; + } else doubleQuotesInColumn = true; + + + } + } + else { + doubleQuotesInColumn = false; + if (ch == separator) { + + result.add(curVal.toString()); + + curVal = new StringBuffer(); + startCollectChar = false; + + } else if (ch == '\r') { + //ignore LF characters + continue; + } else if (ch == '\n') { + //the end, break! + break; + } else { + curVal.append(ch); + } + } + } + + } + result.add(curVal.toString()); + return result; + } + + /** + * Sucht die Nummer einer durch Namen gegebenen Spalte. + * @param name Name der Spalte + * @return Nummer der Spalte + */ + + private int findColumnNumber(String name) { + List columns = header.getChildren(); + int i = 0; + for(Element c : columns) { + if (c.getText().toLowerCase().equals(name.toLowerCase())) { + return i; + + } + i++; + } + return -1; + } + + /** + * Fügt eine neue Spalte am Ende der Tabelle an. + */ + public void addColumn() { + Element entry = new Element("Column"); + entry.setAttribute("type", Table.UNKNOWN); + header.addContent(entry); + } + + /** + * Fügt eine neue Spalte am Ende der Tabelle an und benennt sie. + * @param title Bezeichnung der Spalte + */ + public void addColumn(String title) { + addColumn(); + Element nc = ((List)(header.getChildren())).get(header.getChildren().size()-1); + nc.setText(title); + } + + /** + * Fügt eine neue Spalte am Ende der Tabelle an und benennt und typisiert sie. + * @param title Bezeichnung der Spalte + * @param type Typ der Spalte (UNKNOWN, DOUBLE, INTEGER, FLOAT) + */ + public void addColumn(String title, String type) { + addColumn(title); + Element nc = ((List)(header.getChildren())).get(header.getChildren().size()-1); + nc.setAttribute("type", type); + } + + /** + * Löscht eine Spalte. + * @param i Nummer der Spalte. + */ + public void removeColumn(int i) { + List lines = doc.getRootElement().getChildren(); + for(Element l : lines) { + if(l.getChildren().size()>i) l.removeContent(i); + } + } + + /** + * Löscht eine Spalte + * @param name Name der Spalte + */ + public void removeColumn(String name) { + try{ + removeColumn(findColumnNumber(name)); + } catch(Exception e) { System.out.println("Unbekannter Spaltenname");} + } + + /** + * Liefert die Anzahl der Spalten in der Tabelle + * @return Anzahl der Spalten + */ + public int getColumnCount() { + return header.getChildren().size(); + } + + /** + * Liefert die Anzahl der Zeilen in der Tabelle + * @return Anzahl der Zeilen + */ + public int getRowCount() { + return doc.getRootElement().getChildren().size()-1; + } + + /** + * Löscht alle Zeilen der Tabelle. + * Die Spaltenüberschriften und Typen bleiben erhalten. + */ + public void clearRows() { + doc.getRootElement().removeChildren("Row"); + } + + /** + * Fügt eine neue Zeile an das Ende der Tabelle an. + * @return ein TableRow-Objekt für diese neue Zeile + */ + public TableRow addRow() { + Element row = new Element("Row"); + doc.getRootElement().addContent(row); + return new TableRow(doc, row); + } + + /** + * Löscht eine Zeile + * @param i Nummer der Zeile + */ + public void removeRow(int i) { + if(i rows = doc.getRootElement().getChildren(); + return new TableRow(doc, rows.get(i+1)); + } + return null; + } + + /** + * Liefert die ganze Tabelle als Array von TableRow-Objekten + * @return Array von TableRow-Objekten + */ + public TableRow[] rows() { + TableRow[] rows = new TableRow[getRowCount()]; + for(int i = 0; i < getRowCount(); i++) { + rows[i] = getRow(i); + } + return rows; + } + + /** + * Liefert den Wert einer Zelle als Integer-Zahl + * @param row Zeilennummer + * @param column Spaltennummer + * @return Wert der Zelle + */ + public int getInt(int row, int column) { + return getRow(row).getInt(column); + } + + /** + * Liefert den Wert einer Zelle als Integer-Zahl + * @param row Zeilennummer + * @param name Name der Spalte + * @return Wert der Zelle + */ + public int getInt(int row, String name) { + return getRow(row).getInt(name); + } + + /** + * Setzt den Wert einer Zelle als Integer-Zahl + * @param row Zeilennummer + * @param column Spaltennummer + * @param value neuer Wert der Zelle + */ + public void setInt(int row, int column,int value) { + getRow(row).setInt(column, value); + } + + /** + * Setzt den Wert einer Zelle als Integer-Zahl + * @param row Zeilennummer + * @param name Name der Spalte + * @param value neuer Wert der Zelle + */ + public void setInt(int row, String name, int value) { + getRow(row).setInt(name, value); + } + + /** + * Liefert alle Werte einer Zeile als Integer-Array. + * @param row Nummer der Zeile + * @return int-Array, dass alle Werte der Zeile enthält + */ + public int[] getIntRow(int row) { + try{ + TableRow trow = getRow(row); + int anz = getColumnCount(); + int[] r = new int[anz]; + for(int i=0; i) (header.getChildren())).get(i).getText(); + } else { + return ""; + } + } + + /** + * Liefert die Nummer einer Spalte + * @param name Name der Spalte + * @return Nummer der Spalte + */ + public int getColumn(String name) { + List columns = header.getChildren(); + int i = 0; + while (i < columns.size()) { + if (columns.get(i).getText().toLowerCase().equals(name.toLowerCase())) { + return i; + } + i++; + } // end of while + return -1; + } + + + /** + * Erzeugt eine neue Zeile mit i Spalten + * Wenn bisher nicht genügend Spalten vorhanden sind, werden automatisch neue Spalten hinzugefügt (auch zum Header) + * @param i Anzahl der Spalten + */ + private Element buildRow(int i) { + List columns = header.getChildren(); + Element entry=null; + for(int j=0; j<=i; j++) { + + if(j==columns.size()) { + Element h = new Element("Column"); + h.setAttribute("type", "unknown"); + header.addContent(h); + columns = header.getChildren(); + } + if(j==current.getChildren().size()) { + entry = new Element("Entry"); + current.addContent(entry); + + } + + } + return entry; + + } + + /** + * Erzeugt eine neue Zeile. + * Es werden genügend Spalten erzeugt, dass ein Wert in Spalte "name" eingetragen werden kann + * @param name Name der Spalte + */ + private Element buildRow(String name) { + List columns = header.getChildren(); + int i = 0; + for(Element c: columns) { + + if(c.getText().toLowerCase().equals(name.toLowerCase())) { + return buildRow(i); + } + i++; + } + return null; + + } + + /** + * Liefert den Wert einer Zelle als String + * @param i Nummer der Spalte + * @return Wert der Zelle + */ + public String getString(int i) { + if(i >= current.getContent().size()) return ""; + Element e = (Element) current.getContent(i) ; + if(e!=null) { + return e.getText(); + } else { + return ""; + } + } + + /** + * Liefert den Wert einer Zelle als String + * @param name Name der Spalte + * @return Wert der Zelle + */ + public String getString(String name) { + return getString(getColumn(name)); + } + + /** + * Setzt den Wert einer Zelle als String + * @param i Nummer der Spalte + * @param text neuer Wert der Zelle + */ + public void setString(int i, String text) { + + Element e = buildRow(i); + if(e!=null) e.setText(text); + } + + /** + * Setzt den Wert einer Zelle als String + * @param name Name der Spalte + * @param text neuer Wert der Zelle + */ + public void setString(String name, String text) { + Element e = buildRow(name); + if(e!=null) e.setText(text); + } + + + /** + * Liefert den Wert einer Zelle als Int-Zahl + * @param i Nummer der Spalte + * @return Wert der Zelle + */ + public int getInt(int i) { + try{ + Element e = (Element) current.getContent(i) ; + return Integer.parseInt(e.getText()); + } catch(Exception e) { + return 0; + } + } + + /** + * Liefert den Wert einer Zelle als Int-Zahl + * @param name Name der Spalte + * @return Wert der Zelle + */ + public int getInt(String name) { + return getInt(getColumn(name)); + } + + /** + * Setzt den Wert einer Zelle als Int-Zahl + * @param i Nummer der Spalte + * @param value neuer Wert der Zelle + */ + public void setInt(int i,int value) { + + Element e = buildRow(i); + if(e!=null) e.setText(""+value); + } + + /** + * Setzt den Wert einer Zelle als Int-Zahl + * @param name Name der Spalte + * @param value neuer Wert der Zelle + */ + public void setInt(String name, int value) { + Element e = buildRow(name); + if(e!=null) e.setText(""+value); + } + + /** + * Liefert den Wert einer Zelle als Float-Zahl + * @param i Nummer der Spalte + * @return Wert der Zelle + */ + public float getFloat(int i) { + try{ + Element e = (Element) current.getContent(i) ; + return Float.parseFloat(e.getText().replace(",",".")); + } catch(Exception e) { + return 0; + } + } + + /** + * Liefert den Wert einer Zelle als Float-Zahl + * @param name Name der Spalte + * @return Wert der Zelle + */ + public float getFloat(String name) { + return getFloat(getColumn(name)); + } + + /** + * Setzt den Wert einer Zelle als Float-Zahl + * @param i Nummer der Spalte + * @param value neuer Wert der Zelle + */ + public void setFloat(int i,float value) { + + Element e = buildRow(i); + if(e!=null) e.setText(format.format(value)); + } + + /** + * Setzt den Wert einer Zelle als Float-Zahl + * @param name Name der Spalte + * @param value neuer Wert der Zelle + */ + public void setFloat(String name, float value) { + Element e = buildRow(name); + if(e!=null) e.setText(format.format(value)); + } + + /** + * Liefert den Wert einer Zelle als Double-Zahl + * @param i Nummer der Spalte + * @return Wert der Zelle + */ + public double getDouble(int i) { + try{ + Element e = (Element) current.getContent(i) ; + return Double.parseDouble(e.getText().replace(",",".")); + + } catch(Exception e) { + return 0; + } + } + + /** + * Liefert den Wert einer Zelle als Double-Zahl + * @param name Name der Spalte + * @return Wert der Zelle + */ + public double getDouble(String name) { + return getDouble(getColumn(name)); + } + + /** + * Setzt den Wert einer Zelle als Double-Zahl + * @param i Nummer der Spalte + * @param value neuer Wert der Zelle + */ + public void setDouble(int i,double value) { + + Element e = buildRow(i); + if(e!=null) e.setText(format.format(value)); + } + + /** + * Setzt den Wert einer Zelle als Double-Zahl + * @param name Name der Spalte + * @param value neuer Wert der Zelle + */ + public void setDouble(String name, double value) { + Element e = buildRow(name); + if(e!=null) e.setText(format.format(value)); + } + +} diff --git a/Quellcodes/alg_ds_graphentester/imp/XML.java b/Quellcodes/alg_ds_graphentester/imp/XML.java new file mode 100644 index 0000000..aadbb8f --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/imp/XML.java @@ -0,0 +1,639 @@ +package imp; + +/** + * Klasse zum Vereinfachten Zugriff auf XML-Dokumente + * Diese Klasse ist für den Einsatz in der Schule gedacht und soll den Schülern + * einen einfachen Zugriff auf XML-Dokumente ermöglichen. Die zur Verfügung + * stehenden Befehle sind wie in Processing realisiert. + * Dabei ist jeder Teilbaum des Dokuments wieder als XML-Objekt zugreifbar, das + * intern auf die gleiche XML-Dokumentstruktur zugreift. + * Dies ermöglicht bei unsachgemäßem Gebrauch die XML-Struktur zu zerstören. Im + * normalen Gebrauch sollte dies aber nicht relevant sein. + * + * Benötigt: jdom-1.1.3.jar + + * @author Thomas Schaller + * @version 1.0 vom 31.01.2019 + */ +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.ArrayList; +import java.io.*; + +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.Attribute; +import org.jdom.JDOMException; +import org.jdom.input.SAXBuilder; +import org.jdom.output.XMLOutputter; +import org.jdom.output.Format; + +public class XML { + // Anfang Attribute + // XML-Dokumentstruktur + private Document doc; + // Zeiger auf das aktuelle Element + private Element current; + // Ende Attribute + + /** + * Erzeugt ein leeres XMLDokument + */ + public XML() { + this.doc = new Document(); + this.current = null; + } + + /** + * Erzeugt ein XML-Dokument aus einer Datei + * @param filename Dateiname der XML-Datei + */ + public XML(String filename) { + loadXML(filename); + } + + /** + * interner Konstruktor, um ein XML Objekt zu erzeugen, das auf einen bestimmten Knoten verweist + * @param doc die XML-Dokumentstruktur + * @param current Zeiger auf das aktuelle Element + */ + private XML(Document doc, Element current) { + this.doc = doc; + this.current = current; + } + + // Anfang Methoden + /** Öffnet das durch den Dateinamen gegebene Dokument + * @param filename Dateiname des XML-Files + */ + public void loadXML(String filename) { + doc = null; + File f = new File(filename); + + try { + // Das Dokument erstellen + SAXBuilder builder = new SAXBuilder(); + doc = builder.build(f); + + } catch (JDOMException e) { + e.printStackTrace(); + + } catch (IOException e) { + e.printStackTrace(); + } + // Zeiger im Baum auf Root-Element + current = doc.getRootElement(); + } + + /** Speichert den XML-Baum im angegebenen Dateinamen + * @param filename Dateiname des XML-Files + */ + public void saveXML(String filename) { + try { + // new XMLOutputter().output(doc, System.out); + XMLOutputter xmlOutput = new XMLOutputter(); + + // display nice nice + xmlOutput.setFormat(Format.getPrettyFormat()); + File f = new File(filename); + FileOutputStream outputFile = new FileOutputStream(f); + System.out.println("Speicher in : "+f.getAbsolutePath() ); + xmlOutput.output(doc, outputFile); + outputFile.close(); + System.out.println("File Saved!"); + } catch (IOException io) { + System.out.println(io.getMessage()); + } + + } + + //----------------------------------------------- Zeigerbewegungen -------------------------------------------------- + /** + * liefert ein XML-Objekt, das auf den Vaterknoten des aktuellen Elements zeigt. + * @return Vater des aktuellen Objekts. + */ + public XML getParent() { + if(current != null) { + Element parent = current.getParentElement(); + if (parent == null) { + return null; + } else { + return new XML(doc, parent); + } + } + return null; + } + + /** + * Überprüft, ob das Element irgendwelche Kinder hat oder nicht, und gibt das Ergebnis als boolean zurück. + * @return true, wenn Kinder vorhanden sind, sonst false + */ + public boolean hasChildren() { + if (current == null) { + return doc.hasRootElement(); + } else { + return current.getChildren().size()>0; + } + } + + /** + * Ermittelt die Namen aller Kinder des Elements und gibt die Namen als ein Array von Strings zurück. + * Dies ist dasselbe wie das Durchlaufen und Aufrufen von getName() auf jedem untergeordneten Element einzeln. + * @return Liste aller Namen der Kinder + */ + public String[] listChildren() { + if (current == null) { + if(doc.hasRootElement()) { + String[] names = new String[0]; + names[0] = doc.getRootElement().getName(); + return names; + } else { + return null; + } + } else { + List ch_element = current.getChildren(); + String[] names = new String[ch_element.size()]; + for(int i=0; i < ch_element.size() ; i++) { + names[i] = ch_element.get(i).getName(); + } + return names; + } + } + + /** + * Liefert alle Kinder des Elements als Array von XML-Objekten. + * @return Array der Kinder als XML-Objekte + */ + public XML[] getChildren() { + if (current == null) { + if(doc.hasRootElement()) { + XML[] ch_xml = new XML[1]; + ch_xml[0] = new XML(doc, doc.getRootElement()); + return ch_xml; + } else { + return null; + } + } else { + List ch_element = current.getChildren(); + XML[] ch_xml = new XML[ch_element.size()]; + for(int i=0; i < ch_element.size() ; i++) { + ch_xml[i] = new XML(doc, ch_element.get(i)); + } + return ch_xml; + } + } + + /** + * Liefert bestimmte Kinder des Elements als Array von XML-Objekten. + * Die Methode gibt dabei alle Kinder zurück, die dem angegebenen Namen entsprechen. + * @param name Name der gesuchten Kind-Objekte + * @return Array der Kinder als XML-Objekte + */ + public XML[] getChildren(String name) { + if (current == null) { + if(doc.hasRootElement()) { + XML[] ch_xml = new XML[1]; + ch_xml[0] = new XML(doc, doc.getRootElement()); + if(doc.getRootElement().getName().equals(name)){ + return ch_xml; + } else { + return null; + } + } else { + return null; + } + } else { + List ch_element = current.getChildren(name); + XML[] ch_xml = new XML[ch_element.size()]; + for(int i=0; i < ch_element.size() ; i++) { + ch_xml[i] = new XML(doc, ch_element.get(i)); + } + return ch_xml; + } + } + + /** + * Liefert das erste Kind des Elements mit einem bestimmten Namen. + * Die Methode gibt das erste Kind zurück, das dem angegebenen Namen entsprechen. + * @param name Name des gesuchten Kind-Objektes + * @return Kind als XML-Objekt + */ + + public XML getChild(String name) { + if (current == null) { + Element e = doc.getRootElement(); + if (e.getName().equals(name)) { + return new XML(doc, e); + } else { + return null; + } + } else { + String[] names = name.split("/"); + Element e = current; + int i = 0; + while(i < names.length) { + e = e.getChild(names[i]); + if (e==null) return null; + i++; + } + return new XML(doc, e); + } + } + + /** + * Liefert das i. Kind des Elements. + * Die Methode gibt das i. Kind des aktuellen Elements zurück. + * @param i Nummer des Kindes + * @return Kind als XML-Objekt + */ + public XML getChild(int i) { + if (current == null) { + return new XML(doc, doc.getRootElement()); + } else { + List ch_element = current.getChildren(); + if (i>=ch_element.size()) return null; + return new XML(doc, ch_element.get(i)); + } + } + + //--------------------------------------------------- Methoden für das aktuelle Element ------------------------------------------------- + /** + * Frage den Namen des aktuellen Elements ab + * @return Namen des Elements + */ + public String getName() { + if (current==null) return ""; + return current.getName(); + } + + /** + * Setze den Namen des aktuellen Elements. + * @param name Neuer Name des Elements + */ + public void setName(String name) { + if (current==null) return; + current.setName(name); + } + + /** + * liefert die Anzahl der Attribute eines Elements. + * @return Anzahl des Attribute + */ + public int getAttributeCount() { + if (current == null) return 0; + return current.getAttributes().size(); + } + + /** + * liefert zurück, ob das aktuelle Element Attribute hat . + * @return true, wenn es Attribute gibt + */ + public boolean hasAttribute() { + if (current == null) return false; + return current.getAttributes().size()>0; + } + + /** + * Ruft alle Attribute des angegebenen Elements ab und gibt sie als Array von Strings zurück. + * @return Liste der Attributnamen + */ + public String[] listAttributes() { + if (current == null) return null; + List attr = current.getAttributes(); + String[] names = new String[attr.size()]; + for(int i=0; i < attr.size() ; i++) { + names[i] = attr.get(i).getName(); + } + return names; + } + + /** + * Fragt einen Attributwert des aktuellen Elements ab + * @param attribute Name des Attributs + * @return Wert des Attributs + */ + public String getString(String attribute) { + if (current==null) return ""; + return current.getAttributeValue(attribute); + } + + /** + * Fragt einen Attributwert des aktuellen Elements ab + * Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben + * @param attribute Name des Attributs + * @param defaultValue Standardwert, falls es das Attribut nicht gibt + * @return Wert des Attributs + */ + public String getString(String attribute, String defaultValue) { + if (current==null) return defaultValue; + return current.getAttributeValue(attribute,defaultValue); + } + + /** + * Setzt einen Attributwert des aktuellen Elements + * @param attribute Name des Attributs + * @param text neuer Wert des Attributs + */ + public void setString(String attribute, String text) { + if (current==null) return; + current.setAttribute(attribute, text); + } + + /** + * Fragt einen Attributwert des aktuellen Elements ab + * @param attribute Name des Attributs + * @return Wert des Attributs als Integer-Zahl + */ + public int getInt(String attribute) { + if (current==null) return 0; + try{ + int i = Integer.parseInt(current.getAttributeValue(attribute)); + return i; + } catch(Exception e) { return 0; } + + } + + /** + * Fragt einen Attributwert des aktuellen Elements ab + * Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben + * @param attribute Name des Attributs + * @param defaultValue Standardwert, falls es das Attribut nicht gibt + * @return Wert des Attributs als Integer-Zahl + */ + public int getInt(String attribute, int defaultValue) { + if (current==null) return defaultValue; + try{ + int i = Integer.parseInt(current.getAttributeValue(attribute)); + return i; + } catch(Exception e) { return defaultValue; } + + } + + /** + * Setzt einen Attributwert des aktuellen Elements + * @param attribute Name des Attributs + * @param value neuer Wert des Attributs + */ + public void setInt(String attribute, int value) { + if (current==null) return; + current.setAttribute(attribute, ""+value); + } + + /** + * Fragt einen Attributwert des aktuellen Elements ab + * @param attribute Name des Attributs + * @return Wert des Attributs als Float-Zahl + */ + public float getFloat(String attribute) { + if (current==null) return 0; + try{ + float i = Float.parseFloat(current.getAttributeValue(attribute)); + return i; + } catch(Exception e) { return 0; } + + } + + /** + * Fragt einen Attributwert des aktuellen Elements ab + * Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben + * @param attribute Name des Attributs + * @param defaultValue Standardwert, falls es das Attribut nicht gibt + * @return Wert des Attributs als Float-Zahl + */ + public float getFloat(String attribute, float defaultValue) { + if (current==null) return defaultValue; + try{ + float i = Float.parseFloat(current.getAttributeValue(attribute)); + return i; + } catch(Exception e) { return defaultValue; } + + } + + /** + * Setzt einen Attributwert des aktuellen Elements + * @param attribute Name des Attributs + * @param value neuer Wert des Attributs + */ + public void setFloat(String attribute, float value) { + if (current==null) return; + current.setAttribute(attribute, ""+value); + } + + /** + * Fragt einen Attributwert des aktuellen Elements ab + * @param attribute Name des Attributs + * @return Wert des Attributs als Double-Zahl + */ + public double getDouble(String attribute) { + if (current==null) return 0; + try{ + double i = Double.parseDouble(current.getAttributeValue(attribute)); + return i; + } catch(Exception e) { return 0; } + + } + +/** + * Fragt einen Attributwert des aktuellen Elements ab + * Sollte es das Attribut nicht geben, wird ein default-Wert zurückgegeben + * @param attribute Name des Attributs + * @param defaultValue Standardwert, falls es das Attribut nicht gibt + * @return Wert des Attributs als double-Zahl + */ + public double getDouble(String attribute, double defaultValue) { + if (current==null) return defaultValue; + try{ + double i = Double.parseDouble(current.getAttributeValue(attribute)); + return i; + } catch(Exception e) { return defaultValue; } + + } + + /** + * Setzt einen Attributwert des aktuellen Elements + * @param attribute Name des Attributs + * @param value neuer Wert des Attributs + */ + public void setDouble(String attribute, double value) { + if (current==null) return; + current.setAttribute(attribute, ""+value); + } + + /** + * Fragt den Inhalt/Text des aktuellen Elements ab + * @return Inhalt des Elements + */ + public String getContent() { + if ( current==null) return ""; + + return current.getText(); + } + + /** + * Fragt den Inhalt/Text des aktuellen Elements ab + * Hat das Element keinen Inhalt wird der defaultValue zurückgegeben. + * @param defaultValue Standardtext + * @return Inhalt des Elements + */ + public String getContent(String defaultValue) { + if ( current==null) return defaultValue; + String t = current.getText(); + if(t.equals("")) t = defaultValue; + return t; + } + + /** + * Setzt den Inhalt/Text des aktuellen Elements + * @param text Neuer Inhalt des Elements + */ + public void setContent(String text) { + if ( current==null) return; + current.setText(text); + } + + + /** + * Fragt den Inhalt des aktuellen Elements als Integerzahl ab + * Hat das Element keinen Inhalt wird der defaultValue zurückgegeben. + * @param defaultValue Standardwert + * @return Inhalt des Elements + */ public int getIntContent(int defaultValue) { + if ( current==null) return defaultValue; + try{ + int i = Integer.parseInt(current.getText()); + return i; + } catch(Exception e) { return defaultValue; } + } + + /** + * Fragt den Inhalt des aktuellen Elements als Integerzahl ab + * @return Inhalt des Elements + */ + public int getIntContent() { + if ( current==null) return 0; + try{ + int i = Integer.parseInt(current.getText()); + return i; + } catch(Exception e) { return 0; } + } + + /** + * Setzt den Inhalt des aktuellen Elements + * @param value Neuer Inhalt des Elements + */ + public void setIntContent(int value) { + if ( current==null) return; + current.setText(""+value); + } + + + /** + * Fragt den Inhalt des aktuellen Elements als Floatzahl ab + * Hat das Element keinen Inhalt wird der defaultValue zurückgegeben. + * @param defaultValue Standardwert + * @return Inhalt des Elements + */ + public float getFloatContent(float defaultValue) { + if ( current==null) return defaultValue; + try{ + float i = Float.parseFloat(current.getText()); + return i; + } catch(Exception e) { return defaultValue; } + } + + /** + * Fragt den Inhalt des aktuellen Elements als Floatzahl ab + * @return Inhalt des Elements + */ + public float getFloatContent() { + if ( current==null) return 0; + try{ + float i = Float.parseFloat(current.getText()); + return i; + } catch(Exception e) { return 0; } + } + + /** + * Setzt den Inhalt des aktuellen Elements + * @param value Neuer Inhalt des Elements + */ + public void setFloatContent(float value) { + if ( current==null) return; + current.setText(""+value); + } + +/** + * Fragt den Inhalt des aktuellen Elements als Doublezahl ab + * Hat das Element keinen Inhalt wird der defaultValue zurückgegeben. + * @param defaultValue Standardwert + * @return Inhalt des Elements + */ + public double getDoubleContent(double defaultValue) { + if ( current==null) return defaultValue; + try{ + double i = Double.parseDouble(current.getText()); + return i; + } catch(Exception e) { return defaultValue; } + } + + /** + * Fragt den Inhalt des aktuellen Elements als Doublezahl ab + * @return Inhalt des Elements + */ + public double getDoubleContent() { + if ( current==null) return 0; + try{ + double i = Double.parseDouble(current.getText()); + return i; + } catch(Exception e) { return 0; } + } + + /** + * Setzt den Inhalt des aktuellen Elements + * @param value Neuer Inhalt des Elements + */ + public void setDoubleContent(double value) { + if ( current==null) return; + current.setText(""+value); + } + + + // ----------------------------------------------- XML-Struktur aufbauen ------------------------------------------------ + /** Erzeuge neues Element nach der aktuellen Position und setze dieses als aktuelles Element + * @param name Name des neuen Elements + * @return neues Element als XML-Objekt + */ + public XML addChild(String name) { + Element e = new Element(name); + if(current == null){ // man ist auf Root-Ebene + doc.setRootElement(e); + + } + else { + current.addContent(e); + } // end of if-else + return new XML(doc, e); + } + + /** + * liefert das aktuelle Element als jdom-Element-Objekt + * @return aktuelles Element + */ + private Element getCurrent() { + return current; + } + + /** + * löscht ein Kind des aktuellen Knotens. + * Ist kid kein Kind des aktuellen Elements passiert gar nichts. + * @param kid XML-Objekt des Kindes + */ + public void removeChild(XML kid) { + if (current == null) return; + Element e = kid.getCurrent(); + int index = current.indexOf(e); + if(index >= 0) { current.removeContent(e);} + } + +} diff --git a/Quellcodes/alg_ds_graphentester/imp/package.bluej b/Quellcodes/alg_ds_graphentester/imp/package.bluej new file mode 100644 index 0000000..1553a13 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/imp/package.bluej @@ -0,0 +1,79 @@ +#BlueJ package file +dependency1.from=PictureViewer +dependency1.to=Picture +dependency1.type=UsesDependency +dependency2.from=Table +dependency2.to=TableRow +dependency2.type=UsesDependency +dependency3.from=Picture +dependency3.to=PictureViewer +dependency3.type=UsesDependency +objectbench.height=66 +objectbench.width=776 +package.divider.horizontal=0.599476439790576 +package.divider.vertical=0.8537074148296593 +package.editor.height=419 +package.editor.width=654 +package.editor.x=567 +package.editor.y=331 +package.frame.height=600 +package.frame.width=800 +package.numDependencies=3 +package.numTargets=7 +package.showExtends=true +package.showUses=true +readme.height=60 +readme.name=@README +readme.width=49 +readme.x=10 +readme.y=10 +target1.height=50 +target1.name=PictureViewer +target1.naviview.expanded=true +target1.showInterface=false +target1.type=ClassTarget +target1.width=130 +target1.x=280 +target1.y=310 +target2.height=50 +target2.name=Table +target2.showInterface=false +target2.type=ClassTarget +target2.width=80 +target2.x=420 +target2.y=200 +target3.height=50 +target3.name=HSB +target3.showInterface=false +target3.type=ClassTarget +target3.width=90 +target3.x=40 +target3.y=200 +target4.height=50 +target4.name=XML +target4.showInterface=false +target4.type=ClassTarget +target4.width=80 +target4.x=520 +target4.y=220 +target5.height=50 +target5.name=Picture +target5.showInterface=false +target5.type=ClassTarget +target5.width=80 +target5.x=180 +target5.y=250 +target6.height=50 +target6.name=TableRow +target6.showInterface=false +target6.type=ClassTarget +target6.width=100 +target6.x=520 +target6.y=150 +target7.height=50 +target7.name=NumberField +target7.showInterface=false +target7.type=ClassTarget +target7.width=130 +target7.x=380 +target7.y=70 diff --git a/Quellcodes/alg_ds_graphentester/package.bluej b/Quellcodes/alg_ds_graphentester/package.bluej new file mode 100644 index 0000000..d35c17a --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/package.bluej @@ -0,0 +1,63 @@ +#BlueJ package file +editor.fx.0.height=0 +editor.fx.0.width=0 +editor.fx.0.x=0 +editor.fx.0.y=0 +objectbench.height=80 +objectbench.width=453 +package.divider.horizontal=0.599591419816139 +package.divider.vertical=0.7603305785123967 +package.editor.height=269 +package.editor.width=331 +package.editor.x=72 +package.editor.y=497 +package.frame.height=464 +package.frame.width=477 +package.numDependencies=0 +package.numTargets=6 +package.showExtends=true +package.showUses=true +project.charset=UTF-8 +project.invoke.thread=FX +readme.height=60 +readme.name=@README +readme.width=49 +readme.x=10 +readme.y=10 +target1.height=62 +target1.name=control +target1.type=PackageTarget +target1.width=80 +target1.x=20 +target1.y=90 +target2.height=62 +target2.name=algorithmen +target2.type=PackageTarget +target2.width=90 +target2.x=20 +target2.y=170 +target3.height=62 +target3.name=eigeneAlgorithmen +target3.type=PackageTarget +target3.width=130 +target3.x=130 +target3.y=170 +target4.height=62 +target4.name=imp +target4.type=PackageTarget +target4.width=80 +target4.x=220 +target4.y=90 +target5.height=62 +target5.name=graph +target5.type=PackageTarget +target5.width=80 +target5.x=120 +target5.y=90 +target6.height=50 +target6.name=GraphenTester +target6.showInterface=false +target6.type=ClassTarget +target6.width=150 +target6.x=80 +target6.y=20 diff --git a/Quellcodes/alg_ds_graphentester/readme.adoc b/Quellcodes/alg_ds_graphentester/readme.adoc new file mode 100644 index 0000000..849992d --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/readme.adoc @@ -0,0 +1,11 @@ += Material : + +|=== +|Zuordnung| +|Klassenstufe| +|Bildungsplanbezug | +|Werkzeug| +|Autoren| +|=== + +== Inhalt diff --git a/Quellcodes/alg_ds_graphentester/userhome/bluej/bluej-debuglog.txt b/Quellcodes/alg_ds_graphentester/userhome/bluej/bluej-debuglog.txt new file mode 100644 index 0000000..37e4120 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/userhome/bluej/bluej-debuglog.txt @@ -0,0 +1,12 @@ +BlueJ run started: Sat Jul 13 11:36:30 CEST 2019 +BlueJ version 3.1.4 +Java version 1.8.0_191 +Virtual machine: Java HotSpot(TM) 64-Bit Server VM 25.191-b12 (Oracle Corporation) +Running on: Windows 10 10.0 (amd64) +Java Home: C:\Program Files\Java\jdk1.8.0_191\jre +---- +Opening project: F:\Informatik\Graphenalgorithmen\GraphTester_v6.1 +1563010591858: Listening for JDWP connection on address: javadebug +Connected to debug VM via dt_shmem transport... +Communication with debug VM fully established. +Simple GUI Extension terminates diff --git a/Quellcodes/alg_ds_graphentester/userhome/bluej/bluej.properties b/Quellcodes/alg_ds_graphentester/userhome/bluej/bluej.properties new file mode 100644 index 0000000..63f280b --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/userhome/bluej/bluej.properties @@ -0,0 +1,52 @@ +#BlueJ properties. Settings in this file override "bluej.defs" +#Sat Jul 13 11:36:33 CEST 2019 +extensions.org.bluej.extensions.submitter.Submitter.settings.smtpauthuser=Tom +blackbox.experiment= +bluej.openPackage1=F\:\\Informatik\\Graphenalgorithmen\\GraphTester_v6.1 +extensions.org.bluej.UMLextension.UMLExtension.settings.showAttributes=true +extensions.klassenkarte.Klassenkarte.settings.KONSTANTEN_ANZEIGEN=0 +bluej.startWithTextEval=false +extensions.org.bluej.extensions.submitter.Submitter.settings.ssl=false +extensions.klassenkarte.Klassenkarte.settings.TYPEN_ANZEIGEN=0 +bluej.accessibility.support=false +extensions.klassenkarte.Klassenkarte.settings.NICHT_PUBLIC_METHODEN_ANZEIGEN=0 +extensions.org.bluej.extensions.submitter.Submitter.settings.tls=false +extensions.org.bluej.extensions.submitter.Submitter.settings.saslrealm= +extensions.klassenkarte.Klassenkarte.settings.SIGNATUR_ANSICHT=0 +bluej.userlibrary1.location=F\:\\Informatik\\Graphenalgorithmen\\GraphTester_v5_5_Windows\\libs\\commons-io-2.4.jar +bluej.language=english +bluej.recentProject1=F\:\\Informatik\\Graphenalgorithmen\\GraphTester_v5_5_Windows +extensions.org.bluej.extensions.submitter.Submitter.settings.authenticate=false +bluej.recentProject0=F\:\\Informatik\\Graphenalgorithmen\\GraphTester_v6.1 +extensions.kr.or.bluej.cw.extension.ClassWizardExtension.settings.=BlueJ style +extensions.klassenkarte.Klassenkarte.settings.ATTRIBUTE_TYP=0 +extensions.org.bluej.extensions.submitter.Submitter.settings.smtphost= +extensions.klassenkarte.Klassenkarte.settings.EXPERTEN_ANSICHT=0 +bluej.editor.fontsize=12 +extensions.org.bluej.UMLextension.UMLExtension.settings.showParams=true +bluej.preferences.y=16 +bluej.preferences.x=16 +bluej.compiler.showunchecked=true +extensions.klassenkarte.Klassenkarte.settings.KONSTRUKTOREN_ANZEIGEN=0 +blackbox.participant= +extensions.org.bluej.extensions.submitter.Submitter.settings.username=Tom +bluej.userlibrary2.location=F\:\\Informatik\\Graphenalgorithmen\\GraphTester_v5_5_Windows\\libs\\csv.jar +extensions.klassenkarte.Klassenkarte.settings.FARBIGE_SICHTBARKEITEN=1 +extensions.org.bluej.UMLextension.UMLExtension.settings.useJavaSyntax=false +extensions.klassenkarte.Klassenkarte.settings.METHODEN_SICHTBARKEIT=0 +extensions.klassenkarte.Klassenkarte.settings.ATTRIBUTE_SICHTBARKEIT=0 +bluej.uid=81375721-8257-4d07-bdbc-8d26cd48e5c8 +bluej.editor.scopeHilightingStrength=20 +extensions.org.bluej.extensions.submitter.Submitter.settings.useraddr=Tom@ +extensions.klassenkarte.Klassenkarte.settings.PARAMETERNAMEN_ANZEIGEN=1 +extensions.org.bluej.UMLextension.UMLExtension.settings.showReturnTypes=true +extensions.klassenkarte.Klassenkarte.settings.ATTRIBUTE_ANZEIGEN=1 +extensions.org.bluej.UMLextension.UMLExtension.settings.showMethods=true +bluej.userlibrary3.location=F\:\\Informatik\\Graphenalgorithmen\\GraphTester_v5_5_Windows\\libs\\jgraphx.jar +extensions.org.bluej.UMLextension.UMLExtension.settings.showVisibility=true +extensions.klassenkarte.Klassenkarte.settings.ATTRIBUTE_ALLE=0 +extensions.org.bluej.extensions.submitter.Submitter.settings.port=25 +blackbox.uuid=66b48783-0468-4dd8-a660-7a2fd33bde49 +bluej.terminal.y=16 +bluej.terminal.x=16 +extensions.org.bluej.UMLextension.UMLExtension.settings.showPrivates=false diff --git a/Quellcodes/alg_ds_graphentester/userhome/bluej/editor.keys b/Quellcodes/alg_ds_graphentester/userhome/bluej/editor.keys new file mode 100644 index 0000000..80a4150 Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/userhome/bluej/editor.keys differ diff --git a/Quellcodes/alg_ds_graphentester/userhome/bluej/moe.properties b/Quellcodes/alg_ds_graphentester/userhome/bluej/moe.properties new file mode 100644 index 0000000..2842263 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/userhome/bluej/moe.properties @@ -0,0 +1,2 @@ +#Moe Editor properties. Settings in this file override "moe.defs" +#Sat Jul 13 11:36:33 CEST 2019 diff --git a/Quellcodes/alg_ds_graphentester/view/edittab.fxml b/Quellcodes/alg_ds_graphentester/view/edittab.fxml new file mode 100644 index 0000000..c839a47 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/view/edittab.fxml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Quellcodes/alg_ds_graphentester/view/end.png b/Quellcodes/alg_ds_graphentester/view/end.png new file mode 100644 index 0000000..72d294d Binary files /dev/null and b/Quellcodes/alg_ds_graphentester/view/end.png differ diff --git a/Quellcodes/alg_ds_graphentester/view/graphenalgorithmen.fxml b/Quellcodes/alg_ds_graphentester/view/graphenalgorithmen.fxml new file mode 100644 index 0000000..0863515 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/view/graphenalgorithmen.fxml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Quellcodes/alg_ds_graphentester/view/graphtab.fxml b/Quellcodes/alg_ds_graphentester/view/graphtab.fxml new file mode 100644 index 0000000..ba2ea58 --- /dev/null +++ b/Quellcodes/alg_ds_graphentester/view/graphtab.fxml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +