Package org.gephi.visualization.api.selection

Examples of org.gephi.visualization.api.selection.SelectionManager


        //SelectionManager events
        VizController.getInstance().getSelectionManager().addChangeListener(new ChangeListener() {

            public void stateChanged(ChangeEvent e) {
                SelectionManager selectionManager = VizController.getInstance().getSelectionManager();

                if (selectionManager.isRectangleSelection() && currentTool != null) {
                    toolbar.clearSelection();
                    unselect();
                } else if (selectionManager.isSelectionEnabled() && currentTool != null && currentTool.getSelectionType() == ToolSelectionType.NONE) {
                    toolbar.clearSelection();
                    unselect();
                } else if (selectionManager.isDraggingEnabled() && currentTool != null) {
                    toolbar.clearSelection();
                    unselect();
                }
            }
        });
View Full Code Here


        }
    }

    public JPopupMenu createPopup() {

        SelectionManager manager = VizController.getInstance().getSelectionManager();
        final MouseSelectionPopupPanel popupPanel = new MouseSelectionPopupPanel();
        popupPanel.setDiameter(manager.getMouseSelectionDiameter());
        popupPanel.setProportionnalToZoom(manager.isMouseSelectionZoomProportionnal());
        popupPanel.setChangeListener(new ChangeListener() {

            public void stateChanged(ChangeEvent e) {
                SelectionManager manager = VizController.getInstance().getSelectionManager();
                manager.setMouseSelectionDiameter(popupPanel.getDiameter());
                manager.setMouseSelectionZoomProportionnal(popupPanel.isProportionnalToZoom());
            }
        });

        JPopupMenu menu = new JPopupMenu();
        menu.add(popupPanel);
View Full Code Here

        menu.add(popupPanel);
        return menu;
    }

    public void refresh() {
        SelectionManager manager = VizController.getInstance().getSelectionManager();
        if (manager.isSelectionEnabled()) {
            if (manager.isRectangleSelection()) {
                mouseSelection = false;
                statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.rectangleSelection"));
            } else if (manager.isDirectMouseSelection()) {
                mouseSelection = true;
                statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.mouseSelection"));
            } else if (manager.isDraggingEnabled()) {
                mouseSelection = true;
                statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.dragging"));
            }
        } else {
            mouseSelection = false;
View Full Code Here

        //Init events
        VizController.getInstance().getSelectionManager().addChangeListener(new ChangeListener() {

            public void stateChanged(ChangeEvent e) {
                SelectionManager selectionManager = VizController.getInstance().getSelectionManager();
                if (selectionManager.isBlocked()) {
                    buttonGroup.clearSelection();
                } else if (!selectionManager.isSelectionEnabled()) {
                    buttonGroup.clearSelection();
                } else if (selectionManager.isDirectMouseSelection()) {
                    if (!buttonGroup.isSelected(mouseButton.getModel())) {
                        buttonGroup.setSelected(mouseButton.getModel(), true);
                    }
                }
            }
View Full Code Here

            return;
        }

        boolean ctrl = (e.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0 || (e.getModifiers() & InputEvent.CTRL_MASK) != 0;
        if (ctrl) {
            SelectionManager manager = VizController.getInstance().getSelectionManager();
            if (!manager.isRectangleSelection()) {
                int s = manager.getMouseSelectionDiameter();
                s += -e.getUnitsToScroll() * 2;
                s = Math.min(1000, s);
                s = Math.max(1, s);
                manager.setMouseSelectionDiameter(s);
            }
            return;
        }

        //Attributes
View Full Code Here

            }
        }
    }

    public void selectCluster(Cluster cluster) {
        SelectionManager selectionManager = VizController.getInstance().getSelectionManager();
        selectionManager.resetSelection();
        selectionManager.selectNodes(cluster.getNodes());
    }
View Full Code Here

        //dataBridge = new TestDataBridge();
        modeManager = new ModeManager();
        textManager = new TextManager();
        screenshotMaker = new ScreenshotMaker();
        currentModel = new VizModel(true);
        selectionManager = new SelectionManager();

        if (vizConfig.isUseGLJPanel()) {
            drawable = commander.createPanel();
        } else {
            drawable = commander.createCanvas();
View Full Code Here

            return;
        }

        boolean ctrl = (e.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0 || (e.getModifiers() & InputEvent.CTRL_MASK) != 0;
        if (ctrl) {
            SelectionManager manager = VizController.getInstance().getSelectionManager();
            if (!manager.isRectangleSelection()) {
                int s = manager.getMouseSelectionDiameter();
                s += -e.getUnitsToScroll() * 2;
                s = Math.min(1000, s);
                s = Math.max(1, s);
                manager.setMouseSelectionDiameter(s);
            }
            return;
        }

        //Attributes
View Full Code Here

        //Init events
        VizController.getInstance().getSelectionManager().addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent e) {
                SelectionManager selectionManager = VizController.getInstance().getSelectionManager();
                if (selectionManager.isBlocked()) {
                    buttonGroup.clearSelection();
                } else if (!selectionManager.isSelectionEnabled()) {
                    buttonGroup.clearSelection();
                } else if (selectionManager.isDirectMouseSelection()) {
                    if (!buttonGroup.isSelected(mouseButton.getModel())) {
                        buttonGroup.setSelected(mouseButton.getModel(), true);
                    }
                }
            }
View Full Code Here

        limits = new GraphLimits();
        dataBridge = new DataBridge();
        textManager = new TextManager();
        screenshotMaker = new ScreenshotMaker();
        currentModel = new VizModel(true);
        selectionManager = new SelectionManager();

        if (vizConfig.isUseGLJPanel()) {
            drawable = commander.createPanel();
        } else {
//            drawable = commander.createCanvas();
View Full Code Here

TOP

Related Classes of org.gephi.visualization.api.selection.SelectionManager

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.