-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from FlorianKirmaier/master
Our Changes to the Sampler for the JPro-Demo-Page
- Loading branch information
Showing
9 changed files
with
166 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2015-2018 Andres Almiray | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
apply plugin: 'application' | ||
apply plugin: 'com.sandec.jpro' | ||
|
||
mainClassName = 'org.kordamp.bootstrapfx.SamplerJPro' | ||
|
||
dependencies { | ||
compile project(':sampler') | ||
} |
55 changes: 55 additions & 0 deletions
55
subprojects/sampler-jpro/src/main/java/org/kordamp/bootstrapfx/SamplerJPro.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2015-2018 Andres Almiray | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package org.kordamp.bootstrapfx; | ||
|
||
import javafx.application.Application; | ||
import javafx.scene.Scene; | ||
import javafx.scene.layout.StackPane; | ||
import javafx.stage.Stage; | ||
|
||
/** | ||
* @author Florian Kirmaier | ||
*/ | ||
public class SamplerJPro extends Application { | ||
@Override | ||
public void start(Stage primaryStage) throws Exception { | ||
|
||
StackPane innerPane = new StackPane(new DemoTabPane()); | ||
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", | ||
"org/kordamp/bootstrapfx/xml-highlighting.css"); | ||
|
||
primaryStage.setTitle("BootstrapFX Sampler"); | ||
primaryStage.setScene(scene); | ||
primaryStage.show(); | ||
} | ||
|
||
} |
Binary file added
BIN
+78.9 KB
.../sampler-jpro/src/main/resources/org/kordamp/bootstrapfx/ambient-background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
subprojects/sampler/src/main/java/org/kordamp/bootstrapfx/DemoTabPane.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.kordamp.bootstrapfx; | ||
|
||
import javafx.fxml.FXMLLoader; | ||
import javafx.geometry.Side; | ||
import javafx.scene.Node; | ||
import javafx.scene.control.Tab; | ||
import javafx.scene.control.TabPane; | ||
import javafx.scene.layout.StackPane; | ||
import org.apache.commons.io.IOUtils; | ||
|
||
import java.net.URL; | ||
|
||
public class DemoTabPane extends StackPane { | ||
|
||
public DemoTabPane() throws Exception { | ||
URL location = getClass().getResource("sampler.fxml"); | ||
FXMLLoader fxmlLoader = new FXMLLoader(location); | ||
TabPane tabPane = fxmlLoader.load(); | ||
|
||
tabPane.getTabs().add(new DemoTab("Buttons", "buttons.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Labels", "labels.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Alerts", "alerts.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Panels", "panels.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Headings", "text.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Progress Bars", "progressbars.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Tooltips ", "tooltips.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Text ", "text2.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Paragraph ", "paragraph.fxml")); | ||
tabPane.getTabs().add(new DemoTab("Button Groups ", "button_groups.fxml")); | ||
tabPane.getTabs().add(new DemoTab("SplitMenuButtons", "split_menu_buttons.fxml")); | ||
|
||
getChildren().add(tabPane); | ||
} | ||
|
||
private static class DemoTab extends Tab { | ||
private DemoTab(String title, String sourceFile) throws Exception { | ||
super(title); | ||
setClosable(false); | ||
|
||
TabPane content = new TabPane(); | ||
setContent(content); | ||
content.setSide(Side.BOTTOM); | ||
|
||
Tab widgets = new Tab("Widgets"); | ||
widgets.setClosable(false); | ||
URL location = getClass().getResource(sourceFile); | ||
FXMLLoader fxmlLoader = new FXMLLoader(location); | ||
Node node = fxmlLoader.load(); | ||
widgets.setContent(node); | ||
|
||
Tab source = new Tab("Source"); | ||
source.setClosable(false); | ||
XMLEditor editor = new XMLEditor(); | ||
editor.setEditable(false); | ||
|
||
String text = IOUtils.toString(getClass().getResourceAsStream(sourceFile)); | ||
editor.setText(text); | ||
source.setContent(editor); | ||
|
||
content.getTabs().addAll(widgets, source); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters