当前位置: 首页>>代码示例>>Java>>正文


Java CornerRadii类代码示例

本文整理汇总了Java中javafx.scene.layout.CornerRadii的典型用法代码示例。如果您正苦于以下问题:Java CornerRadii类的具体用法?Java CornerRadii怎么用?Java CornerRadii使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CornerRadii类属于javafx.scene.layout包,在下文中一共展示了CornerRadii类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.scene.layout.CornerRadii; //导入依赖的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: initButtonByInventory

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
public void initButtonByInventory() {
    inventoryGroup.getToggles().remove(0, inventoryGroup.getToggles().size());
    if (core.getCurrentPlayer() == 0) {
        inventoryPlayer1.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(3))));
        inventoryPlayer2.setBorder(Border.EMPTY);
        inventoryPlayer1.setStyle("-fx-effect: none");
        inventoryPlayer2.setStyle("-fx-effect: innershadow(one-pass-box, lightblue, 100, 0.1, 1, 1);");
        namePlayer1.setText(core.getPlayers()[0].getName() + " à vous de jouer !");
        namePlayer2.setText(core.getPlayers()[1].getName() + " attend !");
    } else {
        
        inventoryPlayer1.setBorder(Border.EMPTY);
        inventoryPlayer2.setStyle("-fx-effect: none");
        inventoryPlayer1.setStyle("-fx-effect: innershadow(one-pass-box, lightgrey, 100, 0.1, 1, 1);");
        inventoryPlayer2.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(3))));

        namePlayer1.setText(core.getPlayers()[0].getName() + " attend !");
        namePlayer2.setText(core.getPlayers()[1].getName() + " à vous de jouer !");
    }
    initPlayer1Button();
    initPlayer2Button();
}
 
开发者ID:Plinz,项目名称:Hive_Game,代码行数:23,代码来源:GameScreenController.java

示例3: initGraphics

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
private void initGraphics() {
    backgroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    backgroundCtx    = backgroundCanvas.getGraphicsContext2D();

    foregroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    foregroundCtx    = foregroundCanvas.getGraphicsContext2D();

    ledInnerShadow   = new InnerShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 0.2 * PREFERRED_WIDTH, 0, 0, 0);
    ledDropShadow    = new DropShadow(BlurType.TWO_PASS_BOX, getSkinnable().getBarColor(), 0.3 * PREFERRED_WIDTH, 0, 0, 0);

    pane = new Pane(backgroundCanvas, foregroundCanvas);
    pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
    pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:17,代码来源:CustomGaugeSkin.java

