Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/3h-coder/celatus
Browse files Browse the repository at this point in the history
  • Loading branch information
3h-coder committed Apr 3, 2024
2 parents 3cea7ae + 829dc9b commit 976ed6a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
3 changes: 2 additions & 1 deletion celatus/src/main/java/com/celatus/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public class App extends Application {

private static BaseWindowController controller; // controller associated with the app scene

private static Map<String, Object> tmpVariables; // used to store any variable at runtime, such as signals
private static Map<String, Object>
tmpVariables; // used to store any variable at runtime, such as signals
// -> (signals are boolean variables representing a signal sent from one window
// to the whole
// application)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,22 @@
import javafx.util.Duration;

/**
* Mother class of all of our controllers, coontains all common behaviour to all
* window controllers
* Mother class of all of our controllers, coontains all common behaviour to all window controllers
*/
public class BaseWindowController {

// region =====Variables=====

protected final Logger logger = LogManager.getLogger(this.getClass().toString().replace("class ", ""));
protected final Logger logger =
LogManager.getLogger(this.getClass().toString().replace("class ", ""));

@FXML
protected ImageView logo;
@FXML
protected AnchorPane rootPane;
@FXML
protected AnchorPane rowPane1;
@FXML
protected Button minimizeButton;
@FXML
protected Button closeButton;
@FXML
protected Scene scene;
@FXML
protected Stage window;
@FXML protected ImageView logo;
@FXML protected AnchorPane rootPane;
@FXML protected AnchorPane rowPane1;
@FXML protected Button minimizeButton;
@FXML protected Button closeButton;
@FXML protected Scene scene;
@FXML protected Stage window;

private static double xOffset = 0;
private static double yOffset = 0;
Expand Down Expand Up @@ -139,12 +132,10 @@ public void launchWindow(String fxml, double X, double Y) {
}

/**
* Switches window with the provided one. In other terms, closes the current
* window to open the
* Switches window with the provided one. In other terms, closes the current window to open the
* specified one.
*
* <p>
* <b>Note :</b> This will make the new window the App's main window
* <p><b>Note :</b> This will make the new window the App's main window
*
* @param fxml : the name of the fxml file (without the ".fxml" suffix)
*/
Expand Down Expand Up @@ -226,12 +217,14 @@ public void summonNotificationPopup(Stage window, String message) {

// Create a TranslateTransition to move the popup down right under the menu bar
// row
TranslateTransition translateTransition = new TranslateTransition(Duration.seconds(0.1), popup.getContent().get(0));
TranslateTransition translateTransition =
new TranslateTransition(Duration.seconds(0.1), popup.getContent().get(0));
translateTransition.setByY(
(int) (rowPane1.getHeight() / 2)); // Converting it to int otherwise the text is blurry

// Create a FadeTransition
FadeTransition fadeTransition = new FadeTransition(Duration.seconds(4.9), popup.getContent().get(0));
FadeTransition fadeTransition =
new FadeTransition(Duration.seconds(4.9), popup.getContent().get(0));
fadeTransition.setFromValue(1);
fadeTransition.setToValue(0);
fadeTransition.setOnFinished(
Expand Down Expand Up @@ -260,8 +253,7 @@ public void removeNotificationPopup() {
}

/**
* Browses the window to find all first layer labels (under an anchor pane) and
* make them
* Browses the window to find all first layer labels (under an anchor pane) and make them
* selectable upon clicking on them
*/
private void makeLabelsSelectable() {
Expand Down Expand Up @@ -306,10 +298,7 @@ private void makeLabelsSelectable() {
}
}

/**
* Sets up all the anchor panes so that they get focus whenever the user clicks
* on them
*/
/** Sets up all the anchor panes so that they get focus whenever the user clicks on them */
private void enableAnchorPaneFocusOnClick() {
ArrayList<Node> nodes = FXMLUtils.getAllNodes(rootPane);
for (Node node : nodes) {
Expand Down

0 comments on commit 976ed6a

Please sign in to comment.