Skip to content

Commit 6d32d68

Browse files
author
=
committed
Completed main functionality
1 parent 75a0427 commit 6d32d68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+10956
-0
lines changed

build.xml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><project name="JavaCoursework" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
2+
<description>Builds, tests, and runs the project JavaCoursework.</description>
3+
<import file="nbproject/build-impl.xml"/>
4+
<!--
5+
6+
There exist several targets which are by default empty and which can be
7+
used for execution of your tasks. These targets are usually executed
8+
before and after some main targets. Those of them relevant for JavaFX project are:
9+
10+
-pre-init: called before initialization of project properties
11+
-post-init: called after initialization of project properties
12+
-pre-compile: called before javac compilation
13+
-post-compile: called after javac compilation
14+
-pre-compile-test: called before javac compilation of JUnit tests
15+
-post-compile-test: called after javac compilation of JUnit tests
16+
-pre-jfx-jar: called before FX SDK specific <fx:jar> task
17+
-post-jfx-jar: called after FX SDK specific <fx:jar> task
18+
-pre-jfx-deploy: called before FX SDK specific <fx:deploy> task
19+
-post-jfx-deploy: called after FX SDK specific <fx:deploy> task
20+
-pre-jfx-native: called just after -pre-jfx-deploy if <fx:deploy> runs in native packaging mode
21+
-post-jfx-native: called just after -post-jfx-deploy if <fx:deploy> runs in native packaging mode
22+
-post-clean: called after cleaning build products
23+
24+
(Targets beginning with '-' are not intended to be called on their own.)
25+
26+
Example of inserting a HTML postprocessor after javaFX SDK deployment:
27+
28+
<target name="-post-jfx-deploy">
29+
<basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
30+
<property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/>
31+
<custompostprocess>
32+
<fileset dir="${jfx.deployment.html}"/>
33+
</custompostprocess>
34+
</target>
35+
36+
Example of calling an Ant task from JavaFX SDK. Note that access to JavaFX SDK Ant tasks must be
37+
initialized; to ensure this is done add the dependence on -check-jfx-sdk-version target:
38+
39+
<target name="-post-jfx-jar" depends="-check-jfx-sdk-version">
40+
<echo message="Calling jar task from JavaFX SDK"/>
41+
<fx:jar ...>
42+
...
43+
</fx:jar>
44+
</target>
45+
46+
For more details about JavaFX SDK Ant tasks go to
47+
http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm
48+
49+
For list of available properties check the files
50+
nbproject/build-impl.xml and nbproject/jfx-impl.xml.
51+
52+
-->
53+
</project>

build/built-jar.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#Thu, 11 Apr 2019 13:20:03 +0100
2+
3+
4+
C\:\\Users\\o_noo\\Desktop\\JavaCoursework\\JavaCoursework=

build/classes/Data/items.csv

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name,type,code,cost,availability,username
2+
Jessica Jones,Book,653006,5.0,false,lol
3+
Doctor Who,Book,741190,5.0,true,library
4+
Intel vs AMD,Journal,598658,10.0,true,library
5+
Jessica Jones,Book,19132,10.0,false,admin
6+
james bond,Book,102531,15.0,false,admin
7+
abdi,Book,785116,11.0,true,library
8+
Harry Potter,Book,145471,15.0,true,library
9+
Matilida,Book,589878,10.0,true,library

build/classes/Data/users.csv

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
admin2,John,Smith,12 Private Street,SM5 2FE,0.0,pass
2+
admin,Abdinasir,Mohamed,lmao,haha,82.0,lol

