Preference redesign & helper class

/* Files Removed */
-None

/* Files Added */
-windowOpener.java

/* Removed functions */
-None

/* Added functions */
-Not function yet = added textfields for Nickname and realname

/* File: windowOpener.java */
-Added new helper class
-Added two public methodes
-Added function (1) to open a second window
-Added function (2) to open a new main window
-Added javadoc

/* File: menuCloser.java */
-Added javadoc
-cleaned code

/* File: prefrence.fxml*/
-Added a new design
-Added textfields for nickname and realname
-Added label for themes

/* File: prefrence.css */
-Added new ids and classes
-cleaned code

/* Other Files */
-cleaned code

Today I added a new helper class witch is supposed to help opening new second windows and main windows, also added the javadoc. Javadoc was also added to the other helper classes. Redesigned the prefrence window and added Textfields for nickname and realname.
Still to add: function to get and set the nickname and realname.
main
Kaabp 5 years ago
parent a7fd3c173e
commit a2733072b2

@ -927,7 +927,7 @@
<inspection_tool class="DuplicatedBeanNamesInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="79" name="Java" />
<language minSize="90" name="Java" />
</Languages>
</inspection_tool>
<inspection_tool class="DuplicatedDataProviderNames" enabled="true" level="ERROR" enabled_by_default="true" />
@ -1656,7 +1656,7 @@
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="" />
<option name="myAdditionalJavadocTags" value="version" />
</inspection_tool>
<inspection_tool class="JavaFxColorRgb" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JavaFxDefaultTag" enabled="true" level="WARNING" enabled_by_default="true" />

@ -1,6 +1,22 @@
/* css */
/* Author Lukas Martin */
.buttonMenu {
-fx-background-color: #252530;
-fx-text-fill: white;
-fx-font-size: 14;
}
.buttonMenu:hover {
-fx-text-fill: grey;
}
.buttonTopBarMenus {
-fx-background-color: #252530;
-fx-text-fill: white;
}
.buttonTopBarMenus:hover {
-fx-text-fill: grey;
}
#borderpane {
-fx-background-color: #252526;
}
@ -34,23 +50,6 @@
-fx-border-color: #6b6868;
-fx-border-width: 0px 0.5px 0.5px 0.5px;
}
.buttonMenu {
-fx-background-color: #252530;
-fx-text-fill: white;
-fx-font-size: 14;
}
.buttonMenu:hover {
-fx-text-fill: grey;
}
.buttonTopBarMenus {
-fx-background-color: #252530;
-fx-text-fill: white;
}
.buttonTopBarMenus:hover {
-fx-text-fill: grey;
}
#optionPane {
-fx-background-color: #252530;
-fx-border-color: #6b6868;

@ -48,28 +48,6 @@
<BorderPane id="borderpane" layoutX="162.0" layoutY="64.0" prefHeight="200.0" prefWidth="200.0" stylesheets="@home.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<top>
<BorderPane prefHeight="0.0" prefWidth="1280.0" BorderPane.alignment="CENTER">
<top>
<HBox id="topbar" fx:id="hboxmen" alignment="TOP_RIGHT" onMouseDragged="#dragged" onMouseEntered="#topBarEntered" onMousePressed="#pressed" prefHeight="25.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<FontAwesomeIcon fill="WHITE" iconName="MINUS" onMouseClicked="#min" textAlignment="CENTER" translateY="2.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="#86ff6b" iconName="CIRCLE" onMouseClicked="#max" textAlignment="CENTER" translateY="1.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="RED" iconName="CLOSE" onMouseClicked="#close" scaleX="1.2" scaleY="1.2" scaleZ="1.2" selectionFill="#f20000" size="1.1em" textAlignment="CENTER">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<padding>
<Insets bottom="2.0" left="5.0" right="5.0" top="2.0" />
</padding>
</HBox>
</top>
<center>
<HBox id="men" prefHeight="25.0" prefWidth="1920.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<Label id="menubutton" onMouseClicked="#menuOpenClicked" onMouseEntered="#menuOpenEntered" stylesheets="@home.css" text="Menu" textAlignment="CENTER" textFill="WHITE" translateX="10.0">
@ -97,6 +75,41 @@
</Label>
</HBox>
</center>
<top>
<BorderPane id="topbar" fx:id="hboxmen" onMouseDragged="#dragged" onMouseEntered="#topBarEntered" onMousePressed="#pressed" prefHeight="25.0" prefWidth="1280.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<right>
<HBox id="topbar" alignment="TOP_RIGHT" prefHeight="25.0" prefWidth="678.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<FontAwesomeIcon fill="WHITE" iconName="MINUS" onMouseClicked="#min" textAlignment="CENTER" translateY="2.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="#86ff6b" iconName="CIRCLE" onMouseClicked="#max" textAlignment="CENTER" translateY="1.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="RED" iconName="CLOSE" onMouseClicked="#close" scaleX="1.2" scaleY="1.2" scaleZ="1.2" selectionFill="#f20000" size="1.1em" textAlignment="CENTER">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<padding>
<Insets bottom="2.0" left="5.0" right="5.0" top="2.0" />
</padding>
</HBox>
</right>
<left>
<HBox id="topbar" prefHeight="29.0" prefWidth="592.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<Label id="topbartext" stylesheets="@home.css" text="Genealogie" textFill="WHITE">
<padding>
<Insets bottom="5.0" left="10.0" right="5.0" top="6.0" />
</padding>
</Label>
</HBox>
</left>
</BorderPane>
</top>
</BorderPane>
</top>
<center>

@ -1,5 +1,6 @@
/* css */
/* Author Lukas Martin */
.background {
-fx-background-color: #252530;
}
@ -8,10 +9,51 @@
-fx-background-color: #0b111a;
}
.menu {
-fx-border-color: #6b6868;
-fx-border-width: 0px 0px 0.5px 0px;
}
#lefttopbar {
}
#righttopbar {
}
#leftPane {
-fx-border-color: #6b6868;
-fx-border-width: 0.5px 0.5px 0.5px 0.5px;
}
#centrePane {
}
#submitButton {
}
#nicknameLabel {
-fx-border-color: #6b6868;
-fx-border-width: 0px 0px 0.5px 0px;
}
#nickNamePane {
-fx-border-color: #6b6868;
-fx-border-width: 0px 0px 0.5px 0px;
}
#nicknameField {
-fx-background-color: #252533;
-fx-border-color: #6b6868;
-fx-border-width: 0.5px 0.5px 0.5px 0.5px;
-fx-text-fill: white;
-fx-border-radius: 8 8 8 8;
-fx-background-radius: 8 8 8 8;
}
#menuName1Pane {
}
#menu1MainPane {
}

@ -1,42 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon?>
<?import java.lang.String?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.prefrenceController">
<AnchorPane prefHeight="400.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.prefrenceController">
<BorderPane id="backgroundBorderPane" layoutX="67.0" layoutY="54.0" prefHeight="200.0" prefWidth="200.0" styleClass="background" stylesheets="@prefrence.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<top>
<BorderPane onMouseDragged="#dragged" onMousePressed="#pressed" prefHeight="25.0" prefWidth="600.0" styleClass="topbar" stylesheets="@prefrence.css" BorderPane.alignment="CENTER">
<left>
<HBox id="lefttopbar" prefHeight="25.0" prefWidth="368.0" styleClass="topbar"
stylesheets="@prefrence.css" BorderPane.alignment="CENTER">
<HBox id="lefttopbar" prefHeight="25.0" prefWidth="368.0" styleClass="topbar" stylesheets="@prefrence.css" BorderPane.alignment="CENTER">
<opaqueInsets>
<Insets/>
<Insets />
</opaqueInsets>
<Label text="Prefrences" textFill="WHITE">
<padding>
<Insets left="10.0" top="4.0"/>
<Insets left="10.0" top="4.0" />
</padding>
</Label>
</HBox>
</left>
<right>
<HBox id="lefttopbar" alignment="CENTER_RIGHT" prefHeight="25.0" prefWidth="230.0" styleClass="topbar"
stylesheets="@prefrence.css" BorderPane.alignment="CENTER">
<HBox id="lefttopbar" alignment="CENTER_RIGHT" prefHeight="25.0" prefWidth="230.0" styleClass="topbar" stylesheets="@prefrence.css" BorderPane.alignment="CENTER">
<opaqueInsets>
<Insets/>
<Insets />
</opaqueInsets>
<padding>
<Insets bottom="2.0" left="5.0" right="5.0" top="2.0"/>
<Insets bottom="2.0" left="5.0" right="5.0" top="2.0" />
</padding>
<FontAwesomeIcon fill="#f20000" iconName="CLOSE" onMousePressed="#closeButtonClicked" scaleX="1.1"
scaleY="1.1" scaleZ="1.1" selectionEnd="0" selectionFill="#f20000"/>
<FontAwesomeIcon fill="#f20000" iconName="CLOSE" onMousePressed="#closeButtonClicked" scaleX="1.1" scaleY="1.1" scaleZ="1.1" selectionEnd="0" selectionFill="#f20000" />
</HBox>
</right>
</BorderPane>
</top></BorderPane>
</top>
<center>
<BorderPane prefHeight="380.0" prefWidth="800.0" BorderPane.alignment="CENTER">
<top>
<VBox prefHeight="376.0" prefWidth="800.0" BorderPane.alignment="CENTER">
<Pane prefHeight="10.0" prefWidth="800.0"/>
<Pane id="menuName1Pane" prefHeight="23.0" prefWidth="800.0" stylesheets="@prefrence.css">
<styleClass>
<String fx:value="background"/>
<String fx:value="menu"/>
</styleClass>
<Label alignment="CENTER" layoutX="354.0" layoutY="1.0" stylesheets="@prefrence.css"
text="Personalisieren" textFill="WHITE">
<font>
<Font size="14.0"/>
</font>
</Label>
</Pane>
<Pane id="menu1MainPane" prefHeight="150.0" prefWidth="800.0" styleClass="background"
stylesheets="@prefrence.css">
<HBox prefHeight="150.0" prefWidth="800.0" stylesheets="@prefrence.css">
<Pane prefHeight="150.0" prefWidth="270.0" styleClass="background"
stylesheets="@prefrence.css">
<Label layoutX="104.0" layoutY="14.0" text="Nickname" textFill="WHITE"/>
<TextField id="nicknameField" layoutX="34.0" layoutY="32.0" prefHeight="26.0"
prefWidth="200.0" stylesheets="@prefrence.css"/>
<Label layoutX="84.0" layoutY="90.0" text="Vor &amp; Nachname" textFill="WHITE"/>
<TextField id="nicknameField" layoutX="34.0" layoutY="109.0" prefHeight="26.0"
prefWidth="200.0" stylesheets="@prefrence.css"/>
</Pane>
<Pane prefHeight="150.0" prefWidth="270.0" styleClass="background"
stylesheets="@prefrence.css">
<Label layoutX="114.0" layoutY="14.0" text="Design" textFill="WHITE"/>
</Pane>
<Pane prefHeight="150.0" prefWidth="270.0" styleClass="background"
stylesheets="@prefrence.css"/>
</HBox>
</Pane>
<Pane prefHeight="13.0" prefWidth="800.0"/>
<Pane id="menuName1Pane" prefHeight="23.0" prefWidth="800.0" stylesheets="@prefrence.css">
<styleClass>
<String fx:value="background"/>
<String fx:value="menu"/>
</styleClass>
<Label alignment="CENTER" layoutX="382.0" layoutY="2.0" stylesheets="@prefrence.css"
text="Other" textFill="WHITE">
<font>
<Font size="14.0"/>
</font>
</Label>
</Pane>
<Pane prefHeight="159.0" prefWidth="800.0">
<HBox prefHeight="162.0" prefWidth="800.0" styleClass="background"
stylesheets="@prefrence.css"/>
</Pane>
</VBox>
</top>
</BorderPane>
</center></BorderPane>
</AnchorPane>

