Skip to content

Commit

Permalink
Added JPro to the sampler project.
Browse files Browse the repository at this point in the history
Added a link to the online-demo at jpro.one.
Added an ambient background to the sampler.
The sampler now also works as a jar. Previously, it couldn't properly load the text of the fxml-files.
  • Loading branch information
FlorianKirmaier committed Nov 12, 2018
1 parent e596325 commit 9d4ba01
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ stylesheet that closely resembles the original while being custom tailored for J
It's worth mentioning that Twitter Bootstrap delivers more than just a standardized look for common widgets. It also
provides new widgets, behavior and a grid system. Some of these features may be ported at a later stage to BootstrapFX.

There is an link:https://demos.jpro.one/bootstrapfx.html[online-version] available at link:https://jpro.one/[jpro.one].

== Installing

You can get the latest version of **BootstrapFX** directly from link:https://bintray.com[Bintray's JCenter] repository or Maven Central.
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ buildscript {
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
maven {
url "https://sandec.bintray.com/repo"
}
}

dependencies {
Expand All @@ -34,6 +37,7 @@ buildscript {
classpath 'org.kordamp.gradle:stats-gradle-plugin:0.2.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
classpath 'net.nemerosa:versioning:2.7.1'
classpath "com.sandec.jpro:jpro-plugin-gradle:2018.1.8"
}
}

Expand Down Expand Up @@ -81,6 +85,7 @@ allprojects {
subprojects { subproj ->
apply plugin: 'java'
apply plugin: 'org.kordamp.gradle.stats'
apply plugin: 'com.sandec.jpro'
apply from: rootProject.file('gradle/code-quality.gradle')
apply from: rootProject.file('gradle/javafx.gradle')

Expand Down
1 change: 1 addition & 0 deletions subprojects/sampler/sampler.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ mainClassName = 'org.kordamp.bootstrapfx.Sampler'
dependencies {
compile project(':bootstrapfx-core')
compile 'org.fxmisc.richtext:richtextfx:0.9.1'
compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

import java.net.URL;
import java.nio.file.Paths;
import org.apache.commons.io.IOUtils;

import static java.nio.file.Files.lines;
import static java.util.stream.Collectors.joining;
Expand All @@ -55,7 +58,15 @@ public void start(Stage primaryStage) throws Exception {
tabPane.getTabs().add(new DemoTab("Button Groups ", "button_groups.fxml"));
tabPane.getTabs().add(new DemoTab("SplitMenuButtons", "split_menu_buttons.fxml"));

Scene scene = new Scene(tabPane);
StackPane innerPane = new StackPane(tabPane);
innerPane.setMaxWidth(1000);
innerPane.setMaxHeight(600);
innerPane.setStyle("-fx-background-color: #ddd; -fx-background-radius: 10;");
StackPane outerPane = new StackPane(innerPane);
outerPane.setStyle("-fx-background-image: url('/org/kordamp/bootstrapfx/ambient-background.jpg');" +
"-fx-background-size: cover;");

Scene scene = new Scene(outerPane);
scene.getStylesheets().addAll(
"org/kordamp/bootstrapfx/bootstrapfx.css",
"org/kordamp/bootstrapfx/sampler.css",
Expand Down Expand Up @@ -89,7 +100,7 @@ private DemoTab(String title, String sourceFile) throws Exception {
XMLEditor editor = new XMLEditor();
editor.setEditable(false);

String text = lines(Paths.get(getClass().getResource(sourceFile).toURI())).collect(joining("\n"));
String text = IOUtils.toString(getClass().getResourceAsStream(sourceFile));
editor.setText(text);
source.setContent(editor);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d4ba01

Please sign in to comment.