-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5408acb
Showing
40 changed files
with
851 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" /> | ||
<orderEntry type="module-library"> | ||
<library> | ||
<CLASSES> | ||
<root url="jar://$MODULE_DIR$/lib/mysql-connector-java-8.0.11.jar!/" /> | ||
</CLASSES> | ||
<JAVADOC /> | ||
<SOURCES /> | ||
</library> | ||
</orderEntry> | ||
</component> | ||
</module> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import javafx.geometry.Insets | ||
import javafx.geometry.Pos | ||
import javafx.scene.Scene | ||
import javafx.scene.control.Button | ||
import javafx.scene.control.Label | ||
import javafx.scene.control.PasswordField | ||
import javafx.scene.control.TextField | ||
import javafx.scene.layout.GridPane | ||
import javafx.scene.layout.HBox | ||
import javafx.scene.layout.VBox | ||
|
||
// Login to user account | ||
object Logger { | ||
val scene by lazy { scene() } | ||
|
||
private fun scene(): Scene { | ||
|
||
val gridPane = GridPane() | ||
gridPane.alignment = Pos.CENTER | ||
gridPane.hgap = 10.0 | ||
gridPane.vgap = 10.0 | ||
gridPane.padding = Insets(25.0, 25.0, 25.0, 25.0) | ||
|
||
val text = Label("Login") | ||
text.font = GUIFont.heavy | ||
gridPane.add(text, 0, 0) | ||
|
||
val email = TextField() | ||
email.promptText = "Email" | ||
email.font = GUIFont.regular | ||
|
||
val password = PasswordField() | ||
password.promptText = "Password" | ||
password.font = GUIFont.regular | ||
|
||
val vbox = VBox(10.0) | ||
vbox.children.addAll(email, password) | ||
gridPane.add(vbox, 0, 1) | ||
|
||
val signIn = Button("Sign in") | ||
signIn.font = GUIFont.medium | ||
signIn.setOnAction { | ||
_ -> | ||
Welcome.user = Welcome.User(email.text, password.text) | ||
window.scene = Welcome.scene | ||
} | ||
|
||
val signUp = Button("Sign up") | ||
signUp.font = GUIFont.medium | ||
signUp.setOnAction { _ -> window.scene = Registrar.scene } | ||
|
||
val hbox = HBox(10.0) | ||
hbox.children.addAll(signIn, signUp) | ||
gridPane.add(hbox, 0, 2) | ||
|
||
return Scene(gridPane, 250.0, 150.0) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import javafx.geometry.Insets | ||
import javafx.geometry.Pos | ||
import javafx.scene.Scene | ||
import javafx.scene.control.Button | ||
import javafx.scene.control.Label | ||
import javafx.scene.control.PasswordField | ||
import javafx.scene.control.TextField | ||
import javafx.scene.layout.GridPane | ||
import javafx.scene.layout.HBox | ||
import javafx.scene.layout.VBox | ||
|
||
// Create User Account | ||
object Registrar { | ||
val scene by lazy { scene() } | ||
|
||
private fun scene(): Scene { | ||
|
||
val gridPane = GridPane() | ||
gridPane.alignment = Pos.CENTER | ||
gridPane.hgap = 10.0 | ||
gridPane.vgap = 10.0 | ||
gridPane.padding = Insets(25.0, 25.0, 25.0, 25.0) | ||
|
||
val text = Label("Register") | ||
text.font = GUIFont.heavy | ||
gridPane.add(text, 0, 0) | ||
|
||
val email = TextField() | ||
email.promptText = "Email" | ||
email.font = GUIFont.regular | ||
|
||
val password = PasswordField() | ||
password.promptText = "Password" | ||
password.font = GUIFont.regular | ||
|
||
val retypePassword = PasswordField() | ||
retypePassword.promptText = "Retype Password" | ||
retypePassword.font = GUIFont.regular | ||
|
||
val vbox = VBox(10.0) | ||
vbox.children.addAll(email, password, retypePassword) | ||
gridPane.add(vbox, 0, 1) | ||
|
||
val register = Button("Register") | ||
register.font = GUIFont.medium | ||
register.setOnAction { | ||
_ -> | ||
// Check if email address already exists | ||
// - Connect to database | ||
// - Check database for instances of email-address | ||
// - If found | ||
// - Display warning that email address already exists in the system | ||
// - Check if password matches retype password | ||
// - If matches | ||
// - Display warning that passwords don't match | ||
// Else execute a query that adds email address and password to database | ||
println("An email has been sent confirming your account.") | ||
window.scene = Logger.scene | ||
} | ||
|
||
val back = Button("Go back") | ||
back.font = GUIFont.medium | ||
back.setOnAction { _ -> window.scene = Logger.scene } | ||
|
||
val hbox = HBox(10.0) | ||
hbox.children.addAll(register, back) | ||
gridPane.add(hbox, 0, 2) | ||
|
||
return Scene(gridPane, 250.0, 200.0) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import javafx.application.Application | ||
import javafx.scene.text.Font | ||
import javafx.stage.Stage | ||
|
||
object GUIFont { | ||
val bold = Font.loadFont("file:resources/fonts/SF-Pro-Text-Bold.otf", 20.0)!! | ||
val boldItalic = Font.loadFont("file:resources/fonts/SF-Pro-Text-BoldItalic.otf", 20.0)!! | ||
val heavy = Font.loadFont("file:resources/fonts/SF-Pro-Text-Heavy.otf", 20.0)!! | ||
val heavyItalic = Font.loadFont("file:resources/fonts/SF-Pro-Text-HeavyItalic.otf", 20.0)!! | ||
val light = Font.loadFont("file:resources/fonts/SF-Pro-Text-Light.otf", 20.0)!! | ||
val lightItalic = Font.loadFont("file:resources/fonts/SF-Pro-Text-LightItalic.otf", 20.0)!! | ||
val medium = Font.loadFont("file:resources/fonts/SF-Pro-Text-Medium.otf", 12.0)!! | ||
val mediumItalic = Font.loadFont("file:resources/fonts/SF-Pro-Text-MediumItalic.otf", 20.0)!! | ||
val regular = Font.loadFont("file:resources/fonts/SF-Pro-Text-Regular.otf", 12.0)!! | ||
val regularItalic = Font.loadFont("file:resources/fonts/SF-Pro-Text-RegularItalic.otf", 20.0)!! | ||
val semibold = Font.loadFont("file:resources/fonts/SF-Pro-Text-Semibold.otf", 20.0)!! | ||
val semibolditalic = Font.loadFont("file:resources/fonts/SF-Pro-Text-SemiboldItalic.otf", 20.0)!! | ||
} | ||
|
||
lateinit var window: Stage | ||
|
||
class GUI : Application() { | ||
|
||
val url = "jdbc:mysql://localhost:3306/" | ||
val database = "scheduler" | ||
|
||
override fun start(primaryStage: Stage) { | ||
window = primaryStage | ||
|
||
window.scene = Logger.scene | ||
window.title = "Vision" | ||
window.show() | ||
} | ||
|
||
companion object { | ||
@JvmStatic | ||
fun main(args: Array<String>) { | ||
launch(GUI::class.java) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import javafx.geometry.Insets | ||
import javafx.geometry.Pos | ||
import javafx.scene.Scene | ||
import javafx.scene.layout.GridPane | ||
import javafx.scene.text.Text | ||
|
||
// Main menu: | ||
// Modify user account data | ||
// Menu bar include account, appointment, setting, and help | ||
object Welcome { | ||
data class User(val email: String, val password: String) {} | ||
lateinit var user: User | ||
|
||
val scene by lazy { scene() } | ||
|
||
private fun scene(): Scene { | ||
|
||
val gridPane = GridPane() | ||
gridPane.alignment = Pos.CENTER | ||
gridPane.hgap = 10.0 | ||
gridPane.vgap = 10.0 | ||
gridPane.padding = Insets(25.0, 25.0, 25.0, 25.0) | ||
|
||
val email = Text(user.email) | ||
email.font = GUIFont.bold | ||
gridPane.add(email, 0, 0) | ||
|
||
val password = Text(user.password) | ||
password.font = GUIFont.bold | ||
gridPane.add(password, 1, 0) | ||
|
||
return Scene(gridPane, 150.0, 50.0) | ||
} | ||
} |