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


Java Ellipse.setStrokeWidth方法代码示例

本文整理汇总了Java中javafx.scene.shape.Ellipse.setStrokeWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Ellipse.setStrokeWidth方法的具体用法?Java Ellipse.setStrokeWidth怎么用?Java Ellipse.setStrokeWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Ellipse的用法示例。


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

示例1: configureBackground

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
private void configureBackground() {
    ImageView imageView = new ImageView();
    Image image = loadImage();
    imageView.setImage(image);

    Circle circle1 = new Circle();
    circle1.setCenterX(140);
    circle1.setCenterY(140);
    circle1.setRadius(120);
    circle1.setFill(Color.TRANSPARENT);
    circle1.setStroke(Color.web("#0A0A0A"));
    circle1.setStrokeWidth(0.3);

    Circle circle2 = new Circle();
    circle2.setCenterX(140);
    circle2.setCenterY(140);
    circle2.setRadius(118);
    circle2.setFill(Color.TRANSPARENT);
    circle2.setStroke(Color.web("#0A0A0A"));
    circle2.setStrokeWidth(0.3);

    Circle circle3 = new Circle();
    circle3.setCenterX(140);
    circle3.setCenterY(140);
    circle3.setRadius(140);
    circle3.setFill(Color.TRANSPARENT);
    circle3.setStroke(Color.web("#818a89"));
    circle3.setStrokeWidth(1);

    Ellipse ellipse = new Ellipse(140, 95, 180, 95);
    Circle ellipseClip = new Circle(140, 140, 140);
    ellipse.setFill(Color.web("#535450"));
    ellipse.setStrokeWidth(0);
    GaussianBlur ellipseEffect = new GaussianBlur();
    ellipseEffect.setRadius(10);
    ellipse.setEffect(ellipseEffect);
    ellipse.setOpacity(0.1);
    ellipse.setClip(ellipseClip);
    background.getChildren().addAll(imageView, circle1, circle2, circle3, ellipse);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:StopWatch.java

示例2: createIconContent

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
public static Node createIconContent() {
    Ellipse ellipse = new Ellipse(57,57, 20,40);
    ellipse.setStroke(Color.web("#b9c0c5"));
    ellipse.setStrokeWidth(5);
    ellipse.getStrokeDashArray().addAll(15d,15d);
    ellipse.setFill(null);
    javafx.scene.effect.InnerShadow effect = new javafx.scene.effect.InnerShadow();
    effect.setOffsetX(1);
    effect.setOffsetY(1);
    effect.setRadius(3);
    effect.setColor(Color.rgb(0,0,0,0.6));
    ellipse.setEffect(effect);
    return ellipse;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:15,代码来源:EllipseSample.java

示例3: Piece

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
public Piece(PieceType type, int x, int y) {
    this.type = type;

    move(x, y);

    Ellipse bg = new Ellipse(TILE_SIZE * 0.3125, TILE_SIZE * 0.26);
    bg.setFill(Color.BLACK);

    bg.setStroke(Color.BLACK);
    bg.setStrokeWidth(TILE_SIZE * 0.03);

    bg.setTranslateX((TILE_SIZE - TILE_SIZE * 0.3125 * 2) / 2);
    bg.setTranslateY((TILE_SIZE - TILE_SIZE * 0.26 * 2) / 2 + TILE_SIZE * 0.07);

    Ellipse ellipse = new Ellipse(TILE_SIZE * 0.3125, TILE_SIZE * 0.26);
    ellipse.setFill(type == PieceType.RED
            ? Color.valueOf("#c40003") : Color.valueOf("#fff9f4"));

    ellipse.setStroke(Color.BLACK);
    ellipse.setStrokeWidth(TILE_SIZE * 0.03);

    ellipse.setTranslateX((TILE_SIZE - TILE_SIZE * 0.3125 * 2) / 2);
    ellipse.setTranslateY((TILE_SIZE - TILE_SIZE * 0.26 * 2) / 2);

    getChildren().addAll(bg, ellipse);

    setOnMousePressed(e -> {
        mouseX = e.getSceneX();
        mouseY = e.getSceneY();
    });

    setOnMouseDragged(e -> {
        relocate(e.getSceneX() - mouseX + oldX, e.getSceneY() - mouseY + oldY);
    });
}
 
开发者ID:AlmasB,项目名称:FXTutorials,代码行数:36,代码来源:Piece.java

示例4: initGraphics

import javafx.scene.shape.Ellipse; //导入方法依赖的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);
        }
    }

    tube = new Path();
    tube.setFillRule(FillRule.EVEN_ODD);
    tube.setStroke(null);
    Tooltip.install(tube, barTooltip);

    tubeTop = new Ellipse();
    tubeTop.setStroke(Color.rgb(255, 255, 255, 0.5));
    tubeTop.setStrokeType(StrokeType.INSIDE);
    tubeTop.setStrokeWidth(1);

    tubeBottom = new Ellipse();
    tubeBottom.setStroke(null);

    fluidUpperLeft   = new CubicCurveTo(0.21794871794871795 * PREFERRED_WIDTH, 0.24444444444444444 * PREFERRED_HEIGHT,
                                        0.0, 0.18888888888888888 * PREFERRED_HEIGHT,
                                        0.0, 0.12222222222222222 * PREFERRED_HEIGHT);
    fluidUpperCenter = new CubicCurveTo(PREFERRED_WIDTH, 0.18888888888888888 * PREFERRED_HEIGHT,
                                        0.782051282051282 * PREFERRED_WIDTH, 0.24444444444444444 * PREFERRED_HEIGHT,
                                        0.5 * PREFERRED_WIDTH, 0.24444444444444444 * PREFERRED_HEIGHT);
    fluidUpperRight  = new CubicCurveTo(PREFERRED_WIDTH, 0.7111111111111111 * PREFERRED_HEIGHT,
                                        PREFERRED_WIDTH, 0.12222222222222222 * PREFERRED_HEIGHT,
                                        PREFERRED_WIDTH, 0.12222222222222222 * PREFERRED_HEIGHT);

    fluidBody = new Path();
    fluidBody.getElements().add(new MoveTo(0.0, 0.7111111111111111 * PREFERRED_HEIGHT));
    fluidBody.getElements().add(new CubicCurveTo(0.0, 0.7777777777777778 * PREFERRED_HEIGHT,
                                                 0.21794871794871795 * PREFERRED_WIDTH, 0.8333333333333334 * PREFERRED_HEIGHT,
                                                 0.5 * PREFERRED_WIDTH, 0.8333333333333334 * PREFERRED_HEIGHT));
    fluidBody.getElements().add(new CubicCurveTo(0.782051282051282 * PREFERRED_WIDTH, 0.8333333333333334 * PREFERRED_HEIGHT,
                                                 PREFERRED_WIDTH, 0.7777777777777778 * PREFERRED_HEIGHT,
                                                 PREFERRED_WIDTH, 0.7111111111111111 * PREFERRED_HEIGHT));
    fluidBody.getElements().add(fluidUpperRight);
    fluidBody.getElements().add(fluidUpperCenter);
    fluidBody.getElements().add(fluidUpperLeft);
    fluidBody.getElements().add(new CubicCurveTo(0.0, 0.12222222222222222 * PREFERRED_HEIGHT,
                                                 0.0, 0.7111111111111111 * PREFERRED_HEIGHT,
                                                 0.0, 0.7111111111111111 * PREFERRED_HEIGHT));
    fluidBody.getElements().add(new ClosePath());
    fluidBody.setFillRule(FillRule.EVEN_ODD);
    fluidBody.setStroke(null);

    fluidTop = new Ellipse();
    fluidTop.setStroke(null);

    valueText = new Text(String.format(locale, formatString, gauge.getCurrentValue()));
    valueText.setMouseTransparent(true);
    Helper.enableNode(valueText, gauge.isValueVisible());

    titleText = new Text(gauge.getTitle());

    // Add all nodes
    pane = new Pane(tubeBottom, fluidBody, fluidTop, tube, tubeTop, valueText, titleText);
    pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));

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

