Java Code Examples for javafx.scene.shape.Circle#setStrokeWidth()
The following examples show how to use
javafx.scene.shape.Circle#setStrokeWidth() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserDetail.java From DashboardFx with GNU General Public License v3.0 | 6 votes |
@Override public Node icon() { Image image = new Image(getClass().getResource("/com/gn/media/img/avatar.png").toExternalForm()); ImageView imageView = new ImageView(image); imageView.setFitHeight(30); imageView.setFitWidth(30); Circle circle = new Circle(12); circle.setStroke(Color.WHITE); circle.setStrokeWidth(5); circle.setCenterX(imageView.getFitWidth() / 2); circle.setCenterY(imageView.getFitHeight() / 2); imageView.setClip(circle); return imageView; }
Example 2
Source File: CalibrationButton.java From tet-java-client with BSD 2-Clause "Simplified" License | 6 votes |
private void init() { Group g = new Group(); mCircle = new Circle(0,0,40); mCircle.setFill(Color.WHITE); mCircle.setStrokeWidth(3); mCircle.setStrokeMiterLimit(10); mCircle.setStrokeType(StrokeType.CENTERED); mCircle.setStroke(Color.valueOf("0x333333")); Circle inner = new Circle(0,0,8); inner.setFill(Color.valueOf("0xFFFFFF00")); inner.setStrokeWidth(4); inner.setStrokeMiterLimit(10); inner.setStrokeType(StrokeType.INSIDE); inner.setStroke(Color.valueOf("0x000000")); g.getChildren().addAll(mCircle, inner); setAlignment(g, Pos.CENTER); getChildren().add(g); }
Example 3
Source File: Indicator.java From tilesfx with Apache License 2.0 | 6 votes |
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("indicator"); ring = new Circle(PREFERRED_WIDTH * 0.5); ring.setStrokeType(StrokeType.INSIDE); ring.setStrokeWidth(PREFERRED_WIDTH * 0.078125); ring.setStroke(getRingColor()); ring.setFill(Color.TRANSPARENT); dot = new Circle(PREFERRED_WIDTH * 0.3125); dot.setFill(getDotOnColor()); pane = new Pane(ring, dot); getChildren().setAll(pane); }
Example 4
Source File: FarCry4Loading.java From FXTutorials with MIT License | 6 votes |
public LoadingCircle() { Circle circle = new Circle(20); circle.setFill(null); circle.setStroke(Color.WHITE); circle.setStrokeWidth(2); Rectangle rect = new Rectangle(20, 20); Shape shape = Shape.subtract(circle, rect); shape.setFill(Color.WHITE); getChildren().add(shape); animation = new RotateTransition(Duration.seconds(2.5), this); animation.setByAngle(-360); animation.setInterpolator(Interpolator.LINEAR); animation.setCycleCount(Animation.INDEFINITE); animation.play(); }
Example 5
Source File: CircleSample.java From marathonv5 with Apache License 2.0 | 5 votes |
public static Node createIconContent() { Circle circle = new Circle(57,57,40); circle.setStroke(Color.web("#b9c0c5")); circle.setStrokeWidth(5); circle.getStrokeDashArray().addAll(15d,15d); circle.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)); circle.setEffect(effect); return circle; }
Example 6
Source File: DoughnutChart.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public DoughnutChart(ObservableList<Data> pieData) { super(pieData); innerCircle = new Circle(); // just styled in code for demo purposes, // use a style class instead to style via css. innerCircle.setFill(Color.WHITESMOKE); innerCircle.setStroke(Color.WHITE); innerCircle.setStrokeWidth(3); }
Example 7
Source File: FindIcon.java From FxDock with Apache License 2.0 | 5 votes |
public FindIcon(double size) { super(size); double r = 0.3 * size; double w = 0.075 * size; double gap = 0.12 * size; double handle = 0.15 * size; Circle c = new Circle(0, 0, r); c.setFill(null); c.setStrokeWidth(w); c.setStroke(Color.BLACK); c.setFill(null); FxPath p = new FxPath(); p.setStrokeLineCap(StrokeLineCap.SQUARE); p.setStroke(Color.BLACK); p.setStrokeWidth(w); p.moveto(r, 0); p.lineto(r + gap, 0); FxPath h = new FxPath(); h.setStrokeLineCap(StrokeLineCap.ROUND); h.setStroke(Color.BLACK); h.setStrokeWidth(w * 2); h.moveto(r + gap, 0); h.lineto(r + gap + handle, 0); Group g = new Group(c, p, h); g.setRotate(135); g.setTranslateX(size * 0.30); g.setTranslateY(size * 0.54); add(g); }
Example 8
Source File: ClearIcon.java From FxDock with Apache License 2.0 | 5 votes |
public ClearIcon(double size) { super(size); double r = 0.4 * size; double w = 0.075 * size; double d = 0.14 * size; Circle c = new Circle(0, 0, r); c.setFill(null); c.setStrokeWidth(0); c.setStroke(null); c.setFill(Color.LIGHTGRAY); FxPath p = new FxPath(); p.setStrokeLineCap(StrokeLineCap.SQUARE); p.setStroke(Color.WHITE); p.setStrokeWidth(w); p.moveto(-d, -d); p.lineto(d, d); p.moveto(d, -d); p.lineto(-d, d); Group g = new Group(c, p); g.setTranslateX(size * 0.5); g.setTranslateY(size * 0.5); add(g); }
Example 9
Source File: CircleSegmentHandlePart.java From gef with Eclipse Public License 2.0 | 5 votes |
/** * Creates the visual representation of this selection handle. * * @return {@link Node} representing the handle visually */ @Override protected Circle doCreateVisual() { Circle circle = new Circle(DEFAULT_SIZE / 2d); // initialize invariant visual properties circle.setStroke(getStroke()); circle.setFill(getMoveFill()); circle.setStrokeWidth(1); circle.setStrokeType(StrokeType.OUTSIDE); return circle; }
Example 10
Source File: Dialogs.java From helloiot with GNU General Public License v3.0 | 5 votes |
public static Node createSmallLoadingNode () { Circle c0 = new Circle(45); c0.setFill(Color.TRANSPARENT); c0.setStrokeWidth(0.0); Circle c2 = new Circle(40); c2.setFill(Color.TRANSPARENT); c2.setStrokeType(StrokeType.INSIDE); c2.setStrokeLineCap(StrokeLineCap.BUTT); c2.getStrokeDashArray().addAll(41.89); // 40 * 2 * 3.1416 / 6 c2.setCache(true); c2.setCacheHint(CacheHint.ROTATE); c2.getStyleClass().add("loading-circle"); setRotate(c2, true, 360.0, 14); Circle c3 = new Circle(30); c3.setFill(Color.TRANSPARENT); c3.setStrokeType(StrokeType.INSIDE); c3.setStrokeLineCap(StrokeLineCap.BUTT); c3.getStyleClass().add("loading-circle"); Group g = new Group(c0, c2, c3); g.getStylesheets().add(Dialogs.class.getResource("/com/adr/helloiot/styles/loading.css").toExternalForm()); return g; }
Example 11
Source File: Dialogs.java From helloiot with GNU General Public License v3.0 | 5 votes |
public static Node createLoadingNode () { Circle c0 = new Circle(65); c0.setFill(Color.TRANSPARENT); c0.setStrokeWidth(0.0); Circle c1 = new Circle(50); c1.setFill(Color.TRANSPARENT); c1.setStrokeType(StrokeType.INSIDE); c1.setStrokeLineCap(StrokeLineCap.BUTT); c1.getStrokeDashArray().addAll(78.54); // 50 * 2 * 3.1416 / 4 c1.setCache(true); c1.setCacheHint(CacheHint.ROTATE); c1.getStyleClass().add("loading-circle"); setRotate(c1, true, 440.0, 10); Circle c2 = new Circle(40); c2.setFill(Color.TRANSPARENT); c2.setStrokeType(StrokeType.INSIDE); c2.setStrokeLineCap(StrokeLineCap.BUTT); c2.getStrokeDashArray().addAll(41.89); // 40 * 2 * 3.1416 / 6 c2.setCache(true); c2.setCacheHint(CacheHint.ROTATE); c2.getStyleClass().add("loading-circle"); setRotate(c2, true, 360.0, 14); Circle c3 = new Circle(30); c3.setFill(Color.TRANSPARENT); c3.setStrokeType(StrokeType.INSIDE); c3.setStrokeLineCap(StrokeLineCap.BUTT); c3.getStyleClass().add("loading-circle"); Group g = new Group(c0, c1, c2, c3); g.getStylesheets().add(Dialogs.class.getResource("/com/adr/helloiot/styles/loading.css").toExternalForm()); return g; }
Example 12
Source File: SmoothAreaChartTileSkin.java From tilesfx with Apache License 2.0 | 5 votes |
private void drawDataPoint(final double X, final double Y, final Color COLOR) { double radius = size * 0.02; Circle circle = new Circle(X, Y, radius); circle.setStroke(tile.getBackgroundColor()); circle.setFill(COLOR); circle.setStrokeWidth(size * 0.01); dataPointGroup.getChildren().add(circle); }
Example 13
Source File: StopWatch.java From netbeans with Apache License 2.0 | 5 votes |
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); }
Example 14
Source File: StopWatchSample.java From marathonv5 with Apache License 2.0 | 5 votes |
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); }
Example 15
Source File: CircleSample.java From marathonv5 with Apache License 2.0 | 5 votes |
public static Node createIconContent() { Circle circle = new Circle(57,57,40); circle.setStroke(Color.web("#b9c0c5")); circle.setStrokeWidth(5); circle.getStrokeDashArray().addAll(15d,15d); circle.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)); circle.setEffect(effect); return circle; }
Example 16
Source File: StopWatchSample.java From marathonv5 with Apache License 2.0 | 5 votes |
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); }
Example 17
Source File: MinimalClockSkin.java From Medusa with Apache License 2.0 | 4 votes |
@Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } ZonedDateTime time = clock.getTime(); secondBackgroundCircle = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.48); secondBackgroundCircle.setStrokeWidth(PREFERRED_WIDTH * 0.008); secondBackgroundCircle.setStrokeType(StrokeType.CENTERED); secondBackgroundCircle.setStrokeLineCap(StrokeLineCap.ROUND); secondBackgroundCircle.setFill(null); secondBackgroundCircle.setStroke(Helper.getTranslucentColorFrom(clock.getSecondColor(), 0.2)); secondBackgroundCircle.setVisible(clock.isSecondsVisible()); secondBackgroundCircle.setManaged(clock.isSecondsVisible()); dateText = new Text(dateTextFormatter.format(time)); dateText.setVisible(clock.isDateVisible()); dateText.setManaged(clock.isDateVisible()); hour = new Text(HOUR_FORMATTER.format(time)); hour.setFill(clock.getHourColor()); minute = new Text(MINUTE_FORMATTER.format(time)); minute.setFill(clock.getMinuteColor()); minuteCircle = new Circle(0.075 * PREFERRED_WIDTH); secondArc = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.96, PREFERRED_WIDTH * 0.48, 90, (-6 * clock.getTime().getSecond())); secondArc.setStrokeWidth(PREFERRED_WIDTH * 0.008); secondArc.setStrokeType(StrokeType.CENTERED); secondArc.setStrokeLineCap(StrokeLineCap.BUTT); secondArc.setFill(null); secondArc.setStroke(clock.getSecondColor()); secondArc.setVisible(clock.isSecondsVisible()); secondArc.setManaged(clock.isSecondsVisible()); pane = new Pane(secondBackgroundCircle, dateText, hour, secondArc, minuteCircle, minute); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), new Insets(PREFERRED_WIDTH * 0.04)))); getChildren().setAll(pane); }
Example 18
Source File: FlatSkin.java From Medusa with Apache License 2.0 | 4 votes |
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); } } colorRing = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.5); colorRing.setFill(Color.TRANSPARENT); colorRing.setStrokeWidth(PREFERRED_WIDTH * 0.0075); colorRing.setStroke(gauge.getBarColor()); bar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.468, PREFERRED_HEIGHT * 0.468, 90, 0); bar.setType(ArcType.OPEN); bar.setStroke(gauge.getBarColor()); bar.setStrokeWidth(PREFERRED_WIDTH * 0.15); bar.setStrokeLineCap(StrokeLineCap.BUTT); bar.setFill(null); separator = new Line(PREFERRED_WIDTH * 0.5, 1, PREFERRED_WIDTH * 0.5, 0.16667 * PREFERRED_HEIGHT); separator.setStroke(gauge.getBorderPaint()); separator.setFill(Color.TRANSPARENT); titleText = new Text(gauge.getTitle()); titleText.setFont(Fonts.robotoLight(PREFERRED_WIDTH * 0.08)); titleText.setFill(gauge.getTitleColor()); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); valueText = new Text(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), gauge.getCurrentValue())); valueText.setFont(Fonts.robotoRegular(PREFERRED_WIDTH * 0.27333)); valueText.setFill(gauge.getValueColor()); Helper.enableNode(valueText, gauge.isValueVisible()); unitText = new Text(gauge.getUnit()); unitText.setFont(Fonts.robotoLight(PREFERRED_WIDTH * 0.08)); unitText.setFill(gauge.getUnitColor()); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); pane = new Pane(colorRing, bar, separator, titleText, valueText, unitText); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth())))); getChildren().setAll(pane); }
Example 19
Source File: CardViewComponent.java From FXGLGames with MIT License | 4 votes |
Title(String name, int level, Color outlineColor) { super(-15); Circle circle = new Circle(20, 20, 20, Color.WHITE); circle.setStrokeWidth(2.0); circle.setStroke(outlineColor); var stack = new StackPane(circle, getUIFactory().newText("" + level, Color.BLACK, 30.0)); Rectangle rect = new Rectangle(180, 30, Color.color(1, 1, 1, 0.8)); rect.setStroke(Color.BLACK); getChildren().addAll(stack, new StackPane(rect, getUIFactory().newText(name, Color.BLACK, 16.0))); stack.toFront(); }
Example 20
Source File: LoadingScreen.java From FXTutorials with MIT License | 4 votes |
private Node makeSymbol() { Pane symbol = new Pane(); GaussianBlur blur = new GaussianBlur(2.5); symbol.setEffect(blur); Rectangle top = new Rectangle(70, 5, Colors.LOADING_SYMBOL); top.setArcWidth(25); top.setArcHeight(25); Rectangle mid = new Rectangle(100, 5, Colors.LOADING_SYMBOL); mid.setArcWidth(25); mid.setArcHeight(25); Rectangle bot = new Rectangle(70, 5, Colors.LOADING_SYMBOL); bot.setArcWidth(25); bot.setArcHeight(25); top.setTranslateX(15); bot.setTranslateX(15); top.setTranslateY(10); mid.setTranslateY(10 + 10 + 5); bot.setTranslateY(10 + 10 + 5 + 10 + 5); Circle circle = new Circle(25, 25, 25, Color.BLACK); circle.setStroke(Colors.LOADING_SYMBOL); circle.setStrokeWidth(2); circle.setTranslateX(25); Circle circle2 = new Circle(25, 25, 25, Color.BLACK); circle2.setStroke(Colors.LOADING_SYMBOL); circle2.setStrokeWidth(1); circle2.setTranslateX(25); circle2.setRadius(2); Circle point = new Circle(25, 25, 25, Colors.LOADING_SYMBOL); point.setStroke(Colors.LOADING_SYMBOL); point.setStrokeWidth(1); point.setTranslateX(25); point.setRadius(1); KeyFrame frame = new KeyFrame(Duration.seconds(1), new KeyValue(circle2.radiusProperty(), 20)); timeline.getKeyFrames().add(frame); timeline.setCycleCount(5); timeline.play(); symbol.getChildren().addAll(top, mid, bot, circle, circle2, point); return symbol; }