本文整理汇总了Java中javafx.scene.shape.Circle.setOpacity方法的典型用法代码示例。如果您正苦于以下问题:Java Circle.setOpacity方法的具体用法?Java Circle.setOpacity怎么用?Java Circle.setOpacity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Circle
的用法示例。
在下文中一共展示了Circle.setOpacity方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void init(Stage primaryStage) {
Group root = new Group();
primaryStage.setResizable(false);
primaryStage.setScene(new Scene(root, 250, 90));
//create circles by method createMovingCircle listed below
Circle circle1 = createMovingCircle(Interpolator.LINEAR); //default interpolator
circle1.setOpacity(0.7);
Circle circle2 = createMovingCircle(Interpolator.EASE_BOTH); //circle slows down when reached both ends of trajectory
circle2.setOpacity(0.45);
Circle circle3 = createMovingCircle(Interpolator.EASE_IN);
Circle circle4 = createMovingCircle(Interpolator.EASE_OUT);
Circle circle5 = createMovingCircle(Interpolator.SPLINE(0.5, 0.1, 0.1, 0.5)); //one can define own behaviour of interpolator by spline method
root.getChildren().addAll(
circle1,
circle2,
circle3,
circle4,
circle5
);
}
示例2: createMovingCircle
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private Circle createMovingCircle(Interpolator interpolator) {
//create a transparent circle
Circle circle = new Circle(45,45, 40, Color.web("1c89f4"));
circle.setOpacity(0);
//add effect
circle.setEffect(new Lighting());
//create a timeline for moving the circle
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.setAutoReverse(true);
//create a keyValue for horizontal translation of circle to the position 155px with given interpolator
KeyValue keyValue = new KeyValue(circle.translateXProperty(), 155, interpolator);
//create a keyFrame with duration 4s
KeyFrame keyFrame = new KeyFrame(Duration.seconds(4), keyValue);
//add the keyframe to the timeline
timeline.getKeyFrames().add(keyFrame);
return circle;
}
示例3: createMovingCircle
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private Circle createMovingCircle(Interpolator interpolator, Color color){
Circle circle = new Circle(25,25,35,color);
circle.setOpacity(0.0);
//add effect
circle.setEffect(new Lighting());
//create a timeline for moving the circle
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.setAutoReverse(true);
//create a keyValue for horizontal translation of circle to the position 155px with given interpolator
KeyValue keyValue = new KeyValue(circle.translateXProperty(), 155, interpolator);
//create a keyFrame with duration 4s
KeyFrame keyFrame = new KeyFrame(Duration.seconds(4), keyValue);
//add the keyframe to the timeline
timeline.getKeyFrames().add(keyFrame);
return circle;
}
示例4: buildFragments
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private List<Circle> buildFragments(BubbleType bubbleType) {
List<Circle> fragments = new ArrayList<>(nbFragments);
for (int i = 0; i < nbFragments; i++) {
Circle fragment = new Circle();
fragment.setOpacity(1);
fragment.setRadius(20);
fragment.setVisible(true);
fragment.setCenterX(-100);
fragment.setCenterY(-100);
if (bubbleType == BubbleType.COLOR) {
fragment.setFill(new Color(Math.random(), Math.random(), Math.random(), 1));
} else {
fragment.setFill(new ImagePattern(newPhoto(), 0, 0, 1, 1, true));
}
fragments.add(fragment);
}
return fragments;
}
示例5: 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;
}
示例6: 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;
}
示例7: DayViewSkin
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public DayViewSkin(T view) {
super(view);
earlyHoursRegion = new Region();
earlyHoursRegion.setMouseTransparent(true);
earlyHoursRegion.getStyleClass().add("early-hours-region"); //$NON-NLS-1$
earlyHoursRegion.setManaged(false);
getChildren().add(earlyHoursRegion);
lateHoursRegion = new Region();
lateHoursRegion.setMouseTransparent(true);
lateHoursRegion.getStyleClass().add("late-hours-region"); //$NON-NLS-1$
lateHoursRegion.setManaged(false);
getChildren().add(lateHoursRegion);
for (int i = 1; i < 24; i++) {
createLine("half-hour-line"); //$NON-NLS-1$
createLine("full-hour-line"); //$NON-NLS-1$
}
createLine("half-hour-line"); //$NON-NLS-1$
currentTimeCircle = new Circle(4);
currentTimeCircle.getStyleClass().add("current-time-circle"); //$NON-NLS-1$
currentTimeCircle.setManaged(false);
currentTimeCircle.setMouseTransparent(true);
currentTimeCircle.setOpacity(0);
currentTimeCircle.visibleProperty().bind(view.enableCurrentTimeMarkerProperty());
getChildren().add(currentTimeCircle);
currentTimeLine = new Line();
currentTimeLine.getStyleClass().add("current-time-line"); //$NON-NLS-1$
currentTimeLine.setManaged(false);
currentTimeLine.setMouseTransparent(true);
currentTimeLine.setOpacity(0);
currentTimeLine.visibleProperty().bind(view.enableCurrentTimeMarkerProperty());
getChildren().add(currentTimeLine);
if (!(this instanceof WeekDayViewSkin)) {
/*
* Dragging inside week day views will be handled by a drag controller
* installed on the week view, not on the individual days.
*/
new DayViewEditController(view);
}
setupCurrentTimeMarkerSupport();
view.draggedEntryProperty().addListener(it -> addOrRemoveDraggedEntryView());
view.showCurrentTimeMarkerProperty().addListener(it -> updateTimelineVisibility());
view.showCurrentTimeTodayMarkerProperty().addListener(it -> updateTimelineVisibility());
view.layoutProperty().addListener(it -> view.requestLayout());
updateShowMarkers();
updateTimelineVisibility();
view.dateProperty().addListener(it -> {
if (displayedDate == null || !displayedDate.equals(view.getDate())) {
loadData("date changed");
}
});
view.suspendUpdatesProperty().addListener(evt -> loadData("suspend updates was set to false"));
view.getCalendars().addListener((javafx.beans.Observable obs) -> loadData("list of calendars changed"));
updateLineStyling();
final InvalidationListener styleLinesListener = it -> updateLineStyling();
view.startTimeProperty().addListener(styleLinesListener);
view.endTimeProperty().addListener(styleLinesListener);
view.earlyLateHoursStrategyProperty().addListener(styleLinesListener);
loadData("initial data loading");
}
示例8: initialize
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
backgroundImageView.setMouseTransparent(true);
movieList.setCellFactory(c -> new MovieListCell());
movieList.setItems(model.getMovies());
movieList.setCacheHint(CacheHint.SPEED);
model.selectedMovieProperty().bind(movieList.getSelectionModel().selectedItemProperty());
model.selectedMovieProperty().addListener((obs, oldVal, newVal) -> updateDetailArea());
detailView.visibleProperty().bind(model.selectedMovieProperty().isNotNull());
maximizeAppIconView.setOnMouseClicked(e -> ((Stage) rootPane.getScene().getWindow()).setFullScreen(!((Stage) rootPane.getScene().getWindow()).isFullScreen()));
closeAppIconView.setOnMouseClicked(e -> rootPane.getScene().getWindow().hide());
moviePosterWrapper.setRotationAxis(new Point3D(0, 1, 0));
moviePosterWrapper.setCache(true);
moviePosterWrapper.setCacheShape(true);
moviePosterWrapper.setCacheHint(CacheHint.SPEED);
posterImageView.setCache(true);
posterImageView.setCacheHint(CacheHint.SPEED);
Util.installWindowDragListener(rootPane);
final ChangeListener backgroundImageResizeListener = (obs, oldVal, newVal) -> {
final Image image = backgroundImageView.getImage();
if (backgroundImageView.getImage() != null) {
Dimension2D backgroundDimension = shouldFitIn(image.getWidth(), image.getHeight(), rootPane.getWidth(), rootPane.getHeight());
backgroundImageView.setFitWidth(backgroundDimension.getWidth());
backgroundImageView.setFitHeight(backgroundDimension.getHeight());
}
};
rootPane.widthProperty().addListener(backgroundImageResizeListener);
rootPane.heightProperty().addListener(backgroundImageResizeListener);
backgroundImageView.imageProperty().addListener(backgroundImageResizeListener);
addFeatureSupport();
updateDetailArea();
watchTrailerButton.setOnAction(e -> playTrailer());
mediaView.fitWidthProperty().bind(rootPane.widthProperty().subtract(64.0));
mediaStateIcon = new AnimatedIcon();
mediaStateIcon.setOpacity(0.6);
mediaStateIcon.setScaleX(4.0);
mediaStateIcon.setScaleY(4.0);
mediaStateIcon.setMouseTransparent(true);
mediaStateIcon.toPause();
Circle circle = new Circle();
circle.setMouseTransparent(true);
circle.setRadius(76);
circle.setStroke(Color.ORANGE);
circle.setStrokeWidth(8);
circle.setOpacity(0.6);
StackPane mediaControl = new StackPane(circle, mediaStateIcon);
mediaControl.setMouseTransparent(true);
mediaControl.setMinWidth(USE_PREF_SIZE);
mediaControl.setMinHeight(USE_PREF_SIZE);
mediaControl.setMaxWidth(USE_PREF_SIZE);
mediaControl.setMaxHeight(USE_PREF_SIZE);
mediaControl.setVisible(false);
mediaPane.getChildren().addAll(mediaControl);
//TODO: Animation
mediaView.setOnMouseEntered(e -> mediaControl.setVisible(true));
mediaView.setOnMouseExited(e -> mediaControl.setVisible(false));
movieList.getSelectionModel().select(0);
rootPane.setOnKeyPressed(evt -> {
if (evt.getCode().equals(KeyCode.ESCAPE)) {
stopTrailer();
}
});
}