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


Java Circle.setRadius方法代码示例

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


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

示例1: bind

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public static void bind(final Link subject, final ArrowHead target) {
    final Circle arrowHeadField = new Circle();
    arrowHeadField.centerXProperty().bind(target.xProperty());
    arrowHeadField.centerYProperty().bind(target.yProperty());
    arrowHeadField.setRadius(target.getHeadHeight());

    final LineBinding lineBinding = LineBinding.getCircleBindings(arrowHeadField, new Point(subject.startXProperty(), subject.startYProperty()));

    if (target.shouldBindToTip()) {
        subject.endXProperty().bind(target.xProperty());
        subject.endYProperty().bind(target.yProperty());
    } else {
        subject.endXProperty().bind(lineBinding.startX);
        subject.endYProperty().bind(lineBinding.startY);
    }
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:17,代码来源:BindingHelper.java

示例2: moveCircle

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

        double centerX = (scene.getWidth() - maxRadius) * Math.random() + maxRadius;
        double centerY = scene.getHeight();

        C.setCenterX(centerX);
        //C.setTranslateY((scene.getHeight() - maxRadius) * Math.random() + maxRadius);
        C.setCenterY(centerY);
        double radius = (maxRadius - minRadius) * Math.random() + minRadius;
        C.setFill(new Color(Math.random(), Math.random(), Math.random(), 1));
        C.setRadius(radius);

        Timeline timeline = new Timeline();

        double timelength = ((maxTimeLength - minTimeLength) * Math.random() + minTimeLength) * 1000;

        timeline.getKeyFrames().add(new KeyFrame(new Duration(timelength), new KeyValue(C.centerYProperty(), 0 - maxRadius, Interpolator.EASE_IN)));

       /* SequentialTransition sequence = new SequentialTransition();

        for(int i = 0; i < 10; i++) {
            sequence.getChildren().add(new KeyFrame(new Duration(timelength / 10), new KeyValue(C.centerXProperty(), centerX - 100)));
            sequence.getChildren().add(new KeyFrame(new Duration(timelength / 10), new KeyValue(C.centerXProperty(), centerX + 100)));
        }*/

        timeline.play();

        timeline.setOnFinished(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent actionEvent) {

                //moveCircle(C);
                newCircle();
            }
        });
    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:38,代码来源:Bubble.java

示例3: configureBackground

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

示例4: initializeDeclarations

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void initializeDeclarations() {
    // Initially style the declarations
    declaration.setStyleSpans(0, ComponentPresentation.computeHighlighting(getComponent().getDeclarations()));

    final Circle circle = new Circle(0);
    if(getComponent().isDeclarationOpen()) {
        circle.setRadius(1000);
    }
    final ObjectProperty<Node> clip = new SimpleObjectProperty<>(circle);
    declaration.clipProperty().bind(clip);
    clip.set(circle);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:13,代码来源:ComponentController.java

示例5: DroneBase

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
/** 
 * Constructor
 * @param baseName Unique basename
 * @param latitude of base
 * @param longitude of base
 * @param altitude of base
 * @throws FlightZoneException 
 */
public DroneBase(String baseName, long lat, long lon, int alt, int radius) throws FlightZoneException{
	basePosition = new Coordinates(lat,lon,alt);
	coordTransform = DecimalDegreesToXYConverter.getInstance();
	this.baseName = baseName;	
	circle = new Circle();
	circle.setRadius(radius);
	Point point = coordTransform.getPoint(lat, lon);
	circle.setCenterX(point.getX()+radius*.6);
	circle.setCenterY(point.getY()+radius*.6);
	circle.setFill(Color.LIGHTYELLOW);
	circle.setStroke(Color.BLACK);
	circle.setStrokeWidth(1);
}
 
开发者ID:JaneClelandHuang,项目名称:Dronology,代码行数:22,代码来源:DroneBase.java

示例6: createCloseIcon

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
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;
}
 
开发者ID:michaelnetter,项目名称:dracoon-dropzone,代码行数:30,代码来源:MyPopOverSkin.java

