Skip to content

Commit

Permalink
Adjusted class names and implemented window dragging..
Browse files Browse the repository at this point in the history
  • Loading branch information
Skullians committed Feb 10, 2024
1 parent 979642e commit 5fbbf93
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>skullian.binarysearchinator/skullian.binarysearchinator.HelloApplication
<mainClass>skullian.binarysearchinator/skullian.binarysearchinator.SearchinatorApp
</mainClass>
<launcher>app</launcher>
<jlinkZipName>app</jlinkZipName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,23 @@

import java.io.IOException;

public class HelloApplication extends Application {
public class SearchinatorApp extends Application {
double x,y = 0;
@Override
public void start(Stage stage) throws IOException {
Parent root = FXMLLoader.load(getClass().getResource("menu.fxml"));
//FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("menu.fxml"));
//Scene scene = new Scene(fxmlLoader.load());
stage.setScene(new Scene(root));
stage.initStyle(StageStyle.UNDECORATED);
stage.setTitle("Binary Searchinator");

root.setOnMousePressed(event -> {
x = event.getSceneX();
y = event.getSceneY();
});
root.setOnMouseDragged(event -> {
stage.setX(event.getScreenX() - x);
stage.setY(event.getScreenY() - y);
});
stage.show();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package skullian.binarysearchinator;


public class HelloController {
public class SearchinatorController {

}
74 changes: 74 additions & 0 deletions src/main/resources/skullian/binarysearchinator/about.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="548.0" prefWidth="974.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<children>
<BorderPane prefHeight="554.0" prefWidth="974.0">
<left>
<VBox prefHeight="554.0" prefWidth="230.0" style="-fx-background-color: #282828;" BorderPane.alignment="CENTER">
<children>
<Button id="button" alignment="BASELINE_LEFT" mnemonicParsing="false" prefHeight="30.0" prefWidth="238.0" stylesheets="@css/menu.css" text="Get Started">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<font>
<Font size="14.0" />
</font>
<graphic>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/Home.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button id="button" alignment="BASELINE_LEFT" layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="238.0" stylesheets="@css/menu.css" text="About">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<font>
<Font size="14.0" />
</font>
<graphic>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/Info.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button id="button" alignment="BASELINE_LEFT" layoutX="10.0" layoutY="37.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="238.0" stylesheets="@css/menu.css" text="Help">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<font>
<Font size="14.0" />
</font>
<graphic>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/help.png" />
</image>
</ImageView>
</graphic>
</Button>
</children></VBox>
</left>
<center>
<VBox prefHeight="554.0" prefWidth="198.0" style="-fx-background-color: #1E1E1E;" stylesheets="@css/menu.css" BorderPane.alignment="CENTER" />
</center>
<right>
<Pane prefHeight="554.0" prefWidth="545.0" style="-fx-background-color: #1E1E1E;" stylesheets="@css/menu.css" BorderPane.alignment="CENTER" />
</right>
</BorderPane>
</children>
</AnchorPane>
4 changes: 2 additions & 2 deletions src/main/resources/skullian/binarysearchinator/css/menu.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.button
{
-fx-background-color : #282828;
-fx-text-fill: #FFFFFF;
-fx-background-radius :0em;
}
.button:hover
{
-fx-background-color: #6393E7;
-fs-background-radius :1em;
}
.button:pressed
{
Expand All @@ -14,7 +16,6 @@
}
.button:focused{
-fx-background-color: #165DDB;
-fx-border-color : #165DDB;
-fx-background-radius :5em;
}

Expand All @@ -28,7 +29,6 @@
.button2:hover
{
-fx-background-color : #EBE9F6;
-fx-border-color: #CDD1D6;
-fx-border-width: 1px 1px 1px 1px;
}
.button2:pressed
Expand Down

0 comments on commit 5fbbf93

Please sign in to comment.