-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major refactoring, exception handling and improved logging
- Loading branch information
Showing
46 changed files
with
2,282 additions
and
883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
/.idea/ | ||
/LeagueTeamComp.iml | ||
/out/ | ||
/logs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 67 additions & 38 deletions
105
src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/main/java/com/st4s1k/leagueteamcomp/controller/LTCExceptionController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.st4s1k.leagueteamcomp.controller; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.control.TextArea; | ||
import javafx.scene.input.MouseButton; | ||
import javafx.scene.layout.HBox; | ||
import javafx.stage.Stage; | ||
|
||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
|
||
public class LTCExceptionController implements Initializable { | ||
|
||
private static double xOffset = 0; | ||
private static double yOffset = 0; | ||
|
||
@FXML | ||
private Button minimizeButton; | ||
@FXML | ||
private Button closeButton; | ||
@FXML | ||
private Button okButton; | ||
@FXML | ||
private TextArea errorMessage; | ||
@FXML | ||
private HBox windowTitleBar; | ||
|
||
@Override | ||
public void initialize(URL location, ResourceBundle resources) { | ||
errorMessage.setEditable(false); | ||
} | ||
|
||
public void setStageAndSetupListeners(Stage stage) { | ||
windowTitleBar.setOnMousePressed(event -> { | ||
xOffset = stage.getX() - event.getScreenX(); | ||
yOffset = stage.getY() - event.getScreenY(); | ||
}); | ||
windowTitleBar.setOnMouseDragged(event -> { | ||
stage.setX(event.getScreenX() + xOffset); | ||
stage.setY(event.getScreenY() + yOffset); | ||
}); | ||
windowTitleBar.setOnMouseClicked(event -> { | ||
if (event.getButton().equals(MouseButton.PRIMARY)) { | ||
if (event.getClickCount() == 2) { | ||
stage.setMaximized(!stage.isMaximized()); | ||
} | ||
} | ||
}); | ||
okButton.setOnAction(event -> stage.close()); | ||
closeButton.setOnAction(actionEvent -> stage.close()); | ||
minimizeButton.setOnAction(actionEvent -> stage.setIconified(true)); | ||
} | ||
|
||
public void setErrorText(String text) { | ||
errorMessage.setText(text); | ||
} | ||
} |
Oops, something went wrong.