示例7: toggleDeclaration

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public void toggleDeclaration(final MouseEvent mouseEvent) {
    final Circle circle = new Circle(0);
    circle.setCenterX(component.get().getWidth() - (toggleDeclarationButton.getWidth() - mouseEvent.getX()));
    circle.setCenterY(-1 * mouseEvent.getY());

    final ObjectProperty<Node> clip = new SimpleObjectProperty<>(circle);
    declaration.clipProperty().bind(clip);

    final Transition rippleEffect = new Transition() {
        private final double maxRadius = Math.sqrt(Math.pow(getComponent().getWidth(), 2) + Math.pow(getComponent().getHeight(), 2));

        {
            setCycleDuration(Duration.millis(500));
        }

        protected void interpolate(final double fraction) {
            if (getComponent().isDeclarationOpen()) {
                circle.setRadius(fraction * maxRadius);
            } else {
                circle.setRadius(maxRadius - fraction * maxRadius);
            }
            clip.set(circle);
        }
    };

    final Interpolator interpolator = Interpolator.SPLINE(0.785, 0.135, 0.15, 0.86);
    rippleEffect.setInterpolator(interpolator);

    rippleEffect.play();
    getComponent().declarationOpenProperty().set(!getComponent().isDeclarationOpen());
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:32,代码来源:ComponentController.java

示例8: createCircle

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
/**
 * Ritorna il cerchio che racchiuderà l'indice del nodo
 * @return cerchio che indicherà il nodo.
 */
private Circle createCircle() {
			
	Circle c = new Circle();
	c.setFill((Color) currentPane.getBackground().getFills().get(0).getFill());
	c.setStroke(Color.BLACK);
	c.setStrokeWidth(3);
	
	c.setRadius(Singleton.NODE_RADIUS);
	
	return c;
}
 
开发者ID:steppp,项目名称:Breadth-First-Search,代码行数:16,代码来源:GraphDrawer.java

示例9: createGridPattern

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public ImagePattern createGridPattern() {
    Collections.shuffle(array_sizes);
    index = array_sizes.get(0);
    size = arraypts[ index ].length;
    //size = 10;
    indicator = new ProgressIndicator(0);
    double w = gridSize;
    double h = gridSize;

    circle = new Circle();
    circle.setRadius(45.0f);

    circle.setOpacity(1);
    circle.setFill(Color.BLUE);
    circle.setVisible(true);
    canvas.setGridLinesVisible(true);

    GazeUtils.addEventFilter(circle);
    enterEvent = buildEvent();
    circle.addEventFilter(MouseEvent.ANY, enterEvent);
    circle.addEventFilter(GazeEvent.ANY, enterEvent);

    indicator.setOpacity(0.0);
    canvas.add(indicator, arraypts[index][count], arraypts[index][count+1]);
    canvas.add(circle,arraypts[index][count], arraypts[index][count+1]);
    Image image = canvas.snapshot(new SnapshotParameters(), null);
    ImagePattern pattern = new ImagePattern(image, 0, 0, w, h, false);

    return pattern;

}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:32,代码来源:Circles_points_handler.java

示例10: createGridPattern

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public ImagePattern createGridPattern() {
    Collections.shuffle(array_sizes);
    index = array_sizes.get(0);
    size = arraypts[ index ].length;
    //size = 10;
    indicator = new ProgressIndicator(0);
    double w = gridSize;
    double h = gridSize;

    circle = new Circle();
    circle.setRadius(45.0f);

    circle.setOpacity(1);
    circle.setFill(Color.LIGHTBLUE);
    circle.setVisible(true);
    canvas.setGridLinesVisible(true);

    GazeUtils.addEventFilter(circle);
    enterEvent = buildEvent();
    circle.addEventFilter(MouseEvent.ANY, enterEvent);
    circle.addEventFilter(GazeEvent.ANY, enterEvent);


    indicator.setOpacity(0.0);
    canvas.add(indicator, arraypts[index][count], arraypts[index][count+1]);
    canvas.add(circle,arraypts[index][count], arraypts[index][count+1]);
    Image image = canvas.snapshot(new SnapshotParameters(), null);
    ImagePattern pattern = new ImagePattern(image, 0, 0, w, h, false);

    return pattern;

}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:33,代码来源:Circles_handler2.java

示例11: createIndicator

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private Circle createIndicator(Double toX, Double toY, Double radius) {
	
	indicator = new Circle();
	indicator.setRadius(radius);
	indicator.setCenterX(toX);
	indicator.setCenterY(toY);
	
	return indicator;
}
 
开发者ID:steppp,项目名称:Breadth-First-Search,代码行数:10,代码来源:Arrow.java

示例12: updateClipping

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void updateClipping() {
    if (movieView.isUseClipping()) {
        Circle circle = new Circle();
        double size = 30;
        circle.setRadius(size);
        circle.setCenterX(size);
        circle.setCenterY(size);
        directorImage.setClip(circle);
    } else {
        directorImage.setClip(null);
    }
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:13,代码来源:MovieCell.java

示例13: update

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

        if (!entries.isEmpty()) {

            List<Entry<?>> workingList = new ArrayList<>(entries);

            /*
             * Individual calendars are already sorted, but now we are
             * displaying entries from several calendars, so let's resort.
             */
            Collections.sort(workingList);

            for (Entry<?> entry : workingList) {
                Calendar calendar = entry.getCalendar();

                BorderPane borderPane = new BorderPane();
                borderPane.getStyleClass().add("entry");

                Label titleLabel = new Label(entry.getTitle());
                BorderPane.setAlignment(titleLabel, Pos.CENTER_LEFT);
                titleLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
                titleLabel.getStyleClass().add("title"); //$NON-NLS-1$
                borderPane.setCenter(titleLabel);

                Circle colorDot = new Circle();
                colorDot.setRadius(2.5);
                colorDot.getStyleClass().add(
                        calendar.getStyle() + "-icon-small"); //$NON-NLS-1$
                titleLabel.setGraphic(colorDot);

                Label timeLabel = new Label();
                if (entry.isFullDay()) {
                    timeLabel.setText(Messages.getString("EntriesPane.FULL_DAY")); //$NON-NLS-1$
                } else {
                    timeLabel.setText(DateTimeFormatter.ofLocalizedTime(
                            FormatStyle.SHORT).format(entry.getStartTime()));
                }

                borderPane.setRight(timeLabel);

                timeLabel.getStyleClass().add("time"); //$NON-NLS-1$
                BorderPane.setAlignment(timeLabel, Pos.CENTER_RIGHT);

                getChildren().add(borderPane);
            }
        }
    }
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:48,代码来源:EntriesPane.java

示例14: MonthEntryViewSkin

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public MonthEntryViewSkin(MonthEntryView view) {
    super(view);

    Entry<?> entry = view.getEntry();
    if (entry.isRecurrence()) {
        entry = entry.getRecurrenceSourceEntry();
    }

    Calendar calendar = entry.getCalendar();

    colorDot = new Circle();
    colorDot.setRadius(2.5);
    colorDot.setMouseTransparent(true);

    titleLabel = new Label();
    titleLabel.setGraphic(colorDot);
    titleLabel.setMinSize(0, 0);
    titleLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    titleLabel.setMouseTransparent(true);

    timeLabel = new Label();
    timeLabel.setMouseTransparent(true);
    timeLabel.setMaxHeight(Double.MAX_VALUE);
    timeLabel.setMouseTransparent(true);

    // update in these cases
    entry.titleProperty().addListener(weakUpdateViewListener);
    entry.fullDayProperty().addListener(weakUpdateViewListener);
    entry.intervalProperty().addListener(weakUpdateViewListener);
    entry.calendarProperty().addListener(weakUpdateViewListener);

    view.positionProperty().addListener(weakUpdateViewListener);

    if (calendar != null) {
        calendar.styleProperty().addListener(weakUpdateViewListener);
    }

    getChildren().addAll(titleLabel, timeLabel);

    updateView();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:42,代码来源:MonthEntryViewSkin.java

示例15: SearchResultListViewCell

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public SearchResultListViewCell() {
    setPrefWidth(0);

    getStyleClass().add("search-result-cell"); //$NON-NLS-1$

    colorCircle = new Circle();
    colorCircle.setRadius(3.5);

    titleLabel = new Label();
    titleLabel.setMinWidth(0);
    titleLabel.setGraphic(colorCircle);
    titleLabel.getStyleClass().add("title-label"); //$NON-NLS-1$

    dateLabel = new Label();
    dateLabel.setMinWidth(0);
    dateLabel.getStyleClass().add("date-label"); //$NON-NLS-1$

    timeLabel = new Label();
    timeLabel.setMinWidth(0);
    timeLabel.getStyleClass().add("time-label"); //$NON-NLS-1$

    BorderPane dateTimePane = new BorderPane();
    dateTimePane.getStyleClass().add("date-time-pane");
    dateTimePane.setLeft(dateLabel);
    dateTimePane.setRight(timeLabel);

    borderPane = new BorderPane();
    borderPane.getStyleClass().add("container");
    borderPane.setTop(titleLabel);
    borderPane.setBottom(dateTimePane);

    setGraphic(borderPane);
    setContentDisplay(ContentDisplay.GRAPHIC_ONLY);

    setOnMouseClicked(evt -> {
        if (evt.getClickCount() == 2) {
            Entry<?> entry = getItem();
            if (entry != null) {
                fireEvent(new RequestEvent(this, this, entry));
            }
        }
    });
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:44,代码来源:SearchResultViewSkin.java


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