Skip to content

Commit b919c24

Browse files
authored
Merge pull request #1209 from fesch/bugfix
Version 3.32-31 candidate
2 parents cb021e4 + 72c7430 commit b919c24

18 files changed

Lines changed: 747 additions & 553 deletions

buildapp.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
name="Structorizer"
1616
displayname="Structorizer"
1717
identifier="lu.fisch.Structorizer"
18-
shortversion="3.32-30"
19-
version="3.32-30"
18+
shortversion="3.32-31"
19+
version="3.32-31"
2020
icon="icons/Structorizer.icns"
2121
mainclassname="Structorizer"
2222
copyright="Bob Fisch"

src/lu/fisch/structorizer/archivar/IRoutinePoolListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
******************************************************************************************************
4343
*
4444
* Comment:
45-
*
45+
* FIXME Replace this by a central subscriber / notification mechanism
4646
*
4747
******************************************************************************************************///
4848

src/lu/fisch/structorizer/arranger/Arranger.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,7 @@ public void inspectAttributes(Root _root) {
21912191
_root.addUndo(true);
21922192
_root.adoptAttributes(attrInsp.licenseInfo);
21932193
// START KGU#408 2021-02-28: Enh. #410 Can't be a big issue...
2194+
// FIXME Replace this by a central notification mechanism
21942195
//this.routinePoolChanged(surface, RPC_POOL_CHANGED);
21952196
this.routinePoolChanged(surface, RPC_STATUS_CHANGED);
21962197
// END KGU#408 2021-02-28

src/lu/fisch/structorizer/arranger/Surface.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
*/
2020

21-
2221
package 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) {

src/lu/fisch/structorizer/elements/Alternative.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -983,22 +983,6 @@ public Color getBranchHeadColor(int _branchIndex) {
983983
return this.branchHeadColors[_branchIndex];
984984
}
985985

986-
@Override
987-
public String getHexBranchColorList()
988-
{
989-
StringBuilder sb = new StringBuilder();
990-
for (int i = 0; i < this.getBranchCount(); i++) {
991-
if (i > 0) {
992-
sb.append(",");
993-
}
994-
Color brColor = this.getBranchHeadColor(i);
995-
if (brColor != null) {
996-
sb.append(getHexColor(brColor));
997-
}
998-
}
999-
return sb.toString();
1000-
}
1001-
1002986
@Override
1003987
public boolean setBranchHeadColor(int _branchIndex, Color _branchColor) {
1004988
if (_branchIndex < 0 || _branchIndex > 1) {

src/lu/fisch/structorizer/elements/Case.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
import javax.swing.ImageIcon;
9090

9191
import lu.fisch.graphics.*;
92-
import lu.fisch.structorizer.elements.Element.DrawingContext;
9392
import lu.fisch.structorizer.gui.FindAndReplace;
9493
import lu.fisch.structorizer.gui.IconLoader;
9594
import lu.fisch.utils.*;
@@ -1439,23 +1438,6 @@ public Color getBranchHeadColor(int _branchIndex) {
14391438
return this.branchHeadColors.get(_branchIndex);
14401439
}
14411440

1442-
@Override
1443-
public String getHexBranchColorList()
1444-
{
1445-
StringBuilder sb = new StringBuilder();
1446-
for (int i = 0; i < this.getBranchCount(); i++) {
1447-
if (i > 0) {
1448-
sb.append(",");
1449-
}
1450-
// The method sensibly reacts to a shorter colour vector
1451-
Color brColor = this.getBranchHeadColor(i);
1452-
if (brColor != null) {
1453-
sb.append(getHexColor(brColor));
1454-
}
1455-
}
1456-
return sb.toString();
1457-
}
1458-
14591441
@Override
14601442
public boolean setBranchHeadColor(int _branchIndex, Color _branchColor) {
14611443
if (_branchIndex < 0 || _branchIndex >= this.getBranchCount()) {

src/lu/fisch/structorizer/elements/Element.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
* Kay Gürtzig 2025-07-02 Issue #270: Implementation of isDisabled(boolean) was defective.
145145
* Kay Gürtzig 2025-08-01 Enh. #1197: Support/precaution for IFork branch colouring,
146146
* Enh. #1198: Case editor choice option changed from boolean to enum
147+
* Kay Gürtzig 2025-08-13 Enh. #1198: Defective initial preference for useInputBoxCase mended
147148
*
148149
******************************************************************************************************
149150
*
@@ -315,7 +316,7 @@ public String toString()
315316
public static final long E_HELP_FILE_SIZE = 12300000;
316317
public static final String E_DOWNLOAD_PAGE = "https://www.fisch.lu/Php/download.php";
317318
// END KGU#791 2020-01-20
318-
public static final String E_VERSION = "3.32-30";
319+
public static final String E_VERSION = "3.32-31";
319320
public static final String E_THANKS =
320321
"Developed and maintained by\n"+
321322
" - Robert Fisch <robert.fisch@education.lu>\n"+
@@ -2799,12 +2800,14 @@ public static void loadFromINI()
27992800
// START KGU#916 2021-01-25: Enh. #915
28002801
// START KGU#997 2025-08-01: Enh. #1198
28012802
//useInputBoxCase = ini.getProperty("CaseEditor", "true").equals("true");
2802-
String caseEditorMode = ini.getProperty("CaseEditor", "NON-EMPTY");
2803+
String caseEditorMode = ini.getProperty("CaseEditor", "NON_EMPTY"); // corrected 2025-08-13
28032804
// Legacy identification
2804-
useInputBoxCase = CaseEditorChoice.NEVER;
28052805
if (caseEditorMode.equals("true")) {
28062806
useInputBoxCase = CaseEditorChoice.ALWAYS;
28072807
}
2808+
else if (caseEditorMode.equals("false")) {
2809+
useInputBoxCase = CaseEditorChoice.NEVER;
2810+
}
28082811
for (CaseEditorChoice ce: CaseEditorChoice.values()) {
28092812
if (caseEditorMode.equals(ce.name())) {
28102813
useInputBoxCase = ce;

src/lu/fisch/structorizer/elements/IFork.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,21 @@ public interface IFork {
124124
*
125125
* @see #getBranchHeadColor(int)
126126
*/
127-
public String getHexBranchColorList();
127+
public default String getHexBranchColorList()
128+
{
129+
StringBuilder sb = new StringBuilder();
130+
for (int i = 0; i < this.getBranchCount(); i++) {
131+
if (i > 0) {
132+
sb.append(",");
133+
}
134+
// The method sensibly reacts to a shorter colour vector
135+
Color brColor = this.getBranchHeadColor(i);
136+
if (brColor != null) {
137+
sb.append(Element.getHexColor(brColor));
138+
}
139+
}
140+
return sb.toString();
141+
}
128142
// END KGU#1182
129143

130144
}

0 commit comments

Comments
 (0)