1818 along with this program. If not, see <http://www.gnu.org/licenses/>.
1919*/
2020
21-
2221package lu .fisch .structorizer .arranger ;
2322
2423/******************************************************************************************************
@@ -305,6 +304,7 @@ public class Surface extends LangPanel implements MouseListener, MouseMotionList
305304
306305 private Vector <Diagram > diagrams = new Vector <Diagram >();
307306 // START KGU#305 2016-12-16: Code revision
307+ // FIXME Replace this by a central notification mechanism
308308 private final Vector <IRoutinePoolListener > listeners = new Vector <IRoutinePoolListener >();
309309 // END KGU#305 2016-12-16
310310 // START KGU#624 2018-12-26: Enh. #655 We need more efficient searching
@@ -725,6 +725,7 @@ public int loadFiles(File[] files)
725725 }
726726 // END KGU#278 2016-10-11
727727 // START KGU#624 2018-12-27: Enh. #655 - Notify about the selection change
728+ // FIXME Replace this by a central notification mechanism
728729 notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
729730 // END KGU#624 2018-12-27
730731 return nLoaded ;
@@ -1072,6 +1073,7 @@ else if (option < exactGroups.size()) {
10721073 // START KGU#746 2019-10-05: The status change of the group wasn't shown in Arranger index
10731074 // START KGU#408 2021-03-01: This is a low-level change
10741075 //this.notifyChangeListeners(IRoutinePoolListener.RPC_POOL_CHANGED);
1076+ // FIXME Replace this by a central notification mechanism
10751077 this .notifyChangeListeners (IRoutinePoolListener .RPC_STATUS_CHANGED );
10761078 // END KGU#408 2021-03-01
10771079 // END KGU#746 2019-10-05
@@ -1871,6 +1873,7 @@ public boolean loadArrangement(Frame frame, File arrFile, File unzippedFrom)
18711873 // START KGU#278 2016-10-11: Enh. #267
18721874 if (nLoaded > 0 )
18731875 {
1876+ // FIXME Replace this by a central notification mechanism
18741877 notifyChangeListeners (IRoutinePoolListener .RPC_POOL_CHANGED );
18751878 }
18761879 // END KGU#278 2016-10-11
@@ -2725,6 +2728,7 @@ else if (!diagramsSelected.isEmpty() && owningGroup != null) {
27252728 }
27262729 // END KGU#701 2019-03-30
27272730 // START KGU#624 2018-12-21: Enh. #655
2731+ // FIXME Replace this by a central notification mechanism
27282732 notifyChangeListeners (IRoutinePoolListener .RPC_POOL_CHANGED | IRoutinePoolListener .RPC_SELECTION_CHANGED );
27292733 // END KGU#624 2018-12-21
27302734 repaint ();
@@ -2918,6 +2922,7 @@ private void removeDiagram(Diagram diagr)
29182922 adaptLayout ();
29192923 repaint ();
29202924 // START KGU#278 2016-10-11: Enh. #267
2925+ // FIXME Replace this by a central notification mechanism
29212926 notifyChangeListeners (IRoutinePoolListener .RPC_POOL_CHANGED | IRoutinePoolListener .RPC_SELECTION_CHANGED );
29222927 Vector <Mainform > mainforms = activeMainforms ();
29232928 if (form != null ) {
@@ -3090,6 +3095,7 @@ public void setCovered(Frame frame)
30903095 repaint ();
30913096 // START KGU#318 2017-01-05: Enh. #319 Arranger index now reflects test coverage
30923097 // START KGU#408 2021-03-01: Enh. #410 - no need to rebuild the tree
3098+ // FIXME Replace this by a central notification mechanism
30933099 //this.notifyChangeListeners(IRoutinePoolListener.RPC_POOL_CHANGED | IRoutinePoolListener.RPC_SELECTION_CHANGED);
30943100 this .notifyChangeListeners (IRoutinePoolListener .RPC_STATUS_CHANGED | IRoutinePoolListener .RPC_SELECTION_CHANGED );
30953101 // END KGU#408 2021-03-01
@@ -3405,6 +3411,7 @@ public boolean removeAllDiagrams(Component initiator)
34053411 // END KGU#626 2018-12-31
34063412 adaptLayout ();
34073413 repaint ();
3414+ // FIXME Replace this by a central notification mechanism
34083415 notifyChangeListeners (IRoutinePoolListener .RPC_POOL_CHANGED | IRoutinePoolListener .RPC_SELECTION_CHANGED );
34093416 }
34103417 allDone = true ;
@@ -3466,6 +3473,7 @@ protected void rearrange()
34663473 }
34673474 this .adaptLayout ();
34683475 this .repaint ();
3476+ // FIXME Replace this by a central notification mechanism
34693477 this .notifyChangeListeners (IRoutinePoolListener .RPC_POSITIONS_CHANGED );
34703478 }
34713479 // END KGU#630 2019-01-12
@@ -3598,6 +3606,7 @@ public void mouseClicked(MouseEvent e)
35983606 this .selectGroups (hitGroups );
35993607 }
36003608 }
3609+ // FIXME Replace this by a central notification mechanism
36013610 this .notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
36023611 repaint ();
36033612 }
@@ -3633,6 +3642,7 @@ public void mouseReleased(MouseEvent e)
36333642 {
36343643 // We must reset the last drag information lest mouseDragged() should run havoc
36353644 if (dragPoint != null ) {
3645+ // FIXME Replace this by a central notification mechanism
36363646 this .notifyChangeListeners (IRoutinePoolListener .RPC_POSITIONS_CHANGED );
36373647 }
36383648 // START KGU#896 2020-12-23: Enh. #896 Unambiguous indication of what will happen on dragging
@@ -3803,6 +3813,7 @@ public void actionPerformed(ActionEvent evt) {
38033813 if (diagrams .remove (diagr )) {
38043814 diagrams .add (diagr );
38053815 }
3816+ // FIXME Replace this by a central notification mechanism
38063817 notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
38073818 }});
38083819 Arranger .popupHitList .add (menuItem );
@@ -3833,6 +3844,7 @@ public void actionPerformed(ActionEvent evt) {
38333844 diagrams .add (diagr );
38343845 }
38353846 }
3847+ // FIXME Replace this by a central notification mechanism
38363848 notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
38373849 }});
38383850 Arranger .popupHitList .add (menuItem );
@@ -3970,6 +3982,7 @@ public void unselectAll() {
39703982 diagr .root .setSelected (false , Element .DrawingContext .DC_ARRANGER );
39713983 }
39723984 }
3985+ // FIXME Replace this by a central notification mechanism
39733986 this .notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
39743987 repaint ();
39753988 }
@@ -3989,6 +4002,7 @@ public void selectAll() {
39894002 diagr .root .setSelected (true , Element .DrawingContext .DC_ARRANGER );
39904003 }
39914004 }
4005+ // FIXME Replace this by a central notification mechanism
39924006 notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
39934007 repaint ();
39944008 }
@@ -4004,6 +4018,7 @@ public void selectSet(Collection<Diagram> diagrSet) {
40044018 diagr .root .setSelected (true , Element .DrawingContext .DC_ARRANGER );
40054019 }
40064020 }
4021+ // FIXME Replace this by a central notification mechanism
40074022 this .notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
40084023 repaint ();
40094024 }
@@ -4083,6 +4098,7 @@ private void update(Root source, boolean replaced)
40834098 }
40844099 }
40854100 // END KGU#626 2018-12-31
4101+ // FIXME Replace this by a central notification mechanism
40864102 this .notifyChangeListeners (changes );
40874103 }
40884104 // START KGU#650 2019-02-11: Issue #677 Keep track of changed archive members residing outside
@@ -4436,6 +4452,7 @@ else if (newRoot != null)
44364452 // END KGU#278 2016-10-11
44374453 }
44384454 // START KGU#305 2016-10-16: Enh. #305
4455+ // FIXME Replace this by a central notification mechanism
44394456 notifyChangeListeners (IRoutinePoolListener .RPC_POOL_CHANGED | IRoutinePoolListener .RPC_SELECTION_CHANGED );
44404457 // END KGU#305 2016-10-16
44414458 }
@@ -4864,6 +4881,7 @@ public void scrollToDiagram(Root aRoot, boolean setAtTop) {
48644881 // END KGU#624 2018-12-21
48654882 this .repaint ();
48664883 // START KGU#624 2018-12-21: Enh. #655
4884+ // FIXME Replace this by a central notification mechanism
48674885 this .notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
48684886 // END KGU#624 2018-12-21
48694887 }
@@ -4971,10 +4989,11 @@ public Root getSelected1()
49714989 // END KGU#624 2018-12-21
49724990
49734991 // START KGU#624 2018-12-26: Enh. #655
4974- protected int expandSelectionRecursively (StringList missingSignatures , StringList duplicateSignatures ) {
4975- Set <Root > selectedRoots = getSelected ();
4992+ protected int expandSelectionRecursively (StringList missingSignatures , StringList duplicateSignatures ) {
4993+ Set <Root > selectedRoots = getSelected ();
49764994 Set <Diagram > addedDiagrams = expandRootSet (selectedRoots , missingSignatures , duplicateSignatures );
49774995 diagramsSelected .addAll (addedDiagrams );
4996+ // FIXME Replace this by a central notification mechanism
49784997 notifyChangeListeners (IRoutinePoolListener .RPC_SELECTION_CHANGED );
49794998 repaint ();
49804999 return addedDiagrams .size ();
@@ -5062,6 +5081,7 @@ private void handleReferenceCandidates(Set<Root> rootSet, StringList missingSign
50625081 // END KGU#624 2018-12-26
50635082
50645083 // START KGU#305 2016-12-16: Code revision
5084+ // FIXME Replace this by a central notification mechanism
50655085 @ Override
50665086 public void addChangeListener (IRoutinePoolListener _listener ) {
50675087 if (_listener instanceof Arranger ) {
@@ -5072,6 +5092,7 @@ public void addChangeListener(IRoutinePoolListener _listener) {
50725092 }
50735093 }
50745094
5095+ // FIXME Replace this by a central notification mechanism
50755096 @ Override
50765097 public void removeChangeListener (IRoutinePoolListener _listener ) {
50775098 if (_listener instanceof Arranger ) {
0 commit comments