build/classes/View/addItem.fxml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import java.lang.*?>
4+
<?import java.util.*?>
5+
<?import javafx.collections.*?>
6+
<?import javafx.scene.*?>
7+
<?import javafx.scene.control.*?>
8+
<?import javafx.scene.layout.*?>
9+
<?import javafx.scene.text.*?>
10+
11+
<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="Controller.AddItemController">
12+
<children>
13+
<Label alignment="CENTER" layoutX="224.0" layoutY="42.0" prefHeight="39.0" prefWidth="151.0" text="New Item">
14+
<font>
15+
<Font size="18.0" fx:id="x1" />
16+
</font>
17+
</Label>
18+
<Label alignment="CENTER" font="$x1" layoutX="139.0" layoutY="100.0" prefHeight="40.0" prefWidth="150.0" text="Code" />
19+
<Label alignment="CENTER" font="$x1" layoutX="139.0" layoutY="140.0" prefHeight="40.0" prefWidth="150.0" text="Name" />
20+
<Label alignment="CENTER" font="$x1" layoutX="138.0" layoutY="180.0" prefHeight="40.0" prefWidth="150.0" text="Type" />
21+
<Label alignment="CENTER" font="$x1" layoutX="138.0" layoutY="220.0" prefHeight="40.0" prefWidth="150.0" text="Cost" />
22+
<TextField fx:id="codeTf" layoutX="300.0" layoutY="100.0" prefHeight="40.0" prefWidth="173.0" />
23+
<TextField fx:id="nameTf" layoutX="300.0" layoutY="140.0" prefHeight="40.0" prefWidth="173.0" />
24+
<ComboBox fx:id="typeBox" layoutX="300.0" layoutY="180.0" prefHeight="40.0" prefWidth="173.0">
25+
<items>
26+
<FXCollections fx:factory="observableArrayList">
27+
<String fx:value="Book" />
28+
<String fx:value="Journal" />
29+
</FXCollections>
30+
</items>
31+
</ComboBox>
32+
<TextField fx:id="costTf" layoutX="299.0" layoutY="220.0" prefHeight="40.0" prefWidth="173.0" />
33+
<Button layoutX="177.0" layoutY="296.0" mnemonicParsing="false" onAction="#confirmAction" prefHeight="39.0" prefWidth="94.0" text="Confirm" />
34+
<Button layoutX="347.0" layoutY="296.0" mnemonicParsing="false" onAction="#backAction" prefHeight="39.0" prefWidth="94.0" text="Back" />
35+
</children>
36+
</AnchorPane>

build/classes/View/libraryMain.fxml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import java.lang.*?>
4+
<?import java.util.*?>
5+
<?import javafx.scene.*?>
6+
<?import javafx.scene.control.*?>
7+
<?import javafx.scene.layout.*?>
8+
<?import javafx.scene.text.*?>
9+
10+
<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="930.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="Controller.LibraryMainController">
11+
<children>
12+
<Label fx:id="messageLabel" alignment="CENTER" layoutX="21.0" layoutY="23.0" prefWidth="895.0" text="Label">
13+
<font>
14+
<Font size="18.0" />
15+
</font>
16+
</Label>
17+
<Button layoutX="418.0" layoutY="81.0" mnemonicParsing="false" onAction="#addBalanceAction" prefHeight="34.0" prefWidth="95.0" text="Add Balance" />
18+
<Label id="messageLabel" alignment="CENTER" layoutX="14.0" layoutY="115.0" prefWidth="405.0" text="Items in the Library">
19+
<font>
20+
<Font name="System Bold" size="18.0" fx:id="x1" />
21+
</font>
22+
</Label>
23+
<Label id="messageLabel" alignment="CENTER" font="$x1" layoutX="511.0" layoutY="115.0" prefWidth="405.0" text="Items you have" />
24+
<TableView fx:id="libraryTv" layoutX="14.0" layoutY="147.0" prefHeight="170.0" prefWidth="405.0" />
25+
<TableView fx:id="userTv" layoutX="511.0" layoutY="147.0" prefHeight="170.0" prefWidth="405.0" />
26+
<Button id="toLibrarybtn" fx:id="toLibraryBtn" layoutX="437.0" layoutY="181.0" minHeight="29.0" mnemonicParsing="false" onAction="#toLibrary" prefHeight="29.0" prefWidth="56.0" text="&lt;-" wrapText="true">
27+
<font>
28+
<Font size="15.0" fx:id="x2" />
29+
</font>
30+
</Button>
31+
<Button fx:id="toUserBtn" font="$x2" layoutX="437.0" layoutY="277.0" minHeight="29.0" mnemonicParsing="false" onAction="#toUserTv" prefHeight="29.0" prefWidth="56.0" text="-&gt;" wrapText="true" />
32+
<Button layoutX="96.0" layoutY="342.0" mnemonicParsing="false" onAction="#addItemAction" prefHeight="34.0" prefWidth="95.0" text="Add Item" />
33+
<Button fx:id="deleteItemBtn" layoutX="256.0" layoutY="342.0" mnemonicParsing="false" onAction="#deleteItemAction" prefHeight="34.0" prefWidth="95.0" text="Delete Item" />
34+
<Button layoutX="846.0" layoutY="342.0" mnemonicParsing="false" onAction="#logOffAction" prefHeight="34.0" prefWidth="70.0" text="Log Off" />
35+
</children>
36+
</AnchorPane>

