Browse Source

Added skeleton for new Add Movie window

toomanysugar 4 years ago
parent
commit
69790cc55d

+ 165 - 0
src/com/moviesdb/AdditionController.fxml

@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.TextArea?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.Pane?>
+<?import javafx.scene.text.Font?>
+
+<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="470.0" prefHeight="544.0" prefWidth="604.0" style="-fx-background-color: #212121;" stylesheets="@AdditionControllerStyle.css" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.moviesdb.AdditionController">
+   <children>
+      <Label layoutX="24.0" layoutY="24.0" text="Add movie" textFill="#9f9f9f" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0">
+         <font>
+            <Font size="24.0" />
+         </font>
+      </Label>
+      <Label layoutX="24.0" layoutY="65.0" text="Title" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="55.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="24.0" layoutY="74.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="75.0" />
+      <Pane layoutX="169.0" layoutY="96.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="75.0" />
+      <TextField id="actorName" layoutX="175.0" layoutY="47.0" maxWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="50.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="23.0" layoutY="82.0" text="Cover Link" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="95.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="29.0" layoutY="140.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="115.0" />
+      <Pane layoutX="174.0" layoutY="162.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="115.0" />
+      <TextField id="actorName" layoutX="180.0" layoutY="113.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="90.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="16.0" layoutY="176.0" text="Genre" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="135.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="22.0" layoutY="234.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="155.0" />
+      <Pane layoutX="167.0" layoutY="256.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="155.0" />
+      <TextField id="actorName" layoutX="221.0" layoutY="134.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="130.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="26.0" layoutY="186.0" text="Year" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="175.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="32.0" layoutY="244.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="195.0" />
+      <Pane layoutX="177.0" layoutY="266.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="195.0" />
+      <TextField id="actorName" layoutX="183.0" layoutY="217.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="170.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="26.0" layoutY="186.0" text="Duration" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="215.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="32.0" layoutY="244.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="235.0" />
+      <Pane layoutX="177.0" layoutY="266.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="235.0" />
+      <TextField id="actorName" layoutX="183.0" layoutY="217.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="210.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="36.0" layoutY="196.0" text="Studio" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="255.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="42.0" layoutY="254.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="275.0" />
+      <Pane layoutX="187.0" layoutY="276.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="275.0" />
+      <TextField id="actorName" layoutX="193.0" layoutY="227.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="250.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="6.0" layoutY="291.0" text="Director" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="295.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="12.0" layoutY="349.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="315.0" />
+      <Pane layoutX="157.0" layoutY="371.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="315.0" />
+      <TextField id="actorName" layoutX="163.0" layoutY="322.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="290.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="28.0" layoutY="333.0" text="Actor" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="335.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="124.0" layoutY="370.0" minWidth="304.0" prefHeight="3.0" prefWidth="304.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="126.0" AnchorPane.topAnchor="355.0" />
+      <Pane layoutX="22.0" layoutY="359.0" maxHeight="1.0" maxWidth="150.0" minHeight="1.0" minWidth="150.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="355.0" />
+      <Label layoutX="422.0" layoutY="378.0" text="Role" textFill="#9f9f9f" AnchorPane.rightAnchor="68.0" AnchorPane.topAnchor="335.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="392.0" layoutY="369.0" maxHeight="1.0" maxWidth="64.0" minHeight="1.0" minWidth="64.0" prefHeight="1.0" prefWidth="64.0" style="-fx-background-color: #9f9f9f;" AnchorPane.rightAnchor="62.0" AnchorPane.topAnchor="355.0" />
+      <Label alignment="CENTER" layoutX="555.0" layoutY="323.0" prefHeight="17.0" prefWidth="24.0" text="+" textFill="#9f9f9f" AnchorPane.rightAnchor="38.0" AnchorPane.topAnchor="325.0">
+         <font>
+            <Font name="System Bold" size="24.0" />
+         </font>
+      </Label>
+      <Label alignment="CENTER" layoutX="495.0" layoutY="323.0" prefHeight="17.0" prefWidth="24.0" text="-" textFill="#9f9f9f" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="325.0">
+         <font>
+            <Font name="System Bold" size="24.0" />
+         </font>
+      </Label>
+      <Label layoutX="15.0" layoutY="388.0" text="User Rating" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="375.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="21.0" layoutY="446.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="395.0" />
+      <Pane layoutX="194.0" layoutY="406.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="395.0" />
+      <TextField id="actorName" layoutX="172.0" layoutY="419.0" maxWidth="150.0" minWidth="150.0" style="-fx-opacity: 1; -fx-background-color: transparent; -fx-text-fill: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="370.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextField>
+      <Label layoutX="25.0" layoutY="398.0" text="Description" textFill="#9f9f9f" AnchorPane.leftAnchor="30.0" AnchorPane.topAnchor="415.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </Label>
+      <Pane layoutX="31.0" layoutY="456.0" prefHeight="1.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="24.0" AnchorPane.topAnchor="435.0" />
+      <TextArea layoutX="208.0" layoutY="407.0" minHeight="30.0" prefHeight="70.0" prefWidth="200.0" style="-fx-text-fill: #9f9f9f;" wrapText="true" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="410.0">
+         <font>
+            <Font size="14.0" />
+         </font>
+      </TextArea>
+      <Pane layoutX="146.0" layoutY="445.0" prefHeight="43.0" prefWidth="1.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.topAnchor="435.0" />
+      <Pane layoutX="204.0" layoutY="416.0" prefHeight="3.0" prefWidth="150.0" style="-fx-background-color: #9f9f9f;" AnchorPane.leftAnchor="174.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="475.0" />
+      <Label fx:id="deleteMovieButton" layoutX="61.0" layoutY="468.0" text="Add" textFill="#9f9f9f" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0">
+         <font>
+            <Font name="System Bold" size="16.0" />
+         </font>
+      </Label>
+      <Label fx:id="closeButton" layoutX="231.0" layoutY="24.0" onMouseClicked="#closeStage" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font>
+      </Label>
+      <Label fx:id="minimizeButton" layoutX="211.0" layoutY="14.0" onMouseClicked="#minimizeStage" prefHeight="16.0" prefWidth="16.0" AnchorPane.rightAnchor="24.0" AnchorPane.topAnchor="4.0">
+         <font>
+            <Font name="Arimo" size="12.0" />
+         </font>
+      </Label>
+   </children>
+</AnchorPane>

