Package ru.spbu.math.ontologycomparison.zhukova.visualisation.ui.graphpane

Examples of ru.spbu.math.ontologycomparison.zhukova.visualisation.ui.graphpane.GraphPane


    public void mouseDragged(MouseEvent e) {
        Point mouseLocation = e.getPoint();
        int dx = mouseLocation.x - MovingTool.from.x;
        int dy = mouseLocation.y - MovingTool.from.y;
        GraphPane graphPane = Tool.getGraphPane();
        Set<IVertex> vertices = graphPane.getSelectedVertices();
        for (IVertex v : vertices) {
            graphPane.getGraphModel().moveVertex(v, dx, dy);
        }
        MovingTool.from = mouseLocation;
        graphPane.repaint();
    }
View Full Code Here


    public void mouseDragged(MouseEvent e) {
        Point mouseLocation = e.getPoint();
        int dx = mouseLocation.x - ResizingTool.from.x;
        int dy = mouseLocation.y - ResizingTool.from.y;
        GraphPane graphPane = Tool.getGraphPane();
        if (ResizingTool.moveLeftBorder) {
            ResizingTool.superVertex.moveLeftBorder(dx);
        }
        if (ResizingTool.moveRightBorder) {
            ResizingTool.superVertex.moveRightBorder(dx);
        }
        if (ResizingTool.moveBottomBorder) {
            ResizingTool.superVertex.moveBottomBorder(dy);
        }
        if (ResizingTool.moveTopBorder) {
            ResizingTool.superVertex.moveTopBorder(dy);
        }
        ResizingTool.from = mouseLocation;
        graphPane.repaint();
    }
View Full Code Here

    }

    public void mouseReleased(MouseEvent e) {
        if (e.getButton() == MouseEvent.BUTTON1) {
            Point mouseLocation = e.getPoint();
            GraphPane graphPane = Tool.getGraphPane();
            if (mouseLocation.equals(SelectingTool.left)) {
                if (!SelectingTool.isOnlySuperVerticesSelection) {
                    Set<SimpleVertex> simpleVertices = graphPane.getGraphModel().getSimpleVertices();
                    for (IVertex v : simpleVertices) {
                        if (v.hitTest(mouseLocation)) {
                            graphPane.selectVertex(v);
                            break;
                        }
                    }
                }
                Set<SuperVertex> vertices = graphPane.getGraphModel().getSuperVertices();
                for (IVertex v : vertices) {
                    if (v.hitTest(mouseLocation)) {
                        graphPane.selectVertex(v);
                        break;
                    }
                }

            } else {
                Set<SuperVertex> superVertices = graphPane.getGraphModel().getSuperVertices();
                for (SuperVertex v : superVertices) {
                    if (v.isInRectangleTest(SelectingTool.left, mouseLocation)) {
                        graphPane.selectVertex(v);
                    }
                }
                if (!SelectingTool.isOnlySuperVerticesSelection) {
                    Set<SimpleVertex> simpleVertices = graphPane.getGraphModel().getSimpleVertices();
                    for (SimpleVertex v : simpleVertices) {
                        if (v.isInRectangleTest(SelectingTool.left, mouseLocation) && !graphPane.getSelectedVertices().contains(v.getSuperVertex())) {
                            graphPane.selectVertex(v);
                        }
                    }
                }
            }
            graphPane.repaint();
        }
        SelectingTool.rectangleWidth = 0;
        SelectingTool.rectangleHeight = 0;
    }
View Full Code Here

TOP

Related Classes of ru.spbu.math.ontologycomparison.zhukova.visualisation.ui.graphpane.GraphPane

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.