當前位置: 首頁>>代碼示例>>Java>>正文


Java StackPane.setPadding方法代碼示例

本文整理匯總了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();
}
 
開發者ID:HanSolo,項目名稱:radialchart,代碼行數:14,代碼來源:Demo.java

示例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();
}
 
開發者ID:TheRedSpy15,項目名稱:The-Trail,代碼行數:24,代碼來源:AlertBox.java

示例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;
}
 
開發者ID:Laity000,項目名稱:ChatRoom-JavaFX,代碼行數:29,代碼來源:EmojiDisplayer.java

示例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);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:33,代碼來源:TextValidatorSample.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:circularplot,代碼行數:11,代碼來源:DemoTravel.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:14,代碼來源:SingleChartTest.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:sankeyplot,代碼行數:11,代碼來源:Demo.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:11,代碼來源:NestedBarChartTest.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:11,代碼來源:TimeAxisTest.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:PolarChartTest.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:14,代碼來源:MatrixPlotTest.java

示例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));
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:CoxcombChartTest.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:PlayfairTest.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:LogChartTest.java

示例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();
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:12,代碼來源:LineChartTest.java


注:本文中的javafx.scene.layout.StackPane.setPadding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。