This repository was archived by the owner on Aug 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
engine-core/src/main/java/org/gephi/viz/engine/status
opengl-commons/src/main/java/org/gephi/viz/engine/util/actions
opengl-jogl/src/main/java/org/gephi/viz/engine/jogl/pipeline Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1212 */
1313public interface GraphSelection {
1414
15- enum GraphSelectionMode {
15+ enum GraphSelectionMode {
1616 SIMPLE_MOUSE_SELECTION ,
17- RECTANGLE_SELECTION , NO_SELECTION , CUSTOM_SELECTION
17+ SINGLE_NODE_SELECTION ,
18+ RECTANGLE_SELECTION ,
19+ NO_SELECTION ,
20+ CUSTOM_SELECTION
1821 }
1922
2023 boolean someNodesOrEdgesSelection ();
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ public void clearSelection() {
4949
5050 public void selectNodes (final NodeIterable nodesIterable ) {
5151 final GraphSelection selection = engine .getLookup ().lookup (GraphSelection .class );
52+ GraphSelection .GraphSelectionMode mode = selection .getMode ();
5253 final GraphRenderingOptions renderingOptions = engine .getLookup ().lookup (GraphRenderingOptions .class );
5354 final Graph graph = engine .getGraphModel ().getGraphVisible ();
5455
@@ -57,7 +58,7 @@ public void selectNodes(final NodeIterable nodesIterable) {
5758 final Set <Node > selectionNeighbours = new HashSet <>();
5859 final Set <Edge > selectionEdges = new HashSet <>();
5960
60- final boolean selectNeighbours = renderingOptions .isAutoSelectNeighbours ();
61+ final boolean selectNeighbours = renderingOptions .isAutoSelectNeighbours () && mode != GraphSelection . GraphSelectionMode . SINGLE_NODE_SELECTION ;
6162 try {
6263 while (iterator .hasNext ()) {
6364 final Node node = iterator .next ();
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public void frameStart() {
4545 public void frameEnd () {
4646 if (lastMovedPosition != null ) {
4747 //TODO: move to independent selection input listener
48- if (graphSelection .getMode () == GraphSelection .GraphSelectionMode .SIMPLE_MOUSE_SELECTION ) {
48+ if (graphSelection .getMode () == GraphSelection .GraphSelectionMode .SIMPLE_MOUSE_SELECTION || graphSelection . getMode () == GraphSelection . GraphSelectionMode . SINGLE_NODE_SELECTION ) {
4949 final Vector2f worldCoords = engine .screenCoordinatesToWorldCoordinates (lastMovedPosition .getX (), lastMovedPosition .getY ());
5050 inputActionsProcessor .selectNodesUnderPosition (worldCoords );
5151 }
@@ -105,6 +105,8 @@ public boolean mouseClicked(MouseEvent e) {
105105 } else if (graphSelection .getMode () == GraphSelection .GraphSelectionMode .SIMPLE_MOUSE_SELECTION && leftClick ) {
106106 //TODO: move to independent selection input listener
107107 return true ;
108+ } else if (graphSelection .getMode () == GraphSelection .GraphSelectionMode .SINGLE_NODE_SELECTION && leftClick ) {
109+ return true ;
108110 } else if (graphSelection .getMode () == GraphSelection .GraphSelectionMode .RECTANGLE_SELECTION ) {
109111 inputActionsProcessor .clearSelection ();
110112 return true ;
You can’t perform that action at this time.
0 commit comments