Skip to content

Commit a4ccc31

Browse files
committed
examples (as for versions)
1 parent 4a07677 commit a4ccc31

File tree

11 files changed

+200
-0
lines changed

11 files changed

+200
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package lk.vivoxalabs.customstage.test;
2+
3+
import javafx.application.Application;
4+
import javafx.scene.image.Image;
5+
import javafx.stage.Stage;
6+
import lk.vivoxalabs.customstage.CustomStage;
7+
import lk.vivoxalabs.customstage.CustomStageBuilder;
8+
9+
/**
10+
* Created by oshan on 12-Mar-18.
11+
*
12+
* @author oshan
13+
*/
14+
public class CustomIconStage extends Application {
15+
16+
public static void main(String[] args) {
17+
launch(args);
18+
}
19+
20+
@Override
21+
public void start(Stage primaryStage) throws Exception {
22+
CustomStage stage = new CustomStageBuilder()
23+
.setIcon("/lk/vivoxalabs/customstage/test/logo.png")
24+
//Icons for close,minimize,maximize/restore buttons
25+
//Icon size should be equal or lower than 30px
26+
.setActionIcons(new Image("/lk/vivoxalabs/customstage/test/btnClose.png"),
27+
new Image("/lk/vivoxalabs/customstage/test/btnMinimize.png"),
28+
new Image("/lk/vivoxalabs/customstage/test/btnMaximize.png"),
29+
new Image("/lk/vivoxalabs/customstage/test/btnRestore.png")) //change default icons for action buttons
30+
.setWindowTitle("Custom Icons")
31+
//Title color
32+
.setTitleColor("white")
33+
//Window color (Transparent)
34+
.setWindowColor("gray") //With transparency (hex value [with alpha] can also be used)
35+
.setButtonHoverColor("lightgray")
36+
//Builds the CustomStage
37+
.build();
38+
39+
stage.show();
40+
}
41+
}

examples/v1.0.0/Dashboard.fxml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import com.jfoenix.controls.JFXButton?>
4+
<?import javafx.scene.Group?>
5+
<?import javafx.scene.control.Label?>
6+
<?import javafx.scene.control.TextField?>
7+
<?import javafx.scene.image.Image?>
8+
<?import javafx.scene.image.ImageView?>
9+
<?import javafx.scene.layout.AnchorPane?>
10+
<?import javafx.scene.layout.StackPane?>
11+
<?import javafx.scene.text.Font?>
12+
13+
<AnchorPane fx:id="root" prefHeight="400.0" prefWidth="600.0" style="-fx-border-color: transparent;" xmlns="http://javafx.com/javafx/9" xmlns:fx="http://javafx.com/fxml/1">
14+
<children>
15+
<StackPane fx:id="rootStack" layoutY="3.0" prefHeight="400.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
16+
<children>
17+
<Group>
18+
<children>
19+
<Label layoutX="23.0" layoutY="153.0" text="Drag and drop paper JSON File Here" textFill="#75aaff">
20+
<font>
21+
<Font size="18.0" />
22+
</font>
23+
</Label>
24+
<TextField fx:id="txtPath" editable="false" layoutY="197.0" prefHeight="26.0" prefWidth="337.0" />
25+
<ImageView fitHeight="150.0" fitWidth="200.0" layoutX="94.0" pickOnBounds="true" preserveRatio="true">
26+
<image>
27+
<Image url="@../util/icons/upload.png" />
28+
</image>
29+
</ImageView>
30+
<JFXButton buttonType="RAISED" disable="true" layoutX="102.0" layoutY="252.0" mnemonicParsing="false" prefHeight="32.0" prefWidth="150.0" style="-fx-background-color: #397bd6;" text="Next" textFill="WHITE">
31+
<font>
32+
<Font size="18.0" />
33+
</font>
34+
</JFXButton>
35+
</children>
36+
</Group>
37+
</children>
38+
</StackPane>
39+
</children>
40+
</AnchorPane>

