From 601fad6433d785e8c46a544d7801d63e2d3f5a71 Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Sat, 16 May 2020 16:46:35 +0530 Subject: [PATCH] first commit --- .gitignore | 11 + .scalafmt.conf | 1 + CHANGES.md | 7 + README.md | 6 +- build.sbt | 84 + project/build.properties | 1 + project/metals.sbt | 4 + project/plugin.sbt | 6 + src/main/resources/META-INF/beans.xml | 0 src/main/resources/application.conf | 8 + .../resources/bundles/application.properties | 1 + .../bundles/application_de.properties | 1 + src/main/resources/fxml/Chat.fxml | 67 + src/main/resources/fxml/Login.fxml | 76 + src/main/resources/fxml/MainView.fxml | 71 + src/main/resources/fxml/Navigation.fxml | 20 + src/main/resources/fxml/UserBox.fxml | 20 + src/main/resources/fxml/Workspace.fxml | 17 + src/main/resources/fxml/default.css | 29 + src/main/resources/images/backgroung.jpg | Bin 0 -> 51296 bytes src/main/resources/logback.xml | 14 + src/main/resources/styles/bootstrapfx.css | 1513 +++++++++++++++++ src/main/resources/styles/markdown.css | 18 + src/main/resources/styles/style2.css | 16 + src/main/resources/styles/ui.css | 57 + src/main/resources/styles/userbox.css | 30 + .../scala/wow/doge/chatto/Application.scala | 9 + .../doge/chatto/ApplicationController.scala | 102 ++ .../scala/wow/doge/chatto/config/Beans.scala | 10 + .../wow/doge/chatto/control/UserBox.scala | 52 + .../controller/AbstractViewController.scala | 37 + .../chatto/controller/ChatController.scala | 80 + .../chatto/controller/LoginController.scala | 160 ++ .../controller/MainViewController.scala | 54 + .../controller/NavigationController.scala | 18 + .../controller/StatusBarController.scala | 46 + .../controller/WorkspaceController.scala | 21 + .../wow/doge/chatto/messagebubble/Bubble.java | 81 + .../doge/chatto/messagebubble/BubbleSpec.java | 23 + .../chatto/messagebubble/BubbledLabel.java | 178 ++ .../chatto/messagebubble/BubbledMDFXNode.java | 135 ++ .../wow/doge/chatto/model/ChatUser.scala | 10 + .../wow/doge/chatto/service/UserService.scala | 46 + .../scala/wow/doge/chatto/types/Types.scala | 14 + version.sbt | 2 + 45 files changed, 3155 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .scalafmt.conf create mode 100644 CHANGES.md create mode 100644 build.sbt create mode 100644 project/build.properties create mode 100644 project/metals.sbt create mode 100644 project/plugin.sbt create mode 100644 src/main/resources/META-INF/beans.xml create mode 100644 src/main/resources/application.conf create mode 100644 src/main/resources/bundles/application.properties create mode 100644 src/main/resources/bundles/application_de.properties create mode 100644 src/main/resources/fxml/Chat.fxml create mode 100644 src/main/resources/fxml/Login.fxml create mode 100644 src/main/resources/fxml/MainView.fxml create mode 100644 src/main/resources/fxml/Navigation.fxml create mode 100644 src/main/resources/fxml/UserBox.fxml create mode 100644 src/main/resources/fxml/Workspace.fxml create mode 100644 src/main/resources/fxml/default.css create mode 100644 src/main/resources/images/backgroung.jpg create mode 100644 src/main/resources/logback.xml create mode 100644 src/main/resources/styles/bootstrapfx.css create mode 100644 src/main/resources/styles/markdown.css create mode 100644 src/main/resources/styles/style2.css create mode 100644 src/main/resources/styles/ui.css create mode 100644 src/main/resources/styles/userbox.css create mode 100644 src/main/scala/wow/doge/chatto/Application.scala create mode 100644 src/main/scala/wow/doge/chatto/ApplicationController.scala create mode 100644 src/main/scala/wow/doge/chatto/config/Beans.scala create mode 100644 src/main/scala/wow/doge/chatto/control/UserBox.scala create mode 100644 src/main/scala/wow/doge/chatto/controller/AbstractViewController.scala create mode 100644 src/main/scala/wow/doge/chatto/controller/ChatController.scala create mode 100644 src/main/scala/wow/doge/chatto/controller/LoginController.scala create mode 100644 src/main/scala/wow/doge/chatto/controller/MainViewController.scala create mode 100644 src/main/scala/wow/doge/chatto/controller/NavigationController.scala create mode 100644 src/main/scala/wow/doge/chatto/controller/StatusBarController.scala create mode 100644 src/main/scala/wow/doge/chatto/controller/WorkspaceController.scala create mode 100644 src/main/scala/wow/doge/chatto/messagebubble/Bubble.java create mode 100644 src/main/scala/wow/doge/chatto/messagebubble/BubbleSpec.java create mode 100644 src/main/scala/wow/doge/chatto/messagebubble/BubbledLabel.java create mode 100644 src/main/scala/wow/doge/chatto/messagebubble/BubbledMDFXNode.java create mode 100644 src/main/scala/wow/doge/chatto/model/ChatUser.scala create mode 100644 src/main/scala/wow/doge/chatto/service/UserService.scala create mode 100644 src/main/scala/wow/doge/chatto/types/Types.scala create mode 100644 version.sbt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff2ae26 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.idea* +*.iml +project/target +target +lib +out +.DS_Store +.gitconfig +.vscode +.bloop +.metals diff --git a/.scalafmt.conf b/.scalafmt.conf new file mode 100644 index 0000000..f4a5aed --- /dev/null +++ b/.scalafmt.conf @@ -0,0 +1 @@ +version = "2.4.2" diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..533765f --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,7 @@ +# Changes # + +## Versions + +### 0.1.0-SNAPSHOT + +* initial Version \ No newline at end of file diff --git a/README.md b/README.md index 243604d..3735cc9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # Chatto-Desktop-ScalaFX -WIP desktop client for Chatto reimplemented in ScalaFX and Sapphire Framework \ No newline at end of file +WIP desktop client for Chatto reimplemented in ScalaFX and Sapphire Framework + +## Based on Sapphire + +A JavaFX Application Framework for Scala User. [https://sfxcode.github.io/sapphire-core](https://sfxcode.github.io/sapphire-core) diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..4bec638 --- /dev/null +++ b/build.sbt @@ -0,0 +1,84 @@ +name := "chatto-sapphire" + +organization := "wow.doge" + +scalaVersion := "2.13.1" + +mainClass := Some("wow.doge.chatto.Application") + +resolvers += "sfxcode-maven" at "https://bintray.com/sfxcode/maven/" +resolvers += "javafx-markdown-renderer" at "https://sandec.bintray.com/repo" + +libraryDependencies += "org.specs2" %% "specs2-core" % "4.7.1" % Test + +val JavaFXVersion = "11.0.2" + +val osName = System.getProperty("os.name") match { + case n if n.startsWith("Linux") => "linux" + case n if n.startsWith("Mac") => "mac" + case n if n.startsWith("Windows") => "win" + case _ => throw new Exception("Unknown platform!") +} + +fork := true + +libraryDependencies ++= Seq( + "base", + "controls", + "fxml", + "graphics", + "media", + "swing", + "web" +).map(m => "org.openjfx" % s"javafx-$m" % JavaFXVersion classifier osName) + +libraryDependencies += "com.sfxcode.sapphire" %% "sapphire-core" % "1.7.3" + +libraryDependencies += "com.sfxcode.sapphire" %% "sapphire-extension" % "1.0.6" + +libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3" + +libraryDependencies ++= Seq( + "org.scalafx" %% "scalafx" % "12.0.2-R18", + "org.scalafx" %% "scalafx-extras" % "0.3.4", + "com.softwaremill.sttp.client" %% "json4s" % "2.1.1", + "org.json4s" %% "json4s-native" % "3.6.7", + "org.scala-lang.modules" %% "scala-async" % "0.10.0", + "org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided, + // "org.kordamp.ikonli" %% "ikonli-javafx" % "11.4.0", + // "org.kordamp.ikonli" %% "ikonli-fontawesome-pack" % "11.4.0", + // "org.kordamp.ikonli" %% "ikonli-fontawesome5-pack" % "11.4.0", + "org.jsoup" % "jsoup" % "1.13.1", + "com.sandec" % "mdfx" % "0.1.6", + "com.softwaremill.sttp.client" %% "async-http-client-backend-future" % "2.1.1", + "com.softwaremill.quicklens" %% "quicklens" % "1.5.0" +) +libraryDependencies += "org.asynchttpclient" % "async-http-client" % "2.12.1" +libraryDependencies += "com.softwaremill.macwire" %% "macros" % "2.3.3" +scalacOptions ++= Seq("-Ymacro-annotations", "-deprecation") + +libraryDependencies += "org.scalafx" %% "scalafxml-core-sfx8" % "0.5" +// https://mvnrepository.com/artifact/com.jfoenix/jfoenix +libraryDependencies += "com.jfoenix" % "jfoenix" % "9.0.9" +// https://mvnrepository.com/artifact/org.kordamp.bootstrapfx/bootstrapfx-core +libraryDependencies += "org.kordamp.bootstrapfx" % "bootstrapfx-core" % "0.2.4" + +enablePlugins(BuildInfoPlugin) + +buildInfoPackage := "wow.doge.chatto" + +buildInfoOptions += BuildInfoOption.BuildTime + +enablePlugins(JavaFxPlugin) + +javaFxMainClass := "wow.doge.chatto.Application" + +javaFxJvmargs := Seq("-Xms512m", "-Xmx1024m", "-XX:ReservedCodeCacheSize=128m") + +javaFxTitle := "chatto-sapphire" + +javaFxCategory := "Aplication" + +javaFxNativeBundles := "image" + +javaFxVerbose := true diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 0000000..a919a9b --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.3.8 diff --git a/project/metals.sbt b/project/metals.sbt new file mode 100644 index 0000000..e36d9e9 --- /dev/null +++ b/project/metals.sbt @@ -0,0 +1,4 @@ +// DO NOT EDIT! This file is auto-generated. +// This file enables sbt-bloop to create bloop config files. + +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.0-RC1-229-b7c15aa9") diff --git a/project/plugin.sbt b/project/plugin.sbt new file mode 100644 index 0000000..56e0685 --- /dev/null +++ b/project/plugin.sbt @@ -0,0 +1,6 @@ +addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.0") + +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") + +addSbtPlugin("com.quadstingray" % "sbt-javafx" % "1.5.2") + diff --git a/src/main/resources/META-INF/beans.xml b/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf new file mode 100644 index 0000000..98fce76 --- /dev/null +++ b/src/main/resources/application.conf @@ -0,0 +1,8 @@ +sapphire.core.fxml.basePath="/fxml/" +application.name = "Application" +project.name = "chatto-sapphire" +project.version = "0.1.0-SNAPSHOT" +stage.default { + height = 600 + width = 800 +} \ No newline at end of file diff --git a/src/main/resources/bundles/application.properties b/src/main/resources/bundles/application.properties new file mode 100644 index 0000000..d527374 --- /dev/null +++ b/src/main/resources/bundles/application.properties @@ -0,0 +1 @@ +navigation.toggle=Toggle Workspace \ No newline at end of file diff --git a/src/main/resources/bundles/application_de.properties b/src/main/resources/bundles/application_de.properties new file mode 100644 index 0000000..dee264b --- /dev/null +++ b/src/main/resources/bundles/application_de.properties @@ -0,0 +1 @@ +navigation.toggle=Bereich wechseln \ No newline at end of file diff --git a/src/main/resources/fxml/Chat.fxml b/src/main/resources/fxml/Chat.fxml new file mode 100644 index 0000000..7b2beb4 --- /dev/null +++ b/src/main/resources/fxml/Chat.fxml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +