本文整理匯總了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();
}