本文整理汇总了Java中javafx.scene.shape.Ellipse.setStroke方法的典型用法代码示例。如果您正苦于以下问题:Java Ellipse.setStroke方法的具体用法?Java Ellipse.setStroke怎么用?Java Ellipse.setStroke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Ellipse
的用法示例。
在下文中一共展示了Ellipse.setStroke方法的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
}
示例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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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);
}
示例7: 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());
}
示例8: 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());
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
});
}
示例12: getEllipse
import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
/** Return an Ellipse of specified properties */
private Ellipse getEllipse(Circle c) {
Ellipse e = new Ellipse();
e.setCenterY(c.getRadius() - c.getRadius() / 3);
e.setRadiusX(c.getRadius() / 4);
e.setRadiusY(c.getRadius() / 3 - 20);
e.setStroke(Color.BLACK);
e.setFill(Color.WHITE);
return e;
}
示例13: draw
import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
@Override
public void draw(Group g) {
DropShadow ds = new DropShadow();
ds.setOffsetY(3.0);
ds.setColor(Color.color(0.4, 0.4, 0.4));
Ellipse ellipse = new Ellipse();
ellipse.setCenterX(50.0f);
ellipse.setCenterY(50.0f);
ellipse.setRadiusX(50.0f);
ellipse.setRadiusY(25.0f);
ellipse.setFill(Color.RED);
ellipse.setStroke(Color.BLACK);
ellipse.setEffect(ds);
g.getChildren().add(ellipse);
g.addEventHandler(MouseEvent.MOUSE_CLICKED, ev -> {
if (ev.getClickCount() == 2 && MouseButton.PRIMARY == ev.getButton()) {
if (ev.isConsumed())
return;
if (ellipse.getUserData() != null)
return;
JFXColorPicker picker = new JFXColorPicker();
picker.setValue((Color) ellipse.getFill());
picker.valueProperty().addListener(new ChangeListener<Color>() {
@Override
public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color newValue) {
ellipse.setFill(newValue);
}
});
FxUtil.createStageAndShow(" select color ", picker, stage -> {
ellipse.setUserData(new Object());
stage.setAlwaysOnTop(true);
stage.setOnCloseRequest(se -> {
ellipse.setUserData(null);
});
});
ev.consume();
}
});
}
示例14: 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);
}
示例15: 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;
}
}