examples/v1.0.0/StageTest.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package lk.vivoxalabs.customstage.test;
2+
3+
import javafx.application.Application;
4+
import javafx.fxml.FXMLLoader;
5+
import javafx.stage.Stage;
6+
import lk.vivoxalabs.customstage.CustomStage;
7+
import lk.vivoxalabs.customstage.CustomStageBuilder;
8+
9+
/**
10+
* Created by oshan on 08-Mar-18.
11+
*
12+
* @author oshan
13+
*/
14+
public class StageTest extends Application{
15+
16+
public static void main(String args[]){
17+
launch(args);
18+
}
19+
20+
@Override
21+
public void start(Stage primaryStage) throws Exception {
22+
23+
//Whole usage of CustomStage
24+
25+
CustomStage stage = new CustomStageBuilder()
26+
//Minimum, Maximum values of the window size
27+
// .setDimensions(0,0,1920,1080) // change values the minW,minH,maxW,maxH of the window
28+
//Icons for close,minimize,maximize/restore buttons
29+
// .setActionIcons(null,null,null,null) //change default icons for action buttons
30+
//Application Icon
31+
.setIcon("/lk/vivoxalabs/customstage/test/logo.png")
32+
.setStyleSheet(StageTest.class.getResource("testCss.css"))
33+
//Title of the window
34+
.setWindowTitle("Custom Stage")
35+
//Title color
36+
.setTitleColor("yellow")
37+
//Window color
38+
.setWindowColor("rgb(34,54,122)")
39+
//Window color (Transparent)
40+
// .setWindowColor("rgba(34,54,122,0.6)") //With transparency (hex value [with alpha] can also be used)
41+
//Action button colors (close/minimize/maximize)
42+
// .setButtonColor("#FF56AA") // takes the window's color by default
43+
//Action button hover colors (close/minimize/maximize)
44+
.setButtonHoverColor("yellow")
45+
//Set the navigation pane
46+
// .setLeft_navigationPane(new AnchorPane())
47+
//CustomStage without a navigation panel
48+
// .removeNavigationPane()
49+
//Builds the CustomStage
50+
.build();
51+
52+
stage.show();
53+
54+
//Change the scene of the window
55+
stage.changeScene(FXMLLoader.load(getClass().getResource("/lk/vivoxalabs/customstage/test/Dashboard.fxml")));
56+
}
57+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package lk.vivoxalabs.customstage.test;
2+
3+
import javafx.application.Application;
4+
import javafx.stage.Stage;
5+
import lk.vivoxalabs.customstage.CustomStage;
6+
import lk.vivoxalabs.customstage.CustomStageBuilder;
7+
8+
/**
9+
* Created by oshan on 12-Mar-18.
10+
*
11+
* @author oshan
12+
*/
13+
public class TransparentStage extends Application{
14+
15+
public static void main(String[] args) {
16+
launch(args);
17+
}
18+
19+
@Override
20+
public void start(Stage primaryStage) throws Exception {
21+
CustomStage transparentStage = new CustomStageBuilder()
22+
.setIcon("/lk/vivoxalabs/customstage/test/logo.png")
23+
.setWindowTitle("Custom Stage Transparent")
24+
//Title color
25+
.setTitleColor("white")
26+
//Window color (Transparent)
27+
.setWindowColor("rgba(34,54,122,0.6)") //With transparency (hex value [with alpha] can also be used)
28+
.setButtonHoverColor("lightgray")
29+
//Builds the CustomStage
30+
.build();
31+
32+
transparentStage.show();
33+
}
34+
}

examples/v1.0.0/btnClose.png

761 Bytes
Loading

examples/v1.0.0/btnMaximize.png

663 Bytes
Loading

examples/v1.0.0/btnMinimize.png

632 Bytes
Loading

examples/v1.0.0/btnRestore.png

460 Bytes
Loading

examples/v1.0.0/logo.png

728 KB
Loading

examples/v1.0.0/testCss.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.action-button{
2+
-fx-pref-height: 29px;
3+
-fx-pref-width: 45px;
4+
-fx-min-width: 45px;
5+
-fx-min-height: 29px;
6+
-fx-border-radius: 0;
7+
}
8+
9+
#btnClose{
10+
-fx-graphic: url("/lk/vivoxalabs/customstage/util/icons/close.png");
11+
}
12+
#btnMin{
13+
-fx-graphic: url("/lk/vivoxalabs/customstage/util/icons/minimize.png");
14+
}
15+
#btnMax{
16+
-fx-graphic: url("/lk/vivoxalabs/customstage/util/icons/maximize.png");
17+
}
18+
19+
#dynamicPane{
20+
-fx-background-color: green;
21+
}

0 commit comments

Comments
 (0)