@ -1,33 +1,31 @@
package controller;
import com.jfoenix.controls.JFXListCell;
import helper.menuCloser;
import helper.windowOpener;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Rectangle2D;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Screen;
import javafx.stage.Stage;
import helper.menuCloser;
import javafx.stage.StageStyle;
import java.io.IOException;
/**
* @author Lukas Martin
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
*/
public class homeController {
//Helper
menuCloser mCloser = new menuCloser(); //menu closer
Boolean sliderClicked = false; //Menu slider activated
windowOpener wOpener = new windowOpener(); //window opener
//Menu slider
@ -38,8 +36,8 @@ public class homeController {
@FXML private JFXListCell buttoResearch; //Button Research
@FXML private JFXListCell buttonOptions; //Button Options
@FXML private VBox filesmenu; //Files Menu Slider
@FXML private HBox hboxmen; //Unused
@FXML private BorderPane optionsmenu; //Options Menu Button
@FXML private BorderPane hboxmen; //Unused
@FXML private BorderPane optionsmenu; //Options Menu Button
@FXML private VBox menuslideV; //Menu slider
@ -160,13 +158,7 @@ public class homeController {
//Options Menu Opened Prefrence Button Clicked
public void optionsTopMenuPrefrenceButton(MouseEvent mouseEvent) throws IOException {
Stage prefrenceStage = new Stage(); //Creates new stage
Parent prefrenceScene = FXMLLoader.load(getClass().getResource("/resources/prefrence.fxml")); //Gets the Scene for the new stage
prefrenceStage.setScene(new Scene(prefrenceScene, 800, 400)); //Sets the Scene
prefrenceStage.setTitle("Prefrences"); //Sets the Tile
prefrenceStage.centerOnScreen(); //Centers the stage
prefrenceStage.initStyle(StageStyle.UNDECORATED); //Sets the style
prefrenceStage.show(); //Activates the stage
wOpener.newWindow("/resources/prefrence.fxml", "Prefrences", StageStyle.UNDECORATED,800, 400);
optionsmenu.setVisible(false); //Deactivates option slider
}
@ -203,17 +195,8 @@ public class homeController {
//Stammbaum Button Clicked
public void buttonStammbaumClicked(MouseEvent mouseEvent) { //Stammbaum button clicked
// Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current windows
// Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); //Gets the monitor size
// Parent stammbaum = FXMLLoader.load(getClass().getResource("/resources/stammbaum.fxml")); //Gets the resource stammbaum
// stage.setScene(new Scene(stammbaum, 1920, 1080)); //Sets the Scene
// stage.centerOnScreen(); //Centeres the Screen
// stage.setX(primaryScreenBounds.getMinX()); //Sets the windows x cord to 0
// stage.setY(primaryScreenBounds.getMinY()); //Sets the windows y cord to 0
// stage.setWidth(primaryScreenBounds.getWidth()); //Sets the windows width to the max width of the monitor
// stage.setHeight(primaryScreenBounds.getHeight()); //Sets the windows height to the max height of the monitor
// stage.show(); //Opens the given Scene
public void buttonStammbaumClicked(MouseEvent mouseEvent) { //Stammbaum button clicked
//wOpener.newMainWindow("/resources/stammbaum.fxml", "Stammbaum", 1920, 1080, mouseEvent);
}

@ -5,7 +5,7 @@ import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
/**
* @author Lukas Martin
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
*/
public class prefrenceController {

@ -8,7 +8,7 @@ import javafx.stage.Stage;
import javafx.stage.StageStyle;
/**
* @author Lukas Martin
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
*/
public class Main extends Application {
@ -23,7 +23,7 @@ public class Main extends Application {
primaryStage.setTitle("Genologie"); //Sets the title of the start FXML
primaryStage.initStyle(StageStyle.UNDECORATED); //Sets the style of the window to "UNDECORATED"
primaryStage.setScene(new Scene(root, 1280, 680)); //Sets the scene for the start and sets the size
//helper.ResizeHelper.addResizeListener(primaryStage); //Test
helper.ResizeHelper.addResizeListener(primaryStage); //Test
primaryStage.setResizable(true); //Sets the resizability to true
primaryStage.show(); //Starts the window (therefore the program)
} catch (Exception e) { //Catches the error

@ -42,9 +42,8 @@ public class ResizeHelper {
}
static class ResizeListener implements EventHandler<MouseEvent> {
private Stage stage;
private final Stage stage;
private Cursor cursorEvent = Cursor.DEFAULT;
private int border = 4;
private double startX = 0;
private double startY = 0;
@ -62,7 +61,8 @@ public class ResizeHelper {
sceneWidth = scene.getWidth(),
sceneHeight = scene.getHeight();
if (MouseEvent.MOUSE_MOVED.equals(mouseEventType) == true) {
int border = 4;
if (MouseEvent.MOUSE_MOVED.equals(mouseEventType)) {
if (mouseEventX < border && mouseEventY < border) {
cursorEvent = Cursor.NW_RESIZE;
} else if (mouseEventX < border && mouseEventY > sceneHeight - border) {
@ -85,14 +85,14 @@ public class ResizeHelper {
scene.setCursor(cursorEvent);
} else if(MouseEvent.MOUSE_EXITED.equals(mouseEventType) || MouseEvent.MOUSE_EXITED_TARGET.equals(mouseEventType)){
scene.setCursor(Cursor.DEFAULT);
} else if (MouseEvent.MOUSE_PRESSED.equals(mouseEventType) == true) {
} else if (MouseEvent.MOUSE_PRESSED.equals(mouseEventType)) {
startX = stage.getWidth() - mouseEventX;
startY = stage.getHeight() - mouseEventY;
} else if (MouseEvent.MOUSE_DRAGGED.equals(mouseEventType) == true) {
if (Cursor.DEFAULT.equals(cursorEvent) == false) {
if (Cursor.W_RESIZE.equals(cursorEvent) == false && Cursor.E_RESIZE.equals(cursorEvent) == false) {
double minHeight = stage.getMinHeight() > (border*2) ? stage.getMinHeight() : (border*2);
if (Cursor.NW_RESIZE.equals(cursorEvent) == true || Cursor.N_RESIZE.equals(cursorEvent) == true || Cursor.NE_RESIZE.equals(cursorEvent) == true) {
} else if (MouseEvent.MOUSE_DRAGGED.equals(mouseEventType)) {
if (!Cursor.DEFAULT.equals(cursorEvent)) {
if (!Cursor.W_RESIZE.equals(cursorEvent) && !Cursor.E_RESIZE.equals(cursorEvent)) {
double minHeight = stage.getMinHeight() > (border *2) ? stage.getMinHeight() : (border *2);
if (Cursor.NW_RESIZE.equals(cursorEvent) || Cursor.N_RESIZE.equals(cursorEvent) || Cursor.NE_RESIZE.equals(cursorEvent)) {
if (stage.getHeight() > minHeight || mouseEventY < 0) {
stage.setHeight(stage.getY() - mouseEvent.getScreenY() + stage.getHeight());
stage.setY(mouseEvent.getScreenY());
@ -104,9 +104,9 @@ public class ResizeHelper {
}
}
if (Cursor.N_RESIZE.equals(cursorEvent) == false && Cursor.S_RESIZE.equals(cursorEvent) == false) {
double minWidth = stage.getMinWidth() > (border*2) ? stage.getMinWidth() : (border*2);
if (Cursor.NW_RESIZE.equals(cursorEvent) == true || Cursor.W_RESIZE.equals(cursorEvent) == true || Cursor.SW_RESIZE.equals(cursorEvent) == true) {
if (!Cursor.N_RESIZE.equals(cursorEvent) && !Cursor.S_RESIZE.equals(cursorEvent)) {
double minWidth = stage.getMinWidth() > (border *2) ? stage.getMinWidth() : (border *2);
if (Cursor.NW_RESIZE.equals(cursorEvent) || Cursor.W_RESIZE.equals(cursorEvent) || Cursor.SW_RESIZE.equals(cursorEvent)) {
if (stage.getWidth() > minWidth || mouseEventX < 0) {
stage.setWidth(stage.getX() - mouseEvent.getScreenX() + stage.getWidth());
stage.setX(mouseEvent.getScreenX());

@ -3,13 +3,18 @@ package helper;
import javafx.scene.layout.Pane;
/**
* @author Lukas Martin
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @version 1.1
* @since 11.01
*/
public class menuCloser {
/**
* @param closemenu0 one menu that gets closed
* @author Lukas Martin
* @param <T0> extends {@code Pane}
* @param closemenu0 menu that gets closed
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @since 11.01
* @version 1.1
*/
public <T0 extends Pane> void closeOneMenu(T0 closemenu0) {
closemenu0.setVisible(false);
@ -17,9 +22,14 @@ public class menuCloser {
/**
* @param <T0> extends {@code Pane}
* @param <T1> extends {@code Pane}
* @param openmenu the menu that gets opend
* @param closemenu one menu that gets closed
* @author Lukas Martin
* @param canOpen Boolean if the {@code openmenu} should be opend.
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @since 11.01
* @version 1.1
*/
public <T0 extends Pane, T1 extends Pane> void openMenu(T0 openmenu, T1 closemenu, Boolean canOpen) {
if (closemenu.isVisible() && canOpen) {
@ -29,10 +39,16 @@ public class menuCloser {
}
/**
* @param <T0> extends {@code Pane}
* @param <T1> extends {@code Pane}
* @param <T2> extends {@code Pane}
* @param openmenu the menu that gets opend
* @param closemenu1 one menu that gets closed
* @param closemenu2 one menu that gets closed
* @author Lukas Martin
* @param canOpen Boolean if the {@code openmenu} should be opend.
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @since 11.01
* @version 1.1
*/
public <T0 extends Pane, T1 extends Pane, T2 extends Pane> void openMenu(T0 openmenu, T1 closemenu1, T2 closemenu2, Boolean canOpen) {
if (closemenu1.isVisible() || closemenu2.isVisible() && canOpen) {
@ -43,11 +59,18 @@ public class menuCloser {
}
/**
* @param <T0> extends {@code Pane}
* @param <T1> extends {@code Pane}
* @param <T2> extends {@code Pane}
* @param <T3> extends {@code Pane}
* @param openmenu the menu that gets opend
* @param closemenu1 one menu that gets closed
* @param closemenu2 one menu that gets closed
* @param closemenu3 one menu that gets closed
* @author Lukas Martin
* @param canOpen Boolean if the {@code openmenu} should be opend.
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @since 11.01
* @version 1.1
*/
public <T0 extends Pane, T1 extends Pane, T2 extends Pane, T3 extends Pane> void openMenu(T0 openmenu, T1 closemenu1, T2 closemenu2, T3 closemenu3, Boolean canOpen) {
if (closemenu1.isVisible() || closemenu2.isVisible() || closemenu3.isVisible() && canOpen) {

@ -0,0 +1,93 @@
package helper;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Rectangle2D;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import java.io.IOException;
import java.util.EventObject;
/**
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @version 1.1
* @since 11.01
*/
public class windowOpener {
/**
* @param pathFXML String of fxml file location.
* @param title String of the title.
* @param stageStyle StageStyle will set the style.
* @param width Int for width.
* @param height Int for height.
* @throws IOException Exception if the path {@code pathFXML} is null or not fxml.
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @version 1.1
* @since 11.01
*
*/
public void newWindow(String pathFXML, String title, StageStyle stageStyle, Integer width, Integer height) throws IOException {
Stage secStage = new Stage();
if(height == 1080 && width == 1920) {
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
Parent scene = FXMLLoader.load(getClass().getResource(pathFXML));
secStage.setScene(new Scene(scene, width, height));
secStage.setTitle(title);
secStage.centerOnScreen();
secStage.initStyle(stageStyle);
secStage.setX(primaryScreenBounds.getMinX());
secStage.setY(primaryScreenBounds.getMinY());
secStage.setWidth(primaryScreenBounds.getWidth());
secStage.setHeight(primaryScreenBounds.getHeight());
} else {
Parent scene = FXMLLoader.load(getClass().getResource(pathFXML));
secStage.setScene(new Scene(scene, width, height));
secStage.setTitle(title);
secStage.centerOnScreen();
secStage.initStyle(stageStyle);
}
secStage.show();
}
/**
* @param pathFXML String of fxml file location.
* @param title String of the title.
* @param width Int for width.
* @param height Int for height.
* @param eventObject eventObject to get the current {@code Stage}.
* @throws IOException Exception if the path {@code pathFXML} is null or not fxml.
* @author <a href="http://lukasmartin.eu">Lukas Martin</a>
* @version 1.1
* @since 11
*/
public void newMainWindow(String pathFXML, String title, int width, int height, EventObject eventObject) throws IOException {
if (height == 1080 && width == 1920) {
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
Stage stage = (Stage) ((Node) eventObject.getSource()).getScene().getWindow();
Parent scene = FXMLLoader.load(getClass().getResource(pathFXML));
stage.setScene(new Scene(scene, width, height));
stage.setTitle(title);
stage.centerOnScreen();
stage.setX(primaryScreenBounds.getMinX());
stage.setY(primaryScreenBounds.getMinY());
stage.setWidth(primaryScreenBounds.getWidth());
stage.setHeight(primaryScreenBounds.getHeight());
stage.show();
} else {
Stage stage = (Stage) ((Node) eventObject.getSource()).getScene().getWindow();
Parent scene = FXMLLoader.load(getClass().getResource(pathFXML));
stage.setScene(new Scene(scene, width, height));
stage.setTitle(title);
stage.centerOnScreen();
stage.show();
}
}
}

@ -1,6 +1,22 @@
/* css */
/* Author Lukas Martin */
.buttonMenu {
-fx-background-color: #252530;
-fx-text-fill: white;
-fx-font-size: 14;
}
.buttonMenu:hover {
-fx-text-fill: grey;
}
.buttonTopBarMenus {
-fx-background-color: #252530;
-fx-text-fill: white;
}
.buttonTopBarMenus:hover {
-fx-text-fill: grey;
}
#borderpane {
-fx-background-color: #252526;
}
@ -34,23 +50,6 @@
-fx-border-color: #6b6868;
-fx-border-width: 0px 0.5px 0.5px 0.5px;
}
.buttonMenu {
-fx-background-color: #252530;
-fx-text-fill: white;
-fx-font-size: 14;
}
.buttonMenu:hover {
-fx-text-fill: grey;
}
.buttonTopBarMenus {
-fx-background-color: #252530;
-fx-text-fill: white;
}
.buttonTopBarMenus:hover {
-fx-text-fill: grey;
}
#optionPane {
-fx-background-color: #252530;
-fx-border-color: #6b6868;

@ -48,28 +48,6 @@
<BorderPane id="borderpane" layoutX="162.0" layoutY="64.0" prefHeight="200.0" prefWidth="200.0" stylesheets="@home.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<top>
<BorderPane prefHeight="0.0" prefWidth="1280.0" BorderPane.alignment="CENTER">
<top>
<HBox id="topbar" fx:id="hboxmen" alignment="TOP_RIGHT" onMouseDragged="#dragged" onMouseEntered="#topBarEntered" onMousePressed="#pressed" prefHeight="25.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<FontAwesomeIcon fill="WHITE" iconName="MINUS" onMouseClicked="#min" textAlignment="CENTER" translateY="2.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="#86ff6b" iconName="CIRCLE" onMouseClicked="#max" textAlignment="CENTER" translateY="1.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="RED" iconName="CLOSE" onMouseClicked="#close" scaleX="1.2" scaleY="1.2" scaleZ="1.2" selectionFill="#f20000" size="1.1em" textAlignment="CENTER">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<padding>
<Insets bottom="2.0" left="5.0" right="5.0" top="2.0" />
</padding>
</HBox>
</top>
<center>
<HBox id="men" prefHeight="25.0" prefWidth="1920.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<Label id="menubutton" onMouseClicked="#menuOpenClicked" onMouseEntered="#menuOpenEntered" stylesheets="@home.css" text="Menu" textAlignment="CENTER" textFill="WHITE" translateX="10.0">
@ -97,6 +75,41 @@
</Label>
</HBox>
</center>
<top>
<BorderPane id="topbar" fx:id="hboxmen" onMouseDragged="#dragged" onMouseEntered="#topBarEntered" onMousePressed="#pressed" prefHeight="25.0" prefWidth="1280.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<right>
<HBox id="topbar" alignment="TOP_RIGHT" prefHeight="25.0" prefWidth="678.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<FontAwesomeIcon fill="WHITE" iconName="MINUS" onMouseClicked="#min" textAlignment="CENTER" translateY="2.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="#86ff6b" iconName="CIRCLE" onMouseClicked="#max" textAlignment="CENTER" translateY="1.0">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<FontAwesomeIcon fill="RED" iconName="CLOSE" onMouseClicked="#close" scaleX="1.2" scaleY="1.2" scaleZ="1.2" selectionFill="#f20000" size="1.1em" textAlignment="CENTER">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
</FontAwesomeIcon>
<padding>
<Insets bottom="2.0" left="5.0" right="5.0" top="2.0" />
</padding>
</HBox>
</right>
<left>
<HBox id="topbar" prefHeight="29.0" prefWidth="592.0" stylesheets="@home.css" BorderPane.alignment="CENTER">
<Label id="topbartext" stylesheets="@home.css" text="Genealogie" textFill="WHITE">
<padding>
<Insets bottom="5.0" left="10.0" right="5.0" top="6.0" />
</padding>
</Label>
</HBox>
</left>
</BorderPane>
</top>
</BorderPane>
</top>
<center>

@ -1,5 +1,6 @@
/* css */
/* Author Lukas Martin */
.background {
-fx-background-color: #252530;
}
@ -8,10 +9,51 @@
-fx-background-color: #0b111a;
}
.menu {
-fx-border-color: #6b6868;
-fx-border-width: 0px 0px 0.5px 0px;
}
#lefttopbar {
}
#righttopbar {
}
#leftPane {
-fx-border-color: #6b6868;
-fx-border-width: 0.5px 0.5px 0.5px 0.5px;
}
#centrePane {
}
#submitButton {
}
#nicknameLabel {
-fx-border-color: #6b6868;
-fx-border-width: 0px 0px 0.5px 0px;
}
#nickNamePane {
-fx-border-color: #6b6868;
-fx-border-width: 0px 0px 0.5px 0px;
}
#nicknameField {
-fx-background-color: #252533;
-fx-border-color: #6b6868;
-fx-border-width: 0.5px 0.5px 0.5px 0.5px;
-fx-text-fill: white;
-fx-border-radius: 8 8 8 8;
-fx-background-radius: 8 8 8 8;
}
#menuName1Pane {
}
#menu1MainPane {
}

@ -1,13 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon?>
<?import java.lang.String?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.prefrenceController">
<AnchorPane prefHeight="400.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.prefrenceController">
<BorderPane id="backgroundBorderPane" layoutX="67.0" layoutY="54.0" prefHeight="200.0" prefWidth="200.0" styleClass="background" stylesheets="@prefrence.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<top>
<BorderPane onMouseDragged="#dragged" onMousePressed="#pressed" prefHeight="25.0" prefWidth="600.0" styleClass="topbar" stylesheets="@prefrence.css" BorderPane.alignment="CENTER">
@ -35,5 +40,63 @@
</HBox>
</right>
</BorderPane>
</top></BorderPane>
</top>
<center>
<BorderPane prefHeight="380.0" prefWidth="800.0" BorderPane.alignment="CENTER">
<top>
<VBox prefHeight="376.0" prefWidth="800.0" BorderPane.alignment="CENTER">
<Pane prefHeight="10.0" prefWidth="800.0"/>
<Pane id="menuName1Pane" prefHeight="23.0" prefWidth="800.0" stylesheets="@prefrence.css">
<styleClass>
<String fx:value="background"/>
<String fx:value="menu"/>
</styleClass>
<Label alignment="CENTER" layoutX="354.0" layoutY="1.0" stylesheets="@prefrence.css"
text="Personalisieren" textFill="WHITE">
<font>
<Font size="14.0"/>
</font>
</Label>
</Pane>
<Pane id="menu1MainPane" prefHeight="150.0" prefWidth="800.0" styleClass="background"
stylesheets="@prefrence.css">
<HBox prefHeight="150.0" prefWidth="800.0" stylesheets="@prefrence.css">
<Pane prefHeight="150.0" prefWidth="270.0" styleClass="background"
stylesheets="@prefrence.css">
<Label layoutX="104.0" layoutY="14.0" text="Nickname" textFill="WHITE"/>
<TextField id="nicknameField" layoutX="34.0" layoutY="32.0" prefHeight="26.0"
prefWidth="200.0" stylesheets="@prefrence.css"/>
<Label layoutX="84.0" layoutY="90.0" text="Vor &amp; Nachname" textFill="WHITE"/>
<TextField id="nicknameField" layoutX="34.0" layoutY="109.0" prefHeight="26.0"
prefWidth="200.0" stylesheets="@prefrence.css"/>
</Pane>
<Pane prefHeight="150.0" prefWidth="270.0" styleClass="background"
stylesheets="@prefrence.css">
<Label layoutX="114.0" layoutY="14.0" text="Design" textFill="WHITE"/>
</Pane>
<Pane prefHeight="150.0" prefWidth="270.0" styleClass="background"
stylesheets="@prefrence.css"/>
</HBox>
</Pane>
<Pane prefHeight="13.0" prefWidth="800.0"/>
<Pane id="menuName1Pane" prefHeight="23.0" prefWidth="800.0" stylesheets="@prefrence.css">
<styleClass>
<String fx:value="background"/>
<String fx:value="menu"/>
</styleClass>
<Label alignment="CENTER" layoutX="382.0" layoutY="2.0" stylesheets="@prefrence.css"
text="Other" textFill="WHITE">
<font>
<Font size="14.0"/>
</font>
</Label>
</Pane>
<Pane prefHeight="159.0" prefWidth="800.0">
<HBox prefHeight="162.0" prefWidth="800.0" styleClass="background"
stylesheets="@prefrence.css"/>
</Pane>
</VBox>
</top>
</BorderPane>
</center></BorderPane>
</AnchorPane>

Loading…
Cancel
Save