Package fmg.fmg8.umgebung2D

Examples of fmg.fmg8.umgebung2D.Pixel


     *
     * @param args  Parameter.
     */
    @Deprecated
    public static void main(String[] args) {
        Parametersatz params = new Parametersatz(args);
        params.ergaenze();
        String seqCode
        = "001 110 100 101 000 012 099 001 000 007 000 000 002 001 000 " +
        "012 099 002 000 004 000 000 005 001 000 000 000 014 105 100 " +
        "001 000 012 099 001 000 004 000 000 010 001 000 012 099 001 " +
        "000 007 000 000 004 001 000 000 000 013 108 100 001 000 012 " +
View Full Code Here


            } else {
                automatSp = false;
            }
                this.schnappAuts++;
                this.schnappZyklen = 0;
                this.aufnahme.addPopSn(new PopSnapshot(
                                       this.umgebung.getAkteure(),
                                       this.umgebung.getGegVerschieb(),
                                       this.simZyklen,
                                       automatSp));
        }
View Full Code Here

        double yFakt = bF / bf;
        int xNeuErst;
        int yNeuErst;
        int xNeuLetzt;
        int yNeuLetzt;
        Pixel normPix = null;
        Iterator<Pixel> it = this.neueNormPixel.iterator();

        while (it.hasNext()) {
            try {
                normPix = (Pixel) it.next();
                xNeuErst = (int) Math.round(normPix.x * xFakt);
                yNeuErst = (int) Math.round(normPix.y * yFakt);
                xNeuLetzt = (int) Math.round((normPix.x + 1) * xFakt);
                yNeuLetzt = (int) Math.round((normPix.y + 1) * yFakt);
                for (int x = xNeuErst; x < xNeuLetzt; x++) {
                    for (int y = yNeuErst; y < yNeuLetzt; y++) {
                        if (this.darFeld[x][y] != normPix.farbe()) {
                            this.wartPixel.add(new Pixel(x,
                                                         y,
                                                         normPix.farbe()));
                            this.darFeld[x][y] = normPix.farbe();
                        }
                    }
                }
            } catch (final Exception e) {
                SonstMeth.log(SonstMeth.LOG_WARNING,
View Full Code Here

     *
     * @param g  Das Grafik-Feld.
     */
    private void maleFeld(final Graphics g) {
        LinkedList<Pixel> pixel;
        Pixel aktPix;
        Iterator<Pixel> it;
       
        if (this.xRand == 0 && this.yRand == 0) {
            this.xRand = g.getClipBounds().getX()
                         + Konstanten.SIM_RAND_LINKS;
            this.yRand = g.getClipBounds().getY()
                         + Konstanten.SIM_RAND_OBEN;
        }

        this.laufendeNummer++;

        this.berZuZeichnendePixel();
       
        pixel = this.wartPixel;

        it = pixel.iterator();
        while (it.hasNext()) {
            aktPix = (Pixel) it.next();

            if (aktPix.farbe() == Konstanten.FARBE_ROB) {
                g.setColor(Konstanten.C_VORDERGRUND);
            } else if (aktPix.farbe() == Konstanten.FARBE_SEL) {
                g.setColor(Konstanten.C_SPEZIAL);
            } else if (aktPix.farbe() == Konstanten.FARBE_RAHMEN) {
                g.setColor(Konstanten.C_RAHMEN);
            } else if (aktPix.farbe() == Konstanten.FARBE_GGSTD) {
                g.setColor(Konstanten.C_GEGENSTAND);
            } else if (aktPix.farbe() >= 100 && aktPix.farbe() <= 125) {
                // Benutzerfarben.
                g.setColor(Konstanten.C_BENUTZER[aktPix.farbe() - 100]);
            } else if (aktPix.farbe() == Konstanten.FARBE_DURCHLAESSIG) {
                g.setColor(Konstanten.C_DURCHLAESSIG);
            } else {
                g.setColor(this.getBackground());
            }

View Full Code Here

        double yFakt = bF / bf;
        int xNeuErst;
        int yNeuErst;
        int xNeuLetzt;
        int yNeuLetzt;
        Pixel normPix = null;
        Iterator<Pixel> it = this.neueNormPixel.iterator();

        while (it.hasNext()) {
            try {
                normPix = (Pixel) it.next();
                xNeuErst = (int) Math.round(normPix.x * xFakt);
                yNeuErst = (int) Math.round(normPix.y * yFakt);
                xNeuLetzt = (int) Math.round((normPix.x + 1) * xFakt);
                yNeuLetzt = (int) Math.round((normPix.y + 1) * yFakt);
                for (int x = xNeuErst; x < xNeuLetzt; x++) {
                    for (int y = yNeuErst; y < yNeuLetzt; y++) {
                        if (this.darFeld[x][y] != normPix.farbe()) {
                            this.wartPixel.add(new Pixel(x,
                                                         y,
                                                         normPix.farbe()));
                            this.darFeld[x][y] = normPix.farbe();
                        }
                    }
                }
            } catch (final Exception e) {
                SonstMeth.log(SonstMeth.LOG_WARNING,
View Full Code Here

     *
     * @param g  Das Grafik-Feld.
     */
    private void maleFeld(final Graphics g) {
        LinkedList<Pixel> pixel;
        Pixel aktPix;
        Iterator<Pixel> it;
       
        if (this.xRand == 0 && this.yRand == 0) {
            this.xRand = g.getClipBounds().getX()
                         + Konstanten.SIM_RAND_LINKS;
            this.yRand = g.getClipBounds().getY()
                         + Konstanten.SIM_RAND_OBEN;
        }

        this.laufendeNummer++;

        this.berZuZeichnendePixel();
       
        pixel = this.wartPixel;

        it = pixel.iterator();
        while (it.hasNext()) {
            aktPix = (Pixel) it.next();

            if (aktPix.farbe() == Konstanten.FARBE_ROB) {
                g.setColor(Konstanten.C_VORDERGRUND);
            } else if (aktPix.farbe() == Konstanten.FARBE_SEL) {
                g.setColor(Konstanten.C_SPEZIAL);
            } else if (aktPix.farbe() == Konstanten.FARBE_RAHMEN) {
                g.setColor(Konstanten.C_RAHMEN);
            } else if (aktPix.farbe() == Konstanten.FARBE_GGSTD) {
                g.setColor(Konstanten.C_GEGENSTAND);
            } else if (aktPix.farbe() >= 100 && aktPix.farbe() <= 125) {
                // Benutzerfarben.
                g.setColor(Konstanten.C_BENUTZER[aktPix.farbe() - 100]);
            } else if (aktPix.farbe() == Konstanten.FARBE_DURCHLAESSIG) {
                g.setColor(Konstanten.C_DURCHLAESSIG);
            } else {
                g.setColor(this.getBackground());
            }

View Full Code Here

            final Translator[] trans) {

        this.aktVisTrans = new LinkedList<VisTrans>();
       
        if (this.rob == null) {
            this.rob = new Roboter(
                    0,
                    0,
                    0,
                    fmg.fmg8.umgebung2D.Konstanten.ROB_AUSDEHNUNG_X,
                    fmg.fmg8.umgebung2D.Konstanten.ROB_AUSDEHNUNG_Y,
View Full Code Here

        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,
View Full Code Here

     *                werden soll.
     * @param x       X-Koordinate.
     * @param y       Y-Koordinate.
     */
    public void neueKoord(final Knoten knoten, final int x, final int y) {
        Vektor2D koord;

        if (this.gesetzteKn.containsKey(knoten.holeName())) {
            koord = this.gesetzteKn.get(knoten.holeName());
            koord.x = x;
            koord.y = y;
        } else {
            this.gesetzteKn.put(knoten.holeName(), new Vektor2D(x, y));
        }
    }
View Full Code Here

                    this.drehen.set(i, !this.drehen.get(i));
                    this.winkel.set(i, this.random.nextDouble() * 0.5);
                }
            }
            if (this.versch.get(i)) {
                Vektor2D vSchiebg = umg.getDynVersch()[this.waende.get(i)];
                vSchiebg.add(new Vektor2D(
                        this.xRicht.get(i),
                        this.yRicht.get(i)));
               
                if (null != umg.verschWand(
                        this.waende.get(i),
                        vSchiebg)) {
                    this.versch.set(i, !this.versch.get(i));
                    this.xRicht.set(i, this.random.nextDouble() * 0.5);
                    this.yRicht.set(i, this.random.nextDouble() * 0.5);
                }
            } else {
                Vektor2D vSchiebg = umg.getDynVersch()[this.waende.get(i)];
                vSchiebg.add(new Vektor2D(
                        -this.xRicht.get(i),
                        -this.yRicht.get(i)));
               
                if (null != umg.verschWand(
                        this.waende.get(i),
View Full Code Here

TOP

Related Classes of fmg.fmg8.umgebung2D.Pixel

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.