/* Files Removed */ -stammbaum.fxml -stammbaum.css -stammbaumController.java /* Files Added*/ -prefrence.fxml -prefrence.css -prefrenceController.java /* Removed functions */ removed the ability to click stammbaum button (no new windows will open now) /* Added functions */ added the ability to click the new button prefrences in options menu, if clicked the prefrence.fxml will open in a second window. /* File: home.fxml */ -Added multiple buttons to the menu slider (no function yet) -Added a new design to the option slider Pane -> BorderPane -> 2x VBox -Added two new buttons to option slider -Added one style class cleaned code /* File: home.css*/ -Added one style class cleaned code /* File: homeController.java*/ -Added click event for the new buttons -Added function for prefrence button (as described above) cleaned code /* File: prefrence.fxml */ -Added a overall design -Added two hboxes to top menu -Added a name to top menu -Added a close button to top menu -Added two style classes /* File: prefrence.css*/ -Added overall style -Added two style classes /* File: prefrenceController.java*/ -Added function for dragging -Added function to the close button -Added two events (above)main
parent
fb380f488d
commit
a7fd3c173e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,17 @@
|
||||
/* css */
|
||||
/* Author Lukas Martin */
|
||||
.background {
|
||||
-fx-background-color: #252530;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
-fx-background-color: #0b111a;
|
||||
}
|
||||
|
||||
#lefttopbar {
|
||||
|
||||
}
|
||||
|
||||
#righttopbar {
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
|
||||
<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">
|
||||
<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">
|
||||
<opaqueInsets>
|
||||
<Insets/>
|
||||
</opaqueInsets>
|
||||
<Label text="Prefrences" textFill="WHITE">
|
||||
<padding>
|
||||
<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">
|
||||
<opaqueInsets>
|
||||
<Insets/>
|
||||
</opaqueInsets>
|
||||
<padding>
|
||||
<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"/>
|
||||
</HBox>
|
||||
</right>
|
||||
</BorderPane>
|
||||
</top></BorderPane>
|
||||
</AnchorPane>
|
||||
@ -1,40 +0,0 @@
|
||||
/* css */
|
||||
/* Author Lukas Martin */
|
||||
|
||||
#borderpane {
|
||||
-fx-background-color: #252526;
|
||||
}
|
||||
#topbar {
|
||||
-fx-background-color: #0b111a;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0px 0.5px 0px;
|
||||
}
|
||||
#men {
|
||||
-fx-background-color: #252530;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0.5px 0.5px 0.5px;
|
||||
}
|
||||
#menuslide {
|
||||
-fx-background-color: #252530;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0.5px 0.5px 0.5px;
|
||||
border-top: none;
|
||||
}
|
||||
#menubutton {
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
#menubutton:hover {
|
||||
-fx-text-fill: grey;
|
||||
}
|
||||
#panehome {
|
||||
-fx-background-color: #252526;
|
||||
}
|
||||
#filesmenu {
|
||||
-fx-background-color: #252530;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0.5px 0.5px 0.5px;
|
||||
}
|
||||
#buttonStammbaum {
|
||||
-fx-background-color: #252530;
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (c) 2015, 2019, Gluon and/or its affiliates.
|
||||
All rights reserved. Use is subject to license terms.
|
||||
|
||||
This file is available and licensed under the following license:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of Oracle Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<?import com.jfoenix.controls.JFXListCell?>
|
||||
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?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?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#pressedkey" prefHeight="680.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.stammbaumController">
|
||||
<BorderPane id="borderpane" layoutX="162.0" layoutY="64.0" prefHeight="200.0" prefWidth="200.0" stylesheets="@stammbaum.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="@stammbaum.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="@stammbaum.css" BorderPane.alignment="CENTER">
|
||||
<Label id="menubutton" onMouseClicked="#menuOpenClicked" onMouseEntered="#menuOpenEntered" stylesheets="@stammbaum.css" text="Menu" textAlignment="CENTER" textFill="WHITE" translateX="10.0">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
<Label id="menubutton" onMouseClicked="#filesButtonClicked" onMouseEntered="#filesButtonEntred" stylesheets="@stammbaum.css" text="Files" textFill="WHITE" translateX="10.0">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
<Label id="menubutton" onMouseClicked="#optionButtonClicked" onMouseEntered="#optionButtonEntered" stylesheets="@stammbaum.css" text="Options" textFill="WHITE" translateX="10.0">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
</HBox>
|
||||
</center>
|
||||
</BorderPane>
|
||||
</top>
|
||||
<center>
|
||||
<AnchorPane onMouseClicked="#bodyOnClick" onMouseEntered="#bodyMouseEntred" prefHeight="627.0" prefWidth="1135.0" BorderPane.alignment="CENTER">
|
||||
<Pane id="panehome" stylesheets="@stammbaum.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<Text fill="WHITE" layoutX="444.0" layoutY="322.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Stammbaum und so, lol.">
|
||||
<font>
|
||||
<Font size="30.0" />
|
||||
</font>
|
||||
</Text>
|
||||
<VBox id="menuslide" fx:id="menuslideV" prefHeight="622.0" prefWidth="200.0" stylesheets="@stammbaum.css" visible="false">
|
||||
<JFXListCell id="buttonStammbaum" fx:id="buttonStammbaum" onMouseClicked="#buttonMenuClicked" prefHeight="33.0" prefWidth="208.0" stylesheets="@stammbaum.css" text="Menu" textFill="WHITE" />
|
||||
</VBox>
|
||||
<VBox id="filesmenu" fx:id="filesmenu" layoutX="57.0" onMouseExited="#filesOpenPaneExited" prefHeight="250.0" prefWidth="150.0" stylesheets="@stammbaum.css" visible="false" />
|
||||
<VBox id="filesmenu" fx:id="optionsmenu" layoutX="94.0" onMouseExited="#optionsOpenPaneExited" prefHeight="250.0" prefWidth="150.0" stylesheets="@stammbaum.css" visible="false" />
|
||||
</Pane>
|
||||
</AnchorPane>
|
||||
</center>
|
||||
</BorderPane>
|
||||
</AnchorPane>
|
||||
@ -0,0 +1,40 @@
|
||||
package controller;
|
||||
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
* @author Lukas Martin
|
||||
*/
|
||||
|
||||
public class prefrenceController {
|
||||
|
||||
|
||||
//Const
|
||||
double x,y;
|
||||
|
||||
|
||||
//Menu Top Bar pressed
|
||||
public void pressed(MouseEvent mouseEvent) {
|
||||
x = mouseEvent.getSceneX(); //Gets the x cord
|
||||
y = mouseEvent.getSceneY();
|
||||
}
|
||||
|
||||
|
||||
//Menu Top Bar dragg
|
||||
public void dragged(MouseEvent mouseEvent) {
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current window
|
||||
if(!stage.isFullScreen()) { //Checks if the window is != fullscreen
|
||||
stage.setX(mouseEvent.getScreenX() - x); //Sets the new screen cords x while dragging
|
||||
stage.setY(mouseEvent.getScreenY() - y); //Sets the new screen cords y while dragging
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Close Button
|
||||
public void closeButtonClicked(MouseEvent mouseEvent) {
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current window
|
||||
stage.close(); //Closes the window
|
||||
}
|
||||
}
|
||||
@ -1,181 +0,0 @@
|
||||
package controller;
|
||||
|
||||
import com.jfoenix.controls.JFXListCell;
|
||||
import helper.menuCloser;
|
||||
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.HBox;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.stage.Screen;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author Lukas Martin
|
||||
*/
|
||||
|
||||
public class stammbaumController {
|
||||
|
||||
menuCloser mCloser = new menuCloser(); //menu closer
|
||||
Boolean sliderClicked = false; //Menu slider activated
|
||||
|
||||
//Menu slider
|
||||
@FXML private JFXListCell buttonStammbaum; //Button Stammbaum
|
||||
@FXML private VBox filesmenu; //Files Menu Slider
|
||||
@FXML private HBox hboxmen; //Unused
|
||||
@FXML private VBox optionsmenu; //Options Menu Button
|
||||
@FXML private VBox menuslideV; //Menu slider
|
||||
|
||||
|
||||
//coordinates
|
||||
double x,y; //x and y coordinates from monitor
|
||||
|
||||
|
||||
//top menu
|
||||
public void dragged(MouseEvent mouseEvent) { //Window dragging
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current window
|
||||
if(!stage.isFullScreen()) { //Checks if the window is != fullscreen
|
||||
stage.setX(mouseEvent.getScreenX() - x); //Sets the new screen cords x while dragging
|
||||
stage.setY(mouseEvent.getScreenY() - y); //Sets the new screen cords y while dragging
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//top menu
|
||||
public void pressed(MouseEvent mouseEvent) { //For window drag
|
||||
x = mouseEvent.getSceneX(); //Gets the x cord
|
||||
y = mouseEvent.getSceneY(); //Gets the y cord
|
||||
}
|
||||
|
||||
|
||||
//minus button
|
||||
public void min(MouseEvent mouseEvent) {
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current window
|
||||
stage.setIconified(true); //Put windows into the background
|
||||
}
|
||||
|
||||
|
||||
//circle button
|
||||
public void max(MouseEvent mouseEvent) { //Max Button
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current windows
|
||||
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); //Gets the screen sizes
|
||||
|
||||
if(stage.getWidth() == 1280) { //Checks if windows width is ==
|
||||
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
|
||||
} else if(stage.getWidth() != 1280) { //Checks if windows width is !=
|
||||
stage.setHeight(680); //Sets window height
|
||||
stage.setWidth(1280); //Sets window width
|
||||
stage.centerOnScreen(); //Centers the current window
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//close button
|
||||
public void close(MouseEvent mouseEvent) { //Close Button
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current windows
|
||||
stage.close(); //Closes the current windows and therefore the program
|
||||
}
|
||||
|
||||
|
||||
//Top Bar
|
||||
public void topBarEntered(MouseEvent mouseEvent) {
|
||||
filesmenu.setVisible(false);
|
||||
optionsmenu.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
//Border Pane !!! NOT WORKING !!!
|
||||
public void pressedkey(KeyEvent keyEvent) {
|
||||
Stage stage = (Stage) ((Node) keyEvent.getSource()).getScene().getWindow(); //Gets the current windows
|
||||
if(keyEvent.getCode() == KeyCode.F11) {
|
||||
stage.setFullScreen(!stage.isFullScreen());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Menu Slider Button
|
||||
public void menuOpenClicked(MouseEvent mouseEvent) { //Menu Button Click
|
||||
mCloser.openMenu(menuslideV, filesmenu, optionsmenu, true); //Opens first given menu and closes the others
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current windows
|
||||
menuslideV.prefHeightProperty().bind(stage.heightProperty()); //Bind the menu height to the current window height.
|
||||
}
|
||||
|
||||
|
||||
//Menu Slider Button Entered
|
||||
public void menuOpenEntered(MouseEvent mouseEvent) { //Menu Slider Button Entered
|
||||
filesmenu.setVisible(false); //Deactivates filesmenu
|
||||
}
|
||||
|
||||
|
||||
//Files Slieder Button
|
||||
public void filesButtonEntred(MouseEvent mouseEvent) { //Files Menu Button Click
|
||||
mCloser.openMenu(filesmenu, optionsmenu, sliderClicked); //Opens first given menu and closes the others
|
||||
}
|
||||
|
||||
|
||||
//Files Slider Exit
|
||||
public void filesOpenPaneExited(MouseEvent mouseEvent) { //Files Menu Buttpn Exit
|
||||
filesmenu.setVisible(false); //Files Menu Disable
|
||||
}
|
||||
|
||||
|
||||
//Files Button Clicked
|
||||
public void filesButtonClicked(MouseEvent mouseEvent) { //Files Button Clicked
|
||||
sliderClicked = true; //Buttons Activated
|
||||
mCloser.openMenu(filesmenu, optionsmenu, true); //Opens first given menu and closes the others
|
||||
}
|
||||
|
||||
|
||||
//Option slieder Entered
|
||||
public void optionButtonEntered(MouseEvent mouseEvent) { //Option Slider Entered
|
||||
mCloser.openMenu(optionsmenu, filesmenu, sliderClicked); //Opens first given menu and closes the others
|
||||
}
|
||||
|
||||
|
||||
//Options Slieder Exit
|
||||
public void optionsOpenPaneExited(MouseEvent mouseEvent) { //Options Slieder Exit
|
||||
optionsmenu.setVisible(false); //Option Slider Deactivated
|
||||
}
|
||||
|
||||
|
||||
//Option Button Clicked
|
||||
public void optionButtonClicked(MouseEvent mouseEvent) { ///Option Button Clicked
|
||||
sliderClicked = true; //Buttons Activated
|
||||
mCloser.openMenu(optionsmenu, filesmenu, true); //Opens first given menu and closes the others
|
||||
}
|
||||
|
||||
|
||||
//Body Clicked
|
||||
public void bodyOnClick(MouseEvent mouseEvent) { //Body Clicked (Anchor Pane)
|
||||
sliderClicked = false; //Disables the buttons
|
||||
}
|
||||
|
||||
|
||||
//Body Mouse Entered
|
||||
public void bodyMouseEntred(MouseEvent mouseEvent) { //Body Mouse Entered
|
||||
optionsmenu.setVisible(false); //Deactivates optionmenu
|
||||
}
|
||||
|
||||
|
||||
//Menu Button Clicked
|
||||
public void buttonMenuClicked(MouseEvent mouseEvent) throws IOException { //Menu button clicked event
|
||||
Stage stage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); //Gets the current windows
|
||||
Parent home = FXMLLoader.load(getClass().getResource("/resources/home.fxml")); //Gets the Scene
|
||||
stage.setScene(new Scene(home, 1280, 680)); //Sets the Scene
|
||||
stage.setWidth(1280); //Sets the width
|
||||
stage.setHeight(680); //Sets the height
|
||||
stage.centerOnScreen(); //Centeres the Screen
|
||||
stage.show(); //Opens the given Scene
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
/* css */
|
||||
/* Author Lukas Martin */
|
||||
.background {
|
||||
-fx-background-color: #252530;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
-fx-background-color: #0b111a;
|
||||
}
|
||||
|
||||
#lefttopbar {
|
||||
|
||||
}
|
||||
|
||||
#righttopbar {
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
|
||||
<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">
|
||||
<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">
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
<Label text="Prefrences" textFill="WHITE">
|
||||
<padding>
|
||||
<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">
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
<padding>
|
||||
<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" />
|
||||
</HBox>
|
||||
</right>
|
||||
</BorderPane>
|
||||
</top></BorderPane>
|
||||
</AnchorPane>
|
||||
@ -1,40 +0,0 @@
|
||||
/* css */
|
||||
/* Author Lukas Martin */
|
||||
|
||||
#borderpane {
|
||||
-fx-background-color: #252526;
|
||||
}
|
||||
#topbar {
|
||||
-fx-background-color: #0b111a;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0px 0.5px 0px;
|
||||
}
|
||||
#men {
|
||||
-fx-background-color: #252530;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0.5px 0.5px 0.5px;
|
||||
}
|
||||
#menuslide {
|
||||
-fx-background-color: #252530;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0.5px 0.5px 0.5px;
|
||||
border-top: none;
|
||||
}
|
||||
#menubutton {
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
#menubutton:hover {
|
||||
-fx-text-fill: grey;
|
||||
}
|
||||
#panehome {
|
||||
-fx-background-color: #252526;
|
||||
}
|
||||
#filesmenu {
|
||||
-fx-background-color: #252530;
|
||||
-fx-border-color: #6b6868;
|
||||
-fx-border-width: 0px 0.5px 0.5px 0.5px;
|
||||
}
|
||||
#buttonStammbaum {
|
||||
-fx-background-color: #252530;
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (c) 2015, 2019, Gluon and/or its affiliates.
|
||||
All rights reserved. Use is subject to license terms.
|
||||
|
||||
This file is available and licensed under the following license:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of Oracle Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<?import com.jfoenix.controls.JFXListCell?>
|
||||
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?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?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#pressedkey" prefHeight="680.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.stammbaumController">
|
||||
<BorderPane id="borderpane" layoutX="162.0" layoutY="64.0" prefHeight="200.0" prefWidth="200.0" stylesheets="@stammbaum.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="@stammbaum.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="@stammbaum.css" BorderPane.alignment="CENTER">
|
||||
<Label id="menubutton" onMouseClicked="#menuOpenClicked" onMouseEntered="#menuOpenEntered" stylesheets="@stammbaum.css" text="Menu" textAlignment="CENTER" textFill="WHITE" translateX="10.0">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
<Label id="menubutton" onMouseClicked="#filesButtonClicked" onMouseEntered="#filesButtonEntred" stylesheets="@stammbaum.css" text="Files" textFill="WHITE" translateX="10.0">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
<Label id="menubutton" onMouseClicked="#optionButtonClicked" onMouseEntered="#optionButtonEntered" stylesheets="@stammbaum.css" text="Options" textFill="WHITE" translateX="10.0">
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
</Label>
|
||||
</HBox>
|
||||
</center>
|
||||
</BorderPane>
|
||||
</top>
|
||||
<center>
|
||||
<AnchorPane onMouseClicked="#bodyOnClick" onMouseEntered="#bodyMouseEntred" prefHeight="627.0" prefWidth="1135.0" BorderPane.alignment="CENTER">
|
||||
<Pane id="panehome" stylesheets="@stammbaum.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<Text fill="WHITE" layoutX="444.0" layoutY="322.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Stammbaum und so, lol.">
|
||||
<font>
|
||||
<Font size="30.0" />
|
||||
</font>
|
||||
</Text>
|
||||
<VBox id="menuslide" fx:id="menuslideV" prefHeight="622.0" prefWidth="200.0" stylesheets="@stammbaum.css" visible="false">
|
||||
<JFXListCell id="buttonStammbaum" fx:id="buttonStammbaum" onMouseClicked="#buttonMenuClicked" prefHeight="33.0" prefWidth="208.0" stylesheets="@stammbaum.css" text="Menu" textFill="WHITE" />
|
||||
</VBox>
|
||||
<VBox id="filesmenu" fx:id="filesmenu" layoutX="57.0" onMouseExited="#filesOpenPaneExited" prefHeight="250.0" prefWidth="150.0" stylesheets="@stammbaum.css" visible="false" />
|
||||
<VBox id="filesmenu" fx:id="optionsmenu" layoutX="94.0" onMouseExited="#optionsOpenPaneExited" prefHeight="250.0" prefWidth="150.0" stylesheets="@stammbaum.css" visible="false" />
|
||||
</Pane>
|
||||
</AnchorPane>
|
||||
</center>
|
||||
</BorderPane>
|
||||
</AnchorPane>
|
||||
Loading…
Reference in new issue