Skip to content

Commit 2c2be03

Browse files
Release 1.1.4: canvas view zoom, tab close prompts, maintenance
Diagram canvas scales with platform shortcuts (⌘/Ctrl + and −); mouse-wheel block resize and its setting are removed. Closing a dirty tab offers save, discard, or cancel, with unsaved state on the tab header. Legacy commented-out code is trimmed. Version bumps for Maven, macOS packaging scripts, README, and release-notes/v1.1.4.md. Ignore local VisuStruct-swift/ clone in .gitignore. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e609e07 commit 2c2be03

21 files changed

Lines changed: 618 additions & 338 deletions

‎.gitignore‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ visustruct.properties
2626
dist/
2727

2828
# Abhängigkeitsordner irrtümlich im Projektroot (z. B. entpackte JARs)
29-
com/
29+
com/
30+
31+
# Lokaler Klon des SwiftUI-Repos (nicht ins Java-Projekt einchecken)
32+
VisuStruct-swift/

‎README.md‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ git clone https://github.com/code4teaching/VisuStruct.git
2222

2323
---
2424

25+
## Changes in 1.1.4 (summary)
26+
27+
- **Diagram:** canvas **view zoom** with **⌘+ / ⌘−** (macOS) or **Ctrl+ / Ctrl−** (Windows/Linux); **no** block resize via mouse wheel anymore.
28+
- **Tabs:** prompt to **save / discard / cancel** when closing a diagram with unsaved changes; dirty state shown in the tab header (not as `*` in the title).
29+
- **Code:** removed long blocks of commented-out legacy code (especially `Struktogramm`, `StrTabbedPane`, `XMLLeser`, palette/trash setup) for easier maintenance.
30+
31+
Full notes: [`release-notes/v1.1.4.md`](release-notes/v1.1.4.md).
32+
2533
## Changes in 1.1.3 (summary)
2634

