From 74d11b8ed0e47caa339082df1efd9ea4468c46c8 Mon Sep 17 00:00:00 2001 From: LABSARI Soufyane Date: Fri, 19 Jul 2024 16:07:28 +0200 Subject: [PATCH] Add a selection menu in canvas. --- .../HAbstractMenuItem.class.st | 33 +++++----- .../HAddLinkMenuItem.class.st | 17 ++--- .../HCanvasMenuItem.class.st | 7 +- .../HCollapseCanvasChildrenMenuItem.class.st | 13 ++-- .../HCollapseChildrenMenuItem.class.st | 15 +++-- .../HCollapseGroupMenuItem.class.st | 13 ++-- .../HDefaultMenuItemStrategy.class.st | 11 ++-- .../HExpandCanvasChildrenMenuItem.class.st | 13 ++-- .../HExpandChildrenMenuItem.class.st | 15 +++-- .../HExpandCollapseLinksMenuItem.class.st | 17 ++--- .../HExpandCollapseMenuItem.class.st | 17 ++--- .../HExpandGroupMenuItem.class.st | 13 ++-- .../HGroupMenuItem.class.st | 7 +- .../HHideAllLinksInCanvasMenuItem.class.st | 15 +++-- .../HHideAllLinksMenuItem.class.st | 15 +++-- .../HHideIncomingLinksMenuItem.class.st | 15 +++-- .../HHideLineMenuItem.class.st | 11 ++-- .../HHideOutgoingLinksMenuItem.class.st | 15 +++-- .../HInspectorMenuItem.class.st | 19 +++--- .../HLineMenuItem.class.st | 7 +- .../HMenuBuilder.class.st | 21 +++--- .../HNewContainerMenuItem.class.st | 17 ++--- .../HNewEntityMenuItem.class.st | 15 +++-- .../HNodeMenuItem.class.st | 7 +- .../HOpenGroupMenuItem.class.st | 13 ++-- .../HOpenNodeMenuItem.class.st | 15 +++-- .../HRelayoutCanvasMenuItem.class.st | 15 +++-- .../HRelayoutGroupMenuItem.class.st | 13 ++-- .../HRelayoutMenuItem.class.st | 23 +++---- .../HRemoveLineMenuItem.class.st | 13 ++-- .../HSelectAllLinksMenuItem.class.st | 15 +++-- .../HSelectIncomingLinksMenuItem.class.st | 15 +++-- .../HSelectOutgoingLinksMenuItem.class.st | 15 +++-- .../HSelectShapesMenuItem.class.st | 64 +++++++++++++++++++ .../HShowAllLinksInCanvasMenuItem.class.st | 15 +++-- .../HShowAllLinksMenuItem.class.st | 15 +++-- src/Hierarchical-Roassal-Menu/package.st | 2 +- 37 files changed, 340 insertions(+), 241 deletions(-) create mode 100644 src/Hierarchical-Roassal-Menu/HSelectShapesMenuItem.class.st diff --git a/src/Hierarchical-Roassal-Menu/HAbstractMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HAbstractMenuItem.class.st index 2609196..8b4730e 100644 --- a/src/Hierarchical-Roassal-Menu/HAbstractMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HAbstractMenuItem.class.st @@ -2,21 +2,22 @@ base class for menu items " Class { - #name : #HAbstractMenuItem, - #superclass : #Object, + #name : 'HAbstractMenuItem', + #superclass : 'Object', #instVars : [ 'shape', 'visualization' ], - #category : #'Hierarchical-Roassal-Menu' + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> argument [ ^ nil ] -{ #category : #'building - menus' } +{ #category : 'building - menus' } HAbstractMenuItem >> buildOn: aMenuMorph [ | item | self canBeExecuted ifFalse: [ ^ self ]. @@ -29,58 +30,58 @@ HAbstractMenuItem >> buildOn: aMenuMorph [ item icon: (self iconNamed: self iconName). ] -{ #category : #testing } +{ #category : 'testing' } HAbstractMenuItem >> canBeExecuted [ ^ true ] -{ #category : #execution } +{ #category : 'execution' } HAbstractMenuItem >> execute [ ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> group [ ^ 0 ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> iconName [ ^ nil ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> label [ ^ '' ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> order [ ^ 0 ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> selector [ ^ #execute ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> shape: anObject [ shape := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> target [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> visualization [ ^ visualization ] -{ #category : #accessing } +{ #category : 'accessing' } HAbstractMenuItem >> visualization: anObject [ visualization := anObject diff --git a/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st index 8ac5e88..15edf96 100644 --- a/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HAddLinkMenuItem.class.st @@ -2,12 +2,13 @@ This menu item adds a new draggable interaction to the canvas and then creates a new line between the selected nodes " Class { - #name : #HAddLinkMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HAddLinkMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HAddLinkMenuItem >> execute [ | canvas line pointer | canvas := visualization canvas. @@ -38,24 +39,24 @@ HAddLinkMenuItem >> execute [ evt signalUpdate ]. ] -{ #category : #accessing } +{ #category : 'accessing' } HAddLinkMenuItem >> group [ ^ 2 ] -{ #category : #accessing } +{ #category : 'accessing' } HAddLinkMenuItem >> label [ ^ 'Add dependency to' ] -{ #category : #hooks } +{ #category : 'hooks' } HAddLinkMenuItem >> modelFor: aShape [ ^ aShape model ifNil: [ self modelFor: aShape parent ] ifNotNil: [ aShape model ] ] -{ #category : #accessing } +{ #category : 'accessing' } HAddLinkMenuItem >> order [ ^ 40 ] diff --git a/src/Hierarchical-Roassal-Menu/HCanvasMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HCanvasMenuItem.class.st index a77658b..ac2449c 100644 --- a/src/Hierarchical-Roassal-Menu/HCanvasMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HCanvasMenuItem.class.st @@ -2,7 +2,8 @@ Menu for canvas " Class { - #name : #HCanvasMenuItem, - #superclass : #HAbstractMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HCanvasMenuItem', + #superclass : 'HAbstractMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } diff --git a/src/Hierarchical-Roassal-Menu/HCollapseCanvasChildrenMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HCollapseCanvasChildrenMenuItem.class.st index fa3579b..50bfa90 100644 --- a/src/Hierarchical-Roassal-Menu/HCollapseCanvasChildrenMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HCollapseCanvasChildrenMenuItem.class.st @@ -2,23 +2,24 @@ this menu item, collapses direct children of the canvas " Class { - #name : #HCollapseCanvasChildrenMenuItem, - #superclass : #HCanvasMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HCollapseCanvasChildrenMenuItem', + #superclass : 'HCanvasMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HCollapseCanvasChildrenMenuItem >> execute [ visualization rootNode collapseChildren ] -{ #category : #accessing } +{ #category : 'accessing' } HCollapseCanvasChildrenMenuItem >> label [ ^ 'Collapse children' ] -{ #category : #accessing } +{ #category : 'accessing' } HCollapseCanvasChildrenMenuItem >> order [ ^ 0 ] diff --git a/src/Hierarchical-Roassal-Menu/HCollapseChildrenMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HCollapseChildrenMenuItem.class.st index d3c2258..4bc67f9 100644 --- a/src/Hierarchical-Roassal-Menu/HCollapseChildrenMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HCollapseChildrenMenuItem.class.st @@ -2,29 +2,30 @@ this menu item, collapses the children of a node " Class { - #name : #HCollapseChildrenMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HCollapseChildrenMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #testing } +{ #category : 'testing' } HCollapseChildrenMenuItem >> canBeExecuted [ ^ shape model children isNotEmpty ] -{ #category : #execution } +{ #category : 'execution' } HCollapseChildrenMenuItem >> execute [ shape schildren do: [ :child | child model removeInteractionIfPresent: visualization class ]. shape model collapseChildren. visualization rebuildShape: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HCollapseChildrenMenuItem >> label [ ^ 'Collapse children' ] -{ #category : #accessing } +{ #category : 'accessing' } HCollapseChildrenMenuItem >> order [ ^ 15 ] diff --git a/src/Hierarchical-Roassal-Menu/HCollapseGroupMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HCollapseGroupMenuItem.class.st index 0a5ddcc..af4dae1 100644 --- a/src/Hierarchical-Roassal-Menu/HCollapseGroupMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HCollapseGroupMenuItem.class.st @@ -2,23 +2,24 @@ This class allows to the nodes of one group to collapse " Class { - #name : #HCollapseGroupMenuItem, - #superclass : #HGroupMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HCollapseGroupMenuItem', + #superclass : 'HGroupMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #accessing } +{ #category : 'accessing' } HCollapseGroupMenuItem >> execute [ visualization canvas selectedShapes do: [ :aShape | aShape model collapse ]. ] -{ #category : #accessing } +{ #category : 'accessing' } HCollapseGroupMenuItem >> label [ ^ 'Collapse group' ] -{ #category : #accessing } +{ #category : 'accessing' } HCollapseGroupMenuItem >> order [ ^ 0 ] diff --git a/src/Hierarchical-Roassal-Menu/HDefaultMenuItemStrategy.class.st b/src/Hierarchical-Roassal-Menu/HDefaultMenuItemStrategy.class.st index 03b33dc..244334e 100644 --- a/src/Hierarchical-Roassal-Menu/HDefaultMenuItemStrategy.class.st +++ b/src/Hierarchical-Roassal-Menu/HDefaultMenuItemStrategy.class.st @@ -3,12 +3,13 @@ I am a strategy for HMenuBuilder. I define menu items that can be executed (or needed) for a given object. " Class { - #name : #HDefaultMenuItemStrategy, - #superclass : #Object, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HDefaultMenuItemStrategy', + #superclass : 'Object', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #public } +{ #category : 'public' } HDefaultMenuItemStrategy >> classFor: aRoassalShape [ aRoassalShape isShape ifFalse: [ ^ HCanvasMenuItem ]. @@ -22,7 +23,7 @@ HDefaultMenuItemStrategy >> classFor: aRoassalShape [ ] -{ #category : #public } +{ #category : 'public' } HDefaultMenuItemStrategy >> menuItemClassesFor: aShape [ ^ (self classFor: aShape) subclasses , { HInspectorMenuItem } diff --git a/src/Hierarchical-Roassal-Menu/HExpandCanvasChildrenMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HExpandCanvasChildrenMenuItem.class.st index a87f39b..23cdf97 100644 --- a/src/Hierarchical-Roassal-Menu/HExpandCanvasChildrenMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HExpandCanvasChildrenMenuItem.class.st @@ -2,22 +2,23 @@ This menu item expands the direct children of the root node " Class { - #name : #HExpandCanvasChildrenMenuItem, - #superclass : #HCanvasMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HExpandCanvasChildrenMenuItem', + #superclass : 'HCanvasMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HExpandCanvasChildrenMenuItem >> execute [ [visualization rootNode expandChildren] timeProfile ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCanvasChildrenMenuItem >> label [ ^ 'Expand children' ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCanvasChildrenMenuItem >> order [ ^ 5 ] diff --git a/src/Hierarchical-Roassal-Menu/HExpandChildrenMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HExpandChildrenMenuItem.class.st index c9f879f..5b60a65 100644 --- a/src/Hierarchical-Roassal-Menu/HExpandChildrenMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HExpandChildrenMenuItem.class.st @@ -2,17 +2,18 @@ expand the node and its children " Class { - #name : #HExpandChildrenMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HExpandChildrenMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #testing } +{ #category : 'testing' } HExpandChildrenMenuItem >> canBeExecuted [ ^ shape model children isNotEmpty ] -{ #category : #execution } +{ #category : 'execution' } HExpandChildrenMenuItem >> execute [ shape schildren do: [ :child | child model removeInteractionIfPresent: visualization class ]. shape model @@ -21,12 +22,12 @@ HExpandChildrenMenuItem >> execute [ visualization rebuildShape: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandChildrenMenuItem >> label [ ^ 'Expand children' ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandChildrenMenuItem >> order [ ^ 10 ] diff --git a/src/Hierarchical-Roassal-Menu/HExpandCollapseLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HExpandCollapseLinksMenuItem.class.st index 2bbe7e8..451438c 100644 --- a/src/Hierarchical-Roassal-Menu/HExpandCollapseLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HExpandCollapseLinksMenuItem.class.st @@ -2,17 +2,18 @@ this menu allow to the user collase only link but not nodes " Class { - #name : #HExpandCollapseLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HExpandCollapseLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #testing } +{ #category : 'testing' } HExpandCollapseLinksMenuItem >> canBeExecuted [ ^ shape model children isNotEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseLinksMenuItem >> execute [ | node | node := shape model. @@ -22,19 +23,19 @@ HExpandCollapseLinksMenuItem >> execute [ visualization rebuildLines: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseLinksMenuItem >> label [ ^ shape model isLinksExpanded ifTrue: [ 'Collapse external links' ] ifFalse: [ 'Expand external links' ] ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseLinksMenuItem >> order [ ^ 80 ] diff --git a/src/Hierarchical-Roassal-Menu/HExpandCollapseMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HExpandCollapseMenuItem.class.st index 3bedd65..b3bc6d6 100644 --- a/src/Hierarchical-Roassal-Menu/HExpandCollapseMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HExpandCollapseMenuItem.class.st @@ -2,34 +2,35 @@ this menu item, expands or collapses the current node " Class { - #name : #HExpandCollapseMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HExpandCollapseMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #testing } +{ #category : 'testing' } HExpandCollapseMenuItem >> canBeExecuted [ ^ shape model children isNotEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseMenuItem >> label [ ^ shape model isExpanded ifTrue: [ 'Collapse' ] ifFalse: [ 'Expand' ] ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseMenuItem >> order [ ^ 0 ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseMenuItem >> selector [ ^ #expandCollapse ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandCollapseMenuItem >> target [ ^ shape model ] diff --git a/src/Hierarchical-Roassal-Menu/HExpandGroupMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HExpandGroupMenuItem.class.st index 037e1f1..8207ae3 100644 --- a/src/Hierarchical-Roassal-Menu/HExpandGroupMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HExpandGroupMenuItem.class.st @@ -2,22 +2,23 @@ This class allows to the nodes of one group to expand " Class { - #name : #HExpandGroupMenuItem, - #superclass : #HGroupMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HExpandGroupMenuItem', + #superclass : 'HGroupMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #accessing } +{ #category : 'accessing' } HExpandGroupMenuItem >> execute [ visualization canvas selectedShapes do: [ :aShape | aShape model expand ] ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandGroupMenuItem >> label [ ^ 'Expand group' ] -{ #category : #accessing } +{ #category : 'accessing' } HExpandGroupMenuItem >> order [ ^ 2 ] diff --git a/src/Hierarchical-Roassal-Menu/HGroupMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HGroupMenuItem.class.st index c64f3a8..c5d0fb9 100644 --- a/src/Hierarchical-Roassal-Menu/HGroupMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HGroupMenuItem.class.st @@ -2,7 +2,8 @@ Group menu is activable when users from the visualization uses rightlight dragging to select a group of shapes " Class { - #name : #HGroupMenuItem, - #superclass : #HAbstractMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HGroupMenuItem', + #superclass : 'HAbstractMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } diff --git a/src/Hierarchical-Roassal-Menu/HHideAllLinksInCanvasMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HHideAllLinksInCanvasMenuItem.class.st index ba52b73..1c4e2ed 100644 --- a/src/Hierarchical-Roassal-Menu/HHideAllLinksInCanvasMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HHideAllLinksInCanvasMenuItem.class.st @@ -2,28 +2,29 @@ This menu hides all the links in the root node " Class { - #name : #HHideAllLinksInCanvasMenuItem, - #superclass : #HCanvasMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HHideAllLinksInCanvasMenuItem', + #superclass : 'HCanvasMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HHideAllLinksInCanvasMenuItem >> execute [ visualization rootNode hideAllLinks. visualization rebuildLines: visualization canvas. ] -{ #category : #accessing } +{ #category : 'accessing' } HHideAllLinksInCanvasMenuItem >> group [ ^ 2 ] -{ #category : #accessing } +{ #category : 'accessing' } HHideAllLinksInCanvasMenuItem >> label [ ^ 'Hide all links' ] -{ #category : #accessing } +{ #category : 'accessing' } HHideAllLinksInCanvasMenuItem >> order [ ^ 21 ] diff --git a/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st index 29b6630..68faad9 100644 --- a/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HHideAllLinksMenuItem.class.st @@ -2,28 +2,29 @@ This menu item hide all the links for this node and all children " Class { - #name : #HHideAllLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HHideAllLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HHideAllLinksMenuItem >> execute [ shape model hideAllLinks. visualization rebuildLines: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HHideAllLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HHideAllLinksMenuItem >> label [ ^ 'Hide all links' ] -{ #category : #accessing } +{ #category : 'accessing' } HHideAllLinksMenuItem >> order [ ^ 60 ] diff --git a/src/Hierarchical-Roassal-Menu/HHideIncomingLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HHideIncomingLinksMenuItem.class.st index 79d79eb..d357621 100644 --- a/src/Hierarchical-Roassal-Menu/HHideIncomingLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HHideIncomingLinksMenuItem.class.st @@ -2,28 +2,29 @@ this menu hide incoming links " Class { - #name : #HHideIncomingLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HHideIncomingLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HHideIncomingLinksMenuItem >> execute [ shape model hideIncomingLinks. visualization rebuildLines: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HHideIncomingLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HHideIncomingLinksMenuItem >> label [ ^ 'Hide incoming links' ] -{ #category : #accessing } +{ #category : 'accessing' } HHideIncomingLinksMenuItem >> order [ ^ 61 ] diff --git a/src/Hierarchical-Roassal-Menu/HHideLineMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HHideLineMenuItem.class.st index 97e3770..ce7d106 100644 --- a/src/Hierarchical-Roassal-Menu/HHideLineMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HHideLineMenuItem.class.st @@ -2,18 +2,19 @@ this item changes the visibility of a link, but does not remove the dependency " Class { - #name : #HHideLineMenuItem, - #superclass : #HLineMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HHideLineMenuItem', + #superclass : 'HLineMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HHideLineMenuItem >> execute [ shape model key hideLinkTo: shape model value. visualization rebuildLines: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HHideLineMenuItem >> label [ ^ 'Hide link' ] diff --git a/src/Hierarchical-Roassal-Menu/HHideOutgoingLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HHideOutgoingLinksMenuItem.class.st index d024dd4..8c039b9 100644 --- a/src/Hierarchical-Roassal-Menu/HHideOutgoingLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HHideOutgoingLinksMenuItem.class.st @@ -2,28 +2,29 @@ this menu hide outgoing links " Class { - #name : #HHideOutgoingLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HHideOutgoingLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HHideOutgoingLinksMenuItem >> execute [ shape model hideOutgoingLinks. visualization rebuildLines: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HHideOutgoingLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HHideOutgoingLinksMenuItem >> label [ ^ 'Hide outgoing links' ] -{ #category : #accessing } +{ #category : 'accessing' } HHideOutgoingLinksMenuItem >> order [ ^ 62 ] diff --git a/src/Hierarchical-Roassal-Menu/HInspectorMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HInspectorMenuItem.class.st index d14d01a..3b66eb4 100644 --- a/src/Hierarchical-Roassal-Menu/HInspectorMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HInspectorMenuItem.class.st @@ -2,37 +2,38 @@ for inspector " Class { - #name : #HInspectorMenuItem, - #superclass : #HAbstractMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HInspectorMenuItem', + #superclass : 'HAbstractMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #accessing } +{ #category : 'accessing' } HInspectorMenuItem >> group [ ^ 100 ] -{ #category : #accessing } +{ #category : 'accessing' } HInspectorMenuItem >> iconName [ ^ #smallInspectIt ] -{ #category : #accessing } +{ #category : 'accessing' } HInspectorMenuItem >> label [ ^ 'Inspect' ] -{ #category : #accessing } +{ #category : 'accessing' } HInspectorMenuItem >> order [ ^ 100 ] -{ #category : #accessing } +{ #category : 'accessing' } HInspectorMenuItem >> selector [ ^ #inspect ] -{ #category : #accessing } +{ #category : 'accessing' } HInspectorMenuItem >> target [ ^ shape isShape ifTrue: [ shape model rawModel ] diff --git a/src/Hierarchical-Roassal-Menu/HLineMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HLineMenuItem.class.st index 272bc14..708d3d3 100644 --- a/src/Hierarchical-Roassal-Menu/HLineMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HLineMenuItem.class.st @@ -2,7 +2,8 @@ Menu for lines " Class { - #name : #HLineMenuItem, - #superclass : #HAbstractMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HLineMenuItem', + #superclass : 'HAbstractMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } diff --git a/src/Hierarchical-Roassal-Menu/HMenuBuilder.class.st b/src/Hierarchical-Roassal-Menu/HMenuBuilder.class.st index 62f0d0a..c67fc8e 100644 --- a/src/Hierarchical-Roassal-Menu/HMenuBuilder.class.st +++ b/src/Hierarchical-Roassal-Menu/HMenuBuilder.class.st @@ -6,15 +6,16 @@ Entry point is `buildIn: aMorph shape: aShape visualization: aCanvas` Items in the menu are provided by the method `menuItemsFor:` " Class { - #name : #HMenuBuilder, - #superclass : #Object, + #name : 'HMenuBuilder', + #superclass : 'Object', #instVars : [ 'menuItemStrategy' ], - #category : #'Hierarchical-Roassal-Menu' + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #public } +{ #category : 'public' } HMenuBuilder >> buildIn: aMenuMorph shape: aRoassalShape visualization: anHSimpleVisualizationBuilder [ | items | @@ -27,7 +28,7 @@ HMenuBuilder >> buildIn: aMenuMorph shape: aRoassalShape visualization: anHSimpl withItems: items ] -{ #category : #public } +{ #category : 'public' } HMenuBuilder >> buildIn: aMenuMorph shape: aRoassalShape visualization: anHSimpleVisualizationBuilder withItems: items [ | groups | @@ -44,32 +45,32 @@ HMenuBuilder >> buildIn: aMenuMorph shape: aRoassalShape visualization: anHSimpl separatedBy: [ aMenuMorph addSeparator ] ] -{ #category : #public } +{ #category : 'public' } HMenuBuilder >> groupItems: items [ ^ items groupedBy: [ :item | item group ] ] -{ #category : #initialization } +{ #category : 'initialization' } HMenuBuilder >> initialize [ super initialize. menuItemStrategy := HDefaultMenuItemStrategy new ] -{ #category : #accessing } +{ #category : 'accessing' } HMenuBuilder >> menuItemStrategy [ ^ menuItemStrategy ] -{ #category : #accessing } +{ #category : 'accessing' } HMenuBuilder >> menuItemStrategy: anObject [ menuItemStrategy := anObject ] -{ #category : #public } +{ #category : 'public' } HMenuBuilder >> menuItemsFor: aShape [ ^ (menuItemStrategy menuItemClassesFor: aShape) collect: #new diff --git a/src/Hierarchical-Roassal-Menu/HNewContainerMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HNewContainerMenuItem.class.st index 4cb9d9a..b84df54 100644 --- a/src/Hierarchical-Roassal-Menu/HNewContainerMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HNewContainerMenuItem.class.st @@ -2,17 +2,18 @@ This menu adds a new node into the visualization using ui manager to write its name " Class { - #name : #HNewContainerMenuItem, - #superclass : #HCanvasMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HNewContainerMenuItem', + #superclass : 'HCanvasMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #public } +{ #category : 'public' } HNewContainerMenuItem class >> requestName [ ^ UIManager default request: 'Enter a name' initialAnswer: '' ] -{ #category : #execution } +{ #category : 'execution' } HNewContainerMenuItem >> execute [ | name root | name := self class requestName. @@ -21,17 +22,17 @@ HNewContainerMenuItem >> execute [ root add: (HNode named: name) ] -{ #category : #accessing } +{ #category : 'accessing' } HNewContainerMenuItem >> group [ ^ 1 ] -{ #category : #accessing } +{ #category : 'accessing' } HNewContainerMenuItem >> label [ ^ 'Add Container' ] -{ #category : #accessing } +{ #category : 'accessing' } HNewContainerMenuItem >> order [ ^ 10 ] diff --git a/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st index 47dff17..02b3215 100644 --- a/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HNewEntityMenuItem.class.st @@ -2,12 +2,13 @@ This menu item open a new request dialog to get the name of the new node of the selected node " Class { - #name : #HNewEntityMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HNewEntityMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HNewEntityMenuItem >> execute [ | name node | name := HNewContainerMenuItem requestName. @@ -16,17 +17,17 @@ HNewEntityMenuItem >> execute [ node add: (HNode named: name; yourself). ] -{ #category : #accessing } +{ #category : 'accessing' } HNewEntityMenuItem >> group [ ^ 2 ] -{ #category : #accessing } +{ #category : 'accessing' } HNewEntityMenuItem >> label [ ^ 'New entity' ] -{ #category : #accessing } +{ #category : 'accessing' } HNewEntityMenuItem >> order [ ^ 30 ] diff --git a/src/Hierarchical-Roassal-Menu/HNodeMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HNodeMenuItem.class.st index a0944a2..bc78aeb 100644 --- a/src/Hierarchical-Roassal-Menu/HNodeMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HNodeMenuItem.class.st @@ -2,7 +2,8 @@ This defines a a base for new items in the visualization " Class { - #name : #HNodeMenuItem, - #superclass : #HAbstractMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HNodeMenuItem', + #superclass : 'HAbstractMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } diff --git a/src/Hierarchical-Roassal-Menu/HOpenGroupMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HOpenGroupMenuItem.class.st index 0f24be6..29c5803 100644 --- a/src/Hierarchical-Roassal-Menu/HOpenGroupMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HOpenGroupMenuItem.class.st @@ -2,12 +2,13 @@ This menu item open the selected menu group in a new canvas window " Class { - #name : #HOpenGroupMenuItem, - #superclass : #HGroupMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HOpenGroupMenuItem', + #superclass : 'HGroupMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HOpenGroupMenuItem >> execute [ | listCopy newNode | listCopy := visualization canvas selectedShapes collect: [:node | node model copy ]. @@ -18,12 +19,12 @@ HOpenGroupMenuItem >> execute [ newNode open. ] -{ #category : #execution } +{ #category : 'execution' } HOpenGroupMenuItem >> group [ ^ 2 ] -{ #category : #execution } +{ #category : 'execution' } HOpenGroupMenuItem >> label [ ^ 'Open group' ] diff --git a/src/Hierarchical-Roassal-Menu/HOpenNodeMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HOpenNodeMenuItem.class.st index a32e3d1..933cc15 100644 --- a/src/Hierarchical-Roassal-Menu/HOpenNodeMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HOpenNodeMenuItem.class.st @@ -2,17 +2,18 @@ Open a new window " Class { - #name : #HOpenNodeMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HOpenNodeMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #accessing } +{ #category : 'accessing' } HOpenNodeMenuItem >> canBeExecuted [ ^ shape model hasChildren ] -{ #category : #accessing } +{ #category : 'accessing' } HOpenNodeMenuItem >> execute [ | copy | copy := shape model copy. @@ -20,12 +21,12 @@ HOpenNodeMenuItem >> execute [ copy open ] -{ #category : #accessing } +{ #category : 'accessing' } HOpenNodeMenuItem >> group [ ^ 100 ] -{ #category : #accessing } +{ #category : 'accessing' } HOpenNodeMenuItem >> label [ ^ 'Open node' ] diff --git a/src/Hierarchical-Roassal-Menu/HRelayoutCanvasMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HRelayoutCanvasMenuItem.class.st index bfaabcd..b62ff1a 100644 --- a/src/Hierarchical-Roassal-Menu/HRelayoutCanvasMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HRelayoutCanvasMenuItem.class.st @@ -2,12 +2,13 @@ reorganize the canvas with the layout of the root node " Class { - #name : #HRelayoutCanvasMenuItem, - #superclass : #HCanvasMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HRelayoutCanvasMenuItem', + #superclass : 'HCanvasMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HRelayoutCanvasMenuItem >> execute [ | rootNode | rootNode := visualization rootNode. @@ -16,17 +17,17 @@ HRelayoutCanvasMenuItem >> execute [ visualization container signalUpdate. ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutCanvasMenuItem >> group [ ^ 1 ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutCanvasMenuItem >> label [ ^ 'Relayout' ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutCanvasMenuItem >> order [ ^ 70 ] diff --git a/src/Hierarchical-Roassal-Menu/HRelayoutGroupMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HRelayoutGroupMenuItem.class.st index 65ce749..d99e3ee 100644 --- a/src/Hierarchical-Roassal-Menu/HRelayoutGroupMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HRelayoutGroupMenuItem.class.st @@ -2,12 +2,13 @@ This menu item relayout the nodes of the group using RSGridLayout " Class { - #name : #HRelayoutGroupMenuItem, - #superclass : #HGroupMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HRelayoutGroupMenuItem', + #superclass : 'HGroupMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutGroupMenuItem >> execute [ | selectedShapes layout otherShapes | selectedShapes := visualization canvas selectedShapes. @@ -19,12 +20,12 @@ HRelayoutGroupMenuItem >> execute [ RSHorizontalLineLayout new gapSize: 10; on: { otherShapes. selectedShapes }. ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutGroupMenuItem >> label [ ^ 'Relayout' ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutGroupMenuItem >> order [ ^ 10 ] diff --git a/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st index f4956dd..64e9930 100644 --- a/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HRelayoutMenuItem.class.st @@ -2,24 +2,25 @@ This menu item uses the layout of an HNode to place roassal shapes in their positions. " Class { - #name : #HRelayoutMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HRelayoutMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutMenuItem class >> definedLayouts [ ^ { RSGridLayout . RSFlowLayout . RSCircleLayout }. ] -{ #category : #execution } +{ #category : 'execution' } HRelayoutMenuItem >> applyLayout: node [ node children do: [ :child | child position: nil ]. visualization rebuildShape: shape. ] -{ #category : #'building - menus' } +{ #category : 'building - menus' } HRelayoutMenuItem >> buildOn: aMenuMorph [ | submenu | submenu := MenuMorph new. @@ -33,12 +34,12 @@ HRelayoutMenuItem >> buildOn: aMenuMorph [ aMenuMorph add: self label subMenu: submenu. ] -{ #category : #execution } +{ #category : 'execution' } HRelayoutMenuItem >> execute [ self applyLayout: shape model. ] -{ #category : #execution } +{ #category : 'execution' } HRelayoutMenuItem >> execute: layoutClass [ |node| node := shape model. @@ -47,17 +48,17 @@ HRelayoutMenuItem >> execute: layoutClass [ ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutMenuItem >> group [ ^ 1 ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutMenuItem >> label [ ^ 'Relayout' ] -{ #category : #accessing } +{ #category : 'accessing' } HRelayoutMenuItem >> order [ ^ 70 ] diff --git a/src/Hierarchical-Roassal-Menu/HRemoveLineMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HRemoveLineMenuItem.class.st index e392ec1..0c00805 100644 --- a/src/Hierarchical-Roassal-Menu/HRemoveLineMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HRemoveLineMenuItem.class.st @@ -2,24 +2,25 @@ menu item to remove a link from an HNode " Class { - #name : #HRemoveLineMenuItem, - #superclass : #HLineMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HRemoveLineMenuItem', + #superclass : 'HLineMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HRemoveLineMenuItem >> execute [ shape model key removeLinkTo: shape model value. visualization rebuildLines: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HRemoveLineMenuItem >> label [ ^ 'Remove link' ] -{ #category : #accessing } +{ #category : 'accessing' } HRemoveLineMenuItem >> order [ ^ 10 ] diff --git a/src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st index caf9f21..a7c291d 100644 --- a/src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HSelectAllLinksMenuItem.class.st @@ -2,31 +2,32 @@ This menu item selects all the links of the node. " Class { - #name : #HSelectAllLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HSelectAllLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HSelectAllLinksMenuItem >> execute [ visualization container setSelectedShapes: shape outgoingShapes , shape incomingShapes ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectAllLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectAllLinksMenuItem >> label [ ^ 'Select all links' ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectAllLinksMenuItem >> order [ ^ 100 diff --git a/src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st index 4b43a86..00853df 100644 --- a/src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HSelectIncomingLinksMenuItem.class.st @@ -2,30 +2,31 @@ This menu item selects the incoming links of the node. " Class { - #name : #HSelectIncomingLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HSelectIncomingLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HSelectIncomingLinksMenuItem >> execute [ visualization container setSelectedShapes: shape incomingShapes ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectIncomingLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectIncomingLinksMenuItem >> label [ ^ 'Select incoming links' ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectIncomingLinksMenuItem >> order [ ^ 110 diff --git a/src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st index 14fdfd0..cf38c0d 100644 --- a/src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HSelectOutgoingLinksMenuItem.class.st @@ -2,30 +2,31 @@ This menu item selects the outgoing links of the node. " Class { - #name : #HSelectOutgoingLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HSelectOutgoingLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HSelectOutgoingLinksMenuItem >> execute [ visualization container setSelectedShapes: shape outgoingShapes ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectOutgoingLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectOutgoingLinksMenuItem >> label [ ^ 'Select outgoing links' ] -{ #category : #accessing } +{ #category : 'accessing' } HSelectOutgoingLinksMenuItem >> order [ ^ 120 diff --git a/src/Hierarchical-Roassal-Menu/HSelectShapesMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HSelectShapesMenuItem.class.st new file mode 100644 index 0000000..1c77c45 --- /dev/null +++ b/src/Hierarchical-Roassal-Menu/HSelectShapesMenuItem.class.st @@ -0,0 +1,64 @@ +" +Define the selection in canvas. +" +Class { + #name : 'HSelectShapesMenuItem', + #superclass : 'HCanvasMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' +} + +{ #category : 'building - menus' } +HSelectShapesMenuItem >> buildOn: aMenuMorph [ + + | submenu selections | + submenu := MenuMorph new. + selections := OrderedCollection new. + selections + add: 'Select all' -> #selectAll; + add: 'Invert selection' -> #invertSelection. + + + selections do: [ :assoc | + submenu add: assoc key target: self selector: assoc value ]. + aMenuMorph add: self label subMenu: submenu +] + +{ #category : 'accessing' } +HSelectShapesMenuItem >> execute [ + + +] + +{ #category : 'accessing' } +HSelectShapesMenuItem >> group [ + + ^ 1 +] + +{ #category : 'api - selection' } +HSelectShapesMenuItem >> invertSelection [ + + visualization container selectedShapes ifEmpty: [ ^ self ]. + visualization container setSelectedShapes: + visualization container nodes + \ visualization container selectedShapes +] + +{ #category : 'accessing' } +HSelectShapesMenuItem >> label [ + + ^ 'Select' +] + +{ #category : 'accessing' } +HSelectShapesMenuItem >> order [ + + ^ 70 +] + +{ #category : 'api - selection' } +HSelectShapesMenuItem >> selectAll [ + + visualization container setSelectedShapes: visualization container nodes +] diff --git a/src/Hierarchical-Roassal-Menu/HShowAllLinksInCanvasMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HShowAllLinksInCanvasMenuItem.class.st index 3783058..9de00c9 100644 --- a/src/Hierarchical-Roassal-Menu/HShowAllLinksInCanvasMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HShowAllLinksInCanvasMenuItem.class.st @@ -1,26 +1,27 @@ Class { - #name : #HShowAllLinksInCanvasMenuItem, - #superclass : #HCanvasMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HShowAllLinksInCanvasMenuItem', + #superclass : 'HCanvasMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HShowAllLinksInCanvasMenuItem >> execute [ visualization rootNode showAllLinks. visualization rebuildLines: visualization canvas. ] -{ #category : #accessing } +{ #category : 'accessing' } HShowAllLinksInCanvasMenuItem >> group [ ^ 2 ] -{ #category : #accessing } +{ #category : 'accessing' } HShowAllLinksInCanvasMenuItem >> label [ ^ 'Show all links' ] -{ #category : #accessing } +{ #category : 'accessing' } HShowAllLinksInCanvasMenuItem >> order [ ^ 20 ] diff --git a/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st b/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st index 0418c0e..3a53274 100644 --- a/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st +++ b/src/Hierarchical-Roassal-Menu/HShowAllLinksMenuItem.class.st @@ -2,28 +2,29 @@ This menu item shows all the links of the node and all children. " Class { - #name : #HShowAllLinksMenuItem, - #superclass : #HNodeMenuItem, - #category : #'Hierarchical-Roassal-Menu' + #name : 'HShowAllLinksMenuItem', + #superclass : 'HNodeMenuItem', + #category : 'Hierarchical-Roassal-Menu', + #package : 'Hierarchical-Roassal-Menu' } -{ #category : #execution } +{ #category : 'execution' } HShowAllLinksMenuItem >> execute [ shape model showAllLinks. visualization rebuildLines: shape. ] -{ #category : #accessing } +{ #category : 'accessing' } HShowAllLinksMenuItem >> group [ ^ 3 ] -{ #category : #accessing } +{ #category : 'accessing' } HShowAllLinksMenuItem >> label [ ^ 'Show all links' ] -{ #category : #accessing } +{ #category : 'accessing' } HShowAllLinksMenuItem >> order [ ^ 50 ] diff --git a/src/Hierarchical-Roassal-Menu/package.st b/src/Hierarchical-Roassal-Menu/package.st index 815518a..4ee2ce0 100644 --- a/src/Hierarchical-Roassal-Menu/package.st +++ b/src/Hierarchical-Roassal-Menu/package.st @@ -1 +1 @@ -Package { #name : #'Hierarchical-Roassal-Menu' } +Package { #name : 'Hierarchical-Roassal-Menu' }