diff --git a/build.gradle b/build.gradle index 4bb119b..ffb47b7 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ repositories { dependencies { implementation("com.seedfinding:mc_core:1.0.0") {transitive(false)} implementation("com.seedfinding:mc_biome:1.0.0") {transitive(false)} - implementation("com.seedfinding:mc_reversal:2.0.0") {transitive(false)} + implementation("com.seedfinding:mc_reversal:1.171.1") {transitive(false)} implementation("com.seedfinding:mc_seed:1.0.0") {transitive(false)} implementation("com.seedfinding:mc_math:1.0.0") {transitive(false)} implementation("com.seedfinding:mc_feature:1.0.0") {transitive(false)} @@ -22,8 +22,8 @@ dependencies { implementation("com.seedfinding:latticg:1.06") {transitive(false)} implementation "com.github.Wearblackallday:Javautils:bd48987e5f4d714d2e0cd267fea23970fd5e4776" - implementation "com.formdev:flatlaf:2.4" - implementation "com.formdev:flatlaf-intellij-themes:2.4" + implementation 'com.formdev:flatlaf:2.5' + implementation 'com.formdev:flatlaf-intellij-themes:2.5' } application { diff --git a/src/main/java/wearblackallday/seedcandy/SeedCandy.java b/src/main/java/wearblackallday/seedcandy/SeedCandy.java index 3770aa0..cf72f80 100644 --- a/src/main/java/wearblackallday/seedcandy/SeedCandy.java +++ b/src/main/java/wearblackallday/seedcandy/SeedCandy.java @@ -71,7 +71,7 @@ private JMenuBar createMenuBar() { return new LMenuBar() .addMenu(this.version.name, versionMenu -> - Factory.addSelection(versionMenu, SUPPORTED_VERSIONS, Factory::shortVersionName, this.version::equals, version -> { + Factory.selectionGroup(versionMenu, SUPPORTED_VERSIONS, Factory::shortVersionName, this.version::equals, version -> { this.setVersion(version); versionMenu.setText(Factory.shortVersionName(version)); })) @@ -89,11 +89,11 @@ private JMenuBar createMenuBar() { .addMenu("Theme", themeMenu -> themeMenu .subMenu("dark", darkThemes -> { darkThemes.getPopupMenu().setLayout(new GridLayout(0, 2)); - Factory.addSelection(darkThemes, themes.get(true), FlatIJLookAndFeelInfo::getName, + Factory.selectionGroup(darkThemes, themes.get(true), FlatIJLookAndFeelInfo::getName, info -> info.getClassName().equals(this.getTheme().className()), info -> this.setTheme(info::getClassName)); }) - .subMenu("light", lightThemes -> Factory.addSelection(lightThemes, themes.get(false), FlatIJLookAndFeelInfo::getName, + .subMenu("light", lightThemes -> Factory.selectionGroup(lightThemes, themes.get(false), FlatIJLookAndFeelInfo::getName, info -> info.getClassName().equals(this.getTheme().className()), info -> this.setTheme(info::getClassName))) ); diff --git a/src/main/java/wearblackallday/seedcandy/util/Factory.java b/src/main/java/wearblackallday/seedcandy/util/Factory.java index 97f3385..a32de00 100644 --- a/src/main/java/wearblackallday/seedcandy/util/Factory.java +++ b/src/main/java/wearblackallday/seedcandy/util/Factory.java @@ -30,12 +30,12 @@ public static JSpinner numberSelector(String tooltip) { return spinner; } - public static void addSelection(JMenu menu, Collection options, Function buttonName, Predicate selectCondition, Consumer onSelected) { + public static void selectionGroup(JMenu parentMenu, Collection options, Function buttonName, Predicate selectCondition, Consumer onSelected) { ButtonGroup buttonGroup = new ButtonGroup(); for(T option : options) { JRadioButtonMenuItem button = new JRadioButtonMenuItem(buttonName.apply(option)); button.addActionListener(e -> onSelected.accept(option)); - menu.add(button); + parentMenu.add(button); buttonGroup.add(button); button.setSelected(selectCondition.test(option)); }