2735
- **Tabs:** close tabs via middle-click, context menu, and **Ctrl+W** / **Cmd+W**; clicking the tab header switches diagrams reliably (close “×” is a label, not a button).
@@ -119,7 +127,7 @@ This release aligns **branding and technical identity** with **VisuStruct**. **`
119127
- **Java 17** target (build and run with JDK 17+).
120128
- **FlatLaf** light/dark themes; **JDOM2**; no legacy AppleJavaExtensions.
121129
- **Motif** look-and-feel removed; **Metal** and FlatLaf available.
122-
- Current fat JAR name follows **`pom.xml`** **`version`** (e.g. **`visustruct-1.1.3.jar`**).
130+
- Current fat JAR name follows **`pom.xml`** **`version`** (e.g. **`visustruct-1.1.4.jar`**).
123131

124132
---
125133

@@ -194,13 +202,13 @@ chmod +x mvnw
194202
Output (version from `pom.xml`):
195203

196204
```text
197-
target/visustruct-1.1.3.jar
205+
target/visustruct-1.1.4.jar
198206
```
199207

200208
## Run
201209

202210
```bash
203-
java -jar target/visustruct-1.1.3.jar
211+
java -jar target/visustruct-1.1.4.jar
204212
```
205213

206214
Double-click may work if `.jar` is associated with Java.

‎packaging/macos/build-lightweight-app.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -euo pipefail
55
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
66
ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
7-
VER="${PROJECT_VERSION:-1.1.3}"
7+
VER="${PROJECT_VERSION:-1.1.4}"
88
JAR_NAME="visustruct-${VER}.jar"
99
OUT="${ROOT}/dist/macos-app-light"
1010
APP="${OUT}/VisuStruct.app"

‎packaging/macos/build-macos-app.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Voraussetzung: JDK 17+ mit jpackage (im PATH oder JAVA_HOME).
55
set -euo pipefail
66
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
7-
VER="${PROJECT_VERSION:-1.1.3}"
7+
VER="${PROJECT_VERSION:-1.1.4}"
88
JAR="visustruct-${VER}.jar"
99
INPUT="${ROOT}/target"
1010
OUT="${ROOT}/dist/macos-app"

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>de.visustruct</groupId>
66
<artifactId>visustruct</artifactId>
7-
<version>1.1.3</version>
7+
<version>1.1.4</version>
88
<name>VisuStruct</name>
99

1010
<properties>

‎release-notes/v1.1.4.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# VisuStruct 1.1.4
2+
3+
Release **after** **1.1.3** (GitHub `master`).
4+
5+
## Diagram canvas
6+
7+
- **View zoom** for the diagram: **⌘+ / ⌘−** on macOS, **Strg+ / Strg−** on Windows/Linux (root-pane shortcuts). The logical block layout is unchanged; only the on-screen scale changes.
8+
- **Removed:** resizing blocks with the **mouse wheel** (and the related setting / menu entry / persisted option).
9+
10+
## Tabs
11+
12+
- **Unsaved changes:** closing a tab (×, middle-click, context menu, or **Diagramm schließen**) asks to **save**, **discard**, or **cancel** when the diagram is dirty.
13+
- **Dirty indicator** is shown on the tab chrome (no `*` suffix in the title text).
14+
15+
## Code maintenance
16+
17+
- Removed large sections of **commented-out legacy code** (obsolete helpers, unused fields, dead branches) in **`Struktogramm`**, **`StrTabbedPane`**, **`AuswahlPanel`**, **`Fallauswahl`**, **`StruktogrammElementListe`**, **`XMLLeser`**, and related classes to reduce noise and merge conflicts.
18+
19+
## Build
20+
21+
- Maven: **`de.visustruct:visustruct:1.1.4`**
22+
- Fat JAR: **`visustruct-1.1.4.jar`** (`./mvnw package` → `target/`)

‎src/main/java/de/visustruct/control/Controlling.java‎

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.awt.print.Printable;
2323
import java.awt.print.PrinterException;
2424
import java.awt.print.PrinterJob;
25+
import java.util.logging.Level;
26+
import java.util.logging.Logger;
2527

2628
import javax.swing.JCheckBoxMenuItem;
2729
import javax.swing.JEditorPane;
@@ -56,6 +58,8 @@
5658

5759
public class Controlling implements Konstanten, ActionListener, WindowListener, KeyListener {
5860

61+
private static final Logger LOG = Logger.getLogger(Controlling.class.getName());
62+
5963
private GUI gui;
6064
private enum Betriebssysteme {Windows, Mac, Linux};
6165

@@ -88,7 +92,7 @@ public void handleOSSettingsAndTheme(){
8892
}
8993

9094
}catch(Exception e){
91-
e.printStackTrace();
95+
LOG.log(Level.SEVERE, "Theme/OS-Initialisierung fehlgeschlagen", e);
9296
}
9397
}
9498

@@ -102,14 +106,9 @@ private void applyConfiguredTheme() {
102106
case lookAndFeelOSStandard:
103107
try {
104108
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
105-
} catch (ClassNotFoundException e1) {
106-
e1.printStackTrace();
107-
} catch (InstantiationException e1) {
108-
e1.printStackTrace();
109-
} catch (IllegalAccessException e1) {
110-
e1.printStackTrace();
111-
} catch (UnsupportedLookAndFeelException e1) {
112-
e1.printStackTrace();
109+
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
110+
| UnsupportedLookAndFeelException e1) {
111+
LOG.log(Level.WARNING, "System-Look-and-Feel konnte nicht gesetzt werden", e1);
113112
}
114113
break;
115114

@@ -121,7 +120,7 @@ private void applyConfiguredTheme() {
121120
UIManager.setLookAndFeel(new FlatLightLaf());
122121
}
123122
} catch (UnsupportedLookAndFeelException e) {
124-
e.printStackTrace();
123+
LOG.log(Level.WARNING, "FlatLight-Look-and-Feel konnte nicht gesetzt werden", e);
125124
}
126125
break;
127126

@@ -133,7 +132,7 @@ private void applyConfiguredTheme() {
133132
UIManager.setLookAndFeel(new FlatDarkLaf());
134133
}
135134
} catch (UnsupportedLookAndFeelException e) {
136-
e.printStackTrace();
135+
LOG.log(Level.WARNING, "FlatDark-Look-and-Feel konnte nicht gesetzt werden", e);
137136
}
138137
break;
139138

@@ -150,14 +149,14 @@ private void applyConfiguredTheme() {
150149
try {
151150
UIManager.setLookAndFeel(lookAndFeel);
152151
} catch (UnsupportedLookAndFeelException e) {
153-
e.printStackTrace();
152+
LOG.log(Level.WARNING, "Look-and-Feel (Metal/Nimbus) konnte nicht gesetzt werden", e);
154153
}
155154
}
156155

157156
UiTheme.applyAfterTheme();
158157
I18n.applyFileChooserStrings();
159158
} catch (Exception e) {
160-
e.printStackTrace();
159+
LOG.log(Level.SEVERE, "Look-and-Feel-Konfiguration fehlgeschlagen", e);
161160
}
162161
}
163162

@@ -209,8 +208,13 @@ public void speichern(boolean neuenSpeicherpfadAuswaehlenLassen){
209208

210209
if(str != null){
211210
GlobalSettings.setzeSpeicherpfad(str.speichern(neuenSpeicherpfadAuswaehlenLassen,GlobalSettings.getZuletztGenutzterSpeicherpfad()));//Struktogramm wird gespeichert (zuletztGenutzterSpeicherpfad wird dabei übergeben, damit der JFileChooser, sofern er genutzt wird, dort startet) und der neue Speicherpfad wird gesichert
211+
String p = str.gibAktuellenSpeicherpfad();
212+
if (!p.isEmpty()) {
213+
GlobalSettings.rememberRecentStruktogrammPath(p);
214+
}
212215
GlobalSettings.saveSettings();
213216
titelleisteAktualisieren();
217+
gui.rebuildMenuBar();
214218
}
215219
}
216220

@@ -230,8 +234,28 @@ private void openStruktogramm(String pfad) {
230234
str.graphicsInitialisieren();
231235
str.laden(pfad);
232236
GlobalSettings.setzeSpeicherpfad(pfad);
237+
GlobalSettings.rememberRecentStruktogrammPath(pfad);
233238
GlobalSettings.saveSettings();
234239
titelleisteAktualisieren();
240+
gui.rebuildMenuBar();
241+
}
242+
243+
244+
/** Öffnet eine gespeicherte Datei aus dem Menü „Zuletzt geöffnet“. */
245+
public void oeffneStruktogrammAusZuletztListe(String pfad) {
246+
if (pfad == null || pfad.isBlank()) {
247+
return;
248+
}
249+
File f = new File(pfad);
250+
if (!f.isFile()) {
251+
GlobalSettings.removeRecentStruktogrammPath(pfad);
252+
GlobalSettings.saveSettings();
253+
gui.rebuildMenuBar();
254+
JOptionPane.showMessageDialog(gui, I18n.trf("dialog.recentMissing.message", pfad),
255+
I18n.tr("dialog.recentMissing.title"), JOptionPane.WARNING_MESSAGE);
256+
return;
257+
}
258+
openStruktogramm(pfad);
235259
}
236260

237261

@@ -384,10 +408,6 @@ public void actionPerformed(ActionEvent e) {
384408
new FontChooser(this,true);
385409
break;
386410

387-
case groesseAendernMitMausrad:
388-
mitMausradElementeVergroessernGeklickt(e.getSource());
389-
break;
390-
391411
case zoomeinstellungen:
392412
new ZoomEinstellungen(gui);
393413
break;
@@ -555,16 +575,6 @@ private void letzteElementeStreckenGeklickt(Object source){
555575
}
556576

557577

558-
private void mitMausradElementeVergroessernGeklickt(Object source){
559-
boolean einOderAus = ((JCheckBoxMenuItem)source).isSelected();
560-
GlobalSettings.setBeiMausradGroesseAendern(einOderAus);
561-
GlobalSettings.saveSettings();
562-
gibAktuellesStruktogramm().mausradScrollEinOderAusschalten(einOderAus);
563-
gibAktuellesStruktogramm().zeichenbereichAktualisieren();
564-
gibAktuellesStruktogramm().zeichne();
565-
}
566-
567-
568578
private void elementEinfuegenShortcutsVerwendenGeklickt(Object source){
569579
boolean einOderAus = ((JCheckBoxMenuItem)source).isSelected();
570580
GlobalSettings.setElementShortcutsVerwenden(einOderAus);
@@ -642,18 +652,6 @@ public void windowDeactivated(WindowEvent e) {
642652

643653
@Override
644654
public void keyTyped(KeyEvent e) {
645-
if(e.getSource() == gui.gibTabbedpane() && (e.getModifiersEx() & GlobalSettings.strgOderApfelMask) == 0){
646-
647-
switch(e.getKeyChar()){
648-
case '+':
649-
gibAktuellesStruktogramm().zoomAktuellesElement(true);
650-
break;
651-
652-
case '-':
653-
gibAktuellesStruktogramm().zoomAktuellesElement(false);
654-
break;
655-
}
656-
}
657655
}
658656

659657

0 commit comments

Comments
 (0)