Package net.sourceforge.jpowergraph.manipulator.selection

Examples of net.sourceforge.jpowergraph.manipulator.selection.DefaultNodeSelectionModel


  public LensSet getLensSet() {
    return lensSet;
  }

  public void addManipulatorsAndSelectionModel(final JGraphPane theJGraphPane) {
    NodeSelectionModel nodeSelectionModel = new DefaultNodeSelectionModel(theJGraphPane.getGraph());
    nodeSelectionModel.addNodeSelectionListener(new NodeSelectionListener() {
      public void selectionCleared(NodeSelectionModel nodeSelectionModel) {
        theJGraphPane.getSubGraphHighlighter().setSubGraph(null);
      }

      public void nodesRemovedFromSelection(NodeSelectionModel nodeSelectionModel, Collection nodes) {
        if (nodeSelectionModel.getSelectedNodes().size() == 0){
          theJGraphPane.getSubGraphHighlighter().setSubGraph(null);
        }
        else{
          theJGraphPane.getSubGraphHighlighter().setSubGraph(getSubGraph(nodeSelectionModel.getSelectedNodes()));
        }
      }

      public void nodesAddedToSelection(NodeSelectionModel nodeSelectionModel, Collection nodes) {
        theJGraphPane.getSubGraphHighlighter().setSubGraph(getSubGraph(nodeSelectionModel.getSelectedNodes()));
      }
    });

    theJGraphPane.addManipulator(new SelectionManipulator(nodeSelectionModel));
    theJGraphPane.addManipulator(new DraggingManipulator((CursorLens) getLensSet().getFirstLensOfType(CursorLens.class)));
View Full Code Here


    public LensSet getLensSet() {
        return lensSet;
    }

    public void addManipulatorsAndSelectionModel(final JGraphPane theJGraphPane) {
        NodeSelectionModel nodeSelectionModel = new DefaultNodeSelectionModel(theJGraphPane.getGraph());
        nodeSelectionModel.addNodeSelectionListener(new NodeSelectionListener() {
            public void selectionCleared(NodeSelectionModel nodeSelectionModel) {
                theJGraphPane.getSubGraphHighlighter().setSubGraph(null);
            }
       
            public void nodesRemovedFromSelection(NodeSelectionModel nodeSelectionModel, Collection nodes) {
                if (nodeSelectionModel.getSelectedNodes().size() == 0){
                    theJGraphPane.getSubGraphHighlighter().setSubGraph(null);
                }
                else{
                    theJGraphPane.getSubGraphHighlighter().setSubGraph(getSubGraph(nodeSelectionModel.getSelectedNodes()));
                }
            }
       
            public void nodesAddedToSelection(NodeSelectionModel nodeSelectionModel, Collection nodes) {
                theJGraphPane.getSubGraphHighlighter().setSubGraph(getSubGraph(nodeSelectionModel.getSelectedNodes()));
            }
        });
       
        theJGraphPane.addManipulator(new SelectionManipulator(nodeSelectionModel));
        theJGraphPane.addManipulator(new DraggingManipulator((CursorLens) getLensSet().getFirstLensOfType(CursorLens.class)));
View Full Code Here

TOP

Related Classes of net.sourceforge.jpowergraph.manipulator.selection.DefaultNodeSelectionModel

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.