build/classes/View/loginPage.fxml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import java.lang.*?>
4+
<?import java.util.*?>
5+
<?import javafx.scene.*?>
6+
<?import javafx.scene.control.*?>
7+
<?import javafx.scene.layout.*?>
8+
<?import javafx.scene.text.*?>
9+
10+
<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="Controller.LoginPageController">
11+
<children>
12+
<Label alignment="CENTER" layoutX="127.0" layoutY="68.0" prefHeight="36.0" prefWidth="166.0" text="Username">
13+
<font>
14+
<Font size="18.0" fx:id="x1" />
15+
</font>
16+
</Label>
17+
<Label alignment="CENTER" font="$x1" layoutX="127.0" layoutY="143.0" prefHeight="36.0" prefWidth="166.0" text="Password" />
18+
<TextField fx:id="usernameTf" layoutX="300.0" layoutY="68.0" prefHeight="36.0" prefWidth="200.0" />
19+
<PasswordField fx:id="passwordPf" layoutX="300.0" layoutY="143.0" prefHeight="36.0" prefWidth="200.0" />
20+
<Button fx:id="loginBtn" layoutX="256.0" layoutY="231.0" mnemonicParsing="false" onAction="#loginAction" prefHeight="36.0" prefWidth="88.0" text="Login" />
21+
<Label alignment="CENTER" font="$x1" layoutX="161.0" layoutY="303.0" onMouseClicked="#openRegPage" prefHeight="36.0" prefWidth="279.0" text="Not Registered? Click Here" textAlignment="CENTER" wrapText="false" />
22+
</children>
23+
</AnchorPane>
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import java.lang.*?>
4+
<?import java.util.*?>
5+
<?import javafx.scene.*?>
6+
<?import javafx.scene.control.*?>
7+
<?import javafx.scene.layout.*?>
8+
<?import javafx.scene.text.*?>
9+
10+
<AnchorPane id="AnchorPane" prefHeight="508.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="Controller.RegistrationPageController">
11+
<children>
12+
<Label layoutX="60.0" layoutY="60.0" prefHeight="40.0" prefWidth="197.0" text="Username">
13+
<font>
14+
<Font size="18.0" fx:id="x1" />
15+
</font>
16+
</Label>
17+
<Label font="$x1" layoutX="60.0" layoutY="100.0" prefHeight="40.0" prefWidth="197.0" text="Forename" />
18+
<Label font="$x1" layoutX="60.0" layoutY="140.0" prefHeight="40.0" prefWidth="197.0" text="Surname" />
19+
<Label font="$x1" layoutX="60.0" layoutY="180.0" prefHeight="40.0" prefWidth="197.0" text="Address" />
20+
<Label font="$x1" layoutX="60.0" layoutY="220.0" prefHeight="40.0" prefWidth="197.0" text="Postcode" />
21+
<Label font="$x1" layoutX="60.0" layoutY="260.0" prefHeight="40.0" prefWidth="197.0" text="Password" />
22+
<Label font="$x1" layoutX="60.0" layoutY="300.0" prefHeight="40.0" prefWidth="197.0" text="Confirm Password" />
23+
<TextField fx:id="usernameTf" layoutX="300.0" layoutY="60.0" prefHeight="40.0" prefWidth="200.0" />
24+
<TextField fx:id="forenameTf" layoutX="300.0" layoutY="100.0" prefHeight="40.0" prefWidth="200.0" />
25+
<TextField fx:id="surnameTf" layoutX="300.0" layoutY="140.0" prefHeight="40.0" prefWidth="200.0" />
26+
<TextField fx:id="addressTf" layoutX="300.0" layoutY="180.0" prefHeight="40.0" prefWidth="200.0" />
27+
<TextField fx:id="postcodeTf" layoutX="300.0" layoutY="220.0" prefHeight="40.0" prefWidth="200.0" />
28+
<PasswordField fx:id="passwordPf" layoutX="300.0" layoutY="260.0" prefHeight="40.0" prefWidth="200.0" />
29+
<PasswordField fx:id="password2Pf" layoutX="300.0" layoutY="300.0" prefHeight="40.0" prefWidth="200.0" />
30+
<Button font="$x1" layoutX="230.0" layoutY="367.0" mnemonicParsing="false" onAction="#registerAction" prefHeight="40.0" prefWidth="140.0" text="Register" />
31+
<Label alignment="CENTER" contentDisplay="CENTER" font="$x1" layoutX="158.0" layoutY="425.0" onMouseClicked="#openLoginPage" prefHeight="40.0" prefWidth="284.0" text="Already Registered? Login Here!" />
32+
</children>
33+
</AnchorPane>

