/** * Creates a container with the given animation type and duration. * * @param duration the duration of the animation * @param animationProducer the {@link KeyFrame} instances that define the animation */ public ExtendedAnimatedFlowContainer(Duration duration, Function<AnimatedFlowContainer, List<KeyFrame>> animationProducer) { this.view = new StackPane(); this.duration = duration; this.animationProducer = animationProducer; placeholder = new ImageView(); placeholder.setPreserveRatio(true); placeholder.setSmooth(true); }
ImageView scaledImageView = new ImageView(image); scaledImageView.setSmooth(false);
Image fullImage = new Image(imageURL); // define crop in image coordinates: Rectangle2D croppedPortion = new Rectangle2D(x, y, width, height); // target width and height: double scaledWidth = ... ; double scaledHeight = ... ; ImageView imageView = new ImageView(fullImage); imageView.setViewport(croppedPortion); imageView.setFitWidth(scaledWidth); imageView.setFitHeight(scaledHeight); imageView.setSmooth(true);
imgv.setFitWidth(15); imgv.setPreserveRatio(true); imgv.setSmooth(true); hb.setGraphic(imgv); hb.setTooltip(ControlFactory.getTooltip("Klient entfernen"));
/** * Creates a container with the given animation type and duration * @param duration the duration of the animation * @param animationProducer the {@link KeyFrame} instances that define the animation */ public AnimatedFlowContainer(Duration duration, Function<AnimatedFlowContainer, List<KeyFrame>> animationProducer) { this.root = new StackPane(); this.duration = duration; this.animationProducer = animationProducer; placeholder = new ImageView(); placeholder.setPreserveRatio(true); placeholder.setSmooth(true); }
img.setFitHeight(10d); img.setPreserveRatio(true); img.setSmooth(true); setGraphic(img); setContentDisplay(ContentDisplay.RIGHT);
/** * init the Image */ public void initImage() { // simple displays ImageView the image as is imageView = new ImageView(); imageView.setImage(getImage()); imageView.setSmooth(true); imageView.setCache(true); }
// resizes the image to have width and height of 100 while preserving the ratio and using // higher quality filtering method; this ImageView is also cached to // improve performance ImageView iv2 =newImageView(); iv2.setImage(image); iv2.setFitHeight(100); iv2.setFitWidth(100); iv2.setPreserveRatio(true); iv2.setSmooth(true); iv2.setCache(true);
/** * {@inheritDoc} */ @Override protected void updateItem(Image item, boolean empty) { super.updateItem(item, empty); if (empty) { setGraphic(null); } else { if (preserveImageProperties) { imageView.setPreserveRatio(item.isPreserveRatio()); imageView.setSmooth( item.isSmooth()); } imageView.setImage(item); setGraphic(imageView); } } }
public GridPane moonpane() { GridPane Moonpane = new GridPane(); Moonpane.setId("moonpane"); Moonpane.getColumnConstraints().setAll( ColumnConstraintsBuilder.create().prefWidth(160).minWidth(160).build(), ColumnConstraintsBuilder.create().prefWidth(100).minWidth(100).build() ); Moonpane.setHgap(10); Moonpane.setMaxHeight(50); ImageView Moon_img = new ImageView(new Image(getClass().getResourceAsStream("/Images/Moon/100%.png"))); Moon_img.setFitWidth(100); Moon_img.setFitHeight(100); Moon_img.setPreserveRatio(true); Moon_img.setSmooth(true); Moon_Image_Label.setGraphic(Moon_img); Moonpane.setConstraints(Moon_Image_Label, 1, 0); Moonpane.getChildren().add(Moon_Image_Label); Moon_Date_Label.setId("moon-text-english"); Moonpane.setConstraints(Moon_Date_Label, 0, 0); Moonpane.getChildren().add(Moon_Date_Label); Reflection r = new Reflection(); r.setFraction(0.15f); Moonpane.setEffect(r); Moonpane.setGridLinesVisible(true); return Moonpane; }
imgView.setFitWidth(12); imgView.setPreserveRatio(true); imgView.setSmooth(true); imgView.setCache(true); setGraphic(imgView);
imageView.setSmooth(true); imageView.fitWidthProperty().bind(widthProperty()); imageView.fitHeightProperty().bind(heightProperty());