示例5: drawProcedureStateIndicator

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Draw arround the fixation point the procedure state indicator.
 * - Draw CIRCLE when waiting for starting the procedure;
 * - Draw TRIANGLE when procedure is paused;
 * - Draw SQUARE when procedure is finished;
 * @param indicator
 */
private void drawProcedureStateIndicator(String indicator) {
    switch (indicator) {
        case "Circle":

            double radiusX = fixPointSizeInPxX * 1.5;
            double radiusY = fixPointSizeInPxY * 1.5;

            Ellipse ellipse = new Ellipse(centerOfTheGridInPxX, centerOfTheGridInPxY, radiusX, radiusY);
            ellipse.setFill(Color.TRANSPARENT);
            ellipse.setStroke(fixPointColor);
            ellipse.setStrokeWidth(4);

            displayPane.getChildren().add(ellipse);

            break;
        case "Triangle":

            double triangleSizeX = fixPointSizeInPxX * 4.5;
            double triangleSizeY = fixPointSizeInPxY * 4.5;

            double twoThirdOfTheTriangleHeightX = (triangleSizeX * Math.sqrt(3)) / 3;
            double twoThirdOfTheTriangleHeightY = (triangleSizeY * Math.sqrt(3)) / 3;

            double angleForA = Math.toRadians(270);
            double angleForB = Math.toRadians(30);
            double angleForC = Math.toRadians(150);

            double xA = centerOfTheGridInPxX + twoThirdOfTheTriangleHeightX * Math.cos(angleForA);
            double yA = centerOfTheGridInPxY - twoThirdOfTheTriangleHeightY * Math.sin(angleForA);

            double xB = centerOfTheGridInPxX + twoThirdOfTheTriangleHeightX * Math.cos(angleForB);
            double yB = centerOfTheGridInPxY - twoThirdOfTheTriangleHeightY * Math.sin(angleForB);

            double xC = centerOfTheGridInPxX + twoThirdOfTheTriangleHeightX * Math.cos(angleForC);
            double yC = centerOfTheGridInPxY - twoThirdOfTheTriangleHeightY * Math.sin(angleForC);

            Polygon polygon = new Polygon();
            polygon.getPoints().addAll(xA, yA, xB, yB, xC, yC);
            polygon.setFill(Color.TRANSPARENT);
            polygon.setStroke(fixPointColor);
            polygon.setStrokeWidth(4);

            displayPane.getChildren().add(polygon);

            break;
        case "Square":

            double sizeX = fixPointSizeInPxX * 3;
            double sizeY = fixPointSizeInPxY * 3;

            Rectangle rectangle = new Rectangle(centerOfTheGridInPxX - (sizeX / 2), centerOfTheGridInPxY - (sizeY / 2), sizeX, sizeY);
            rectangle.setFill(Color.TRANSPARENT);
            rectangle.setStroke(fixPointColor);
            rectangle.setStrokeWidth(4);

            displayPane.getChildren().add(rectangle);

            break;
    }
}
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:68,代码来源:ProcedureBasicFixMonitorFixPointChange.java

