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)));