circle.setCenterX(-circleRadius); circle.setCenterY(0); circle.setRadius(circleRadius); circle.setSmooth(true); JFXDepthManager.setDepth(circle, 1);
private Node createCloseIcon() { Group group = new Group(); group.getStyleClass().add("graphics"); //$NON-NLS-1$ Circle circle = new Circle(); circle.getStyleClass().add("circle"); //$NON-NLS-1$ circle.setRadius(6); circle.setCenterX(6); circle.setCenterY(6); group.getChildren().add(circle); Line line1 = new Line(); line1.getStyleClass().add("line"); //$NON-NLS-1$ line1.setStartX(4); line1.setStartY(4); line1.setEndX(8); line1.setEndY(8); group.getChildren().add(line1); Line line2 = new Line(); line2.getStyleClass().add("line"); //$NON-NLS-1$ line2.setStartX(8); line2.setStartY(4); line2.setEndX(4); line2.setEndY(8); group.getChildren().add(line2); return group; }
@Override protected void layoutChildren() { double size = Math.min(getWidth(), getHeight()) * 0.9; double margin = size / 10; c.setCenterX(size / 2); c.setCenterY(size / 2); c.setRadius(size / 2); a1.setCenterX(size / 4 + margin / 2); a1.setCenterY(size / 2); a1.setRadiusX(size / 4 - margin / 2); a1.setRadiusY(size / 4 - margin / 2); a2.setCenterX(size * 3 / 4 - margin / 2); a2.setCenterY(size / 2); a2.setRadiusX(size / 4 - margin / 2); a2.setRadiusY(size / 4 - margin / 2); } }
/** * draw a circle with given text on the given pane * * @param pane * @param text * @param radius * @param color * @param x * @param y */ public static Circle drawCircleWithText(Pane pane, String text, double radius, Color color, double x, double y) { Circle circle = new Circle(); circle.setRadius(radius); circle.setFill(color); circle.setTranslateX(x); circle.setTranslateY(y); Label label = new Label(text); label.setTranslateX(x + radius); label.setTranslateY(y + radius); label.setTextFill(color); pane.getChildren().addAll(circle, label); return circle; }
/** * Constructs a new map view with an initially empty list of countries which will * result in the entire world to be shown. */ public WorldMapView() { getStyleClass().add(DEFAULT_STYLE_CLASS); setCountryViewFactory(country -> { CountryView view = new CountryView(country); view.setOnMouseEntered(evt -> tooltip.setText(country.getLocale().getDisplayCountry())); Tooltip.install(view, tooltip); return view; }); setLocationViewFactory(location -> { Circle circle = new Circle(); circle.setRadius(4); circle.setTranslateX(-4); circle.setTranslateY(-4); circle.setOnMouseEntered(evt -> tooltip.setText(location.getName())); Tooltip.install(circle, tooltip); return circle; }); }
circle.setRadius(CIRCLE_RADIUS);
circle.setCenterX(-circleRadius); circle.setCenterY(0); circle.setRadius(circleRadius); circle.setSmooth(true); JFXDepthManager.setDepth(circle, 1);