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

            }
        }
    }

    public void selectCluster(Cluster cluster) {
        SelectionManager selectionManager = VizController.getInstance().getSelectionManager();
        selectionManager.resetSelection();
        selectionManager.selectNodes(cluster.getNodes());
    }
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.