示例4: initGraphics

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
private void initGraphics() {
    // Set initial size
    if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 ||
        Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) {
        if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) {
            getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight());
        } else {
            getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    pane = new Pane();
    pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(getSkinnable().getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:medusademo,代码行数:18,代码来源:TemplateClockSkin.java

示例5: handleLaunchGameClick

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
@FXML
public void handleLaunchGameClick() {
               String player = "Anonyme";
	Core core = new Core(-1, -1);
	String host = choiceClient.isSelected() ? hostName.getText() : null;
	int mode = choiceHost.isSelected() ? (state == Consts.WHITE ? Consts.PVEX : Consts.EXVP) : -1;
               if(!playerName.getText().equals(""))
                   player = playerName.getText();
	int error = core.connect(host, mode, player);
	if (error == 0) {
		core.playNextTurn();
		main.showGameScreen(core,false);
	} else if (choiceClient.isSelected()) {
		hostName.setBackground(
				new Background(new BackgroundFill(Color.ORANGERED, new CornerRadii(2), new Insets(2))));
		hostName.clear();
		hostName.setText(error==1?"Host inconnnu":"Erreur de connexion");
	} else {
		playerName.setBackground(
				new Background(new BackgroundFill(Color.ORANGERED, new CornerRadii(2), new Insets(2))));
		playerName.clear();
		playerName.setText("Erreur de connexion");
	}
	// hostName.setBorder(new Border(new BorderStroke(Color.RED,
	// BorderStrokeStyle.SOLID, new CornerRadii(10), BorderWidths.FULL)));
}
 
开发者ID:Plinz,项目名称:Hive_Game,代码行数:27,代码来源:NetworkScreenController.java

示例6: start

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
@Override public void start(Stage stage) {
    HBox pane = new HBox(imageView, matrix);
    pane.setSpacing(10);
    pane.setPadding(new Insets(10));
    pane.setBackground(new Background(new BackgroundFill(Color.rgb(10, 10, 20), CornerRadii.EMPTY, Insets.EMPTY)));
    Scene scene = new Scene(pane);

    stage.setTitle("Matrix Image");
    stage.setScene(scene);
    stage.show();

    timer.start();
}
 
开发者ID:HanSolo,项目名称:matriximage,代码行数:14,代码来源:Main.java

示例7: setLegendSymbolFill

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
public void setLegendSymbolFill(final Series<X, Y> SERIES, final Paint LEGEND_SYMBOL_FILL) {
    if (getData().isEmpty()) { return; }
    if (!getData().contains(SERIES)) { return; }

    int seriesIndex = getData().indexOf(SERIES);
    if (seriesIndex == -1) { return; }

    Legend legend = (Legend) getLegend();
    if (null == legend) { return; }

    LegendItem item = legend.getItems().get(seriesIndex);
    if (null == item) { return; }

    Region symbol = (Region) item.getSymbol();
    if (null == symbol) { return; }

    symbol.setBackground(new Background(new BackgroundFill(LEGEND_SYMBOL_FILL, new CornerRadii(6), Insets.EMPTY)));
}
 
开发者ID:HanSolo,项目名称:smoothcharts,代码行数:19,代码来源:SmoothedChart.java

示例8: start

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
@Override public void start(Stage stage) {
    GridPane pane = new GridPane();
    pane.setBackground(new Background(new BackgroundFill(Color.DARKGRAY, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setPadding(new Insets(10));
    pane.setHgap(10);
    pane.setVgap(10);
    pane.add(lineChartNotSmoothed, 0, 0);
    pane.add(lineChartSmoothed, 1, 0);
    pane.add(areaChartNotSmoothed, 0, 1);
    pane.add(areaChartSmoothed, 1, 1);
    pane.add(tweakedChart, 0, 2);
    pane.add(tweaked2Chart, 1, 2);


    Scene scene = new Scene(pane);

    stage.setTitle("Smooth Charts");
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:HanSolo,项目名称:smoothcharts,代码行数:21,代码来源:Demo.java

示例9: getDemoPane

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
public GridPane getDemoPane() {
    GridPane pane = new GridPane();
    pane.add(framedGauge1, 0, 0);
    pane.add(framedGauge2, 1, 0);
    pane.add(gauge3, 2, 0);
    pane.add(gauge4, 3, 0);
    pane.add(gauge5, 4, 0);
    pane.add(clock1, 5, 0);
    pane.add(clock5, 6, 0);
    pane.add(gauge22, 7, 0);
    pane.add(gauge29, 8, 0);

    pane.add(gauge6, 0, 1);
    pane.add(gauge7, 1, 1);
    pane.add(gauge8, 2, 1);
    pane.add(gauge9, 3, 1);
    pane.add(gauge10, 4, 1);
    pane.add(clock2, 5, 1);
    pane.add(gauge21, 6, 1);
    pane.add(gauge23, 7, 1);
    pane.add(gauge30, 8, 1);

    pane.add(gauge11, 0, 2);
    pane.add(gauge12, 1, 2);
    pane.add(gauge13, 2, 2);
    pane.add(gauge14, 3, 2);
    pane.add(gauge15, 4, 2);
    pane.add(clock3, 5, 2);
    pane.add(clock6, 6, 2);
    pane.add(clock8, 7, 2);
    pane.add(gauge31, 8, 2);

    pane.add(gauge16, 0, 3);
    pane.add(gauge17, 1, 3);
    pane.add(gauge18, 2, 3);
    pane.add(gauge19, 3, 3);
    pane.add(gauge20, 4, 3);
    pane.add(clock4, 5, 3);
    pane.add(clock7, 6, 3);
    pane.add(gauge24, 7, 3);
    pane.add(clock12, 8, 3);

    pane.add(gauge25, 0, 4);
    pane.add(gauge26, 1, 4);
    pane.add(gauge27, 2, 4);
    pane.add(gauge28, 4, 4);
    pane.add(clock9, 5, 4);
    pane.add(clock10, 6, 4);
    pane.add(clock11, 7, 4);
    pane.setHgap(10);
    pane.setVgap(10);
    pane.setPadding(new Insets(10));
    for (int i = 0 ; i < 9 ; i++) {
        pane.getColumnConstraints().add(new ColumnConstraints(MIN_CELL_SIZE, PREF_CELL_SIZE, MAX_CELL_SIZE));
    }
    for (int i = 0 ; i < 5 ; i++) {
        pane.getRowConstraints().add(new RowConstraints(MIN_CELL_SIZE, PREF_CELL_SIZE, MAX_CELL_SIZE));
    }
    pane.setBackground(new Background(new BackgroundFill(Color.rgb(90, 90, 90), CornerRadii.EMPTY, Insets.EMPTY)));
    return pane;
}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:62,代码来源:OverviewDemo.java

示例10: initGraphics

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
private void initGraphics() {
    if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 ||
        Double.compare(getHeight(), 0.0) <= 0) {
        if (getPrefWidth() > 0 && getPrefHeight() > 0) {
            setPrefSize(getPrefWidth(), getPrefHeight());
        } else {
            setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    segmentPane = new Pane();

    chartCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    chartCanvas.setMouseTransparent(true);

    chartCtx    = chartCanvas.getGraphicsContext2D();

    pane = new Pane(segmentPane, chartCanvas);
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));

    getChildren().setAll(pane);

    prepareData();
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:26,代码来源:SunburstChart.java

示例11: generate

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
/**
 * Generates a panel image form char.
 * <p>First, this function converts ch to upper case if ch is lower case.</p>
 * <p>Then, this generates javafx's image from ch.And return it.</p>
 * You can fix the resolution of image through {@link capslock.CharPanelGenerator#PANEL_IMAGE_SIZE}
 * and {@link capslock.CharPanelGenerator#FONT_SIZE}.
 * @param ch パネルの生成に使う1文字.
 * @param color 背景色.
 * @return 生成されたパネル.
 */
static final Image generate(char ch, Color color){
    final Label label = new Label(Character.toString(Character.toUpperCase(ch)));
    label.setMinSize(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    label.setMaxSize(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    label.setPrefSize(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    label.setFont(Font.font(FONT_SIZE));
    label.setAlignment(Pos.CENTER);
    label.setTextFill(Color.WHITE);
    label.setBackground(new Background(new BackgroundFill(color, CornerRadii.EMPTY, Insets.EMPTY)));
    final Scene scene = new Scene(new Group(label));
    final WritableImage img = new WritableImage(PANEL_IMAGE_SIZE, PANEL_IMAGE_SIZE);
    scene.snapshot(img);
    return img ;
}
 
开发者ID:chrootRISCassembler,项目名称:CapsLock,代码行数:25,代码来源:CharPanelGenerator.java

示例12: initGraphics

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
private void initGraphics() {
    if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 ||
        Double.compare(getWidth(), 0.0) <= 0 || Double.compare(getHeight(), 0.0) <= 0) {
        if (getPrefWidth() > 0 && getPrefHeight() > 0) {
            setPrefSize(getPrefWidth(), getPrefHeight());
        } else {
            setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    getStyleClass().add("my-region");
    
    pane = new Pane();                
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:hol1634,代码行数:19,代码来源:Region.java

示例13: initGraphics

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
private void initGraphics() {
    if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 ||
        Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) {
        if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) {
            getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight());
        } else {
            getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    node = new Region();
    node.getStyleClass().setAll("node");

    pane = new Pane(node);
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:hol1634,代码行数:20,代码来源:Skin.java

示例14: initGraphics

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
private void initGraphics() {
    // Set initial size
    if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
        Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
        if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
            gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
        } else {
            gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    for (int i = 0 ; i < 12 ; i++) {
        Region bar = new Region();
        bar.setPrefSize(20, 20 + (i * 4));
        bars[i] = bar;
    }

    pane = new HBox(bars);
    pane.setSpacing(PREFERRED_WIDTH * 0.01960784);
    pane.setAlignment(Pos.BOTTOM_CENTER);
    pane.setFillHeight(false);
    pane.setBackground(new Background(new BackgroundFill(backgroundPaint, new CornerRadii(1024), Insets.EMPTY)));
    pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(borderWidth))));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:Medusa,代码行数:27,代码来源:ChargeSkin.java

示例15: initGraphics

import javafx.scene.layout.CornerRadii; //导入依赖的package包/类
private void initGraphics() {
    if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 ||
        Double.compare(getWidth(), 0.0) <= 0 || Double.compare(getHeight(), 0.0) <= 0) {
        if (getPrefWidth() > 0 && getPrefHeight() > 0) {
            setPrefSize(getPrefWidth(), getPrefHeight());
        } else {
            setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    nameText = new Text(getName());
    nameText.setTextOrigin(VPos.TOP);

    valueText = new Text(String.format(locale, formatString, getValue()));
    valueText.setTextOrigin(VPos.TOP);

    barBackground = new Rectangle();

    bar = new Rectangle();

    pane = new Pane(nameText, valueText, barBackground, bar);
    pane.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:tilesfx,代码行数:26,代码来源:BarChartItem.java


注:本文中的javafx.scene.layout.CornerRadii类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。