From f8c3c3be229edc86de334350880acc49ece2fd80 Mon Sep 17 00:00:00 2001 From: Gabriel Darbord Date: Fri, 28 Jun 2024 15:16:09 +0200 Subject: [PATCH] Fix moosetechnology/MooseIDE#1085: Add menu item to select all/incoming/outgoing links --- .../HAddLinkMenuItem.class.st | 6 ---- .../HHideAllLinksMenuItem.class.st | 2 +- .../HNewEntityMenuItem.class.st | 2 +- .../HRelayoutMenuItem.class.st | 2 +- .../HSelectAllLinksMenuItem.class.st | 33 +++++++++++++++++++ .../HSelectIncomingLinksMenuItem.class.st | 32 ++++++++++++++++++ .../HSelectOutgoingLinksMenuItem.class.st | 32 ++++++++++++++++++ .../HShowAllLinksMenuItem.class.st | 4 +-- 8 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st create mode 100644 src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st create mode 100644 src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st diff --git a/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st index 1efd067..8ac5e88 100644 --- a/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st @@ -36,11 +36,6 @@ HAddLinkMenuItem >> execute [ visualization rebuildLines: shape. ]. evt signalUpdate ]. - - - - - ] { #category : #accessing } @@ -58,7 +53,6 @@ HAddLinkMenuItem >> modelFor: aShape [ ^ aShape model ifNil: [ self modelFor: aShape parent ] ifNotNil: [ aShape model ] - ] { #category : #accessing } diff --git a/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st index 00ad287..29b6630 100644 --- a/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st @@ -20,7 +20,7 @@ HHideAllLinksMenuItem >> group [ { #category : #accessing } HHideAllLinksMenuItem >> label [ - ^ 'Hide All links' + ^ 'Hide all links' ] { #category : #accessing } diff --git a/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st index 9552941..47dff17 100644 --- a/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st @@ -23,7 +23,7 @@ HNewEntityMenuItem >> group [ { #category : #accessing } HNewEntityMenuItem >> label [ - ^ 'New Entity' + ^ 'New entity' ] { #category : #accessing } diff --git a/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st index 8b82ce1..f4956dd 100644 --- a/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st @@ -1,5 +1,5 @@ " -This menu item uses the layout of an HNode to place roassal shapes in their positions +This menu item uses the layout of an HNode to place roassal shapes in their positions. " Class { #name : #HRelayoutMenuItem, diff --git a/src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st new file mode 100644 index 0000000..caf9f21 --- /dev/null +++ b/src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st @@ -0,0 +1,33 @@ +" +This menu item selects all the links of the node. +" +Class { + #name : #HSelectAllLinksMenuItem, + #superclass : #HNodeMenuItem, + #category : #'Hierarchical-Roassal-Menu' +} + +{ #category : #execution } +HSelectAllLinksMenuItem >> execute [ + + visualization container setSelectedShapes: + shape outgoingShapes , shape incomingShapes +] + +{ #category : #accessing } +HSelectAllLinksMenuItem >> group [ + + ^ 3 +] + +{ #category : #accessing } +HSelectAllLinksMenuItem >> label [ + + ^ 'Select all links' +] + +{ #category : #accessing } +HSelectAllLinksMenuItem >> order [ + + ^ 100 +] diff --git a/src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st new file mode 100644 index 0000000..4b43a86 --- /dev/null +++ b/src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st @@ -0,0 +1,32 @@ +" +This menu item selects the incoming links of the node. +" +Class { + #name : #HSelectIncomingLinksMenuItem, + #superclass : #HNodeMenuItem, + #category : #'Hierarchical-Roassal-Menu' +} + +{ #category : #execution } +HSelectIncomingLinksMenuItem >> execute [ + + visualization container setSelectedShapes: shape incomingShapes +] + +{ #category : #accessing } +HSelectIncomingLinksMenuItem >> group [ + + ^ 3 +] + +{ #category : #accessing } +HSelectIncomingLinksMenuItem >> label [ + + ^ 'Select incoming links' +] + +{ #category : #accessing } +HSelectIncomingLinksMenuItem >> order [ + + ^ 110 +] diff --git a/src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st new file mode 100644 index 0000000..14fdfd0 --- /dev/null +++ b/src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st @@ -0,0 +1,32 @@ +" +This menu item selects the outgoing links of the node. +" +Class { + #name : #HSelectOutgoingLinksMenuItem, + #superclass : #HNodeMenuItem, + #category : #'Hierarchical-Roassal-Menu' +} + +{ #category : #execution } +HSelectOutgoingLinksMenuItem >> execute [ + + visualization container setSelectedShapes: shape outgoingShapes +] + +{ #category : #accessing } +HSelectOutgoingLinksMenuItem >> group [ + + ^ 3 +] + +{ #category : #accessing } +HSelectOutgoingLinksMenuItem >> label [ + + ^ 'Select outgoing links' +] + +{ #category : #accessing } +HSelectOutgoingLinksMenuItem >> order [ + + ^ 120 +] diff --git a/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st index 501730f..0418c0e 100644 --- a/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st @@ -1,5 +1,5 @@ " -this menu item show all the links of the node and all children +This menu item shows all the links of the node and all children. " Class { #name : #HShowAllLinksMenuItem, @@ -20,7 +20,7 @@ HShowAllLinksMenuItem >> group [ { #category : #accessing } HShowAllLinksMenuItem >> label [ - ^ 'Show All links' + ^ 'Show all links' ] { #category : #accessing }