Package fmg.fmg8.pfeilGUI.funktionen2D

Examples of fmg.fmg8.pfeilGUI.funktionen2D.FlagFunktion


        this.aktGraph = this.darstArt.erzeuge(this.aktTrans, this.gewKnot);

        this.removeAll();
       
        this.addWindowListener(new WindHideAdapt());
       
        this.zwischenablage = new Zwischenablage();

        this.zeichenArt = new PfeilMaster(this.pars);
        this.gewKnot = null;
View Full Code Here


     * @param autAnz  Die Anzahl der Automaten pro Roboter.
     */
    private void init2(final int autAnz) {
        this.removeAll();
        this.setSize(800, 730);
        this.addWindowListener(new WindHideAdapt());
       
        this.darstArten = new DarstModEA[autAnz];
       
        for (int i = 0; i < autAnz; i++) {
            this.darstArten[i] = new DarstModEA(
View Full Code Here

        DargestellterGraph darstellung = new DargestellterGraph();
        Iterator<Knoten> it;
        Iterator<Knoten> it1;
        Iterator<Integer> it2;
        Iterator<Transition> it3;
        Knoten knot;
        Knoten knot1;
        Knoten knot2;
        Vektor2D koord1;
        Vektor2D koord2;

        if (!g.istLeer()) {
            final ArrayList<Knoten> knotenListe
                = new ArrayList<Knoten>(g.holAdj().values());
            int knAnzahl = knotenListe.size();
           
            if (knAnzahl < 2) {
                knAnzahl = 2;
            }
           
            int gitterX = Math.abs(this.rechts - this.links)
                          / (int) ((Math.ceil(Math.sqrt(knAnzahl))) - 1);
            int gitterY = Math.abs(this.unten - this.oben)
                          / (int) ((Math.ceil(Math.sqrt(knAnzahl))) - 1);

            int koordX = this.links;
            int koordY = this.oben;
           
            int kX;
            int kY;
            Transition bed;
            int folgeZustand;
            String bedingung;
            int xAusgleich;
            int zaehler = 0;
           
            // Knoten
            it = knotenListe.iterator();
            while (it.hasNext()) {
                knot = it.next();

                if (this.gesetzteKn.containsKey(knot.holeName())) {
                    kX = (int) this.gesetzteKn.get(knot.holeName()).x;
                    kY = (int) this.gesetzteKn.get(knot.holeName()).y;
                    this.setzeKnoten(knot,
                                     darstellung,
                                     kX,
                                     kY,
                                     (Knoten) ausgKn);

                    if (g.istStartZ(knot)) {
                        darstellung.hinzuPfeil(kX - 60,
                                               kY - 60,
                                               kX - 45,
                                               kY - 45,
                                               0.5,
                                               false);
                    }
                } else {
                    this.setzeKnoten(knot,
                                     darstellung,
                                     koordX,
                                     koordY,
                                     (Knoten) ausgKn);

                    this.gesetzteKn.put(knot.holeName(),
                                        new Vektor2D(koordX, koordY));

                    if (g.istStartZ(knot)) {
                        darstellung.hinzuPfeil(koordX - 60,
                                               koordY - 60,
                                               koordX - 45,
                                               koordY - 45,
                                               0.5,
                                               false);
                    }

                    zaehler++;
                   
                    if (zaehler < Math.ceil(Math.sqrt(knAnzahl))) {
                        koordX = koordX + gitterX;
                    } else {
                        koordX = this.links;
                        koordY = koordY + gitterY;
                        zaehler = 0;
                    }
                }
            }

            // Kanten
            it1 = knotenListe.iterator();
            while (it1.hasNext()) {
                knot1 = (Knoten) it1.next();
                koord1 = (Vektor2D) this.gesetzteKn.get(knot1.holeName());

                it2 = (new ArrayList<Integer>(
                                knot1.holeNachfolger().keySet())).iterator();
                while (it2.hasNext()) {
                    boolean gebogen = true;
                   
                    knot2 = g.holeKnoten((Integer) it2.next());
                    koord2 = (Vektor2D) this.gesetzteKn.get(knot2.holeName());
                    Condition cond
                        = knot1.getInfo().getTransZuZustand(
                                knot2.holeName()).get(0).getCond();
                    double staerke = SonstMeth.condStrength(cond,
                                                   Konstanten.STAERKE_ERST,
                                                   Konstanten.STAERKE_ZWEIT);
                   
                    if (koord1.distanz(koord2) < 140
                            && !koord1.equals(koord2)) {
                        gebogen = false;
                    }
                   
                    darstellung.hinzuPfeil(
                            (int) koord1.x,
                            (int) koord1.y,
                            (int) koord2.x,
                            (int) koord2.y,
                            staerke,
                            gebogen);
                }
            }

            // Kantenbeschriftungen
            it1 = knotenListe.iterator();
            while (it1.hasNext()) {
                int kantNum = 1;
                knot1 = (Knoten) it1.next();
                koord1 = this.gesetzteKn.get(knot1.holeName());

                it3 = ((ZInfo) knot1.getInfo()).getBeds().iterator();
                while (it3.hasNext()) {
                    Polygon p = new Polygon();
                    bed = it3.next();
                    folgeZustand = bed.getFolgezustand();
                    bedingung = bed.getCond().toString();
                    knot2 = g.holeKnoten(new Integer(folgeZustand));
                    koord2 = this.gesetzteKn.get(knot2.holeName());

                    p.addPoint((int) koord1.x, (int) koord1.y);
                    p.addPoint((int) koord2.x, (int) koord2.y);

                    if (koord1.equals(koord2)) {
View Full Code Here

                                        final double radius) {
        final ArrayList<Knoten> knotenListe = new ArrayList<Knoten>();
        final ArrayList<Point> koordListe = new ArrayList<Point>();
        final ArrayList<Knoten> endListe = new ArrayList<Knoten>();
        Point             aktPunkt;
        Knoten            aktObj;
        Iterator<Point>   itKoord;
        Iterator<Knoten>  itObj;
        double            minAbs = Double.MAX_VALUE;
        double            aktAbs;
        final double      dX = (double) x;
View Full Code Here

                                           final int x2,
                                           final int y2) {

        final ArrayList<Knoten>  knotenListe = new ArrayList<Knoten>();
        Point                    aktPunkt;
        Knoten                   aktObj;
        final Iterator<Point>    itKoord;
        final Iterator<Knoten>   itObj;

        itKoord = this.knotenpunktKoord.iterator();
        itObj   = this.knotenpunktObjekte.iterator();
View Full Code Here

     *            Das observierte Objekt.
     * @param arg
     *            Der Zusatzparameter.
     */
    public void update(final Observable o, final Object arg) {
        Knoten k;
        AutomatenNummer aN;
        ConditionNummer cN;
        int autNum;

        if (arg == null) {
View Full Code Here

       
        this.addWindowListener(new WindHideAdapt());
       
        this.zwischenablage = new Zwischenablage();

        this.zeichenArt = new PfeilMaster(this.pars);
        this.gewKnot = null;

        this.setLayout(new BorderLayout());
       
        JPanel editPanel = new JPanel();
View Full Code Here

                    this.getHeight() - 50);
        }

        this.zwischenablage = new Zwischenablage();

        this.zeichenArt = new PfeilMaster(this.pars);
        this.selKnot = new Knoten[autAnz];
        this.gewKnot = null;

        this.setLayout(new BorderLayout());
       
View Full Code Here

                        unmark2,
                        4);
            }
           
            if (this.ersteEcke != null && this.zweiteEcke != null) {
                Polygon2D quad = new Polygon2D(4);
               
                quad.add(new Vektor2D(this.ersteEcke));
                quad.add(new Vektor2D(this.ersteEcke.x, this.zweiteEcke.y));
                quad.add(new Vektor2D(this.zweiteEcke));
                quad.add(new Vektor2D(this.zweiteEcke.x, this.ersteEcke.y));
               
                liste.add(new AusgMerkm(
                        Color.lightGray,
                        Color.black,
                        true,
                        false));
                liste.add(quad.toPol(this.skalierung, this.verschiebung));
            }
           
            LinkedList<AbstractMsg> msgsError
                = this.pars.getMsgs(
                    (new MsgError(null, 0, null)).getType(),
View Full Code Here

     *
     * @param bezKonst  Die Bezierkonstante.
     */
    public void bezier(final double bezKonst) {
        double bezK = bezKonst;
        Polygon2D bez;
        Vektor2D v1, v2, v3, v4;
        ArrayList<Integer> mark = new ArrayList<Integer>(4);
       
        if (bezK > 1) {
            bezK = fmg.fmg8.graphVis.zeichenModi.Konstanten.BEZ_NORMAL;
        }
       
        if (this.mark1 != null
                && this.mark2 != null
                && !this.mark1.equals(this.mark2)
                && this.markierte.size() == 4) {
           
            mark.addAll(this.markierte);
               
            Collections.sort(this.markierte, new IntComp());

            v1 = this.pfeilPol.get(mark.get(0));
            v2 = this.pfeilPol.get(mark.get(1));
            v3 = this.pfeilPol.get(mark.get(2));
            v4 = this.pfeilPol.get(mark.get(3));

            bez = Geometrie2D.bezierKurve(v1, v2, v3, v4, bezK);
           
            Polygon2D polNeu = new Polygon2D();
            ArrayList<Double> dickenNeu = new ArrayList<Double>();
            boolean platziert = false;
           
            for (int i = 0; i < this.pfeilPol.size(); i++) {
                if (!this.between(mark.get(0), mark.get(3), i)) {
                    polNeu.add(this.pfeilPol.get(i));
                    dickenNeu.add(this.dicken.get(i));
                } else if (!platziert) {
                    for (int n = 0; n < bez.size(); n++) {
                        polNeu.add(bez.get(n));
                        dickenNeu.add(this.dicken.get(i));
                    }
                    platziert = true;
                }
            }
View Full Code Here

TOP

Related Classes of fmg.fmg8.pfeilGUI.funktionen2D.FlagFunktion

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