Skip to content

Commit

Permalink
#187: adds simple app to provide a clean background for screencasts
Browse files Browse the repository at this point in the history
  • Loading branch information
rladstaetter committed Jan 1, 2024
1 parent ab1ee1d commit b185707
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .run/ScreenCastBackgroundApp.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ScreenCastBackgroundApp" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="app.logorrr.docs.ScreenCastBackgroundApp" />
<module name="docs" />
<option name="VM_PARAMETERS" value="-Xmx4g -Djava.util.logging.config.file=develop-logging.properties -Djava.library.path=$PROJECT_DIR$/native/native-osx/target -Duser.language=en --module-path $PROJECT_DIR$/env/target/javafx-sdk-21.0.1/lib --add-modules javafx.controls,javafx.fxml --add-exports javafx.base/com.sun.javafx.binding=ALL-UNNAMED" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="app.logorrr.docs.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
40 changes: 40 additions & 0 deletions docs/src/main/scala/app/logorrr/docs/ScreenCastBackgroundApp.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package app.logorrr.docs

import app.logorrr.docs.Area._
import app.logorrr.util.CanLog
import javafx.application.Application
import javafx.geometry.Insets
import javafx.scene.Scene
import javafx.scene.layout.{Background, BackgroundFill, BorderPane}
import javafx.scene.paint.Color
import javafx.scene.shape.Rectangle
import javafx.stage.Stage

/**
* White background for screencasts
*/
object ScreenCastBackgroundApp {

def main(args: Array[String]): Unit = {
javafx.application.Application.launch(classOf[ScreenCastBackgroundApp], args: _*)
}
}

class ScreenCastBackgroundApp extends javafx.application.Application with CanLog {

def start(stage: Stage): Unit = {
Application.setUserAgentStylesheet("/app/logorrr/LogoRRR.css")
val s0 = R1280x800

val rectangle = new Rectangle(s0.width,s0.height)
rectangle.setFill(Color.WHITE)
val pane = new BorderPane(rectangle)
pane.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null)))
pane.setPadding(new Insets(100, 100, 100, 100))
val scene = new Scene(pane)
stage.setScene(scene)
stage.show()
}


}

0 comments on commit b185707

Please sign in to comment.