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


Java Ellipse.setFill方法代码示例

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


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

示例1: EllipseSample

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
public EllipseSample() {
    super(180,90);
    // Simple red filled ellipse
    Ellipse ellipse1 = new Ellipse(45,45,30,45);
    ellipse1.setFill(Color.RED);
    // Blue stroked ellipse
    Ellipse ellipse2 = new Ellipse(135,45,30,45);
    ellipse2.setStroke(Color.DODGERBLUE);
    ellipse2.setFill(null);
    // Create a group to show all the ellipses);
    getChildren().add(new Group(ellipse1,ellipse2));
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Ellipse 1 Fill", ellipse1.fillProperty()),
            new SimplePropertySheet.PropDesc("Ellipse 1 Width", ellipse1.radiusXProperty(), 10d, 40d),
            new SimplePropertySheet.PropDesc("Ellipse 1 Height", ellipse1.radiusYProperty(), 10d, 45d),
            new SimplePropertySheet.PropDesc("Ellipse 2 Stroke", ellipse2.strokeProperty()),
            new SimplePropertySheet.PropDesc("Ellipse 2 Stroke Width", ellipse2.strokeWidthProperty(), 1d, 5d),
            new SimplePropertySheet.PropDesc("Ellipse 2 Width", ellipse2.radiusXProperty(), 10d, 40d),
            new SimplePropertySheet.PropDesc("Ellipse 2 Height", ellipse2.radiusYProperty(), 10d, 45d)
    );
    // END REMOVE ME
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:EllipseSample.java

示例2: createEllipseStimulus

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Create stimulus in ellipse shape.
 * @param locationX
 * @param locationY
 * @param sizeXY
 * @return Ellipse stimulus.
 */
