Skip to content

Commit

Permalink
fix: fix compiler warnings and remove unused dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradHoeffner committed May 13, 2024
1 parent 87b16e1 commit 76f0457
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 21 deletions.
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>eu.snik.tag.gui.Main</mainClass>
<mainClass>sniktag/eu.snik.tag.gui.Main</mainClass>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -138,24 +138,24 @@
<version>${version.javafx}</version>
<classifier>win</classifier>
</dependency>
<dependency>
<!-- <dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${version.javafx}</version>
<classifier>win</classifier>
</dependency>
<dependency>
</dependency>-->
<!-- <dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${version.javafx}</version>
<classifier>win</classifier>
</dependency>
<dependency>
</dependency>-->
<!-- <dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>${version.javafx}</version>
<classifier>win</classifier>
</dependency>
</dependency>-->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
Expand Down Expand Up @@ -194,10 +194,10 @@
<artifactId>jsoup</artifactId>
<version>1.17.2</version>
</dependency>
<dependency>
<!--<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.2</version>
</dependency>
</dependency>-->
</dependencies>
</project>
2 changes: 1 addition & 1 deletion src/main/java/eu/snik/tag/gui/ClassTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void split(Clazz splitter) {
* @param createRestorePoint callback that is run when the user changes a class.
* This is necessary because an observable list's change listeners only fire when a class is added or removed, not changed.*/
@SuppressWarnings("unchecked")
public ClassTable(final State state, final Runnable createRestorePoint) {
ClassTable(final State state, final Runnable createRestorePoint) {
this.state = state;
this.createRestorePoint = createRestorePoint;
this.table = new TableView<Clazz>();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/eu/snik/tag/gui/ClassTextPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void highlightObject(Clazz old, Clazz neww) {

/** @param classes added or removed classes will automatically be shown.
* @param relationPane */
public ClassTextPane(State state, RelationPane relationPane) {
ClassTextPane(State state, RelationPane relationPane) {
this.state = state;
this.setContent(flow);
this.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
Expand Down
29 changes: 28 additions & 1 deletion src/main/java/eu/snik/tag/gui/Log.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
package eu.snik.tag.gui;

import org.controlsfx.control.Notifications;

import javafx.application.Platform;
import javafx.stage.Window;
import javafx.util.Duration;
import org.controlsfx.control.Notifications;

public final class Log {

public static void warn(String message, Window window) {
Platform.runLater(
() -> {
Notifications.create().owner(window).title("Warnung").text(message).hideAfter(Duration.seconds(10 + Math.log10(message.length()))).showWarning();
/*
VBox content = new VBox();
Pane backgroundPane = new Pane();
backgroundPane.getChildren().add(content);
backgroundPane.setStyle("-fx-background-color: white;");
Label messageLabel = new Label(message);
content.getChildren().add(messageLabel);
// Create the popup
Popup popup = new Popup();
popup.getContent().addAll(backgroundPane);
// Add a button to close the popup (optional)
Button closeButton = new Button("Close");
closeButton.setOnAction(event -> popup.hide());
content.getChildren().add(closeButton);
// Create a PauseTransition to hide the popup after a delay
PauseTransition pause = new PauseTransition(Duration.seconds(8 + Math.log10(message.length())));
pause.setOnFinished(e -> popup.hide());
// Show the popup and start the auto-hide timer
popup.show(window);
pause.play();
*/
}
);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/eu/snik/tag/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/** GUI entry point. Run with Maven via javafx:run. */
public class Main extends Application {

public final State state = new State();
final State state = new State();

private final SplitPane textPane = new SplitPane();

Expand All @@ -38,7 +38,7 @@ public class Main extends Application {
private final ClassTable tableView = new ClassTable(state, this::createRestorePoint);
private final TripleTable tripleTable = new TripleTable(state.triples, this::createRestorePoint);

public Stage stage;
Stage stage;

private Window window;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/eu/snik/tag/gui/MainMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ static Menu helpMenu() {
return helpMenu;
}

public static MenuBar create(Main main) {
static MenuBar create(Main main) {
return new MenuBar(fileMenu(main), helpMenu());
}
}
2 changes: 1 addition & 1 deletion src/main/java/eu/snik/tag/gui/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.json.JSONArray;
import org.json.JSONObject;

public class State {
class State {

public final StringProperty text = new SimpleStringProperty();
public final ObservableList<Clazz> classes = FXCollections.observableArrayList();
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/** @author Konrad Höffner */
module sniktag {
exports eu.snik.tag.gui ;
exports eu.snik.tag ;
opens eu.snik.tag.gui to javafx.graphics;
opens eu.snik.tag to javafx.base;
exports eu.snik.tag;

requires java.desktop;
requires org.docx4j.openxml_objects;
Expand All @@ -14,10 +15,11 @@
requires org.apache.commons.text;
requires transitive org.apache.jena.core;
requires org.apache.jena.base;
requires org.apache.jena.iri;
// requires org.apache.jena.iri;
requires org.apache.jena.arq;
//requires javafx.controls;
requires org.controlsfx.controls;
requires transitive org.eclipse.jetty.server;
requires javafx.base;
requires transitive javafx.controls;
//requires javafx.base;
//requires transitive javafx.controls;
}

0 comments on commit 76f0457

Please sign in to comment.