1
0
Fork 0

Add build tool, modern ui, update libraries

main
Simon vor 2 Tagen
Ursprung 0837752495
Commit 21e087bb0d

22
.gitignore vendored

@ -1,3 +1,5 @@
DungeonGenerator.jar
#################
## Eclipse
#################
@ -16,6 +18,24 @@ local.properties
.settings/
.loadpath
out/
.idea
.gradle
#################
## Gradle
#################
.gradle/
build/
gradle/
gradlew
gradlew.bat
#################
## Project Build
#################
*.jar
!lib/*.jar
sources.txt
# External tool builders
.externalToolBuilders/
@ -212,4 +232,4 @@ pip-log.txt
#Mr Developer
.mr.developer.cfg
/dist/
/dist/

2
.idea/.gitignore vendored

@ -1,2 +0,0 @@
# Default ignored files
/workspace.xml

@ -1,3 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="smoser" />
</component>

@ -1,10 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</component>

@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/pdfbox-app-2.0.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jgrapht-core-0.9.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jgraphx-2.0.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/itext-2.1.7.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jgrapht-ext-0.9.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jgraph-5.13.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/DungeonGenerator.iml" filepath="$PROJECT_DIR$/DungeonGenerator.iml" />
</modules>
</component>
</project>

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -32,6 +32,41 @@ And of course DungeonGenerator itself is open source with a [public repository](
Want to contribute? Great!
Maybe the [Javadoc](https://naclador.de/mosers/DungeonGenerator/src/branch/master/docs) is useful?
### Building
#### Using the build script (recommended)
```bash
# Build the JAR
./build.sh jar
# Clean build artifacts
./build.sh clean
# Build and run
./build.sh run
# Clean and rebuild
./build.sh all
```
#### Using Gradle
If you have Gradle installed:
```bash
# Build the JAR
gradle jar
# Run the application
gradle run
```
#### Requirements
- Java JDK 11 or higher
- All dependencies are included in the `lib/` folder
### Todos
- Implement more random stuff
@ -43,7 +78,7 @@ License
The MIT License (MIT)
Copyright (c) 2019 Simon Moser IT
Copyright (c) 2025 Simon Moser IT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@ -0,0 +1,70 @@
plugins {
id 'java'
id 'application'
}
group = 'eu.smoser'
version = '1.0'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
flatDir {
dirs 'lib'
}
}
dependencies {
implementation files('lib/flatlaf-3.4.1.jar')
implementation files('lib/itext-2.1.7.jar')
implementation files('lib/jgraph-5.13.0.0.jar')
implementation files('lib/jgrapht-core-0.9.2.jar')
implementation files('lib/jgrapht-ext-0.9.2.jar')
implementation files('lib/jgraphx-2.0.0.1.jar')
implementation files('lib/pdfbox-app-2.0.33.jar')
}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src', 'resources']
}
}
}
application {
mainClass = 'eu.smoser.dungeongenerator.main.DungeonGeneratorUI'
}
jar {
manifest {
attributes(
'Main-Class': 'eu.smoser.dungeongenerator.main.DungeonGeneratorUI',
'Class-Path': configurations.runtimeClasspath.files.collect { 'lib/' + it.name }.join(' ')
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName = 'DungeonGenerator'
}
tasks.register('buildJar') {
dependsOn jar
doLast {
println "JAR created: build/libs/DungeonGenerator-${version}.jar"
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

@ -0,0 +1,101 @@
#!/bin/bash
# Build script for DungeonGenerator
# Usage: ./build.sh [clean|jar|run]
set -e
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="$PROJECT_DIR/build/classes"
JAR_FILE="$PROJECT_DIR/DungeonGenerator.jar"
LIB_DIR="$PROJECT_DIR/lib"
SRC_DIR="$PROJECT_DIR/src"
RESOURCES_DIR="$PROJECT_DIR/resources"
# All library JARs
LIBS=$(find "$LIB_DIR" -name "*.jar" | tr '\n' ':')
clean() {
echo "Cleaning build directory..."
rm -rf "$PROJECT_DIR/build"
rm -f "$JAR_FILE"
rm -f "$PROJECT_DIR/sources.txt"
echo "Clean complete."
}
compile() {
echo "Compiling sources..."
mkdir -p "$BUILD_DIR"
# Find all Java files
find "$SRC_DIR" -name "*.java" > "$PROJECT_DIR/sources.txt"
# Compile
javac -cp "$LIBS" -d "$BUILD_DIR" @"$PROJECT_DIR/sources.txt"
# Copy resources
cp -r "$RESOURCES_DIR"/* "$BUILD_DIR/" 2>/dev/null || true
cp "$SRC_DIR/version.properties" "$BUILD_DIR/" 2>/dev/null || true
echo "Compilation complete."
}
create_jar() {
compile
echo "Creating JAR..."
mkdir -p "$BUILD_DIR/META-INF"
# Create manifest
LIB_CLASSPATH=$(find "$LIB_DIR" -name "*.jar" -exec basename {} \; | sed 's/^/lib\//' | tr '\n' ' ')
cat > "$BUILD_DIR/META-INF/MANIFEST.MF" << EOF
Manifest-Version: 1.0
Main-Class: eu.smoser.dungeongenerator.main.DungeonGeneratorUI
Class-Path: $LIB_CLASSPATH
EOF
# Create JAR
cd "$BUILD_DIR"
jar cfm "$JAR_FILE" META-INF/MANIFEST.MF .
cd "$PROJECT_DIR"
echo "JAR created: $JAR_FILE"
}
run_app() {
if [ ! -f "$JAR_FILE" ]; then
create_jar
fi
echo "Running DungeonGenerator..."
java -jar "$JAR_FILE"
}
# Main
case "${1:-jar}" in
clean)
clean
;;
compile)
compile
;;
jar)
create_jar
;;
run)
run_app
;;
all)
clean
create_jar
;;
*)
echo "Usage: $0 [clean|compile|jar|run|all]"
echo " clean - Remove build artifacts"
echo " compile - Compile Java sources"
echo " jar - Create executable JAR (default)"
echo " run - Build and run the application"
echo " all - Clean and build JAR"
exit 1
;;
esac

Binäre Datei nicht angezeigt.

Binäre Datei nicht angezeigt.

Binäre Datei nicht angezeigt.

@ -0,0 +1,2 @@
rootProject.name = 'DungeonGenerator'

@ -0,0 +1,16 @@
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/Exit.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/ADungeonObject.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Enemy.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Encounters.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Magic.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Treasure.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Trap.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/objects/Special.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/Room.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/dungeon/Dungeon.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/util/Dice.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/util/Counter.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/DungeonGeneratorUI.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/EncounterGenerator.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/AGenerator.java
/opt/DungeonGenerator/src/eu/smoser/dungeongenerator/main/TreasureGenerator.java

@ -3,7 +3,6 @@ package eu.smoser.dungeongenerator.dungeon;
import java.util.*;
import eu.smoser.dungeongenerator.util.*;
import org.jgraph.graph.DefaultEdge;
import org.jgrapht.UndirectedGraph;
import org.jgrapht.graph.SimpleGraph;
@ -36,7 +35,7 @@ public class Dungeon {
* Returns the greedy map
* @return HashMap greedy HashMap
*/
public HashMap GetGreedyMap(){
public HashMap<Integer, Object> GetGreedyMap(){
return greedyMap;
}
@ -78,8 +77,8 @@ public class Dungeon {
*
* @return UndirectedGraph from JGraphT
*/
public UndirectedGraph toGraph() {
UndirectedGraph<Room, Exit> g = new SimpleGraph(DefaultEdge.class);
public UndirectedGraph<Room, Exit> toGraph() {
UndirectedGraph<Room, Exit> g = new SimpleGraph<>(Exit.class);
rooms.forEach(g::addVertex);
rooms.forEach((r) -> {
for (Exit e : r.exits) {

@ -3,6 +3,8 @@ package eu.smoser.dungeongenerator.main;
import javax.swing.*;
abstract class AGenerator extends javax.swing.JFrame {
private static final long serialVersionUID = 1L;
AGenerator() {
JButton jButtonStart = new JButton();
JPanel jPanel1 = new JPanel();

@ -23,6 +23,8 @@
*/
package eu.smoser.dungeongenerator.main;
import com.formdev.flatlaf.FlatDarkLaf;
import com.formdev.flatlaf.FlatLightLaf;
import com.lowagie.text.BadElementException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
@ -33,6 +35,8 @@ import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
import eu.smoser.dungeongenerator.dungeon.Dungeon;
import eu.smoser.dungeongenerator.dungeon.Exit;
import eu.smoser.dungeongenerator.dungeon.Room;
import javax.swing.*;
import java.net.*;
import java.io.*;
@ -62,9 +66,11 @@ import org.apache.pdfbox.multipdf.PDFMergerUtility;
*/
public class DungeonGeneratorUI extends javax.swing.JFrame {
private Dungeon mDungeon;
private UndirectedGraph mGraph;
mxGraphComponent mGraphComponent;
private static final long serialVersionUID = 1L;
private transient Dungeon mDungeon;
private transient UndirectedGraph<Room, Exit> mGraph;
transient mxGraphComponent mGraphComponent;
/**
* Creates new form DungeonGeneratorUI
@ -222,7 +228,7 @@ public class DungeonGeneratorUI extends javax.swing.JFrame {
jMenu.setText("Datei");
jMenuNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
jMenuNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_DOWN_MASK));
jMenuNew.setText("Neuer Dungeon");
jMenuNew.setEnabled(false);
jMenuNew.addActionListener(new java.awt.event.ActionListener() {
@ -307,7 +313,7 @@ public class DungeonGeneratorUI extends javax.swing.JFrame {
});
jMenu.add(jMenuPdf);
jMenuClose.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));
jMenuClose.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_DOWN_MASK));
jMenuClose.setText("Beenden");
jMenuClose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
@ -381,10 +387,10 @@ public class DungeonGeneratorUI extends javax.swing.JFrame {
}
mDungeon.generate(size, type, mode);
mGraph = mDungeon.toGraph();
JGraphXAdapter graphAdapter = new JGraphXAdapter(mGraph);
JGraphXAdapter<Room, Exit> graphAdapter = new JGraphXAdapter<>(mGraph);
mGraphComponent = new mxGraphComponent(graphAdapter);
mGraphComponent.setEnabled(false);
Map edgeStyle = graphAdapter.getStylesheet().getDefaultEdgeStyle();
Map<String, Object> edgeStyle = graphAdapter.getStylesheet().getDefaultEdgeStyle();
edgeStyle.put(mxConstants.STYLE_NOLABEL, true);
edgeStyle.put(mxConstants.STYLE_ENDARROW, mxConstants.NONE);
@ -467,7 +473,7 @@ public class DungeonGeneratorUI extends javax.swing.JFrame {
}
try (FileWriter fw = new FileWriter(file, false)) {
//System.setProperties(file);
GmlExporter gex = new GmlExporter();
GmlExporter<Room, Exit> gex = new GmlExporter<>();
gex.setPrintLabels(GmlExporter.PRINT_EDGE_VERTEX_LABELS);
gex.export(fw, mGraph);
JOptionPane.showMessageDialog(this, "Gespeichert!");
@ -708,28 +714,23 @@ public class DungeonGeneratorUI extends javax.swing.JFrame {
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
/* Set the FlatLaf look and feel for modern UI */
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
UIManager.setLookAndFeel(new FlatDarkLaf());
} catch (Exception ex) {
System.err.println("Failed to initialize FlatLaf");
// Fallback to Nimbus
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
java.util.logging.Logger.getLogger(DungeonGeneratorUI.class.getName()).log(java.util.logging.Level.SEVERE, null, e);
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(DungeonGeneratorUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(DungeonGeneratorUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(DungeonGeneratorUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(DungeonGeneratorUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(() -> {

@ -11,6 +11,8 @@ import java.util.Objects;
* @author MrMcX
*/
public class EncounterGenerator extends AGenerator {
private static final long serialVersionUID = 1L;
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always

@ -9,6 +9,8 @@ import javax.swing.*;
* @author mosers
*/
public class TreasureGenerator extends AGenerator {
private static final long serialVersionUID = 1L;
/**
* This method is called from within the constructor to initialize the form.
*/

Laden…
Abbrechen
Speichern