示例6: drawProcedureStateIndicator

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Draw arround the fixation point the procedure state indicator.
 * - Draw circle when waiting for starting the procedure;
 * - Draw triangle when procedure is paused;
 * - Draw square when procedure is finished;
 * @param indicator
 */
private void drawProcedureStateIndicator(String indicator) {
    switch (indicator) {
        case "Circle":

            double radiusX = (fixationPointSizeX * 1.5) * pixelsForOneDegreeX;
            double radiusY = (fixationPointSizeY * 1.5) * pixelsForOneDegreeY;

            Ellipse ellipse = new Ellipse(centerOfTheGridInPixelsX, centerOfTheGridInPixelsY, radiusX, radiusY);
            ellipse.setFill(Color.TRANSPARENT);
            ellipse.setStroke(fixationPointColor);
            ellipse.setStrokeWidth(4);

            displayPane.getChildren().add(ellipse);

            break;
        case "Triangle":

            double triangleSizeX = (fixationPointSizeX * 4.5) * pixelsForOneDegreeX;
            double triangleSizeY = (fixationPointSizeY * 4.5) * pixelsForOneDegreeY;

            double twoThirdOfTheTriangleHeightX = (triangleSizeX * Math.sqrt(3)) / 3;
            double twoThirdOfTheTriangleHeightY = (triangleSizeY * Math.sqrt(3)) / 3;

            double angleForA = Math.toRadians(270);
            double angleForB = Math.toRadians(30);
            double angleForC = Math.toRadians(150);

            double xA = centerOfTheGridInPixelsX + twoThirdOfTheTriangleHeightX * Math.cos(angleForA);
            double yA = centerOfTheGridInPixelsY - twoThirdOfTheTriangleHeightY * Math.sin(angleForA);

            double xB = centerOfTheGridInPixelsX + twoThirdOfTheTriangleHeightX * Math.cos(angleForB);
            double yB = centerOfTheGridInPixelsY - twoThirdOfTheTriangleHeightY * Math.sin(angleForB);

            double xC = centerOfTheGridInPixelsX + twoThirdOfTheTriangleHeightX * Math.cos(angleForC);
            double yC = centerOfTheGridInPixelsY - twoThirdOfTheTriangleHeightY * Math.sin(angleForC);

            Polygon polygon = new Polygon();
            polygon.getPoints().addAll(xA, yA, xB, yB, xC, yC);
            polygon.setFill(Color.TRANSPARENT);
            polygon.setStroke(fixationPointColor);
            polygon.setStrokeWidth(4);

            displayPane.getChildren().add(polygon);

            break;
        case "Square":

            double sizeX = (fixationPointSizeX * 3) * pixelsForOneDegreeX;
            double sizeY = (fixationPointSizeY * 3) * pixelsForOneDegreeY;

            Rectangle rectangle = new Rectangle(centerOfTheGridInPixelsX - (sizeX / 2), centerOfTheGridInPixelsY - (sizeY / 2), sizeX, sizeY);
            rectangle.setFill(Color.TRANSPARENT);
            rectangle.setStroke(fixationPointColor);
            rectangle.setStrokeWidth(4);

            displayPane.getChildren().add(rectangle);

            break;
    }
}
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:68,代码来源:DEPRECATED_Procedure.java


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