本文整理汇总了Java中javafx.scene.layout.Pane.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java Pane.setStyle方法的具体用法?Java Pane.setStyle怎么用?Java Pane.setStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.Pane
的用法示例。
在下文中一共展示了Pane.setStyle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: aendereReihenfolge
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void aendereReihenfolge(){
Stage stage = new Stage();
Label l = new Label("Reihenfolge festlegen:");
l.setStyle("-fx-text-fill: white");
l.setFont(Font.font(settingsFontSize));
l.setTranslateY(25);
l.setTranslateX(25);
TextField tf = new TextField(String.valueOf(orderId+1));
tf.setFont(Font.font(settingsFontSize-3));
tf.setTranslateX(25);
tf.setTranslateY(60);
Button b = new Button("Speichern");
b.setFont(Font.font(settingsFontSize));
b.setTranslateX(25);
b.setTranslateY(120);
b.setOnAction(e -> {
orderId = Integer.parseInt(tf.getText())-1;
stage.close();
Plugin_Gleisbelegung.sortiereGleiseListener();
});
Pane p = new Pane(l,tf,b);
p.setStyle("-fx-background-color: #303030");
p.setMinSize(500,200);
p.setMaxSize(500, 200);
Scene scene = new Scene(p, 300,200);
stage.setScene(scene);
stage.show();
stage.setAlwaysOnTop(true);
}
示例2: start
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
if (primaryStage == null) {
return;
}
/* Layers */
Group backgroundLayer = new Group();
Group statesLayer = new Group();
Group selectionLayer = new Group();
Pane paintingPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
paintingPane.setStyle(BACKGROUND_STYLE);
/* Top-level */
Pane contentPane = new Pane(paintingPane);
contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());
ScrollPane scrollPane = new ScrollPane(contentPane);
scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
scrollPane.setFitToHeight(true);
scrollPane.setFitToWidth(true);
scrollPane.setPannable(true);
BorderPane borderPane = new BorderPane(scrollPane);
primaryStage.setScene(new Scene(borderPane));
primaryStage.show();
primaryStage.setHeight(500);
primaryStage.setWidth(500);
contentPane.setPrefHeight(200);
contentPane.setPrefWidth(PANE_WIDTH);
/* Bind painting pane's height to the content pane */
paintingPane.minHeightProperty().bind(contentPane.minHeightProperty());
paintingPane.prefHeightProperty().bind(contentPane.prefHeightProperty());
paintingPane.maxHeightProperty().bind(contentPane.maxHeightProperty());
/* We set painting's pane width programmatically */
paintingPane.minWidthProperty().bind(paintingPane.prefWidthProperty());
paintingPane.maxWidthProperty().bind(paintingPane.prefWidthProperty());
paintingPane.setPrefWidth(2000);
double x = PANE_WIDTH - 2000;
System.out.println(x);
paintingPane.relocate(x, 0);
drawBackground(backgroundLayer, paintingPane);
drawRectangles(statesLayer);
drawSelection(selectionLayer, paintingPane);
}
示例3: start
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
if (primaryStage == null) {
return;
}
/* Layers */
Group backgroundLayer = new Group();
Group statesLayer = new Group();
Group selectionLayer = new Group();
/* Top-level */
Pane contentPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());
contentPane.setStyle(BACKGROUND_STYLE);
ScrollPane scrollPane = new ScrollPane(contentPane);
scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
scrollPane.setFitToHeight(true);
scrollPane.setFitToWidth(true);
scrollPane.setPannable(true);
BorderPane borderPane = new BorderPane(scrollPane);
primaryStage.setScene(new Scene(borderPane));
primaryStage.show();
primaryStage.setHeight(500);
primaryStage.setWidth(500);
contentPane.setPrefHeight(200);
contentPane.setPrefWidth(PANE_WIDTH);
drawBackground(backgroundLayer, contentPane);
drawRectangles(statesLayer);
drawSelection(selectionLayer, contentPane);
}
示例4: openLogWindow
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void openLogWindow(){
Stage stage = new Stage();
//Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter werden deine Log-Datei und deine Anregungen anonym hochgeladen.");
Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter wird deine Log-Datei anonym hochgeladen.");
l.setStyle("-fx-text-fill: white");
l.setFont(Font.font(settingsFontSize));
l.setWrapText(true);
l.setMaxWidth(450);
l.setTranslateY(25);
l.setTranslateX(25);
/*TextField ta = new TextField();
ta.setFont(Font.font(settingsFontSize-3));
ta.setTranslateX(25);
ta.setTranslateY(125);
ta.setPrefWidth(450);
ta.setPrefHeight(100);*/
Button bno = new Button("Abbrechen");
bno.setFont(Font.font(settingsFontSize));
bno.setOnAction(e -> stage.close());
bno.setTranslateX(250);
bno.setTranslateY(150);
Button byes = new Button("Weiter");
byes.setFont(Font.font(settingsFontSize));
byes.setTranslateX(150);
byes.setTranslateY(150);
byes.setOnAction(e -> {
byes.setDisable(true);
bno.setDisable(true);
Runnable r = () -> {
sendLogFile(l);
};
new Thread(r).start();
});
Pane p = new Pane(l, byes, bno);
p.setStyle("-fx-background-color: #303030");
p.setMinSize(500,200);
p.setMaxSize(500, 200);
Scene s = new Scene(p,500,200);
stage.setScene(s);
stage.setTitle("Log-Datei senden?");
stage.setAlwaysOnTop(true);
stage.show();
}
示例5: setActive
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
/**
* Sets the style active
* If <tt>name</tt> is null, the style will be temporary
*/
public void setActive() {
Jrfl.ACTIVE_STYLE = this;
Jrfl.cache.set("selected-style", name);
Jrfl.cache.store(true);
Pane pane = ((Pane) JavaFX.getRoot());
pane.getChildrenUnmodifiable().forEach(n -> n.setStyle(""));
Nodes.TEXT_VBOX.getChildrenUnmodifiable().forEach(n -> n.setStyle(""));
pane.setStyle("-fx-background-color: " + configuration.get("background.color"));
new JrflRectangle(); new JrflLabel(); new JrflTextField();
}
示例6: start
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
if (stage == null) {
return;
}
Rectangle clipRect1 = new Rectangle(-130, -130, 115, 115);
Rectangle clipRect2 = new Rectangle(15, -130, 115, 115);
Rectangle clipRect3 = new Rectangle(-130, 15, 115, 115);
Rectangle clipRect4 = new Rectangle(15, 15, 115, 115);
Group clip = new Group(clipRect1, clipRect2, clipRect3, clipRect4);
Circle spinnanCircle = new Circle(100);
spinnanCircle.setFill(null);
spinnanCircle.setStrokeWidth(30);
spinnanCircle.setStroke(LTTNG_PURPLE);
spinnanCircle.setClip(clip);
Circle magCircle = new Circle(60);
magCircle.setFill(null);
magCircle.setStrokeWidth(25);
magCircle.setStroke(LTTNG_LIGHT_BLUE);
Rectangle magHandle = new Rectangle(-12.5, 60, 25, 110);
magHandle.setFill(LTTNG_LIGHT_BLUE);
Group mag = new Group(magCircle, magHandle);
Group root = new Group(spinnanCircle, mag);
root.setRotate(30);
root.relocate(0, 0);
Pane pane = new Pane(root);
pane.setStyle(BACKGROUND_STYLE);
RotateTransition spinnan = new RotateTransition(Duration.seconds(4), spinnanCircle);
spinnan.setByAngle(360);
spinnan.setCycleCount(Animation.INDEFINITE);
spinnan.setInterpolator(Interpolator.LINEAR);
Scene scene = new Scene(pane);
stage.setScene(scene);
stage.show();
spinnan.play();
}
示例7: getPane
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@Override
public Pane getPane() {
Pane pane=new StackPane();
pane.setStyle("-fx-background-color:red");
return pane;
}
示例8: start
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
if (primaryStage == null) {
return;
}
Pane pane = new Pane();
pane.setStyle("-fx-background-color:white");
new RubberBandSelection( pane);
double width = 200;
double height = 160;
double padding = 20;
for( int row=0; row < 4; row++) {
for( int col=0; col < 4; col++) {
Selectable selectable = new Selectable( width, height);
selectable.relocate( padding * (col+1) + width * col, padding * (row + 1) + height * row);
pane.getChildren().add(selectable);
dragMouseGestures.makeDraggable(selectable);
}
}
Label infoLabel = new Label( "Drag on scene for Rubberband Selection. Shift+Click to add to selection, CTRL+Click to toggle selection. Drag selected nodes for multi-dragging.");
pane.getChildren().add( infoLabel);
Scene scene = new Scene( pane, 1600, 900);
scene.getStylesheets().add( getClass().getResource("application.css").toExternalForm());
primaryStage.setScene( scene);
primaryStage.show();
}