本文整理汇总了Java中javafx.scene.layout.StackPane.setPadding方法的典型用法代码示例。如果您正苦于以下问题:Java StackPane.setPadding方法的具体用法?Java StackPane.setPadding怎么用?Java StackPane.setPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.StackPane
的用法示例。
在下文中一共展示了StackPane.setPadding方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(graph);
pane.setPadding(new Insets(10));
pane.setBackground(new Background(new BackgroundFill(Color.rgb(40, 40, 40), CornerRadii.EMPTY, Insets.EMPTY)));
Scene scene = new Scene(pane);
stage.setTitle("Radial Chart");
stage.setScene(scene);
stage.show();
timer.start();
}
示例2: alert
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
/**
*
* Creates a scene, that has a label with a message, and is modal
*
* @param alertMSG String to be turned into a label
*/
protected void alert(String alertMSG){
Label label = new Label(alertMSG);
label.setFont(new Font(20));
label.setStyle("-fx-text-fill: white;");
label.setFont(new Font(20));
StackPane stackPane = new StackPane();
stackPane.setStyle("-fx-background-color: #cf1020");
stackPane.setPadding(new Insets(20,20,20,20));
stackPane.getChildren().add(label);
Scene scene = new Scene(stackPane);
Main.getAlertWindow().setScene(scene);
if (!(Main.getAlertWindow().isShowing())) Main.getAlertWindow().showAndWait();
}
示例3: createEmojiNode
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
/**
* 创建emoji图片节点
*
* @param emoji
* emoji
* @param size
* 图片显示大小
* @param pad
* 图片间距
* @param isCursor
* 是否需要图片光标及鼠标处理事件
* @return
*/
public static Node createEmojiNode(Emoji emoji, int size, int pad) {
// 将表情放到stackpane中
StackPane stackPane = new StackPane();
stackPane.setMaxSize(size, size);
stackPane.setPrefSize(size, size);
stackPane.setMinSize(size, size);
stackPane.setPadding(new Insets(pad));
ImageView imageView = new ImageView();
imageView.setFitWidth(size);
imageView.setFitHeight(size);
imageView.setImage(ImageCache.getInstance().getImage(getEmojiImagePath(emoji.getHex())));
stackPane.getChildren().add(imageView);
return stackPane;
}
示例4: TextValidatorSample
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
public TextValidatorSample() {
String validatorCss = TextValidatorSample.class.getResource("Validators.css").toExternalForm();
TextField dateField = new TextField();
dateField.setPromptText("Enter a Large Number");
dateField.setMaxHeight(TextField.USE_PREF_SIZE);
TextInputValidatorPane<TextField> pane = new TextInputValidatorPane<TextField>();
pane.setContent(dateField);
pane.setValidator(new Validator<TextField>() {
public ValidationResult validate(TextField control) {
try {
String text = control.getText();
if (text == null || text.trim().equals("")) return null;
double d = Double.parseDouble(text);
if (d < 1000) {
return new ValidationResult("Should be > 1000", ValidationResult.Type.WARNING);
}
return null; // succeeded
} catch (Exception e) {
// failed
return new ValidationResult("Bad number", ValidationResult.Type.ERROR);
}
}
});
StackPane rootSP = new StackPane();
rootSP.setPadding(new Insets(12));
rootSP.getChildren().add(pane);
pane.getStylesheets().add(validatorCss);
getChildren().add(rootSP);
}
示例5: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(circluarPlot);
pane.setPadding(new Insets(10));
Scene scene = new Scene(pane);
stage.setTitle("Circular Plot");
stage.setScene(scene);
stage.show();
}
示例6: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(yChart);
//StackPane pane = new StackPane(xyChart);
pane.setPadding(new Insets(10));
Scene scene = new Scene(new StackPane(pane));
stage.setTitle("Charts");
stage.setScene(scene);
stage.show();
timer.start();
}
示例7: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(sankeyPlot);
pane.setPadding(new Insets(10));
Scene scene = new Scene(pane);
stage.setTitle("Sankey Plot");
stage.setScene(scene);
stage.show();
}
示例8: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(chart);
pane.setPadding(new Insets(10));
Scene scene = new Scene(pane);
stage.setTitle("Nested Bar Chart");
stage.setScene(scene);
stage.show();
}
示例9: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(tyChart);
pane.setPadding(new Insets(10));
Scene scene = new Scene(new StackPane(pane));
stage.setTitle("Charts");
stage.setScene(scene);
stage.show();
}
示例10: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(polarChart);
pane.setPadding(new Insets(10));
Scene scene = new Scene(new StackPane(pane));
stage.setTitle("Polar Chart");
stage.setScene(scene);
stage.show();
//timer.start();
}
示例11: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(pixelMatrix);
pane.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
pane.setPadding(new Insets(10));
Scene scene = new Scene(pane);
stage.setTitle("MatrixPlot");
stage.setScene(scene);
stage.show();
timer.start();
}
示例12: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(chart);
pane.setPadding(new Insets(10));
Scene scene = new Scene(pane);
stage.setTitle("Coxcomb Chart");
stage.setScene(scene);
stage.show();
chart.addItem(new ChartItem("New Item", 3, Color.RED));
}
示例13: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(playfairChart);
pane.setPadding(new Insets(10));
Scene scene = new Scene(new StackPane(pane));
stage.setTitle("Playfair Chart Test");
stage.setScene(scene);
stage.show();
//timer.start();
}
示例14: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(smoothLineChart);
pane.setPadding(new Insets(10));
Scene scene = new Scene(pane);
stage.setTitle("Charts");
stage.setScene(scene);
stage.show();
timer.start();
}
示例15: start
import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
StackPane pane = new StackPane(lineChart);
pane.setPadding(new Insets(10));
pane.setBackground(new Background(new BackgroundFill(Color.web("#293C47"), CornerRadii.EMPTY, Insets.EMPTY)));
Scene scene = new Scene(pane);
stage.setTitle("Line Chart");
stage.setScene(scene);
stage.show();
}