private Ellipse createEllipseStimulus(double locationX, double locationY, double[] sizeXY) {

    /* Get horizontal and vertical radius of the ellipse */
    double radiusX = sizeXY[0] / 2;
    double radiusY = sizeXY[1] / 2;

    /* Get ellipse color */
    double hue = settings.getLuminanceScaleForStimuli().getHue();
    double saturation = settings.getLuminanceScaleForStimuli().getSaturation() / 100;
    double brightness = settings.getStimuliMaxBrightness() / 100;
    Color color = Color.hsb(hue, saturation, brightness);

    /* Create ellipse */
    Ellipse ellipse = new Ellipse(locationX, locationY, radiusX, radiusY);
    ellipse.setFill(color);
    ellipse.setStroke(color);

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

示例3: setDisplayVals

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
public void setDisplayVals(int displayWidth, int displayHeight, int feedWidth, int feedHeight) {

		final double scaleX = (double) displayWidth / (double) feedWidth;
		final double scaleY = (double) displayHeight / (double) feedHeight;

		double scaledX, scaledY;
		if (displayX.isPresent()) {
			scaledX = displayX.get() * scaleX;
			scaledY = displayY.get() * scaleY;
		}
		else {
			scaledX = super.getX() * scaleX;
			scaledY = super.getY() * scaleY;
		}

		if (logger.isTraceEnabled()) {
			logger.trace("setTranslation {} {} - {} {} to {} {}", scaleX, scaleY, super.getX(), super.getY(), scaledX, scaledY);
		}

		marker = new Ellipse(scaledX, scaledY, marker.radiusXProperty().get(), marker.radiusYProperty().get());
		marker.setFill(colorMap.get(color));

		displayX = Optional.of(scaledX);
		displayY = Optional.of(scaledY);
		
	}
 
开发者ID:phrack,项目名称:ShootOFF,代码行数:27,代码来源:DisplayShot.java

示例4: encloseLabelWithOval

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
private Group encloseLabelWithOval(DrawingEntity entity, Label label) {
    Ellipse ellipse = new Ellipse();
    ellipse.getStyleClass().add("outline");
    ellipse.setFill(entity.getColor());

    ellipse.setCenterX(0);
    ellipse.setCenterY(0);

    int insets = 5;

    label.boundsInLocalProperty().addListener((observable, oldValue, newValue) -> {
        double halfWidth = newValue.getWidth() / 2;
        double halfHeight = newValue.getHeight() / 2;
        label.setLayoutX(-halfWidth);
        label.setLayoutY(-halfHeight);
        // Calculate the relevant radii of the ellipse while maintaining
        // aspect ratio.
        // Thanks: http://stackoverflow.com/questions/433371/ellipse-bounding-a-rectangle
        ellipse.setRadiusX((halfWidth + insets) * SQRT2);
        ellipse.setRadiusY((halfHeight + insets) * SQRT2);
    });

    return new Group(ellipse, label);
}
 
开发者ID:fuzzyBSc,项目名称:systemdesign,代码行数:25,代码来源:FXMLDrawingNode.java

示例5: start

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws IOException {
	Group root = new Group();
	// describes the window itself: name, size
	primaryStage.setTitle(" Aufgabe 10 by John Malc ");
	primaryStage.setScene(new Scene(root));
	// say: center on screen, user can resize, and it will in general exists
	primaryStage.centerOnScreen();
	primaryStage.setResizable(true);
	primaryStage.show();

	// Ellipse alone
	Ellipse a = new Ellipse();
	a.setFill(Color.RED);
	a.setCenterX(205);
	a.setCenterY(150);
	a.setRadiusX(80);
	a.setRadiusY(30);

	// shows Ellipse and it will add it to the group
	root.getChildren().add(new Group(a));
}
 
开发者ID:dmpe,项目名称:JavaFX,代码行数:23,代码来源:Main.java

示例6: 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

示例7: 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

示例8: createBubble

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
private Node[] createBubble(final double SIZE) {
    final double CENTER = SIZE * 0.5;
    final Node[] NODES  = new Node[3];

    final Circle MAIN = new Circle(CENTER, CENTER, CENTER);
    final Paint MAIN_FILL = new LinearGradient(CENTER, 0.02 * SIZE,
                                               0.50 * SIZE, 0.98 * SIZE,
                                               false, CycleMethod.NO_CYCLE,
                                               new Stop(0.0, Color.TRANSPARENT),
                                               new Stop(0.85, Color.rgb(255, 255, 255, 0.2)),
                                               new Stop(1.0, Color.rgb(255, 255, 255, 0.90)));
    MAIN.setFill(MAIN_FILL);
    MAIN.setStroke(null);

    final Circle FRAME      = new Circle(CENTER, CENTER, CENTER);
    final Paint  FRAME_FILL = new RadialGradient(0, 0,
                                                 CENTER, CENTER,
                                                 0.48 * SIZE,
                                                 false, CycleMethod.NO_CYCLE,
                                                 new Stop(0.0, Color.TRANSPARENT),
                                                 new Stop(0.92, Color.TRANSPARENT),
                                                 new Stop(1.0, Color.rgb(255, 255, 255, 0.5)));
    FRAME.setFill(FRAME_FILL);
    FRAME.setStroke(null);

    final Ellipse HIGHLIGHT      = new Ellipse(CENTER, 0.27 * SIZE, 0.38 * SIZE, 0.25 * SIZE);
    final Paint   HIGHLIGHT_FILL = new LinearGradient(CENTER, 0.04 * SIZE,
                                                     CENTER, CENTER,
                                                     false, CycleMethod.NO_CYCLE,
                                                     new Stop(0.0, Color.rgb(255, 255, 255, 0.7)),
                                                     new Stop(1.0, Color.TRANSPARENT));
    HIGHLIGHT.setFill(HIGHLIGHT_FILL);
    HIGHLIGHT.setStroke(null);

    NODES[0] = FRAME;
    NODES[1] = MAIN;
    NODES[2] = HIGHLIGHT;
    
    return NODES;
}
 
开发者ID:HanSolo,项目名称:particlesfx,代码行数:41,代码来源:NodeBubbles.java

示例9: createEllipse

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Returns a visualization of a graph segment
 */
public Ellipse createEllipse(int segmentId, double ellipseHeigth) {
	int contentLength = segmentdna.get(segmentId - 1).length();
	double xcoord = graphxcoords.get(segmentId - 1);
	double ycoord = graphycoords.get(segmentId - 1);
	double xradius = 30 + 2 * Math.log(contentLength);
	Ellipse node = new Ellipse(xcoord, ycoord, xradius, ellipseHeigth);
	node.setFill(Color.DODGERBLUE);
	node.setStroke(Color.BLACK);
	node.setStrokeType(StrokeType.INSIDE);
	return node;
}
 
开发者ID:ProgrammingLife2016,项目名称:PL3-2016,代码行数:15,代码来源:GraphView.java

示例10: initFixationMonitorShape_FixPointChange

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Init fixation monitor shape (Fixation point change).
 */
private void initFixationMonitorShape_FixPointChange() {

    double monitorStimulusRadiusX = (settingsFixMonitorBoth.getChangedFixPointSizeInDgX() / 2) * pxForOneDgX;
    double monitorStimulusRadiusY = (settingsFixMonitorBoth.getChangedFixPointSizeInDgY() / 2) * pxForOneDgY;

    fixationMonitorShape = new Ellipse(centerOfTheGridInPxX, centerOfTheGridInPxY, monitorStimulusRadiusX, monitorStimulusRadiusY);
    fixationMonitorShape.setFill(settingsFixMonitorBoth.getChangedFixPointColor());
    fixationMonitorShape.setStroke(settingsFixMonitorBoth.getChangedFixPointColor());
}
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:13,代码来源:ProcedureBasicFixMonitorBoth.java

示例11: drawFixationPoint

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Draw fixation point on given location on Display Pane.
 */
private void drawFixationPoint() {

    /* Create Ellipse object, fill it and set its stroke */
    Ellipse fixPoint = new Ellipse(centerOfTheGridInPxX, centerOfTheGridInPxY, fixPointSizeInPxX / 2, fixPointSizeInPxY / 2);
    fixPoint.setFill(fixPointColor);
    fixPoint.setStroke(fixPointColor);

    /* Add created fixation point to the Display Pane */
    displayPane.getChildren().add(fixPoint);
}
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:14,代码来源:ProcedureBasicFixMonitorFixPointChange.java

示例12: initFixationMonitorShape

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Init fixation monitor shape.
 */
private void initFixationMonitorShape() {

    double monitorStimulusRadiusX = (settingsFixMonFixPointChange.getChangedFixPointSizeInDegreesHorizontal() / 2) * pxForOneDgX;
    double monitorStimulusRadiusY = (settingsFixMonFixPointChange.getChangedFixPointSizeInDegreesVertical() / 2) * pxForOneDgY;

    fixationMonitorShape = new Ellipse(centerOfTheGridInPxX, centerOfTheGridInPxY, monitorStimulusRadiusX, monitorStimulusRadiusY);
    fixationMonitorShape.setFill(settingsFixMonFixPointChange.getChangedFixPointColor());
    fixationMonitorShape.setStroke(settingsFixMonFixPointChange.getChangedFixPointColor());
}
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:13,代码来源:ProcedureBasicFixMonitorFixPointChange.java

示例13: initFixationMonitorShape_Blindspot

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Init fixation monitor shape (Blindspot).
 */
private void initFixationMonitorShape_Blindspot() {

    double monitorStimulusRadiusX = (settingsFixMonitorBoth.getFixMonitorStimulusSizeInDgX() / 2) * pxForOneDgX;
    double monitorStimulusRadiusY = (settingsFixMonitorBoth.getFixMonitorStimulusSizeInDgY() / 2) * pxForOneDgY;

    double monitorStimulusPositionX;
    double monitorStimulusPositionY;

    if (settings.isUseCorrectionForSphericityOfTheFieldOfView()) {

        double r = StartApplication.getSpecvisData().getUiSettingsScreenAndLuminanceScale().getPatientDistanceFromTheScreen();

        double ax = settingsFixMonitorBoth.getFixMonitorStimulusDistanceFromFixPointInDgX();
        double ay = settingsFixMonitorBoth.getFixMonitorStimulusDistanceFromFixPointInDgY();

        double mx = functions.calculateOppositeAngle(ax, r);
        double my = functions.calculateOppositeAngle(ay, r);

        double mxPixels = functions.millimitersToPixels(mx, screenResInPxX, settings.getScreenWidthInMm());
        double myPixels = functions.millimitersToPixels(my, screenResInPxY, settings.getScreenHeightInMm());

        monitorStimulusPositionX = centerOfTheGridInPxX + mxPixels;
        monitorStimulusPositionY = centerOfTheGridInPxY + myPixels;

    } else {
        monitorStimulusPositionX = centerOfTheGridInPxX + (settingsFixMonitorBoth.getFixMonitorStimulusDistanceFromFixPointInDgX() * pxForOneDgX);
        monitorStimulusPositionY = centerOfTheGridInPxY + (settingsFixMonitorBoth.getFixMonitorStimulusDistanceFromFixPointInDgY() * pxForOneDgY);
    }

    double hue = settings.getLuminanceScaleForStimuli().getHue();
    double saturation = settings.getLuminanceScaleForStimuli().getSaturation() / 100;
    double brightness = Double.valueOf(settingsFixMonitorBoth.getFixMonitorStimulusBrightness()) / 100;
    Color color = Color.hsb(hue, saturation, brightness);

    fixationMonitorShape = new Ellipse(monitorStimulusPositionX, monitorStimulusPositionY, monitorStimulusRadiusX, monitorStimulusRadiusY);
    fixationMonitorShape.setFill(color);
    fixationMonitorShape.setStroke(color);
}
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:42,代码来源:ProcedureBasicFixMonitorBoth.java

示例14: initFixationMonitorShape

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/**
 * Init fixation monitor shape.
 */
private void initFixationMonitorShape() {

    double monitorStimulusRadiusX = (settingsFixMonitorBlindspot.getMonitorStimulusSizeInDegreesHorizontal() / 2) * pxForOneDgX;
    double monitorStimulusRadiusY = (settingsFixMonitorBlindspot.getMonitorStimulusSizeInDegreesVertical() / 2) * pxForOneDgY;

    double monitorStimulusPositionX;
    double monitorStimulusPositionY;

    if (settings.isUseCorrectionForSphericityOfTheFieldOfView()) {

        double r = StartApplication.getSpecvisData().getUiSettingsScreenAndLuminanceScale().getPatientDistanceFromTheScreen();

        double ax = settingsFixMonitorBlindspot.getMonitorStimulusDistanceFromFixPointInDegreesHorizontal();
        double ay = settingsFixMonitorBlindspot.getMonitorStimulusDistanceFromFixPointInDegreesVertical();

        double mx = functions.calculateOppositeAngle(ax, r);
        double my = functions.calculateOppositeAngle(ay, r);

        double mxPixels = functions.millimitersToPixels(mx, screenResInPxX, settings.getScreenWidthInMm());
        double myPixels = functions.millimitersToPixels(my, screenResInPxY, settings.getScreenHeightInMm());

        monitorStimulusPositionX = centerOfTheGridInPxX + mxPixels;
        monitorStimulusPositionY = centerOfTheGridInPxY + myPixels;

    } else {
        monitorStimulusPositionX = centerOfTheGridInPxX + (settingsFixMonitorBlindspot.getMonitorStimulusDistanceFromFixPointInDegreesHorizontal() * pxForOneDgX);
        monitorStimulusPositionY = centerOfTheGridInPxY + (settingsFixMonitorBlindspot.getMonitorStimulusDistanceFromFixPointInDegreesVertical() * pxForOneDgY);
    }

    double hue = settings.getLuminanceScaleForStimuli().getHue();
    double saturation = settings.getLuminanceScaleForStimuli().getSaturation() / 100;
    double brightness = Double.valueOf(settingsFixMonitorBlindspot.getMonitorStimulusBrightness()) / 100;
    Color color = Color.hsb(hue, saturation, brightness);

    fixationMonitorShape = new Ellipse(monitorStimulusPositionX, monitorStimulusPositionY, monitorStimulusRadiusX, monitorStimulusRadiusY);
    fixationMonitorShape.setFill(color);
    fixationMonitorShape.setStroke(color);
}
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:42,代码来源:ProcedureBasicFixMonitorBlindspot.java

示例15: drawFixationPoint

import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
private void drawFixationPoint() {

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

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

        displayPane.getChildren().add(ellipse);
    }
 
开发者ID:piotrdzwiniel,项目名称:Specvis,代码行数:12,代码来源:DEPRECATED_Procedure.java


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