Package edu.uci.ics.jung.visualization

Examples of edu.uci.ics.jung.visualization.VisualizationViewer.inverseTransform()


        if (checkModifiers(e) && isConsumer()) {
            if (rect.getHeight() > 10 && rect.getWidth() > 10) {
                Color c = JColorChooser.showDialog(vv, "Choose a background color", Color.GRAY);
                if (c != null) {
                    NexsmPaintableBox npb = new NexsmPaintableBox();
                    npb.setP1(vv.inverseTransform(down));
                    npb.setP2(vv.inverseTransform(p));
                    npb.setColor(c);
                    if (gm != null) {
                        gm.putRenderer(vv.getName(), npb);
                    }
View Full Code Here


            if (rect.getHeight() > 10 && rect.getWidth() > 10) {
                Color c = JColorChooser.showDialog(vv, "Choose a background color", Color.GRAY);
                if (c != null) {
                    NexsmPaintableBox npb = new NexsmPaintableBox();
                    npb.setP1(vv.inverseTransform(down));
                    npb.setP2(vv.inverseTransform(p));
                    npb.setColor(c);
                    if (gm != null) {
                        gm.putRenderer(vv.getName(), npb);
                    }
                }
View Full Code Here

    public void mouseDragged(MouseEvent e) {
        if(locked == false) {
            VisualizationViewer vv = (VisualizationViewer)e.getSource();
            if(vertex != null) {
                Point p = e.getPoint();
                Point2D graphPoint = vv.inverseTransform(p);
                Point2D graphDown = vv.inverseTransform(down);
                Layout layout = vv.getGraphLayout();
                double dx = graphPoint.getX()-graphDown.getX();
                double dy = graphPoint.getY()-graphDown.getY();
                PickedState ps = vv.getPickedState();
View Full Code Here

        if(locked == false) {
            VisualizationViewer vv = (VisualizationViewer)e.getSource();
            if(vertex != null) {
                Point p = e.getPoint();
                Point2D graphPoint = vv.inverseTransform(p);
                Point2D graphDown = vv.inverseTransform(down);
                Layout layout = vv.getGraphLayout();
                double dx = graphPoint.getX()-graphDown.getX();
                double dy = graphPoint.getY()-graphDown.getY();
                PickedState ps = vv.getPickedState();
               
View Full Code Here

        if (pickedVerticesIt != null && pickedVerticesIt.hasNext()) {
            Vertex vertex = (Vertex)pickedVerticesIt.next();
            if (vertex != null) {
                Layout layout = vv.getGraphLayout();
                Point2D q = layout.getLocation(vertex);
                Point2D lvc = vv.inverseTransform(vv.getCenter());
                final double dx = (lvc.getX() - q.getX()) / 10;
                final double dy = (lvc.getY() - q.getY()) / 10;
               
                Runnable animator = new Runnable() {
                   
View Full Code Here

        VisualizationViewer vv = null;
        if (checkModifiers(e) && isConsumer()) {
            Object o = e.getSource();
            if (o instanceof VisualizationViewer) {
                vv = (VisualizationViewer)o;
                final Point2D p = vv.inverseTransform(e.getPoint());
                String text = JOptionPane.showInputDialog(vv, "Please provide the text", "Label's value", JOptionPane.QUESTION_MESSAGE);
                if (text != null && text.length() > 0) {
                    NexsmPaintableText npt = new NexsmPaintableText();
                    npt.setText(text);
                    npt.setP1(p);
View Full Code Here

        if (checkModifiers(e) && isConsumer()) {
            if (Math.sqrt( line.getBounds2D().getWidth() + line.getBounds2D().getHeight() ) > 10) {
                Color c = JColorChooser.showDialog(vv, "Choose a foreground color", Color.GRAY);
                if (c != null) {
                    NexsmPaintableLine npb = new NexsmPaintableLine();
                    npb.setP1(vv.inverseTransform(down));
                    npb.setP2(vv.inverseTransform(p));
                    npb.setColor(c);
                    if (gm != null) {
                        gm.putRenderer(vv.getName(), npb);
                    }
View Full Code Here

            if (Math.sqrt( line.getBounds2D().getWidth() + line.getBounds2D().getHeight() ) > 10) {
                Color c = JColorChooser.showDialog(vv, "Choose a foreground color", Color.GRAY);
                if (c != null) {
                    NexsmPaintableLine npb = new NexsmPaintableLine();
                    npb.setP1(vv.inverseTransform(down));
                    npb.setP2(vv.inverseTransform(p));
                    npb.setColor(c);
                    if (gm != null) {
                        gm.putRenderer(vv.getName(), npb);
                    }
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.