Package java.awt.event

Examples of java.awt.event.MouseMotionAdapter


                    }
                }

            });

            this.addMouseMotionListener(new MouseMotionAdapter() {
                @Override
                public void mouseDragged(final MouseEvent event) {
                    int x = event.getX();
                    int y = event.getY();

                    int un = Vis.this.getSize().height - 50;
                    int re = Vis.this.getSize().width - 50;
                    int li = 50;
                   
                    if (Vis.this.gewKnot != null) {
                        if (x < li) {
                            x = li;
                        }
                        if (x > re) {
                            x = re;
                        }
                        if (y < ConstantsDarstellung.OBEN) {
                            y = ConstantsDarstellung.OBEN;
                        }
                        if (y > un) {
                            y = un;
                        }

                        Vis.this.darstArten[Vis.this.aktAut].neueKoord(
                                Vis.this.gewKnot, x, y);

                        Vis.this.aktGraph = Vis.this.darstArten[Vis.this.aktAut]
                                .erzeuge(Vis.this.rob.vAuts()[Vis.this.aktAut],
                                        Vis.this.selKnot[Vis.this.aktAut]);
                        Vis.super.update(Vis.this.getGraphics());
                        Vis.this.repaint();
                    }
                }
            });
            return;
        }

        this.addKeyListener(new KeyListener() {

            /**
             * Die Key-Typed-Methode.
             */
            @Override
            public void keyTyped(final KeyEvent e) {

            }

            /**
             * Die Key-Released-Methode.
             */
            @Override
            public void keyReleased(final KeyEvent e) {

            }

            /**
             * Die Key-Pressed-Methode.
             */
            @Override
            public void keyPressed(final KeyEvent e) {
                if (e.getKeyCode() == java.awt.event.KeyEvent.VK_C) {
                    if (e.isControlDown()) {
                        String copy = Vis.this.holeAktGrSeq();

                        StaticMethods.log(StaticMethods.LOG_DEBUG,
                                "In Zwischenablage (" + copy + ")",
                                Vis.this.pars);
                        Vis.this.zwischenablage.copyToClipboard(copy);
                    }
                }

                if (e.getKeyCode() == java.awt.event.KeyEvent.VK_V) {
                    if (e.isControlDown()) {
                        String copy = Vis.this.zwischenablage.getClipbB();

                        StaticMethods.log(
                                StaticMethods.LOG_DEBUG,
                                "Aus Zwischenablage mit Standardtranslator ("
                                + copy
                                + ")",
                                Vis.this.pars);
                        // try {
                        // Vis.this.erzeugeAktAusSequenz(
                        // SonstMeth.decompressString(
                        // copy,
                        // Vis.this.pars),
                        // null,
                        // false);
                        // } catch (Exception e1) {
                        Vis.this.erzeugeAktAusSequenz(copy, null, false);
                        // }
                        Vis.this.steuer.loescheSelKnot();
                        Vis.this.repaint();
                    }
                }
            }
        });

        this.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(final MouseEvent event) {
                if (!Vis.this.simLaueft) {
                    final int x = event.getX();
                    final int y = event.getY();

                    final int radius = (int) (
                       eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM) / 2;
                    ArrayList<Knoten> naKn;

                    naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                    if (naKn.size() > 0) {
                        Vis.this.gewKnot = naKn.get(0);
                        Vis.this.selKnot[Vis.this.aktAut] = naKn
                                .get(0);
                    } else {
                        Vis.this.selKnot[Vis.this.aktAut] = null;
                    }
                    Vis.this.neuZeichnen();
                }
            }

            @Override
            public void mouseClicked(final MouseEvent event) {
                if (!Vis.this.simLaueft) {
                    if (event.getButton() == 1 && event.getClickCount() == 2) {
                        final int x = event.getX();
                        final int y = event.getY();

                        final int radius = (int) (
                            eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM)
                            / 2;
                        ArrayList<Knoten> naKn;

                        naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                        if (naKn.size() > 0) {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .setStart(naKn.get(0));
                        } else {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .entferneStartZ();
                        }

                        Vis.this.neuZeichnen();
                        Vis.this.steuer
                                .selKn(Vis.this.selKnot[Vis.this.aktAut]);
                    } else if (event.getButton() == 3
                            && event.getClickCount() == 2) {
                        final int x = event.getX();
                        final int y = event.getY();

                        final int radius = (int) (
                            eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM)
                            / 2;
                        ArrayList<Knoten> naKn;

                        naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                        if (naKn.size() > 0) {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .einfStern(naKn.get(0)
                                            .holeName(),
                                            new ArrayList<Integer>(Vis.this.rob
                                                    .vAuts()[Vis.this.aktAut]
                                                    .holAdj().keySet()));
                            Vis.this.neuZeichnen();
                            Vis.this.steuer
                                    .selKn(Vis.this.selKnot[Vis.this.aktAut]);
                        }
                    } else if (event.getButton() == 3
                            && event.getClickCount() == 3) {
                        final int x = event.getX();
                        final int y = event.getY();
                        final int radius = (int) (
                            eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM)
                            / 2;
                        ArrayList<Knoten> naKn;

                        naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                        if (naKn.size() == 0) {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .einfClique(new ArrayList<Integer>(
                                         Vis.this.rob.vAuts()[Vis.this.aktAut]
                                                         .holAdj().keySet()));
                            Vis.this.neuZeichnen();
                            Vis.this.steuer
                                    .selKn(Vis.this.selKnot[Vis.this.aktAut]);
                        }
                    }
                }
            }

            @Override
            public void mouseReleased(final MouseEvent event) {
                if (!Vis.this.simLaueft) {
                    Vis.this.gewKnot = null;
                    Vis.this.steuer.selKn(Vis.this.selKnot[Vis.this.aktAut]);
                }
            }
        });

        this.addMouseMotionListener(new MouseMotionAdapter() {
            @Override
            public void mouseDragged(final MouseEvent event) {
                int x = event.getX();
                int y = event.getY();

View Full Code Here


               
            }
        }
        );

        this.addMouseMotionListener(new MouseMotionAdapter() {
            public void mouseDragged(final MouseEvent event) {
                Vektor2D vek = new Vektor2D(
                        (event.getX() - verschiebung.x) / skalierung,
                        (event.getY() - verschiebung.y) / skalierung);
                Vektor2D neu;
View Full Code Here

                    }
                }

            });

            this.addMouseMotionListener(new MouseMotionAdapter() {
                public void mouseDragged(final MouseEvent event) {
                    int x = event.getX();
                    int y = event.getY();

                    int un = Vis.this.getSize().height - 50;
                    int re = Vis.this.getSize().width - 50;
                    int li = 50;
                   
                    if (Vis.this.gewKnot != null) {
                        if (x < li) {
                            x = li;
                        }
                        if (x > re) {
                            x = re;
                        }
                        if (y < Konstanten.OBEN) {
                            y = Konstanten.OBEN;
                        }
                        if (y > un) {
                            y = un;
                        }

                        Vis.this.darstArten[Vis.this.aktAut].neueKoord(
                                Vis.this.gewKnot, x, y);

                        Vis.this.aktGraph = Vis.this.darstArten[Vis.this.aktAut]
                                .erzeuge(Vis.this.rob.vAuts()[Vis.this.aktAut],
                                        Vis.this.selKnot[Vis.this.aktAut]);
                        Vis.super.update(Vis.this.getGraphics());
                        Vis.this.repaint();
                    }
                }
            });
            return;
        }

        this.addKeyListener(new KeyListener() {

            /**
             * Die Key-Typed-Methode.
             */
            public void keyTyped(final KeyEvent e) {

            }

            /**
             * Die Key-Released-Methode.
             */
            public void keyReleased(final KeyEvent e) {

            }

            /**
             * Die Key-Pressed-Methode.
             */
            public void keyPressed(final KeyEvent e) {
                if (e.getKeyCode() == java.awt.event.KeyEvent.VK_C) {
                    if (e.isControlDown()) {
                        String copy = Vis.this.holeAktGrSeq();

                        SonstMeth.log(SonstMeth.LOG_DEBUG,
                                "In Zwischenablage (" + copy + ")",
                                Vis.this.pars);
                        Vis.this.zwischenablage.copyToClipboard(copy);
                    }
                }

                if (e.getKeyCode() == java.awt.event.KeyEvent.VK_V) {
                    if (e.isControlDown()) {
                        String copy = Vis.this.zwischenablage.getClipbB();

                        SonstMeth.log(1, "Aus Zwischenablage (" + copy + ")",
                                Vis.this.pars);
                        Vis.this.erzeugeAktAusSequenz(copy, null, false);
                        Vis.this.steuer.loescheSelKnot();
                        Vis.this.repaint();
                    }
                }
            }
        });

        this.addMouseListener(new MouseAdapter() {
            public void mousePressed(final MouseEvent event) {
                if (!Vis.this.simLaueft) {
                    final int x = event.getX();
                    final int y = event.getY();

                    final int radius = (int) (
                       fmg.fmg8.graphVis.zeichenModi.Konstanten.KN_DURCHM) / 2;
                    ArrayList<Knoten> naKn;

                    naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                    if (naKn.size() > 0) {
                        Vis.this.gewKnot = (Knoten) naKn.get(0);
                        Vis.this.selKnot[Vis.this.aktAut] = (Knoten) naKn
                                .get(0);
                    } else {
                        Vis.this.selKnot[Vis.this.aktAut] = null;
                    }
                    Vis.this.neuZeichnen();
                }
            }

            public void mouseClicked(final MouseEvent event) {
                if (!Vis.this.simLaueft) {
                    if (event.getButton() == 1 && event.getClickCount() == 2) {
                        final int x = event.getX();
                        final int y = event.getY();

                        final int radius = (int) (
                            fmg.fmg8.graphVis.zeichenModi.Konstanten.KN_DURCHM)
                            / 2;
                        ArrayList<Knoten> naKn;

                        naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                        if (naKn.size() > 0) {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .setStart((Knoten) naKn.get(0));
                        } else {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .entferneStartZ();
                        }

                        Vis.this.neuZeichnen();
                        Vis.this.steuer
                                .selKn(Vis.this.selKnot[Vis.this.aktAut]);
                    } else if (event.getButton() == 3
                            && event.getClickCount() == 2) {
                        final int x = event.getX();
                        final int y = event.getY();

                        final int radius = (int) (
                            fmg.fmg8.graphVis.zeichenModi.Konstanten.KN_DURCHM)
                            / 2;
                        ArrayList<Knoten> naKn;

                        naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                        if (naKn.size() > 0) {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .einfStern(((Knoten) naKn.get(0))
                                            .holeName(),
                                            new ArrayList<Integer>(Vis.this.rob
                                                    .vAuts()[Vis.this.aktAut]
                                                    .holAdj().keySet()));
                            Vis.this.neuZeichnen();
                            Vis.this.steuer
                                    .selKn(Vis.this.selKnot[Vis.this.aktAut]);
                        }
                    } else if (event.getButton() == 3
                            && event.getClickCount() == 3) {
                        final int x = event.getX();
                        final int y = event.getY();
                        final int radius = (int) (
                            fmg.fmg8.graphVis.zeichenModi.Konstanten.KN_DURCHM)
                            / 2;
                        ArrayList<Knoten> naKn;

                        naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
                        if (naKn.size() == 0) {
                            Vis.this.rob.vAuts()[Vis.this.aktAut]
                                    .einfClique(new ArrayList<Integer>(
                                         Vis.this.rob.vAuts()[Vis.this.aktAut]
                                                         .holAdj().keySet()));
                            Vis.this.neuZeichnen();
                            Vis.this.steuer
                                    .selKn(Vis.this.selKnot[Vis.this.aktAut]);
                        }
                    }
                }
            }

            public void mouseReleased(final MouseEvent event) {
                if (!Vis.this.simLaueft) {
                    Vis.this.gewKnot = null;
                    Vis.this.steuer.selKn(Vis.this.selKnot[Vis.this.aktAut]);
                }
            }
        });

        this.addMouseMotionListener(new MouseMotionAdapter() {
            public void mouseDragged(final MouseEvent event) {
                int x = event.getX();
                int y = event.getY();

                int un = Vis.this.getSize().height - 50;
View Full Code Here

               
            }
        }
        );

        this.addMouseMotionListener(new MouseMotionAdapter() {
            @Override
            public void mouseDragged(final MouseEvent event) {
                Vector2D vek = new Vector2D(
                        (event.getX() - verschiebung.x) / skalierung,
                        (event.getY() - verschiebung.y) / skalierung);
View Full Code Here

                    VisTrans.this.gewKnot = null;
                }
            }
        });

        this.addMouseMotionListener(new MouseMotionAdapter() {
            @Override
            public void mouseDragged(final MouseEvent event) {
                int x = event.getX();
                int y = event.getY();
View Full Code Here

        }
      }
    });

    this.addMouseMotionListener(new MouseMotionAdapter() {
      public void mouseMoved(MouseEvent e) {
        // We might have to show a tooltip
        // if the mouse is over a node.
        updateTooltipState(e.getPoint());
      }
View Full Code Here

        svgCanvas.addSVGLoadEventDispatcherListener(this);
        svgCanvas.addGVTTreeRendererListener(this);
        svgCanvas.addLinkActivationListener(this);
        svgCanvas.addUpdateManagerListener(this);

        svgCanvas.addMouseMotionListener(new MouseMotionAdapter() {
                public void mouseMoved(MouseEvent e) {
                    if (svgDocument == null) {
                        statusBar.setXPosition(e.getX());
                        statusBar.setYPosition(e.getY());
                    } else {
View Full Code Here

    /**
     *
     */
    public AbstractDataPanel() {
        initUIComponents();
        table.addMouseMotionListener(new MouseMotionAdapter() {
            int lastRow = -1;
            public void mouseMoved(MouseEvent e) {
                int row = table.rowAtPoint(e.getPoint());
                if (row != lastRow) {
                    lastRow = row;
View Full Code Here

     * Create the mouse motion listener.
     *
     * @return the mouse motion listener.
     */
    private MouseMotionAdapter createMouseMotionListener() {
        return new MouseMotionAdapter() {
            @Override
            public void mouseDragged(MouseEvent e) {
                Point dragPoint = new Point(e.getPoint());

                SwingUtilities.convertPointToScreen(dragPoint, fComponent);
View Full Code Here

         {
            onMouseReleased(e);
         }
      });

      _desktopPane.addMouseMotionListener(new MouseMotionAdapter()
      {
         public void mouseDragged(MouseEvent e)
         {
            onMouseDragged(e);
         }
View Full Code Here

TOP

Related Classes of java.awt.event.MouseMotionAdapter

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.