javafx.scene.control.Label#setMinSize ( )源码实例Demo

下面列出了javafx.scene.control.Label#setMinSize ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: StockInference-Spark   文件: LineChartSample.java
private Label createDataThresholdLabel(int priorValue, int value) {
    final Label label = new Label(value + "");
    label.getStyleClass().addAll("default-color0", "chart-line-symbol", "chart-series-line");
    label.setStyle("-fx-font-size: 20; -fx-font-weight: bold;");

    if (priorValue == 0) {
        label.setTextFill(Color.DARKGRAY);
    } else if (value > priorValue) {
        label.setTextFill(Color.FORESTGREEN);
    } else {
        label.setTextFill(Color.FIREBRICK);
    }

    label.setMinSize(Label.USE_PREF_SIZE, Label.USE_PREF_SIZE);
    return label;
}
 
源代码2 项目: StockPrediction   文件: LineChartSample.java
private Label createDataThresholdLabel(int priorValue, int value) {
    final Label label = new Label(value + "");
    label.getStyleClass().addAll("default-color0", "chart-line-symbol", "chart-series-line");
    label.setStyle("-fx-font-size: 20; -fx-font-weight: bold;");

    if (priorValue == 0) {
        label.setTextFill(Color.DARKGRAY);
    } else if (value > priorValue) {
        label.setTextFill(Color.FORESTGREEN);
    } else {
        label.setTextFill(Color.FIREBRICK);
    }

    label.setMinSize(Label.USE_PREF_SIZE, Label.USE_PREF_SIZE);
    return label;
}
 
源代码3 项目: DevToolBox   文件: ChartUtil.java
private Label createDataThresholdLabel(Double priorValue, Double value) {
    final Label label = new Label(value + "");
    label.getStyleClass().addAll("default-color0", "chart-line-symbol", "chart-series-line");
    label.setStyle("-fx-font-size: 20; -fx-font-weight: bold;");
    if (priorValue == 0) {
        label.setTextFill(Color.DARKGRAY);
    } else if (value > priorValue) {
        label.setTextFill(Color.FORESTGREEN);
    } else {
        label.setTextFill(Color.FIREBRICK);
    }
    label.setMinSize(Label.USE_PREF_SIZE, Label.USE_PREF_SIZE);
    return label;
}