+ 18 - 0
src/com/moviesdb/AdditionController.java

@@ -0,0 +1,18 @@
+package com.moviesdb;
+import javafx.fxml.FXML;
+import javafx.scene.control.*;
+import javafx.stage.Modality;
+
+public class AdditionController extends Controller{
+
+    Object caller;
+
+    public void open(Object caller) {
+        prepare();
+        stage.initModality(Modality.WINDOW_MODAL);
+        stage.initOwner(((BrowserController)caller).stage.getScene().getWindow());
+        this.caller = caller;
+        stage.setTitle("Add Movie");
+        stage.show();
+    }
+}

+ 6 - 0
src/com/moviesdb/AdditionControllerStyle.css

@@ -0,0 +1,6 @@
+.text-area, 
+.text-area .scroll-pane,  
+.text-area .scroll-pane .viewport, 
+.text-area .scroll-pane .content {
+    -fx-background-color: transparent;
+}

+ 16 - 0
src/com/moviesdb/BrowserController.java

@@ -361,6 +361,22 @@ public class BrowserController extends Controller {
 
     }
 
+    AdditionController altAddition;
+    public void openAltAddForm(){
+        try {
+            FXMLLoader loader = new FXMLLoader(getClass().getResource("AdditionController.fxml"));
+            Parent root = loader.load();
+            altAddition = loader.getController();
+            altAddition.stage = new Stage();
+            altAddition.stage.setScene(new Scene(root, 377, 635));
+            altAddition.stage.setUserData(loader);
+            altAddition.open(this);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
     public Boolean newArgLogin(String user, String pass){
 
         Properties property = new Properties();

+ 1 - 0
src/com/moviesdb/test2.fxml

@@ -64,6 +64,7 @@
                 <Menu mnemonicParsing="false" text="Edit">
                   <items>
                     <MenuItem fx:id="addMenu" mnemonicParsing="false" onAction="#openAddForm" text="Add" />
+                    <MenuItem fx:id="addMenuAlt" mnemonicParsing="false" onAction="#openAltAddForm" text="AddAlt" />
                   </items>
                 </Menu>
                 <Menu mnemonicParsing="false" text="Help">