diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..f954323
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..aa00ffa
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..712ab9d
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_dlsc_formsfx_formsfx_core_11_5_0.xml b/.idea/libraries/Maven__com_dlsc_formsfx_formsfx_core_11_5_0.xml
new file mode 100644
index 0000000..880eae4
--- /dev/null
+++ b/.idea/libraries/Maven__com_dlsc_formsfx_formsfx_core_11_5_0.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_1.xml
new file mode 100644
index 0000000..a0e4be6
--- /dev/null
+++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_1.xml
new file mode 100644
index 0000000..f9459dc
--- /dev/null
+++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_1.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_1.xml
new file mode 100644
index 0000000..8c97ac6
--- /dev/null
+++ b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_github_almasb_fxgl_17_1.xml b/.idea/libraries/Maven__com_github_almasb_fxgl_17_1.xml
new file mode 100644
index 0000000..d27807f
--- /dev/null
+++ b/.idea/libraries/Maven__com_github_almasb_fxgl_17_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_github_almasb_fxgl_core_17_1.xml b/.idea/libraries/Maven__com_github_almasb_fxgl_core_17_1.xml
new file mode 100644
index 0000000..61a2944
--- /dev/null
+++ b/.idea/libraries/Maven__com_github_almasb_fxgl_core_17_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_github_almasb_fxgl_entity_17_1.xml b/.idea/libraries/Maven__com_github_almasb_fxgl_entity_17_1.xml
new file mode 100644
index 0000000..f7db1bc
--- /dev/null
+++ b/.idea/libraries/Maven__com_github_almasb_fxgl_entity_17_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_github_almasb_fxgl_gameplay_17_1.xml b/.idea/libraries/Maven__com_github_almasb_fxgl_gameplay_17_1.xml
new file mode 100644
index 0000000..ad6eb6f
--- /dev/null
+++ b/.idea/libraries/Maven__com_github_almasb_fxgl_gameplay_17_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_github_almasb_fxgl_io_17_1.xml b/.idea/libraries/Maven__com_github_almasb_fxgl_io_17_1.xml
new file mode 100644
index 0000000..871c4ff
--- /dev/null
+++ b/.idea/libraries/Maven__com_github_almasb_fxgl_io_17_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_github_almasb_fxgl_scene_17_1.xml b/.idea/libraries/Maven__com_github_almasb_fxgl_scene_17_1.xml
new file mode 100644
index 0000000..8f43ed3
--- /dev/null
+++ b/.idea/libraries/Maven__com_github_almasb_fxgl_scene_17_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_gluonhq_attach_audio_4_0_13.xml b/.idea/libraries/Maven__com_gluonhq_attach_audio_4_0_13.xml
new file mode 100644
index 0000000..221d783
--- /dev/null
+++ b/.idea/libraries/Maven__com_gluonhq_attach_audio_4_0_13.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_gluonhq_attach_lifecycle_4_0_13.xml b/.idea/libraries/Maven__com_gluonhq_attach_lifecycle_4_0_13.xml
new file mode 100644
index 0000000..016519e
--- /dev/null
+++ b/.idea/libraries/Maven__com_gluonhq_attach_lifecycle_4_0_13.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_gluonhq_attach_storage_4_0_13.xml b/.idea/libraries/Maven__com_gluonhq_attach_storage_4_0_13.xml
new file mode 100644
index 0000000..9f69eb2
--- /dev/null
+++ b/.idea/libraries/Maven__com_gluonhq_attach_storage_4_0_13.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_gluonhq_attach_util_4_0_13.xml b/.idea/libraries/Maven__com_gluonhq_attach_util_4_0_13.xml
new file mode 100644
index 0000000..0d89db2
--- /dev/null
+++ b/.idea/libraries/Maven__com_gluonhq_attach_util_4_0_13.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__eu_hansolo_fx_countries_17_0_22.xml b/.idea/libraries/Maven__eu_hansolo_fx_countries_17_0_22.xml
new file mode 100644
index 0000000..7bcd0e4
--- /dev/null
+++ b/.idea/libraries/Maven__eu_hansolo_fx_countries_17_0_22.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__eu_hansolo_fx_heatmap_17_0_9.xml b/.idea/libraries/Maven__eu_hansolo_fx_heatmap_17_0_9.xml
new file mode 100644
index 0000000..4773330
--- /dev/null
+++ b/.idea/libraries/Maven__eu_hansolo_fx_heatmap_17_0_9.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__eu_hansolo_tilesfx_17_1_9.xml b/.idea/libraries/Maven__eu_hansolo_tilesfx_17_1_9.xml
new file mode 100644
index 0000000..2a54b70
--- /dev/null
+++ b/.idea/libraries/Maven__eu_hansolo_tilesfx_17_1_9.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__eu_hansolo_toolbox_17_0_22.xml b/.idea/libraries/Maven__eu_hansolo_toolbox_17_0_22.xml
new file mode 100644
index 0000000..acaa46a
--- /dev/null
+++ b/.idea/libraries/Maven__eu_hansolo_toolbox_17_0_22.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__eu_hansolo_toolboxfx_17_0_28.xml b/.idea/libraries/Maven__eu_hansolo_toolboxfx_17_0_28.xml
new file mode 100644
index 0000000..ba165dd
--- /dev/null
+++ b/.idea/libraries/Maven__eu_hansolo_toolboxfx_17_0_28.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__net_synedra_validatorfx_0_3_1.xml b/.idea/libraries/Maven__net_synedra_validatorfx_0_3_1.xml
new file mode 100644
index 0000000..d979f7d
--- /dev/null
+++ b/.idea/libraries/Maven__net_synedra_validatorfx_0_3_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml b/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml
new file mode 100644
index 0000000..6ac1c42
--- /dev/null
+++ b/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_controlsfx_controlsfx_11_1_1.xml b/.idea/libraries/Maven__org_controlsfx_controlsfx_11_1_1.xml
new file mode 100644
index 0000000..50a2ebe
--- /dev/null
+++ b/.idea/libraries/Maven__org_controlsfx_controlsfx_11_1_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_jetbrains_annotations_13_0.xml b/.idea/libraries/Maven__org_jetbrains_annotations_13_0.xml
new file mode 100644
index 0000000..e2c8297
--- /dev/null
+++ b/.idea/libraries/Maven__org_jetbrains_annotations_13_0.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_5_32.xml b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_5_32.xml
new file mode 100644
index 0000000..20b2280
--- /dev/null
+++ b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_5_32.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_modular_1_5_32.xml b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_modular_1_5_32.xml
new file mode 100644
index 0000000..8204af1
--- /dev/null
+++ b/.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_modular_1_5_32.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_json_json_20210307.xml b/.idea/libraries/Maven__org_json_json_20210307.xml
new file mode 100644
index 0000000..629b7e6
--- /dev/null
+++ b/.idea/libraries/Maven__org_json_json_20210307.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_8_2.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_8_2.xml
new file mode 100644
index 0000000..8e50783
--- /dev/null
+++ b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_8_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml
new file mode 100644
index 0000000..fc8291b
--- /dev/null
+++ b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_8_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_8_2.xml b/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_8_2.xml
new file mode 100644
index 0000000..181d095
--- /dev/null
+++ b/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_8_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_8_2.xml b/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_8_2.xml
new file mode 100644
index 0000000..5f3aebe
--- /dev/null
+++ b/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_8_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_kordamp_bootstrapfx_bootstrapfx_core_0_4_0.xml b/.idea/libraries/Maven__org_kordamp_bootstrapfx_bootstrapfx_core_0_4_0.xml
new file mode 100644
index 0000000..a2ef147
--- /dev/null
+++ b/.idea/libraries/Maven__org_kordamp_bootstrapfx_bootstrapfx_core_0_4_0.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_kordamp_ikonli_ikonli_core_12_3_1.xml b/.idea/libraries/Maven__org_kordamp_ikonli_ikonli_core_12_3_1.xml
new file mode 100644
index 0000000..ab78885
--- /dev/null
+++ b/.idea/libraries/Maven__org_kordamp_ikonli_ikonli_core_12_3_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_kordamp_ikonli_ikonli_javafx_12_3_1.xml b/.idea/libraries/Maven__org_kordamp_ikonli_ikonli_javafx_12_3_1.xml
new file mode 100644
index 0000000..5602aa7
--- /dev/null
+++ b/.idea/libraries/Maven__org_kordamp_ikonli_ikonli_javafx_12_3_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_base_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_base_17_0_2.xml
new file mode 100644
index 0000000..49c76b8
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_base_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_base_win_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_base_win_17_0_2.xml
new file mode 100644
index 0000000..583877e
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_base_win_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_controls_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_controls_17_0_2.xml
new file mode 100644
index 0000000..25b943a
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_controls_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_controls_win_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_controls_win_17_0_2.xml
new file mode 100644
index 0000000..359c1a3
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_controls_win_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_fxml_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_fxml_17_0_2.xml
new file mode 100644
index 0000000..48e1695
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_fxml_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_17_0_2.xml
new file mode 100644
index 0000000..5762fb4
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_graphics_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_graphics_17_0_2.xml
new file mode 100644
index 0000000..77cc3b9
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_graphics_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_17_0_2.xml
new file mode 100644
index 0000000..157c740
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_media_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_media_17_0_2.xml
new file mode 100644
index 0000000..2bb9828
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_media_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_media_win_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_media_win_17_0_2.xml
new file mode 100644
index 0000000..782bdfe
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_media_win_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_web_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_web_17_0_2.xml
new file mode 100644
index 0000000..bfc8451
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_web_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_openjfx_javafx_web_win_17_0_2.xml b/.idea/libraries/Maven__org_openjfx_javafx_web_win_17_0_2.xml
new file mode 100644
index 0000000..fc0a874
--- /dev/null
+++ b/.idea/libraries/Maven__org_openjfx_javafx_web_win_17_0_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml b/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml
new file mode 100644
index 0000000..fbc1b16
--- /dev/null
+++ b/.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..e8d124d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..3d7fcdb
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..288b36b
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..d105f94
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ "keyToString": {
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "WebServerToolWindowFactoryState": "false",
+ "extract.method.default.visibility": "private",
+ "last_directory_selection": "C:/Users/Lenovo/Desktop/Java Projects/Reddit/src/main/java/com/example/reddit",
+ "last_opened_file_path": "C:/Users/Lenovo/Desktop/Java Projects/Reddit/src/main/resources/com/example/reddit",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "preferences.JavaFX"
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1712521680765
+
+
+ 1712521680765
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 0000000..40ca015
--- /dev/null
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
\ No newline at end of file
diff --git a/Account.txt b/Account.txt
new file mode 100644
index 0000000..48f4f24
--- /dev/null
+++ b/Account.txt
@@ -0,0 +1,4 @@
+{"Display Name":"soroush","Email":"a@A.a","Username":"soroush","Admin Subreddit":["Food","Indie","blackhead","blackheads"],"Joined Subreddit":["Food","blackheads","Indie","blackhead","blackheads"],"ID":"87a8757e-ec14-4d7e-879b-c888de6b79d2","Followings":["SrgtSajjad","mita"],"Followers":["mita"],"Karma":3,"Password":"48657","About":""}
+{"Display Name":"Khar Gav","Email":"a@a.a","Username":"sepanta","Admin Subreddit":[],"Joined Subreddit":["Food"],"ID":"9d4639bc-b2fa-4396-99c0-d70b80dc4929","Followings":[],"Followers":[],"Karma":0,"Password":"48690","About":""}
+{"Display Name":"mita","Email":"mita@gmail.com","Username":"mita","Admin Subreddit":["blackheads"],"Joined Subreddit":["Food","blackheads"],"ID":"7828720b-8d62-46fc-aca2-a2431eee5309","Followings":["soroush"],"Followers":["soroush"],"Karma":2,"Password":"-1408706944","About":""}
+{"Display Name":"SrgtSajjad","Email":"msajjad.za135@gmail.com","Username":"SrgtSajjad","Admin Subreddit":[],"Joined Subreddit":["blackheads"],"ID":"e3528d90-3014-4ca0-9dea-9139430f66ff","Followings":[],"Followers":["soroush"],"Karma":2,"Password":"-1831087644","About":""}
diff --git a/Explore.txt b/Explore.txt
new file mode 100644
index 0000000..c92786c
--- /dev/null
+++ b/Explore.txt
@@ -0,0 +1,2 @@
+{"Comment":[{"karma":1,"Downvote":[],"Replay":["u/soroush\nhello"],"Upvote":["soroush"],"Text":"qaza bad","Writer":"soroush"}],"Username":"soroush","Downvote":[],"Post":"qaza ali","Upvote":["soroush"],"Title":"Ghormeh Sabzi","ID":"daa13931-8b0b-4768-aa18-636702592a3a","Subreddit":"Food","Karma":1}
+{"Comment":[{"karma":2,"Downvote":[],"Replay":["u/soroush\nsalam"],"Upvote":["SrgtSajjad","soroush"],"Text":"i dont like this genrre","Writer":"SrgtSajjad"},{"karma":1,"Downvote":[],"Replay":["u/soroush\nbest of best fr"],"Upvote":["soroush"],"Text":"Love this yay","Writer":"soroush"}],"Username":"mita","Downvote":[],"Post":"so before anyone using soroush's reddit imma make the first music based subreddit here \nyo \nmaybe no one else will do something like this but anyway \nblack lovers every where\nrest in chaos","Upvote":["mita","soroush"],"Title":"First music community here yayyyyyyyy","ID":"32fbf57c-f28f-492c-aa05-0f71c551dfed","Subreddit":"blackheads","Karma":2}
diff --git a/README.md b/README.md
index 8032a1f..f8a8918 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,101 @@
-# Reddit-With-JavaFX-
\ No newline at end of file
+# Reddit (With JavaFX) ☜(゚ヮ゚☜)
+
+Dive into anything. Reddit is a communicating app where people can post their ideas about anything.
+
+## Description 📖
+
+In Reddit there are different rules which I'm gonna explain them.
+* **User**: You are the one who manage your own account. You can post on different, You can even have your own Subreddit.
+* **Subreddit**: So what's subreddit then? It's like a community that has a specific topic where users can posts their ideas there.
+* **Moderator**: The moderator can manage the subreddit he made. or he can make his member a moderator.
+
+## Getting Started
+
+### Dependencies 🍔
+
+* If you want to use the JavaFX, You have to download Maven for your program.(gradle won't work for this)
+* To use JavaFX you have to download it from [Gluon](https://gluonhq.com/products/javafx/).
+* If you are not perfect at html and css you can use **SceneBuilder**.
+* Having the Last version of java is recommended.
+
+## Help 🚑
+**This one is really important:**
+1. go to Files Class
+2. there are two method called `filewriter` and `fileReader`
+3. you have to change the pathname of subreddit and account folder to your path.
+4. if you don't do these above the code won't work
+* 
+
+## Executing program ▶
+
+* Run the "Main" program.
+* This method which is in Main is where the program starts with FX. So if you want to Change window you can do it here.
+```
+public void start(Stage stage) throws IOException {
+ Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("StartUP.fxml")));
+ stage.setScene(new Scene(root));
+ Image icon = new Image(Main.class.getResourceAsStream("icon.png"));
+ stage.getIcons().add(icon);
+ stage.setTitle("Reddit");
+ stage.setResizable(false);
+ stage.show();
+}
+```
+
+* After running program this window pops up.
+* 
+* Here you can log in to your account or if you don't have one you can simply create one. ᓚᘏᗢ
+### TimeLine
+* This is Timline here you can see every post. It also has a sorting option on top right.
+* 
+* The search field is where you can search for subreddit(starts with r/) and username(starts with u/). if you don't use them it shows both subreddit and username.
+* after you searched click on search icon to see a list of what did it find.
+* The 👤 button takes you to the Account Menu where you manage your account.
+* if you click on the post you like it shows the post in another scene.
+### Account Menu
+* This is account menu and as you can see it shows your information.
+* 
+* There are some options that do different actions as you can see.
+* If you want to add a post you have to join or create subreddit first.
+* if you want to change your account go to setting.
+### Subreddit
+* In subreddit if you see the Moderator option, you know you are a one of them.
+* 
+* You are able to join the subreddit and post in it.
+### Profile
+* This is where you want to see profile of user you want.
+* 
+* you are able to follow others, so you can see their post in timeline.(you can not follow yourself ಠ_ಠ)
+### Post
+* when you select a post in any of these windows this pop up.
+* 
+* You can upvote or downvote the post (you can do it just once) and if you do it for your own post it doesn't count as profile karma for you.
+* The trash option is for deleting the post (you only can see it if you are the moderator of subreddit or it's just your own post).
+* If you click on subreddit or username it takes you to their page.
+* You can add comment by clicking +.
+* And see the comments by clicking the **Comments**.
+* Choose the comment you want to add replay or vote for it.
+
+### Problems 🐞
+**Here are some problems that I might fix later:**
+* If you want to close the Post window it only takes you to timeline no matter where were you before.
+* It uses Json between classes, and it should do it with Account class.
+* you can not replay another replay.
+
+## Authors 📝
+
+**GitHub:** [Soroushsbr](https://github.com/Soroushsbr)
+**Email:** soroush.13830o@gmail.com
+
+## Resources🧱
+
+🔗 [Different patterns to design your classes](https://refactoring.guru/design-patterns/catalog)
+
+🔗 [Types of UML Diagrams](https://www.lucidchart.com/blog/types-of-UML-diagrams)
+
+
+🔗 [Getting Started With Javafx](https://openjfx.io/openjfx-docs/)
+
+🔗 [Guide to UUID in Java](https://www.baeldung.com/java-uuid)
+
+🔗 [Bro Code YouTube to learn javafx(recommended)](https://youtube.com/playlist?list=PLZPZq0r_RZOM-8vJA3NQFZB7JroDcMwev&si=mYJP3AoyxC08zqMs)
diff --git a/Reddit.iml b/Reddit.iml
new file mode 100644
index 0000000..e2a424a
--- /dev/null
+++ b/Reddit.iml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Subreddit.txt b/Subreddit.txt
new file mode 100644
index 0000000..a57bb5b
--- /dev/null
+++ b/Subreddit.txt
@@ -0,0 +1,2 @@
+{"Admins":["soroush"],"Members":["soroush"],"Name":"Indie","About":"Music for your soul"}
+{"Admins":["soroush"],"Members":["soroush"],"Name":"blackheads","About":"A place for who love black metal uwu"}
diff --git a/accounts/soroush.txt b/accounts/soroush.txt
new file mode 100644
index 0000000..b684794
--- /dev/null
+++ b/accounts/soroush.txt
@@ -0,0 +1 @@
+{"Comment":[{"karma":0,"Downvote":[],"Replay":[],"Upvote":[],"Text":"qaza bad","Writer":"soroush"}],"Username":"soroush","Downvote":[],"Post":"qaza ali","Upvote":["soroush"],"Title":"Ghormeh Sabzi","ID":"daa13931-8b0b-4768-aa18-636702592a3a","Subreddit":"Food","Karma":1}
diff --git a/img.png b/img.png
new file mode 100644
index 0000000..5a57427
Binary files /dev/null and b/img.png differ
diff --git a/img_1.png b/img_1.png
new file mode 100644
index 0000000..845aaa1
Binary files /dev/null and b/img_1.png differ
diff --git a/img_2.png b/img_2.png
new file mode 100644
index 0000000..60ff069
Binary files /dev/null and b/img_2.png differ
diff --git a/img_4.png b/img_4.png
new file mode 100644
index 0000000..ab27401
Binary files /dev/null and b/img_4.png differ
diff --git a/img_5.png b/img_5.png
new file mode 100644
index 0000000..e738a8c
Binary files /dev/null and b/img_5.png differ
diff --git a/img_6.png b/img_6.png
new file mode 100644
index 0000000..8cd3b98
Binary files /dev/null and b/img_6.png differ
diff --git a/img_7.png b/img_7.png
new file mode 100644
index 0000000..d2012fa
Binary files /dev/null and b/img_7.png differ
diff --git a/mvnw b/mvnw
new file mode 100644
index 0000000..8a8fb22
--- /dev/null
+++ b/mvnw
@@ -0,0 +1,316 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /usr/local/etc/mavenrc ] ; then
+ . /usr/local/etc/mavenrc
+ fi
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="`which javac`"
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+ if $darwin ; then
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+ else
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ fi
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`\\unset -f command; \\command -v java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' < "$1")"
+ fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+ fi
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+ fi
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ $MAVEN_DEBUG_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" \
+ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
new file mode 100644
index 0000000..1d8ab01
--- /dev/null
+++ b/mvnw.cmd
@@ -0,0 +1,188 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% ^
+ %JVM_CONFIG_MAVEN_PROPS% ^
+ %MAVEN_OPTS% ^
+ %MAVEN_DEBUG_OPTS% ^
+ -classpath %WRAPPER_JAR% ^
+ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
+ %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
+if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%"=="on" pause
+
+if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
+
+cmd /C exit /B %ERROR_CODE%
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..dea47a0
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,149 @@
+
+
+ 4.0.0
+
+ com.example
+ Reddit
+ 1.0-SNAPSHOT
+ Reddit
+
+
+ UTF-8
+ 5.8.2
+
+
+
+
+ org.json
+ json
+ 20210307
+
+
+ org.openjfx
+ javafx-controls
+ 17.0.2
+
+
+ org.openjfx
+ javafx-fxml
+ 17.0.2
+
+
+ org.openjfx
+ javafx-web
+ 17.0.2
+
+
+ org.openjfx
+ javafx-media
+ 17.0.2
+
+
+ org.controlsfx
+ controlsfx
+ 11.1.1
+
+
+ com.dlsc.formsfx
+ formsfx-core
+ 11.5.0
+
+
+ org.openjfx
+ *
+
+
+
+
+ net.synedra
+ validatorfx
+ 0.3.1
+
+
+ org.openjfx
+ *
+
+
+
+
+ org.kordamp.ikonli
+ ikonli-javafx
+ 12.3.1
+
+
+ org.kordamp.bootstrapfx
+ bootstrapfx-core
+ 0.4.0
+
+
+ eu.hansolo
+ tilesfx
+ 17.1.9
+
+
+ org.openjfx
+ *
+
+
+
+
+ com.github.almasb
+ fxgl
+ 17.1
+
+
+ org.openjfx
+ *
+
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ ${junit.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${junit.version}
+ test
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.10.1
+
+ 17
+ 17
+
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.8
+
+
+
+ default-cli
+
+ com.example.reddit/com.example.reddit.HelloApplication
+ app
+ app
+ app
+ true
+ true
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/example/reddit/Account.java b/src/main/java/com/example/reddit/Account.java
new file mode 100644
index 0000000..695d38b
--- /dev/null
+++ b/src/main/java/com/example/reddit/Account.java
@@ -0,0 +1,129 @@
+package com.example.reddit;
+import java.util.ArrayList;
+import java.util.Collections;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import java.util.Scanner;
+import java.util.UUID;
+public class Account {
+ private String displayName;
+ private String username;
+ private String password;
+ private int karma = 0;
+ private String email;
+ private String about = "";
+ private ArrayList joinedSubreddits = new ArrayList<>();
+ private ArrayList adminSubreddits = new ArrayList<>();
+ private ArrayList followers = new ArrayList<>();
+ private ArrayList followings = new ArrayList<>();
+ private String id;
+
+ public void idMaker(){
+ id = (UUID.randomUUID()).toString();
+ }
+
+
+ public void setAbout(String about) {
+ this.about = about;
+ }
+
+ public Account(String username , String password , String email){
+ displayName = username;
+ this.username = username;
+ this.password = password;
+ this.email = email;
+ }
+
+ public Account(String username){
+ this.username = username;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public void setKarma(int karma) {
+ this.karma = karma;
+ }
+
+ public boolean validatePassword(String enteredPassword){
+ String hashedPass = Integer.toString(enteredPassword.hashCode());
+ return (hashedPass).equals(this.password);
+ }
+
+ public Account(){
+
+ }
+
+
+ public JSONObject toJson() {
+ JSONObject json = new JSONObject();
+ json.put("Username" , this.username);
+ json.put("Password", this.password);
+ json.put("Email", this.email);
+ json.put("Karma", this.karma);
+ json.put("Joined Subreddit" ,this.joinedSubreddits);
+ json.put("Admin Subreddit", adminSubreddits);
+ json.put("ID" , this.id);
+ json.put("Display Name",this.displayName);
+ json.put("About" , this.about);
+ json.put("Followers" , followers);
+ json.put("Followings" , followings);
+ return json;
+ }
+
+ public void deleteAccount(JSONObject user){
+ //delete all posts
+ Files file = new Files();
+ ArrayList posts = new ArrayList<>();
+ file.fileReader(posts , user.getString("Username") , 1);
+ for(int i = 0 ; i < posts.size() ;i++){
+ JSONObject temp = new JSONObject(posts.get(i));
+ file.deletePost(temp);
+ }
+ //delete the account
+ ArrayList accounts = new ArrayList<>();
+ file.fileReader(accounts , "Account" , 2);
+ accounts.remove(user.toString());
+ String data ="";
+ for(int i = 0 ; i < accounts.size(); i++){
+ data += accounts.get(i) + "\n";
+ }
+ file.fileWriter("Account" , data , 2 , false);
+ //delete joined subreddit from them
+ ArrayList subreddit = new ArrayList<>();
+ file.fileReader(subreddit , "Subreddit" , 2);
+ ArrayList joinedSub = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Joined Subreddit") , joinedSub);
+ ArrayList member = new ArrayList<>();
+ for(String sub : subreddit){
+ if(joinedSub.contains(sub)){
+ JSONObject temp = new JSONObject(sub);
+ member.clear();
+ Main.jsonToList(temp.getJSONArray("Member") , member);
+ member.remove(user.getString("Username"));
+ temp.put("Members" , member);
+ file.subredditSave(temp);
+ }
+ }
+ //delete follower
+ ArrayList followers = new ArrayList<>();
+ ArrayList followings = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Followers") , followers);
+ for(String follower: followers){
+ JSONObject followerJson = new JSONObject(file.usernameFind(follower));
+ followings.clear();
+ Main.jsonToList(followerJson.getJSONArray("Followings"), followings);
+ followings.remove(user.getString("Username"));
+ followerJson.put("Followers" , follower);
+ file.profileSave(followerJson);
+ }
+ }
+
+ public void addAdmin(String subreddit) {
+ adminSubreddits.add(subreddit);
+ Files file = new Files();
+ file.profileSave(toJson());
+ }
+
+}
diff --git a/src/main/java/com/example/reddit/AccountMenu.java b/src/main/java/com/example/reddit/AccountMenu.java
new file mode 100644
index 0000000..0727629
--- /dev/null
+++ b/src/main/java/com/example/reddit/AccountMenu.java
@@ -0,0 +1,318 @@
+package com.example.reddit;
+
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.fxml.Initializable;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.VBox;
+import javafx.scene.shape.Rectangle;
+import javafx.stage.Stage;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Objects;
+import java.util.ResourceBundle;
+import java.util.UUID;
+
+public class AccountMenu {
+ @FXML
+ private Label username;
+ @FXML
+ private Label displayname;
+ @FXML
+ private Label karma;
+ @FXML
+ AnchorPane newPostPane;
+ @FXML
+ ScrollPane scrollPanePosts;
+ @FXML
+ Label about;
+ private Stage stage;
+ private Scene scene;
+ private Parent root;
+ JSONObject user = new JSONObject();
+
+ public void setUser(JSONObject user){
+ this.user = user;
+ meun();
+ }
+ public void meun(){
+ displayname.setText(user.getString("Display Name"));
+ username.setText("u/" + user.getString("Username"));
+ karma.setText("Karma: " + user.getInt("Karma"));
+ about.setText(user.getString("About"));
+ }
+
+ @FXML
+ TextField textField;
+ @FXML
+ TextArea textArea;
+
+ public void newPost(){
+ System.out.println("new post panel");
+ followPane.setVisible(false);
+ buttonView.setVisible(false);
+ scrollPanePosts.setVisible(false);
+ subPane.setVisible(false);
+ newPostPane.setVisible(true);
+ showBox();
+ }
+
+ public void post(){
+ String subreddit = comboBox.getValue();
+ String title = textField.getText();
+ String text = textArea.getText();
+ String postId = (UUID.randomUUID()).toString(); //to make every post unique
+ JSONObject json = new JSONObject();
+ json.put("Post", text);
+ json.put("Comment", new ArrayList<>());
+ json.put("Title", title);
+ json.put("Karma", 0);
+ json.put("Username", user.getString("Username"));
+ json.put("Subreddit", subreddit);
+ json.put("ID" , postId);
+ json.put("Upvote" , new ArrayList<>());
+ json.put("Downvote" , new ArrayList<>());
+ Files file = new Files();
+ file.fileWriter(user.getString("Username"), json.toString(), 1, true);
+ file.fileWriter(subreddit , json.toString(), 3 , true );
+ file.fileWriter("Explore" , json.toString(), 2 , true);
+ newPostPane.setVisible(false);
+ System.out.println("new post has made");
+ }
+ @FXML
+ VBox vboxPost;
+
+ public void posts(){
+ System.out.println("your posts showed");
+ followPane.setVisible(false);
+ buttonView.setVisible(false);
+ newPostPane.setVisible(false);
+ subPane.setVisible(false);
+ scrollPanePosts.setVisible(true);
+ Files file = new Files();
+ ArrayList posts = new ArrayList<>();
+ file.fileReader(posts , user.getString("Username") , 1);
+ vboxPost.getChildren().clear();
+ for(int i = posts.size() -1 ; i >= 0 ; i--) {
+ try { //here it shows your posts
+ JSONObject jsonPost = new JSONObject(posts.get(i));
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("PostsAccount.fxml"));
+ AnchorPane anchorPane = loader.load();
+ ((Label) anchorPane.getChildren().get(0)).setText("r/" + jsonPost.getString("Subreddit"));
+ ((Label) anchorPane.getChildren().get(1)).setText(jsonPost.getString("Title"));
+ ((Label) anchorPane.getChildren().get(2)).setText(jsonPost.getString("Post"));
+ ((Label) anchorPane.getChildren().get(3)).setText(user.toString());
+ ((Button) anchorPane.getChildren().get(4)).setText(jsonPost.toString());
+ vboxPost.getChildren().add(anchorPane);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ @FXML
+ Button selectButton;
+ @FXML
+ Label userLabel;
+
+ public void timeline(ActionEvent event) throws IOException{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Timeline.fxml"));
+ root = loader.load();
+ Timeline timeline= loader.getController();
+ timeline.setUser(user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public void logout(ActionEvent event) throws IOException{
+ root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("StartUp.fxml")));
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+ @FXML
+ ListView followList;
+ @FXML
+ ScrollPane followPane;
+ private String selectedUserName;
+ @FXML
+ Button buttonView;
+ public void following(){
+ System.out.println("Following list showed");
+ newPostPane.setVisible(false);
+ subPane.setVisible(false);
+ scrollPanePosts.setVisible(false);
+ followPane.setVisible(true);
+ buttonView.setVisible(true);
+ ArrayList followingList = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Followings") , followingList);
+ followList.getItems().clear();
+ followList.getItems().addAll(followingList);
+ followList.getSelectionModel().selectedItemProperty().addListener(
+ (observable, oldValue, newValue) -> {
+ selectedUserName = newValue; //here it saves the selected User
+ }
+ );
+ }
+
+ public void follower(){
+ System.out.println("follower panel showed");
+ newPostPane.setVisible(false);
+ subPane.setVisible(false);
+ scrollPanePosts.setVisible(false);
+ followPane.setVisible(true);
+ buttonView.setVisible(true);
+ ArrayList followerList = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Followers") , followerList);
+ followList.getItems().clear();
+ followList.getItems().addAll(followerList);
+ followList.getSelectionModel().selectedItemProperty().addListener(
+ (observable, oldValue, newValue) -> {
+ selectedUserName = newValue;
+ }
+ );
+ }
+
+ public void selectUsername(ActionEvent event) throws IOException{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Profile.fxml"));
+ root = loader.load();
+ Profile profile = loader.getController();
+ Files files = new Files();
+ JSONObject selectedUser = new JSONObject(files.usernameFind(selectedUserName)); //that selected User is being used here
+ profile.setInfo(selectedUser , "SelectPost.fxml" , user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ @FXML
+ ComboBox comboBox;
+
+ public void showBox(){
+ comboBox.getItems().clear();
+ ArrayList subs =new ArrayList<>() ;
+ Main.jsonToList(user.getJSONArray("Joined Subreddit") , subs); //add joined subreddit to a combo box to choose for making a new post
+ comboBox.getItems().addAll(subs);
+ }
+
+ @FXML
+ TextField subName;
+ @FXML
+ TextArea subAbout;
+ @FXML
+ ListView subs;
+ @FXML
+ AnchorPane subPane;
+ @FXML
+ Label notValid;
+ public void subreddit(){
+ System.out.println("subreddit Panel showed");
+ followPane.setVisible(false);
+ buttonView.setVisible(false);
+ newPostPane.setVisible(false);
+ scrollPanePosts.setVisible(false);
+ subPane.setVisible(true);
+ ArrayList admin = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Admin Subreddit") , admin);
+ subs.getItems().clear();
+ subs.getItems().addAll(admin);
+ }
+
+ public void newSubreddit(){
+ Files files = new Files();
+ String name = subName.getText();
+ if(files.subredditFind(name) == null){ //check if the name for subreddit is unique or not
+ notValid.setVisible(false);
+ String about = subAbout.getText();
+ JSONObject json = new JSONObject();
+ ArrayList admins = new ArrayList<>();
+ admins.add(user.getString("Username"));
+ ArrayList members = new ArrayList<>();
+ members.add(user.getString("Username"));
+ json.put("Name", name);
+ json.put("Members" , members);
+ json.put("Admins" , admins);
+ json.put("About", about);
+ JSONArray temp = user.getJSONArray("Admin Subreddit");
+ temp.put(name);
+ user.put("Admin Subreddit" , temp);
+ temp = user.getJSONArray("Joined Subreddit");
+ temp.put(name);
+ user.put("Joined Subreddit" , temp);
+ files.profileSave(user);
+ files.fileWriter("Subreddit" , json.toString(), 2 , true );
+ System.out.println("new Subreddit made");
+ subPane.setVisible(false);
+ }else{
+ notValid.setVisible(true);
+ }
+ }
+
+ @FXML
+ TextField newNameField;
+ @FXML
+ TextField newPassField;
+ @FXML
+ AnchorPane settingPane;
+ @FXML
+ Rectangle backgroundSetting;
+ public void showSetting(){
+ System.out.println("Setting Panel showed");
+ backgroundSetting.setVisible(true);
+ settingPane.setVisible(true);
+ }
+
+ public void hideSetting(){
+ System.out.println("Setting Panel hide");
+ settingPane.setVisible(false);
+ backgroundSetting.setVisible(false);
+ }
+
+ public void savePass(){
+ String newPass = newPassField.getText();
+ newPass = String.valueOf(newPass.hashCode());
+ user.put("Password" , newPass);
+ Files files = new Files();
+ files.profileSave(user);
+ }
+ public void saveName(){
+ String newName = newNameField.getText();
+ user.put("Display Name" , newName);
+ Files files = new Files();
+ files.profileSave(user);
+ setUser(user);
+ }
+ @FXML
+ TextArea aboutField;
+ public void saveAbout(){
+ String newAbout = aboutField.getText();
+ user.put("About" , newAbout);
+ Files files = new Files();
+ files.profileSave(user);
+ setUser(user);
+ }
+
+ public void deleteAccount(ActionEvent event) throws IOException {
+ Account account = new Account();
+ account.deleteAccount(user);
+ logout(event);
+ }
+
+
+}
diff --git a/src/main/java/com/example/reddit/Admin.java b/src/main/java/com/example/reddit/Admin.java
new file mode 100644
index 0000000..a357f15
--- /dev/null
+++ b/src/main/java/com/example/reddit/Admin.java
@@ -0,0 +1,34 @@
+package com.example.reddit;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import java.util.ArrayList;
+import java.util.Scanner;
+
+public class Admin extends SubReddit{
+ private String name;
+
+ private JSONObject subInfo;
+ private ArrayList members = new ArrayList<>();
+
+ private ArrayList admins = new ArrayList<>();
+
+ public Admin(String name){
+ this.name = name;
+ Files file = new Files();
+ subInfo = new JSONObject(file.subredditFind(name));
+ setMembers();
+ setAdmins();
+ }
+
+ public void setMembers() {
+ JSONArray memberJson = new JSONArray(subInfo.getJSONArray("Members"));
+ Main.jsonToList(memberJson , members);
+ }
+
+ public void setAdmins() {
+ JSONArray adminJson = new JSONArray(subInfo.getJSONArray("Admins"));
+ Main.jsonToList(adminJson , admins);
+ }
+
+
+}
diff --git a/src/main/java/com/example/reddit/Comment.java b/src/main/java/com/example/reddit/Comment.java
new file mode 100644
index 0000000..98233bb
--- /dev/null
+++ b/src/main/java/com/example/reddit/Comment.java
@@ -0,0 +1,65 @@
+package com.example.reddit;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import java.util.ArrayList;
+import java.util.Scanner;
+
+public class Comment extends Post {
+ private String writer = "";
+ private String text = "";
+ private int karma = 0;
+ private ArrayList upvotes = new ArrayList<>();
+ private ArrayList downvotes = new ArrayList<>();
+ private ArrayList replay = new ArrayList<>();
+
+ public JSONObject newComment(JSONObject currentUser , String text){
+ this.text = text;
+ writer = currentUser.getString("Username");
+ JSONObject json = new JSONObject();
+ json.put("Text" , this.text);
+ json.put("Writer" , writer);
+ json.put("Upvote" , upvotes);
+ json.put("Downvote" , downvotes);
+ json.put("Replay" , replay);
+ json.put("karma" , karma);
+ return json;
+ }
+
+
+
+ @Override
+ public void saveChanges(String changedPost) {
+ super.saveChanges(changedPost);
+ }
+
+
+
+ @Override
+ public int validKarma(JSONObject currentUser, int value, JSONObject comment) {
+ return super.validKarma(currentUser, value, comment);
+ }
+
+ public void addReplay(JSONObject selectedComment , String replay , JSONObject post , int index){
+ JSONArray replayJson = selectedComment.getJSONArray("Replay");
+ replayJson.put(replay);
+// selectedComment.put("Replay" , replayJson);
+// ArrayList comments = new ArrayList<>();
+// jsonComment.put("Comment" , comments);
+ ArrayList comments = new ArrayList<>();
+ jsonArraytoList(post.getJSONArray("Comment") , comments);
+ comments.set(index , selectedComment);
+ post.put("Comment" , comments);
+ saveChanges(post.toString());
+ }
+
+ public void jsonArraytoList(JSONArray jsonArray , ArrayList list){
+ for(int i = 0 ; i < jsonArray.length() ; i++){
+ list.add(jsonArray.getJSONObject(i));
+ }
+ }
+
+ @Override
+ public void profileKarma(int value, String username) {
+ super.profileKarma(value, username);
+ }
+}
diff --git a/src/main/java/com/example/reddit/Developer.java b/src/main/java/com/example/reddit/Developer.java
new file mode 100644
index 0000000..fa39fb0
--- /dev/null
+++ b/src/main/java/com/example/reddit/Developer.java
@@ -0,0 +1,27 @@
+package com.example.reddit;
+import org.json.JSONObject;
+import java.util.ArrayList;
+import java.util.Scanner;
+
+public class Developer{
+ private String username = "Soroush";
+ private String password = "48657";
+
+ public void validInput(String enteredUsername , String enteredPassword){
+ if(enteredUsername.equals(username) && enteredPassword.equals(password)){
+ }
+ }
+
+ private void deleteFromList(String user){
+ Files file = new Files();
+ ArrayList list = new ArrayList<>();
+ file.fileReader(list , "Reports" , 2);
+ list.remove(user);
+ String data = "";
+ for (int i = 0 ; i < list.size() ; i++){
+ data += list.get(i) + "\n";
+ }
+ file.fileWriter("Reports" , data , 2 , false);
+ }
+
+}
diff --git a/src/main/java/com/example/reddit/Explore.java b/src/main/java/com/example/reddit/Explore.java
new file mode 100644
index 0000000..aac56eb
--- /dev/null
+++ b/src/main/java/com/example/reddit/Explore.java
@@ -0,0 +1,10 @@
+package com.example.reddit;
+import org.json.JSONObject;
+import java.util.ArrayList;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+public class Explore{
+ private ArrayList posts = new ArrayList<>();
+
+}
diff --git a/src/main/java/com/example/reddit/Files.java b/src/main/java/com/example/reddit/Files.java
new file mode 100644
index 0000000..ab9c728
--- /dev/null
+++ b/src/main/java/com/example/reddit/Files.java
@@ -0,0 +1,179 @@
+package com.example.reddit;
+
+import org.json.JSONObject;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Scanner;
+public class Files {
+
+ public void fileWriter(String username , String data, int option , boolean append){
+ String address;
+ if(option == 1){
+ address = "C:\\Users\\Lenovo\\Desktop\\Java Projects\\Reddit\\accounts\\" + username + ".txt";
+ } else if(option == 3){
+ address = "C:\\Users\\Lenovo\\Desktop\\Java Projects\\Reddit\\subreddits\\" + username + ".txt";
+ } else{
+ address = username + ".txt";
+ }
+ try{
+ FileWriter writer = new FileWriter(address , append);
+ if(append) {
+ writer.write(data + "\n");
+ }
+ else{
+ writer.write(data); //when I don't want to append I don't need the extra end line
+ }
+ writer.close();
+ }catch (IOException e){
+ }
+ }
+
+ public void fileReader(ArrayList List , String address , int option){
+ if(option == 1){
+ address = "C:\\Users\\Lenovo\\Desktop\\Java Projects\\Reddit\\accounts\\" + address + ".txt";
+ } else if(option == 3){
+ address = "C:\\Users\\Lenovo\\Desktop\\Java Projects\\Reddit\\subreddits\\" + address + ".txt";
+ } else{
+ address = address + ".txt";
+ }
+ try{
+ File file = new File(address);
+ Scanner reader = new Scanner(file);
+ while(reader.hasNextLine()){
+ List.add(reader.nextLine());
+ }
+ reader.close();
+ }catch (FileNotFoundException e){
+ }
+ }
+
+ public String usernameFind(String username) {
+ ArrayList accountList = new ArrayList<>();
+ fileReader(accountList , "Account" , 2 );
+ if(!(accountList.isEmpty())) {
+ for (int i = 0; i < accountList.size(); i++) {
+ JSONObject jsonObject = new JSONObject(accountList.get(i));
+ if((jsonObject.getString("Username")).equals(username)){
+ return jsonObject.toString();
+ }
+ }
+ }
+ return null;
+ }
+
+ public String subredditFind(String name){
+ ArrayList subredditList = new ArrayList<>();
+ fileReader(subredditList, "Subreddit" , 2 );
+ if(!(subredditList.isEmpty())) {
+ for (int i = 0; i < subredditList.size(); i++) {
+ JSONObject jsonObject = new JSONObject(subredditList.get(i));
+ if((jsonObject.getString("Name")).equals(name)){
+ return jsonObject.toString();
+ }
+ }
+ }
+ return null;
+ }
+
+ public void karmaSaver(String username , ArrayList accountList, int value) { // check this later
+ if(!(accountList.isEmpty())) {
+ for (int i = 0; i < accountList.size(); i++) {
+ JSONObject jsonObject = new JSONObject(accountList.get(i));
+ if((jsonObject.getString("Username")).equals(username)){
+ int karma = jsonObject.getInt("Karma");
+ jsonObject.put("Karma" , karma + value);
+ save(accountList, i, jsonObject , "Account");
+ break;
+ }
+ }
+ }
+ }
+
+
+ public void profileSave(JSONObject account){
+ ArrayList accountList = new ArrayList<>();
+ fileReader(accountList , "Account" , 2);
+ if(!(accountList.isEmpty())){
+ for(int i = 0 ; i < accountList.size() ; i++){
+ JSONObject jsonObject = new JSONObject(accountList.get(i));
+ if((jsonObject.getString("Username")).equals(account.getString("Username"))){
+ save(accountList, i, account , "Account");
+ }
+ }
+ }
+ }
+
+ public void subredditSave(JSONObject subJson){
+ ArrayList subList = new ArrayList<>();
+ fileReader(subList , "Subreddit" , 2);
+ if(!(subList.isEmpty())){
+ for(int i = 0 ; i < subList.size() ; i++){
+ JSONObject jsonObject = new JSONObject(subList.get(i));
+ if((jsonObject.getString("Name")).equals(subJson.getString("Name"))){
+ save(subList, i, subJson , "Subreddit");
+ }
+ }
+ }
+ }
+
+ private void save(ArrayList list, int i, JSONObject jsonObject , String address) {
+ list.set(i , jsonObject.toString());
+ String data ="";
+ for(int j = 0 ; j < list.size() ; j++){
+ data += (list.get(j)) + "\n";
+ }
+ fileWriter(address, data, 2 , false);
+ }
+
+ public void postFinder(ArrayList list , String target){
+ JSONObject jsonTarget = new JSONObject(target);
+ for(int i = 0 ; i < list.size(); i++){
+ JSONObject json = new JSONObject(list.get(i));
+ if((json.getString("ID")).equals(jsonTarget.getString("ID"))){
+ list.set(i , target);
+ break;
+ }
+ }
+ }
+
+ public void deletePost(JSONObject jsonPost){
+ ArrayList list = new ArrayList<>();
+ fileReader(list , jsonPost.getString("Username") , 1);
+ postFind2Delete(list , jsonPost.toString());
+ String data ="";
+ for(int j = 0 ; j < list.size() ; j++){
+ data += (list.get(j)) + "\n";
+ }
+ fileWriter(jsonPost.getString("Username") , data , 1 , false);
+ list.clear();
+ fileReader(list, jsonPost.getString("Subreddit") , 3 );
+ postFind2Delete(list , jsonPost.toString());
+ data ="";
+ for(int i = 0 ; i < list.size() ; i++){
+ data += (list.get(i)) + "\n";
+ }
+ fileWriter(jsonPost.getString("Subreddit") , data, 3 , false);
+ list.clear();
+ fileReader(list, "Explore", 2 );
+ postFind2Delete(list , jsonPost.toString());
+ data ="";
+ for(int i = 0 ; i < list.size() ; i++){
+ data += (list.get(i)) + "\n";
+ }
+ fileWriter("Explore", data, 2 , false);
+ }
+
+
+ private void postFind2Delete(ArrayList list, String target){
+ for(int i = 0 ; i < list.size() ; i++){
+ if(list.get(i).equals(target)){
+ list.remove(i);
+ break;
+ }
+ }
+ }
+
+}
diff --git a/src/main/java/com/example/reddit/Main.java b/src/main/java/com/example/reddit/Main.java
new file mode 100644
index 0000000..040e425
--- /dev/null
+++ b/src/main/java/com/example/reddit/Main.java
@@ -0,0 +1,38 @@
+package com.example.reddit;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.stage.Stage;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Objects;
+
+public class Main extends Application {
+ @Override
+ public void start(Stage stage) throws IOException {
+ System.out.println("Program starts");
+ Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("StartUP.fxml")));
+ stage.setScene(new Scene(root));
+ Image icon = new Image(Main.class.getResourceAsStream("icon.png"));
+ stage.getIcons().add(icon);
+ stage.setTitle("Reddit");
+ stage.setResizable(false);
+ stage.show();
+ }
+
+ public static void main(String[] args) {
+ launch();
+ }
+
+ public static void jsonToList(JSONArray jsonArray , ArrayList list){
+ for(int i = 0 ; i < jsonArray.length() ; i++){
+ list.add(jsonArray.getString(i));
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/reddit/Post.java b/src/main/java/com/example/reddit/Post.java
new file mode 100644
index 0000000..a35c964
--- /dev/null
+++ b/src/main/java/com/example/reddit/Post.java
@@ -0,0 +1,113 @@
+package com.example.reddit;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import java.util.ArrayList;
+import java.util.Scanner;
+import java.util.UUID;
+import org.json.JSONException;
+
+public class Post {
+ private Files file = new Files();
+ private ArrayList comments = new ArrayList<>();
+ private ArrayList upvotes = new ArrayList<>();
+ private ArrayList downvotes = new ArrayList<>();
+ private String username;
+ private int karma = 0;
+ private String title;
+ private String subreddit;
+ private String postId;
+
+ public Post(String username){
+ this.username = username;
+ }
+
+ public Post(){
+
+ }
+
+ public void saveChanges(String changedPost){
+ //for account folder
+ JSONObject jsonObject = new JSONObject(changedPost);
+ ArrayList list = new ArrayList<>();
+ file.fileReader(list, jsonObject.getString("Username") , 1 );
+ file.postFinder(list , changedPost);
+ String data ="";
+ for(int i = 0 ; i < list.size() ; i++){
+ data += (list.get(i)) + "\n";
+ }
+ file.fileWriter(jsonObject.getString("Username") , data, 1 , false);
+ //for subreddit file
+ list.clear();
+ file.fileReader(list, jsonObject.getString("Subreddit") , 3 );
+ file.postFinder(list , changedPost);
+ data ="";
+ for(int i = 0 ; i < list.size() ; i++){
+ data += (list.get(i)) + "\n";
+ }
+ file.fileWriter(jsonObject.getString("Subreddit") , data, 3 , false);
+ //at the end lets save it in explore
+ list.clear();
+ file.fileReader(list, "Explore", 2 );
+ file.postFinder(list , changedPost);
+ data ="";
+ for(int i = 0 ; i < list.size() ; i++){
+ data += (list.get(i)) + "\n";
+ }
+ file.fileWriter("Explore", data, 2 , false);
+ }
+
+ public void profileKarma(int value , String username){ // might change it
+ ArrayList accountList = new ArrayList<>();
+ file.fileReader(accountList , "Account" , 2);
+ file.karmaSaver(username , accountList , value);
+ }
+
+ public int validKarma(JSONObject currentUser , int value , JSONObject json){
+ String name = currentUser.getString("Username");
+ ArrayList upvotes = new ArrayList<>();
+ jsonToList(json.getJSONArray("Upvote") , upvotes);
+ ArrayList downvotes = new ArrayList<>();
+ jsonToList(json.getJSONArray("Downvote") , downvotes);
+ if(value == 1){
+ if(upvotes.contains(name)){ //if you already upvoted it removes the upvote
+ value *= -1;
+ upvotes.remove(name);
+ json.put("Upvote" , upvotes);
+ }
+ else if(downvotes.contains(name)){ //and if you downvoted it deletes it and make it an upvote
+ value *= 2;
+ downvotes.remove(name);
+ json.put("Downvote" , downvotes);
+ upvotes.add(name);
+ json.put("Upvote" , upvotes);
+ } else{
+ upvotes.add(name);
+ json.put("Upvote" , upvotes);
+ }
+ } else if(value == -1){
+ if(upvotes.contains(name)){
+ value *= 2;
+ upvotes.remove(name);
+ json.put("Upvote" , upvotes);
+ downvotes.add(name);
+ json.put("Downvote" , downvotes);
+ }
+ else if(downvotes.contains(name)){ //if you already downvoted
+ value *= -1;
+ downvotes.remove(name);
+ json.put("Downvote" , downvotes);
+ }else{
+ downvotes.add(name);
+ json.put("Downvote" , downvotes);
+ }
+ }
+ return value;
+ }
+
+ public void jsonToList(JSONArray jsonArray , ArrayList list){
+ for(int i = 0 ; i < jsonArray.length() ; i++){
+ list.add(jsonArray.getString(i));
+ }
+ }
+
+}
diff --git a/src/main/java/com/example/reddit/Profile.java b/src/main/java/com/example/reddit/Profile.java
new file mode 100644
index 0000000..8de6335
--- /dev/null
+++ b/src/main/java/com/example/reddit/Profile.java
@@ -0,0 +1,152 @@
+package com.example.reddit;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.ListView;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+public class Profile {
+ @FXML
+ private Label displayname;
+ @FXML
+ private Label username;
+ @FXML
+ private Label about;
+ @FXML
+ private Label follower;
+ @FXML
+ private Label following;
+ @FXML
+ private Label karma;
+ private JSONObject user;
+ private JSONObject selectedUser;
+ private String perScene;
+ private Stage stage;
+ private Scene scene;
+ private Parent root;
+ public void setInfo(JSONObject selectedUser , String perScene ,JSONObject user ){ //here it set all the information about the profile
+ displayname.setText(selectedUser.getString("Display Name"));
+ username.setText("u/" + selectedUser.getString("Username"));
+ about.setText(selectedUser.getString("About"));
+ follower.setText(String.valueOf(selectedUser.getJSONArray("Followers").length()));
+ following.setText(String.valueOf(selectedUser.getJSONArray("Followings").length()));
+ karma.setText(String.valueOf(selectedUser.getInt("Karma")));
+ this.perScene = perScene;
+ this.user = user;
+ this.selectedUser = selectedUser;
+ validateFollow();
+ if(user.getString("Username").equals(selectedUser.getString("Username"))){ //checks if the user and profile have same name or not if they do it doesn't show the follow button
+ follow.setVisible(false);
+ }
+ posts();
+ }
+
+ public void getBack(ActionEvent event) throws IOException {
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Timeline.fxml"));
+ root = loader.load();
+ Timeline timeline= loader.getController();
+ timeline.setUser(user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ @FXML
+ Button follow;
+
+ public void validateFollow(){
+ ArrayList follower = new ArrayList<>();
+ JSONArray jsonFollower = new JSONArray(selectedUser.getJSONArray("Followers"));
+ Main.jsonToList(jsonFollower , follower);
+ if(follower.contains(user.getString("Username"))){
+ follow.setText("Unfollow");
+ }else{
+ follow.setText("Follow");
+ }
+ }
+
+ public void follow(){
+ Files file = new Files();
+ ArrayList following = new ArrayList<>();
+ ArrayList follower = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Followings") , following);
+ Main.jsonToList(selectedUser.getJSONArray("Followers") , follower);
+ if(follower.contains(user.getString("Username"))){ //to follow
+ following.remove(selectedUser.getString("Username"));
+ user.put("Followings" , following);
+ file.profileSave(user);
+ //
+ follower.remove(user.getString("Username"));
+ selectedUser.put("Followers" , follower);
+ file.profileSave(selectedUser);
+ }else{ //to unfollow
+ following.add(selectedUser.getString("Username"));
+ user.put("Followings" , following);
+ file.profileSave(user);
+ // up for user and down for user who we follow
+ follower.add(user.getString("Username"));
+ selectedUser.put("Followers" , follower);
+ file.profileSave(selectedUser);
+ }
+ setInfo(selectedUser , perScene ,user);
+ }
+
+ @FXML
+ VBox vboxPost;
+
+ public void posts(){
+ Files file = new Files();
+ ArrayList posts = new ArrayList<>();
+ file.fileReader(posts , selectedUser.getString("Username") , 1);
+ vboxPost.getChildren().clear();
+ for(int i = posts.size() -1 ; i >= 0 ; i--) {
+ try { //shows the posts of the user who is selected
+ JSONObject jsonPost = new JSONObject(posts.get(i));
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("PostsProfile.fxml"));
+ AnchorPane anchorPane = loader.load();
+ ((Label) anchorPane.getChildren().get(0)).setText("r/" + jsonPost.getString("Subreddit"));
+ ((Label) anchorPane.getChildren().get(1)).setText(jsonPost.getString("Title"));
+ ((Label) anchorPane.getChildren().get(2)).setText(jsonPost.getString("Post"));
+ ((Label) anchorPane.getChildren().get(3)).setText(user.toString());
+ ((Button) anchorPane.getChildren().get(4)).setText(jsonPost.toString());
+ vboxPost.getChildren().add(anchorPane);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ @FXML
+ Button selectButton;
+ @FXML
+ Label userLabel;
+ public void selectedPost(ActionEvent event){
+ try {
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("SelectPost.fxml"));
+ root = loader.load();
+ SelectPost selectPost = loader.getController();
+ JSONObject jsonPost = new JSONObject(selectButton.getText());
+ System.out.println(user);
+ selectPost.setUser(new JSONObject(userLabel.getText()), jsonPost);
+ stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }catch (IOException e){
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/example/reddit/SelectPost.java b/src/main/java/com/example/reddit/SelectPost.java
new file mode 100644
index 0000000..afe2a51
--- /dev/null
+++ b/src/main/java/com/example/reddit/SelectPost.java
@@ -0,0 +1,288 @@
+package com.example.reddit;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.VBox;
+import javafx.scene.shape.Rectangle;
+import javafx.stage.Stage;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+public class SelectPost {
+ @FXML
+ Hyperlink subreddit;
+ @FXML
+ Hyperlink username;
+ @FXML
+ Label title;
+ @FXML
+ Label text;
+ @FXML
+ Label karma;
+ @FXML
+ Button deletePostButton;
+ private Stage stage;
+ private Scene scene;
+ private Parent root;
+ private JSONObject user = new JSONObject();
+ private JSONObject post = new JSONObject();
+ public void setUser(JSONObject user , JSONObject post){
+ this.user = user;
+ this.post = post;
+ ArrayList tempSub = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Admin Subreddit") , tempSub);
+ //the creator of post and the moderators of the subreddit can delete the post
+ if(user.getString("Username").equals(post.getString("Username")) || tempSub.contains(post.getString("Subreddit"))){
+ deletePostButton.setVisible(true);
+ }
+ setInfo(post);
+ }
+
+ public void selectUsername(ActionEvent event) throws IOException{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Profile.fxml"));
+ root = loader.load();
+ Profile profile = loader.getController();
+ Files files = new Files();
+ JSONObject selectedUser = new JSONObject(files.usernameFind(post.getString("Username")));
+ profile.setInfo(selectedUser , "SelectPost.fxml" , user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public void selectSubreddit(ActionEvent event)throws IOException{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("SubPage.fxml"));
+ root = loader.load();
+ Files files = new Files();
+ JSONObject selectedSub = new JSONObject(files.subredditFind(post.getString("Subreddit")));
+ SubPage subPage = loader.getController();
+ subPage.setInfo(selectedSub , user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public void setInfo(JSONObject post){
+ subreddit.setText("r/" + post.getString("Subreddit"));
+ username.setText(post.getString("Username"));
+ title.setText(post.getString("Title"));
+ text.setText(post.getString("Post"));
+ karma.setText(String.valueOf(post.getInt("Karma")));
+ }
+
+ public void timeline(ActionEvent event) throws IOException{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Timeline.fxml"));
+ root = loader.load();
+ Timeline timeline = loader.getController();
+ timeline.setUser(user);
+ stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public void upvote(){
+ String name = post.getString("Username");
+ Post selectedPost = new Post();
+ int value = selectedPost.validKarma(user, 1 , post);
+ saveKarma(name, selectedPost, value);
+ }
+
+ private void saveKarma(String name, Post selectedPost, int value) {
+ int perKarma = post.getInt("Karma");
+ post.put("Karma", perKarma + value);
+ selectedPost.saveChanges(post.toString());
+ if(!name.equals(user.getString("Username"))) { //user cant give karma to himself
+ selectedPost.profileKarma(value, name);
+ }
+ karma.setText(String.valueOf(perKarma + value));
+ int userKarma = user.getInt("Karma");
+ user.put("Karma" , userKarma + value);
+ }
+
+ public void downvote(){
+ String name = post.getString("Username");
+ Post selectedPost = new Post();
+ int value = selectedPost.validKarma(user, -1 , post);
+ saveKarma(name, selectedPost, value);
+ }
+ @FXML
+ ScrollPane scrollPane;
+ @FXML
+ AnchorPane anchorPaneComments;
+ @FXML
+ TextArea textArea;
+ @FXML
+ VBox commentVbox;
+
+ public void showComment(){
+ anchorPaneComments.setVisible(false);
+ scrollPane.setVisible(true);
+ commentVbox.getChildren().clear();
+ ArrayList comments = new ArrayList<>();
+ jsonArrayToList(post.getJSONArray("Comment") , comments);
+ int i = 0;
+ for(JSONObject comment: comments){
+ try {
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("CommentView.fxml"));
+ AnchorPane anchorPane = loader.load();
+ ((Label) anchorPane.getChildren().get(0)).setText("u/" + comment.getString("Writer"));
+ ((Label) anchorPane.getChildren().get(1)).setText(comment.getString("Text"));
+ ((Label) anchorPane.getChildren().get(2)).setText(String.valueOf(i));
+ ((Button) anchorPane.getChildren().get(3)).setText(comment.toString());
+ ((Button) anchorPane.getChildren().get(3)).setOnAction(event -> selectComment(((Button) anchorPane.getChildren().get(3)) , ((Label) anchorPane.getChildren().get(2))));
+ commentVbox.getChildren().add(anchorPane);
+ i++;
+ }catch (IOException e){
+ e.printStackTrace();
+ }
+ }
+
+ }
+ @FXML
+ AnchorPane selectedCommentPane;
+ @FXML
+ Hyperlink writerLink;
+ @FXML
+ Label commentTextLabel;
+ @FXML
+ ListView listViewReplay;
+ JSONObject comment = new JSONObject();
+
+ public void selectComment(Button commentButton , Label index){
+ System.out.println("Comment selected");
+ listViewReplay.getItems().clear();
+ this.index = Integer.parseInt(index.getText());
+ selectedCommentPane.setVisible(true);
+ comment = new JSONObject(commentButton.getText());
+ writerLink.setText( "u/" + comment.getString("Writer"));
+ commentTextLabel.setText(comment.getString("Text"));
+ karmaCommentLabel.setText(String.valueOf(comment.getInt("karma")));
+ ArrayList replays = new ArrayList<>();
+ Main.jsonToList(comment.getJSONArray("Replay") , replays);
+ listViewReplay.getItems().addAll(replays);
+ backgroundReplay.setVisible(true);
+ }
+ public void selectWriter(ActionEvent event) throws IOException {
+ System.out.println("user selected");
+ String writer = writerLink.getText();
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Profile.fxml"));
+ root = loader.load();
+ Profile profile = loader.getController();
+ Files files = new Files();
+ JSONObject selectedUser = new JSONObject(files.usernameFind(writer.substring(2)));
+ profile.setInfo(selectedUser , "SelectPost.fxml" , user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+ public void hideComment(){
+ selectedCommentPane.setVisible(false);
+ backgroundReplay.setVisible(false);
+ }
+ @FXML
+ Button closeReplayButton;
+
+ @FXML
+ TextArea textAreaReplay;
+ @FXML
+ Button postReplay;
+ @FXML
+ Rectangle backgroundReplay;
+ public void newReplayShow(){
+ closeReplayButton.setVisible(true);
+ textAreaReplay.setVisible(true);
+ postReplay.setVisible(true);
+ postReplay.setVisible(true);
+ }
+ int index = 0;
+ public void AddReplay(){
+ listViewReplay.getItems().clear();
+ String replay = textAreaReplay.getText();
+ replay = "u/" + user.getString("Username") + "\n" + replay;
+ Comment commentClass = new Comment();
+ commentClass.addReplay(comment , replay , post , index);
+ ArrayList replays = new ArrayList<>();
+ Main.jsonToList(comment.getJSONArray("Replay") , replays);
+ listViewReplay.getItems().addAll(replays);
+ System.out.println("replay added");
+ textAreaReplay.setVisible(false);
+ showComment();
+ }
+
+ public void hideNewReplay(){
+ closeReplayButton.setVisible(false);
+ textAreaReplay.setVisible(false);
+ postReplay.setVisible(false);
+ postReplay.setVisible(false);
+ }
+ @FXML
+ Label karmaCommentLabel;
+
+ public void upvoteComment(){
+ Comment commentClass = new Comment();
+ int value = commentClass.validKarma(user , 1 , comment);
+ saveKarma(commentClass, value);
+ }
+
+ public void downvoteComment(){
+ Comment commentClass = new Comment();
+ int value = commentClass.validKarma(user , -1 , comment);
+ saveKarma(commentClass, value);
+ }
+
+ private void saveKarma(Comment commentClass, int value) {
+ int karma = comment.getInt("karma");
+ comment.put("karma" , karma + value);
+ karmaCommentLabel.setText(String.valueOf(karma + value));
+ ArrayList newComments = new ArrayList<>();
+ commentClass.jsonArraytoList(post.getJSONArray("Comment") , newComments);
+ newComments.set(index , comment);
+ post.put("Comment" , newComments);
+ commentClass.saveChanges(post.toString());
+ commentClass.profileKarma(value , comment.getString("Writer"));
+ showComment();
+ }
+
+ public void jsonArrayToList(JSONArray jsonArray , ArrayList list){
+ for(int i = 0 ; i < jsonArray.length() ; i++){
+ JSONObject temp = jsonArray.getJSONObject(i);
+ list.add(temp);
+ }
+ }
+
+ public void newComment(){
+ scrollPane.setVisible(false);
+ anchorPaneComments.setVisible(true);
+ }
+
+ public void postComment(){
+ JSONArray commentsJson = post.getJSONArray("Comment");
+ String text = textArea.getText();
+ Comment commentClass = new Comment();
+ JSONObject newComment = commentClass.newComment(user , text);
+ commentsJson.put(newComment);
+ post.put("Comment" ,commentsJson);
+ Post selectedPost = new Post();
+ selectedPost.saveChanges(post.toString());
+ showComment();
+ }
+
+ public void deletePost() throws IOException{
+ Files files = new Files();
+ files.deletePost(post);
+ timeline(new ActionEvent());
+ }
+}
diff --git a/src/main/java/com/example/reddit/SignUP.java b/src/main/java/com/example/reddit/SignUP.java
new file mode 100644
index 0000000..d62b42f
--- /dev/null
+++ b/src/main/java/com/example/reddit/SignUP.java
@@ -0,0 +1,105 @@
+package com.example.reddit;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.control.PasswordField;
+import javafx.scene.control.TextField;
+import javafx.stage.Stage;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class SignUP {
+ @FXML
+ TextField userField;
+ @FXML
+ PasswordField passField;
+ @FXML
+ TextField emailField;
+ @FXML
+ Label validEmail;
+ @FXML
+ Label validUser;
+ private Stage stage;
+ private Scene scene;
+ private Parent root;
+
+ public void signUp(ActionEvent event) throws IOException {
+ String username = userField.getText();
+ String password = passField.getText();
+ String email = emailField.getText();
+ boolean flagUser = validUsername(username);
+ boolean flagEmail = validEmail(email);
+ if(flagEmail && flagUser){
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Timeline.fxml"));
+ root = loader.load();
+ Account account = new Account(username , Integer.toString(password.hashCode()) , email);
+ account.idMaker();
+ Files files = new Files();
+ files.fileWriter("Account" , (account.toJson()).toString() , 0 , true);
+ Timeline timeline = loader.getController();
+ timeline.setUser(account.toJson());
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+ }
+
+ public void login(ActionEvent event) throws IOException{
+ root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("StartUp.fxml")));
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public boolean validEmail(String email){
+ Files files = new Files();
+ ArrayList accountList = new ArrayList<>();
+ files.fileReader(accountList , "Account" , 0);
+ String regex = "[^\\s]*@[^\\s]*.[^\\s]*";
+ Pattern pattern = Pattern.compile(regex);
+ Matcher matcher = pattern.matcher(email);
+ boolean flag = true;
+ boolean find = matcher.find();
+ if (find) {//if email is valid we have to check if it's unique
+ if (!(accountList.isEmpty())) {
+ for (int i = 0; i < accountList.size(); i++) {
+ JSONObject jsonObject = new JSONObject(accountList.get(i));
+ String emailList = (jsonObject.getString("Email"));
+ validEmail.setText(" ");
+ if (emailList.equals(email)) {
+ flag = false;
+ validEmail.setText("Already Exist");
+ break;
+ }
+ }
+ }
+ }else{
+ validEmail.setText("x");
+ }
+ return (flag && find);
+ }
+
+ public boolean validUsername(String username){
+ Files files = new Files();
+ if(files.usernameFind(username) == null){
+ validUser.setText(" ");
+ return true;
+ }else{
+ validUser.setText("Already Taken");
+ return false;
+ }
+ }
+
+}
diff --git a/src/main/java/com/example/reddit/StartUp.java b/src/main/java/com/example/reddit/StartUp.java
new file mode 100644
index 0000000..739586e
--- /dev/null
+++ b/src/main/java/com/example/reddit/StartUp.java
@@ -0,0 +1,63 @@
+package com.example.reddit;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+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.image.Image;
+import javafx.stage.Stage;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Objects;
+
+public class StartUp {
+ @FXML
+ TextField userField;
+ @FXML
+ PasswordField passField;
+ private Stage stage;
+ private Scene scene;
+ private Parent root;
+ public void login(ActionEvent event) throws IOException {
+ userField.setStyle("-fx-background-radius: 50;-fx-background-color: #44475A;-fx-text-fill: white");
+ String username = userField.getText(); //entered username
+ String password = passField.getText();
+ password = Integer.toString(password.hashCode());
+ Files files = new Files();
+ if(files.usernameFind(username) != null){
+ userField.setStyle("-fx-background-radius: 50;-fx-background-color: #44475A;-fx-text-fill: white");
+ JSONObject user = new JSONObject(files.usernameFind(username));
+ if(user.getString("Password").equals(password)){
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Timeline.fxml"));
+ root = loader.load();
+ Timeline timeline= loader.getController();
+ timeline.setUser(user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }else{
+ passField.setStyle("-fx-background-radius: 50;-fx-background-color: #44475A;-fx-text-fill: white;-fx-border-color: red; -fx-border-radius: 50");
+ }
+ }else{
+ userField.setStyle("-fx-background-radius: 50;-fx-background-color: #44475A;-fx-text-fill: white;-fx-border-color: red; -fx-border-radius: 50");
+ }
+
+ }
+
+ public void signUp(ActionEvent event) throws IOException{
+ root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("SignUp.fxml")));
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+}
diff --git a/src/main/java/com/example/reddit/SubPage.java b/src/main/java/com/example/reddit/SubPage.java
new file mode 100644
index 0000000..5812b2d
--- /dev/null
+++ b/src/main/java/com/example/reddit/SubPage.java
@@ -0,0 +1,218 @@
+package com.example.reddit;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.ListView;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.VBox;
+import javafx.scene.shape.Rectangle;
+import javafx.stage.Stage;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+public class SubPage {
+ @FXML
+ Label name;
+ @FXML
+ Label about;
+ @FXML
+ Label members;
+ @FXML
+ ListView listView;
+ private Stage stage;
+ private Scene scene;
+ private Parent root;
+ private JSONObject user = new JSONObject();
+ private JSONObject sub = new JSONObject();
+ public void setInfo(JSONObject sub , JSONObject user){
+ name.setText("r/" + sub.getString("Name"));
+ about.setText(sub.getString("About"));
+ members.setText(String.valueOf(sub.getJSONArray("Members").length()));
+ this.user = user;
+ this.sub = sub;
+ validateJoin();
+ validateAdmin();
+ posts();
+ }
+
+ public void getBack(ActionEvent event) throws IOException {
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Timeline.fxml"));
+ root = loader.load();
+ Timeline timeline= loader.getController();
+ timeline.setUser(user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ @FXML
+ Button join;
+
+ public void validateJoin(){
+ ArrayList membersList = new ArrayList<>();
+ JSONArray jsonMember = new JSONArray(sub.getJSONArray("Members"));
+ Main.jsonToList(jsonMember , membersList);
+ if(membersList.contains(user.getString("Username"))){
+ join.setText("Joined");
+ }else{
+ join.setText("Join");
+ }
+ }
+
+ public void join(){
+ Files file = new Files();
+ ArrayList joinedSub = new ArrayList<>();
+ ArrayList member = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray("Joined Subreddit") , joinedSub);
+ Main.jsonToList(sub.getJSONArray("Members") , member);
+ if(member.contains(user.getString("Username"))){ //to join
+ joinedSub.remove(sub.getString("Name"));
+ user.put("Joined Subreddit" , joinedSub);
+ file.profileSave(user);
+ //
+ member.remove(user.getString("Username"));
+ sub.put("Members" , member);
+ file.subredditSave(sub);
+ setInfo(sub , user);
+ }else{ //to unjoin
+ joinedSub.add(sub.getString("Name"));
+ user.put("Joined Subreddit" , joinedSub);
+ file.profileSave(user);
+ // up for user and down for user who we follow
+ member.add(user.getString("Username"));
+ sub.put("Members" , member);
+ file.subredditSave(sub);
+ setInfo(sub , user);
+ }
+ }
+ @FXML
+ VBox vboxPost;
+ public void posts(){
+ Files file = new Files();
+ ArrayList posts = new ArrayList<>();
+ file.fileReader(posts , sub.getString("Name") , 3);
+ vboxPost.getChildren().clear();
+ for(int i = posts.size() -1 ; i >= 0 ; i--) {
+ try {
+ JSONObject jsonPost = new JSONObject(posts.get(i));
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("PostsSub.fxml"));
+ AnchorPane anchorPane = loader.load();
+ ((Label) anchorPane.getChildren().get(0)).setText("r/" + jsonPost.getString("Subreddit"));
+ ((Label) anchorPane.getChildren().get(1)).setText(jsonPost.getString("Title"));
+ ((Label) anchorPane.getChildren().get(2)).setText(jsonPost.getString("Post"));
+ ((Label) anchorPane.getChildren().get(3)).setText(user.toString());
+ ((Button) anchorPane.getChildren().get(4)).setText(jsonPost.toString());
+ vboxPost.getChildren().add(anchorPane);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ @FXML
+ Button selectButton;
+ @FXML
+ Label userLabel;
+ public void selectedPost(ActionEvent event){
+ try {
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("SelectPost.fxml"));
+ root = loader.load();
+ SelectPost selectPost = loader.getController();
+ JSONObject jsonPost = new JSONObject(selectButton.getText());
+ System.out.println(user);
+ selectPost.setUser(new JSONObject(userLabel.getText()), jsonPost);
+ stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }catch (IOException e){
+ e.printStackTrace();
+ }
+ }
+ @FXML
+ Rectangle backgroundAdmin;
+ @FXML
+ AnchorPane anchorPaneAdmin;
+ @FXML
+ ComboBox adminsBox;
+ @FXML
+ ComboBox membersBox;
+ @FXML
+ Button adminButton;
+
+ public void validateAdmin(){
+ ArrayList admins = new ArrayList<>();
+ Main.jsonToList(sub.getJSONArray("Admins"), admins);
+ if(admins.contains(user.getString("Username"))){
+ adminButton.setVisible(true);
+ }
+ }
+ public void admin(){
+ adminsBox.getItems().clear();
+ membersBox.getItems().clear();
+ backgroundAdmin.setVisible(true);
+ anchorPaneAdmin.setVisible(true);
+ ArrayList admins = new ArrayList<>();
+ ArrayList members = new ArrayList<>();
+ Main.jsonToList(sub.getJSONArray("Admins") , admins);
+ adminsBox.getItems().addAll(admins);
+ Main.jsonToList(sub.getJSONArray("Members") , members);
+ membersBox.getItems().addAll(members);
+ }
+ @FXML
+ Label isAdminLabel;
+
+ public void addAdmin(){
+ Files files = new Files();
+ String selectedMember = membersBox.getValue();
+ ArrayList adminsTemp = new ArrayList<>();
+ Main.jsonToList(sub.getJSONArray("Admins") , adminsTemp);
+ if(!adminsTemp.contains(selectedMember)) {
+ isAdminLabel.setText("");
+ adminsTemp.add(selectedMember);
+ sub.put("Admins", adminsTemp);
+ files.subredditSave(sub); //save changes in subreddit
+ JSONObject memberJson = new JSONObject(files.usernameFind(selectedMember));
+ JSONArray memberTemp = memberJson.getJSONArray("Admin Subreddit");
+ memberTemp.put(sub.getString("Name"));
+ memberJson.put("Admin Subreddit", memberTemp);
+ files.profileSave(memberJson); //and profile
+ admin();
+ }else{
+ isAdminLabel.setText(selectedMember + " is Already Moderator");
+ }
+ }
+
+ public void removeAdmin(){
+ Files files = new Files();
+ isAdminLabel.setText("");
+ String selectedAdmin = adminsBox.getValue();
+ ArrayList adminsTemp = new ArrayList<>();
+ Main.jsonToList(sub.getJSONArray("Admins") , adminsTemp);
+ adminsTemp.remove(selectedAdmin);
+ sub.put("Admins" , adminsTemp);
+ files.subredditSave(sub);
+ JSONObject adminJson = new JSONObject(files.usernameFind(selectedAdmin));
+ ArrayList adminTemp = new ArrayList<>();
+ Main.jsonToList(adminJson.getJSONArray("Admin Subreddit") , adminTemp);
+ adminTemp.remove(sub.getString("Name"));
+ adminJson.put("Admin Subreddit",adminTemp);
+ files.profileSave(adminJson);
+ admin();
+ }
+
+ public void closeAdmin(){
+ backgroundAdmin.setVisible(false);
+ anchorPaneAdmin.setVisible(false);
+ }
+}
diff --git a/src/main/java/com/example/reddit/SubReddit.java b/src/main/java/com/example/reddit/SubReddit.java
new file mode 100644
index 0000000..9e52b7f
--- /dev/null
+++ b/src/main/java/com/example/reddit/SubReddit.java
@@ -0,0 +1,34 @@
+package com.example.reddit;
+import java.util.ArrayList;
+import java.util.Scanner;
+import org.json.JSONArray;
+import org.json.JSONObject;
+public class SubReddit {
+ private String name;
+ private String about;
+ private ArrayList members = new ArrayList<>();
+
+ private ArrayList admins = new ArrayList<>();
+
+ public SubReddit(){
+ }
+
+ public void newSubreddit(String name){
+ Scanner in = new Scanner(System.in);
+ this.name = name;
+ System.out.println("Tell us about your community");
+ about = in.nextLine();
+ System.out.println("(1) Create\n(2) Exit");
+ if("1".equals(in.next())){
+ JSONObject json = new JSONObject();
+ json.put("Name", this.name);
+ json.put("Members" , members);
+ json.put("Admins" , admins);
+ json.put("About", about);
+ Files file = new Files();
+ file.fileWriter("Subreddit" , json.toString(), 2 , true );
+ }
+ }
+
+}
+
diff --git a/src/main/java/com/example/reddit/Timeline.java b/src/main/java/com/example/reddit/Timeline.java
new file mode 100644
index 0000000..3a87de6
--- /dev/null
+++ b/src/main/java/com/example/reddit/Timeline.java
@@ -0,0 +1,260 @@
+package com.example.reddit;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Timeline {
+ @FXML
+ TextField searchbar;
+ @FXML
+ ListView listView;
+
+ private Stage stage;
+ private Scene scene;
+ private Parent root;
+ private JSONObject user = new JSONObject();
+ private ArrayList posts = new ArrayList<>();
+
+ public void setUser(JSONObject user){
+ this.user = user;
+ Collections.addAll(sorting.getItems() , "Newest" , "For You" , "Followings");
+ newest();
+ setTopSub();
+ }
+ @FXML
+ AnchorPane searchScroll;
+ @FXML
+ VBox vboxSearch;
+ @FXML
+ Label jsonUser;
+ public void search() throws IOException {
+ searchScroll.setVisible(true);
+ vboxSearch.getChildren().clear();
+ Button button = new Button();
+ button.setMaxWidth(Double.MAX_VALUE);
+ vboxSearch.getChildren().add(button);
+ String regex = searchbar.getText();
+ ArrayList nameFind = new ArrayList<>();
+ if(regex.length()> 1){
+ if(regex.startsWith("u/")){ //search for username
+ regex = regex.substring(2);
+ finder(nameFind , regex , "Account" , "Username");
+ }else if ((regex).startsWith("r/")){ //for subreddit
+ regex = regex.substring(2);
+ finder(nameFind, regex , "Subreddit" , "Name");
+ }else{ //for both
+ finder(nameFind , regex,"Subreddit" , "Name");
+ finder(nameFind , regex , "Account" , "Username");
+ }
+ }else{
+ finder(nameFind , regex,"Subreddit" , "Name");
+ finder(nameFind , regex , "Account" , "Username");
+ //todo show
+ }
+ for(String find : nameFind){ //show them as a button in vbox
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("searchFinds.fxml"));
+ AnchorPane anchorPane = loader.load();
+ ((Label) anchorPane.getChildren().get(0)).setText(user.toString());
+ ((Button) anchorPane.getChildren().get(1)).setText(find);
+ vboxSearch.getChildren().add(anchorPane);
+ }
+ }
+ @FXML
+ Button searchButton;
+ public void selectSearch(ActionEvent event)throws IOException{
+ if(searchButton.getText().startsWith("u/")) {
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Profile.fxml"));
+ root = loader.load();
+ Profile profile = loader.getController();
+ Files files = new Files();
+ JSONObject selectedUser = new JSONObject(files.usernameFind(searchButton.getText().substring(2)));
+ profile.setInfo(selectedUser, "SelectPost.fxml", new JSONObject(jsonUser.getText()));
+ stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }else{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("SubPage.fxml"));
+ root = loader.load();
+ Files files = new Files();
+ JSONObject selectedSub = new JSONObject(files.subredditFind(searchButton.getText().substring(2)));
+ SubPage subPage = loader.getController();
+ subPage.setInfo(selectedSub , new JSONObject(jsonUser.getText()));
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+ }
+
+ public void unshowSearch(){
+ searchScroll.setVisible(false);
+ }
+
+
+ public void finder(ArrayList nameFind , String regex , String address , String name){
+ regex = "^" + regex + ".*";
+ Pattern pattern = Pattern.compile(regex , Pattern.CASE_INSENSITIVE);
+ ArrayList nameList = new ArrayList<>();
+ Files file = new Files();
+ file.fileReader(nameList , address , 2);
+ Matcher matcher;
+ for(int i = 0 ; i < nameList.size() ; i++){
+ JSONObject json = new JSONObject(nameList.get(i));
+ matcher = pattern.matcher(json.getString(name));
+ if(matcher.find()){
+ if(address.equals("Subreddit")){
+ nameFind.add("r/" + json.getString(name));
+ }else {
+ nameFind.add("u/" + json.getString(name));
+ }
+ }
+ }
+ }
+
+ public void profile(ActionEvent event) throws IOException{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("AccountMenu.fxml"));
+ root = loader.load();
+ AccountMenu accountMenu = loader.getController();
+ accountMenu.setUser(user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public void newest(){
+ posts.clear();
+ Files file = new Files();
+ file.fileReader(posts , "Explore" , 2);
+ posts();
+ }
+
+ public void forYou(String nameList , String name){ //this method set the list of posts as subreddit you joined or followings
+ Files file = new Files();
+ posts.clear();
+ ArrayList list = new ArrayList<>();
+ ArrayList temp = new ArrayList<>();
+ Main.jsonToList(user.getJSONArray(nameList) , list);
+ file.fileReader(posts , "Explore" , 2);
+ for(int i = 0 ; i < posts.size() ; i++){
+ JSONObject jsonObject = new JSONObject(posts.get(i));
+ if(list.contains(jsonObject.getString(name))){
+ temp.add(posts.get(i));
+ }
+ }
+ posts = temp;
+ posts();
+ }
+ @FXML
+ ComboBox sorting;
+
+ public void sort(){
+ if(sorting.getValue().equals("Newest")){
+ newest();
+ }else if(sorting.getValue().equals("For You")){
+ forYou("Joined Subreddit", "Subreddit");
+ }else{
+ forYou("Followings", "Username");
+ }
+ }
+ @FXML
+ VBox vbox;
+ public void posts(){
+ vbox.getChildren().clear();
+ for(int i = posts.size() -1 ; i >= 0 ; i--){
+ try { //to set posts in timline in a vbox
+ JSONObject jsonPost = new JSONObject(posts.get(i));
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("Posts.fxml"));
+ AnchorPane anchorPane = loader.load();
+ ((Label) anchorPane.getChildren().get(0)).setText("r/" + jsonPost.getString("Subreddit"));
+ ((Label) anchorPane.getChildren().get(1)).setText(jsonPost.getString("Title"));
+ ((Label) anchorPane.getChildren().get(2)).setText(jsonPost.getString("Post"));
+ ((Label) anchorPane.getChildren().get(3)).setText(user.toString());
+ ((Button) anchorPane.getChildren().get(4)).setText(jsonPost.toString());
+ vbox.getChildren().add(anchorPane);
+ }catch (IOException e){
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @FXML
+ Button selectButton;
+ @FXML
+ Label userLabel;
+ public void selectedPost(ActionEvent event){
+ try {
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("SelectPost.fxml"));
+ root = loader.load();
+ SelectPost selectPost = loader.getController();
+ JSONObject jsonPost = new JSONObject(selectButton.getText());
+ System.out.println(user);
+ selectPost.setUser(new JSONObject(userLabel.getText()), jsonPost);
+ stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }catch (IOException e){
+ e.printStackTrace();
+ }
+ }
+ @FXML
+ Hyperlink firstSub;
+ @FXML
+ Hyperlink secondSub;
+ @FXML
+ Hyperlink thirdSub;
+ public void setTopSub(){
+ ArrayList subreddits = new ArrayList<>();
+ Files files = new Files();
+ files.fileReader(subreddits , "Subreddit" , 2);
+ try {
+ JSONObject first = new JSONObject(subreddits.get(subreddits.size() - 1));
+ firstSub.setText(first.getString("Name"));
+ JSONObject second = new JSONObject(subreddits.get(subreddits.size() - 2));
+ secondSub.setText(second.getString("Name"));
+ JSONObject third = new JSONObject(subreddits.get(subreddits.size() - 3));
+ thirdSub.setText(third.getString("Name"));
+ }catch (IndexOutOfBoundsException e){
+ e.printStackTrace();
+ }
+ }
+
+ public void setFirstSub(ActionEvent event) throws IOException {
+ selectSubreddit(event ,firstSub.getText());
+ }
+ public void setSecondSub(ActionEvent event)throws IOException{
+ selectSubreddit(event , secondSub.getText());
+ }
+ public void setThirdSub(ActionEvent event)throws IOException{
+ selectSubreddit(event, thirdSub.getText());
+ }
+ public void selectSubreddit(ActionEvent event , String subName)throws IOException{
+ FXMLLoader loader = new FXMLLoader(getClass().getResource("SubPage.fxml"));
+ root = loader.load();
+ Files files = new Files();
+ JSONObject selectedSub = new JSONObject(files.subredditFind(subName));
+ SubPage subPage = loader.getController();
+ subPage.setInfo(selectedSub , user);
+ stage = (Stage) ((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ stage.show();
+ }
+}
diff --git a/src/main/java/com/example/reddit/icon.png b/src/main/java/com/example/reddit/icon.png
new file mode 100644
index 0000000..d889e1a
Binary files /dev/null and b/src/main/java/com/example/reddit/icon.png differ
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
new file mode 100644
index 0000000..5703800
--- /dev/null
+++ b/src/main/java/module-info.java
@@ -0,0 +1,17 @@
+module com.example.reddit {
+ requires javafx.controls;
+ requires javafx.fxml;
+ requires javafx.web;
+ requires org.json;
+
+// requires org.controlsfx.controls;
+// requires com.dlsc.formsfx;
+// requires validatorfx;
+// requires org.kordamp.ikonli.javafx;
+// requires org.kordamp.bootstrapfx.core;
+// requires eu.hansolo.tilesfx;
+// requires com.almasb.fxgl.all;
+
+ opens com.example.reddit to javafx.fxml;
+ exports com.example.reddit;
+}
\ No newline at end of file
diff --git a/src/main/resources/com/example/reddit/AccountMenu.fxml b/src/main/resources/com/example/reddit/AccountMenu.fxml
new file mode 100644
index 0000000..8d45fe1
--- /dev/null
+++ b/src/main/resources/com/example/reddit/AccountMenu.fxml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/CommentView.fxml b/src/main/resources/com/example/reddit/CommentView.fxml
new file mode 100644
index 0000000..4d0a068
--- /dev/null
+++ b/src/main/resources/com/example/reddit/CommentView.fxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/NewPost.fxml b/src/main/resources/com/example/reddit/NewPost.fxml
new file mode 100644
index 0000000..9e2ffc7
--- /dev/null
+++ b/src/main/resources/com/example/reddit/NewPost.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/Posts.fxml b/src/main/resources/com/example/reddit/Posts.fxml
new file mode 100644
index 0000000..ae13bbc
--- /dev/null
+++ b/src/main/resources/com/example/reddit/Posts.fxml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/PostsAccount.fxml b/src/main/resources/com/example/reddit/PostsAccount.fxml
new file mode 100644
index 0000000..93503f1
--- /dev/null
+++ b/src/main/resources/com/example/reddit/PostsAccount.fxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/PostsProfile.fxml b/src/main/resources/com/example/reddit/PostsProfile.fxml
new file mode 100644
index 0000000..93503f1
--- /dev/null
+++ b/src/main/resources/com/example/reddit/PostsProfile.fxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/PostsSub.fxml b/src/main/resources/com/example/reddit/PostsSub.fxml
new file mode 100644
index 0000000..93503f1
--- /dev/null
+++ b/src/main/resources/com/example/reddit/PostsSub.fxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/Profile.fxml b/src/main/resources/com/example/reddit/Profile.fxml
new file mode 100644
index 0000000..1e2a23c
--- /dev/null
+++ b/src/main/resources/com/example/reddit/Profile.fxml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/Reddit_Lockup_OnDark.png b/src/main/resources/com/example/reddit/Reddit_Lockup_OnDark.png
new file mode 100644
index 0000000..ff44c1c
Binary files /dev/null and b/src/main/resources/com/example/reddit/Reddit_Lockup_OnDark.png differ
diff --git a/src/main/resources/com/example/reddit/Reddit_VerticalLockup_OnDark.png b/src/main/resources/com/example/reddit/Reddit_VerticalLockup_OnDark.png
new file mode 100644
index 0000000..53baebf
Binary files /dev/null and b/src/main/resources/com/example/reddit/Reddit_VerticalLockup_OnDark.png differ
diff --git a/src/main/resources/com/example/reddit/SelectPost.fxml b/src/main/resources/com/example/reddit/SelectPost.fxml
new file mode 100644
index 0000000..2b7c4d1
--- /dev/null
+++ b/src/main/resources/com/example/reddit/SelectPost.fxml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/SignUP.fxml b/src/main/resources/com/example/reddit/SignUP.fxml
new file mode 100644
index 0000000..2b0a0ad
--- /dev/null
+++ b/src/main/resources/com/example/reddit/SignUP.fxml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/StartUp.fxml b/src/main/resources/com/example/reddit/StartUp.fxml
new file mode 100644
index 0000000..5c0739f
--- /dev/null
+++ b/src/main/resources/com/example/reddit/StartUp.fxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/SubPage.fxml b/src/main/resources/com/example/reddit/SubPage.fxml
new file mode 100644
index 0000000..946bff3
--- /dev/null
+++ b/src/main/resources/com/example/reddit/SubPage.fxml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/Timeline.fxml b/src/main/resources/com/example/reddit/Timeline.fxml
new file mode 100644
index 0000000..e59e46d
--- /dev/null
+++ b/src/main/resources/com/example/reddit/Timeline.fxml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/example/reddit/icon.png b/src/main/resources/com/example/reddit/icon.png
new file mode 100644
index 0000000..d889e1a
Binary files /dev/null and b/src/main/resources/com/example/reddit/icon.png differ
diff --git a/src/main/resources/com/example/reddit/logo.png b/src/main/resources/com/example/reddit/logo.png
new file mode 100644
index 0000000..d1d65fc
Binary files /dev/null and b/src/main/resources/com/example/reddit/logo.png differ
diff --git a/src/main/resources/com/example/reddit/reddit-logo-2436 (3).png b/src/main/resources/com/example/reddit/reddit-logo-2436 (3).png
new file mode 100644
index 0000000..d889e1a
Binary files /dev/null and b/src/main/resources/com/example/reddit/reddit-logo-2436 (3).png differ
diff --git a/src/main/resources/com/example/reddit/reddit-logo-2436.png b/src/main/resources/com/example/reddit/reddit-logo-2436.png
new file mode 100644
index 0000000..c62a027
Binary files /dev/null and b/src/main/resources/com/example/reddit/reddit-logo-2436.png differ
diff --git a/src/main/resources/com/example/reddit/reddit-logo.png b/src/main/resources/com/example/reddit/reddit-logo.png
new file mode 100644
index 0000000..3d99e04
Binary files /dev/null and b/src/main/resources/com/example/reddit/reddit-logo.png differ
diff --git a/src/main/resources/com/example/reddit/searchFinds.fxml b/src/main/resources/com/example/reddit/searchFinds.fxml
new file mode 100644
index 0000000..d9cb98b
--- /dev/null
+++ b/src/main/resources/com/example/reddit/searchFinds.fxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/subreddits/Food.txt b/subreddits/Food.txt
new file mode 100644
index 0000000..b684794
--- /dev/null
+++ b/subreddits/Food.txt
@@ -0,0 +1 @@
+{"Comment":[{"karma":0,"Downvote":[],"Replay":[],"Upvote":[],"Text":"qaza bad","Writer":"soroush"}],"Username":"soroush","Downvote":[],"Post":"qaza ali","Upvote":["soroush"],"Title":"Ghormeh Sabzi","ID":"daa13931-8b0b-4768-aa18-636702592a3a","Subreddit":"Food","Karma":1}
diff --git a/target/classes/com/example/reddit/AccountMenu.fxml b/target/classes/com/example/reddit/AccountMenu.fxml
new file mode 100644
index 0000000..8d45fe1
--- /dev/null
+++ b/target/classes/com/example/reddit/AccountMenu.fxml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/CommentView.fxml b/target/classes/com/example/reddit/CommentView.fxml
new file mode 100644
index 0000000..4d0a068
--- /dev/null
+++ b/target/classes/com/example/reddit/CommentView.fxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/NewPost.fxml b/target/classes/com/example/reddit/NewPost.fxml
new file mode 100644
index 0000000..9e2ffc7
--- /dev/null
+++ b/target/classes/com/example/reddit/NewPost.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/Posts.fxml b/target/classes/com/example/reddit/Posts.fxml
new file mode 100644
index 0000000..ae13bbc
--- /dev/null
+++ b/target/classes/com/example/reddit/Posts.fxml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/PostsAccount.fxml b/target/classes/com/example/reddit/PostsAccount.fxml
new file mode 100644
index 0000000..93503f1
--- /dev/null
+++ b/target/classes/com/example/reddit/PostsAccount.fxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/PostsProfile.fxml b/target/classes/com/example/reddit/PostsProfile.fxml
new file mode 100644
index 0000000..93503f1
--- /dev/null
+++ b/target/classes/com/example/reddit/PostsProfile.fxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/PostsSub.fxml b/target/classes/com/example/reddit/PostsSub.fxml
new file mode 100644
index 0000000..93503f1
--- /dev/null
+++ b/target/classes/com/example/reddit/PostsSub.fxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/Profile.fxml b/target/classes/com/example/reddit/Profile.fxml
new file mode 100644
index 0000000..1e2a23c
--- /dev/null
+++ b/target/classes/com/example/reddit/Profile.fxml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/Reddit_Lockup_OnDark.png b/target/classes/com/example/reddit/Reddit_Lockup_OnDark.png
new file mode 100644
index 0000000..ff44c1c
Binary files /dev/null and b/target/classes/com/example/reddit/Reddit_Lockup_OnDark.png differ
diff --git a/target/classes/com/example/reddit/Reddit_VerticalLockup_OnDark.png b/target/classes/com/example/reddit/Reddit_VerticalLockup_OnDark.png
new file mode 100644
index 0000000..53baebf
Binary files /dev/null and b/target/classes/com/example/reddit/Reddit_VerticalLockup_OnDark.png differ
diff --git a/target/classes/com/example/reddit/SelectPost.fxml b/target/classes/com/example/reddit/SelectPost.fxml
new file mode 100644
index 0000000..2b7c4d1
--- /dev/null
+++ b/target/classes/com/example/reddit/SelectPost.fxml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/SignUP.fxml b/target/classes/com/example/reddit/SignUP.fxml
new file mode 100644
index 0000000..2b0a0ad
--- /dev/null
+++ b/target/classes/com/example/reddit/SignUP.fxml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/StartUp.fxml b/target/classes/com/example/reddit/StartUp.fxml
new file mode 100644
index 0000000..5c0739f
--- /dev/null
+++ b/target/classes/com/example/reddit/StartUp.fxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/SubPage.fxml b/target/classes/com/example/reddit/SubPage.fxml
new file mode 100644
index 0000000..946bff3
--- /dev/null
+++ b/target/classes/com/example/reddit/SubPage.fxml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/Timeline.fxml b/target/classes/com/example/reddit/Timeline.fxml
new file mode 100644
index 0000000..e59e46d
--- /dev/null
+++ b/target/classes/com/example/reddit/Timeline.fxml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/target/classes/com/example/reddit/icon.png b/target/classes/com/example/reddit/icon.png
new file mode 100644
index 0000000..d889e1a
Binary files /dev/null and b/target/classes/com/example/reddit/icon.png differ
diff --git a/target/classes/com/example/reddit/logo.png b/target/classes/com/example/reddit/logo.png
new file mode 100644
index 0000000..d1d65fc
Binary files /dev/null and b/target/classes/com/example/reddit/logo.png differ
diff --git a/target/classes/com/example/reddit/reddit-logo-2436 (3).png b/target/classes/com/example/reddit/reddit-logo-2436 (3).png
new file mode 100644
index 0000000..d889e1a
Binary files /dev/null and b/target/classes/com/example/reddit/reddit-logo-2436 (3).png differ
diff --git a/target/classes/com/example/reddit/reddit-logo-2436.png b/target/classes/com/example/reddit/reddit-logo-2436.png
new file mode 100644
index 0000000..c62a027
Binary files /dev/null and b/target/classes/com/example/reddit/reddit-logo-2436.png differ
diff --git a/target/classes/com/example/reddit/reddit-logo.png b/target/classes/com/example/reddit/reddit-logo.png
new file mode 100644
index 0000000..3d99e04
Binary files /dev/null and b/target/classes/com/example/reddit/reddit-logo.png differ
diff --git a/target/classes/com/example/reddit/searchFinds.fxml b/target/classes/com/example/reddit/searchFinds.fxml
new file mode 100644
index 0000000..d9cb98b
--- /dev/null
+++ b/target/classes/com/example/reddit/searchFinds.fxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+