diff --git a/src/main/java/com/example/statemachinedemo/ExportUtils.java b/src/main/java/com/example/statemachinedemo/ExportUtils.java index 5e0a1b6..b2cb83b 100644 --- a/src/main/java/com/example/statemachinedemo/ExportUtils.java +++ b/src/main/java/com/example/statemachinedemo/ExportUtils.java @@ -52,13 +52,15 @@ public class ExportUtils { Set transitionLines = new HashSet<>(); // Helper to get color for non-choice transitions (NO leading '#') - java.util.function.Function getTransitionColor = (type) -> { - if ("withExternal".equals(type)) return "1E90FF"; // DodgerBlue - if ("withInternal".equals(type)) return "32CD32"; // LimeGreen - if ("withJunction".equals(type)) return "FF69B4"; // HotPink - return "000000"; // Black fallback - }; - + java.util.function.Function getTransitionColor = (type) -> switch (type) { + case "withExternal" -> "1E90FF"; // DodgerBlue + case "withInternal" -> "32CD32"; // LimeGreen + case "withLocal" -> "FFA500"; // Orange + case "withJunction" -> "FF69B4"; // HotPink + case "withJoin" -> "8A2BE2"; // BlueViolet + case "withFork" -> "20B2AA"; // LightSeaGreen + default -> "000000"; // Black fallback + }; // 4. Output transitions for (Transition t : transitions) { if (t.sourceStates == null || t.sourceStates.isEmpty()) continue;