当前位置: 首页>>代码示例>>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;未经允许,请勿转载。