dist/JavaCoursework.html

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<html><head>
2+
<SCRIPT src="./web-files/dtjava.js"></SCRIPT>
3+
<script>
4+
function launchApplication(jnlpfile) {
5+
dtjava.launch( {
6+
url : 'JavaCoursework.jnlp',
7+
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iSmF2YUNvdXJzZXdvcmsuam5scCI+DQogIDxpbmZvcm1hdGlvbj4NCiAgICA8dGl0bGU+SmF2YUNvdXJzZXdvcms8L3RpdGxlPg0KICAgIDx2ZW5kb3I+b19ub288L3ZlbmRvcj4NCiAgICA8ZGVzY3JpcHRpb24+bnVsbDwvZGVzY3JpcHRpb24+DQogICAgPG9mZmxpbmUtYWxsb3dlZC8+DQogIDwvaW5mb3JtYXRpb24+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iSmF2YUNvdXJzZXdvcmsuamFyIiBzaXplPSIyMTc0MSIgZG93bmxvYWQ9ImVhZ2VyIiAvPg0KICA8L3Jlc291cmNlcz4NCiAgPGFwcGxldC1kZXNjICB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgbWFpbi1jbGFzcz0iY29tLmphdmFmeC5tYWluLk5vSmF2YUZYRmFsbGJhY2siICBuYW1lPSJKYXZhQ291cnNld29yayIgPg0KICAgIDxwYXJhbSBuYW1lPSJyZXF1aXJlZEZYVmVyc2lvbiIgdmFsdWU9IjguMCsiLz4NCiAgPC9hcHBsZXQtZGVzYz4NCiAgPGpmeDpqYXZhZngtZGVzYyAgd2lkdGg9IjgwMCIgaGVpZ2h0PSI2MDAiIG1haW4tY2xhc3M9Ik1haW4iICBuYW1lPSJKYXZhQ291cnNld29yayIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo='
8+
},
9+
{
10+
javafx : '8.0+'
11+
},
12+
{}
13+
);
14+
return false;
15+
}
16+
</script>
17+
18+
<script>
19+
function javafxEmbedMain() {
20+
dtjava.embed(
21+
{
22+
id : 'Main',
23+
url : 'JavaCoursework.jnlp',
24+
placeholder : 'javafx-app-placeholder',
25+
width : '800',
26+
height : '600',
27+
jnlp_content : 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxqbmxwIHNwZWM9IjEuMCIgeG1sbnM6amZ4PSJodHRwOi8vamF2YWZ4LmNvbSIgaHJlZj0iSmF2YUNvdXJzZXdvcmsuam5scCI+DQogIDxpbmZvcm1hdGlvbj4NCiAgICA8dGl0bGU+SmF2YUNvdXJzZXdvcms8L3RpdGxlPg0KICAgIDx2ZW5kb3I+b19ub288L3ZlbmRvcj4NCiAgICA8ZGVzY3JpcHRpb24+bnVsbDwvZGVzY3JpcHRpb24+DQogICAgPG9mZmxpbmUtYWxsb3dlZC8+DQogIDwvaW5mb3JtYXRpb24+DQogIDxyZXNvdXJjZXM+DQogICAgPGoyc2UgdmVyc2lvbj0iMS42KyIgaHJlZj0iaHR0cDovL2phdmEuc3VuLmNvbS9wcm9kdWN0cy9hdXRvZGwvajJzZSIvPg0KICAgIDxqYXIgaHJlZj0iSmF2YUNvdXJzZXdvcmsuamFyIiBzaXplPSIyMTc0MSIgZG93bmxvYWQ9ImVhZ2VyIiAvPg0KICA8L3Jlc291cmNlcz4NCiAgPGFwcGxldC1kZXNjICB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgbWFpbi1jbGFzcz0iY29tLmphdmFmeC5tYWluLk5vSmF2YUZYRmFsbGJhY2siICBuYW1lPSJKYXZhQ291cnNld29yayIgPg0KICAgIDxwYXJhbSBuYW1lPSJyZXF1aXJlZEZYVmVyc2lvbiIgdmFsdWU9IjguMCsiLz4NCiAgPC9hcHBsZXQtZGVzYz4NCiAgPGpmeDpqYXZhZngtZGVzYyAgd2lkdGg9IjgwMCIgaGVpZ2h0PSI2MDAiIG1haW4tY2xhc3M9Ik1haW4iICBuYW1lPSJKYXZhQ291cnNld29yayIgLz4NCiAgPHVwZGF0ZSBjaGVjaz0iYWx3YXlzIi8+DQo8L2pubHA+DQo='
28+
},
29+
{
30+
javafx : '8.0+'
31+
},
32+
{}
33+
);
34+
}
35+
<!-- Embed FX application into web page once page is loaded -->
36+
dtjava.addOnloadCallback(javafxEmbedMain);
37+
</script>
38+
39+
</head><body>
40+
<h2>Test page for <b>JavaCoursework</b></h2>
41+
<b>Webstart:</b> <a href='JavaCoursework.jnlp' onclick="return launchApplication('JavaCoursework.jnlp');">click to launch this app as webstart</a><br><hr><br>
42+
43+
<!-- Applet will be inserted here -->
44+
<div id='javafx-app-placeholder'></div>
45+
</body></html>

dist/JavaCoursework.jnlp

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="JavaCoursework.jnlp">
3+
<information>
4+
<title>JavaCoursework</title>
5+
<vendor>o_noo</vendor>
6+
<description>null</description>
7+
<offline-allowed/>
8+
</information>
9+
<resources>
10+
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
11+
<jar href="JavaCoursework.jar" size="21741" download="eager" />
12+
</resources>
13+
<applet-desc width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback" name="JavaCoursework" >
14+
<param name="requiredFXVersion" value="8.0+"/>
15+
</applet-desc>
16+
<jfx:javafx-desc width="800" height="600" main-class="Main" name="JavaCoursework" />
17+
<update check="always"/>
18+
</jnlp>

0 commit comments

Comments
 (0)