@Override public ImageView createNode() { final ImageView view = new ImageView(); view.setPreserveRatio(true); view.setFitHeight(48); brand.logoLarge() .map(Image::new) .ifPresent(view::setImage); return view; }
/** * 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); }
public Image scale(Image source, int targetWidth, int targetHeight, boolean preserveRatio) { ImageView imageView = new ImageView(source); imageView.setPreserveRatio(preserveRatio); imageView.setFitWidth(targetWidth); imageView.setFitHeight(targetHeight); return imageView.snapshot(null, null); }
ColorAdjust colorAdjust = new ColorAdjust(); colorAdjust.setContrast(0.1); colorAdjust.setHue(-0.05); colorAdjust.setBrightness(0.1); colorAdjust.setSaturation(0.2); ImageView imageView = new ImageView(image); imageView.setFitWidth(image.getWidth()); imageView.setPreserveRatio(true); imageView.setEffect(colorAdjust);
ImageView imageView = new ImageView(new Image("/images/Wim_F.png")); imageView.setPreserveRatio(true); imageView.fitWidthProperty().bind(lsduController1.oneWIM.widthProperty().subtract(10d)); imageView.fitHeightProperty().bind(lsduController1.oneWIM.heightProperty().subtract(10d)); lsduController1.oneWIM.setGraphic(imageView);
iconImageView.setPreserveRatio(true); setGraphic(iconImageView);
/** * 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/Remove.png"))); imgv.setFitWidth(15); imgv.setPreserveRatio(true); imgv.setSmooth(true); hb.setGraphic(imgv);
imageView.setPreserveRatio(true); imageView.setEffect(colorAdjust);
ImageView img = new ImageView(new Image(getClass().getResource("unlock24.png").toExternalForm())); img.setFitHeight(10d); img.setPreserveRatio(true); img.setSmooth(true); setGraphic(img);
// 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);
iview1.setFitWidth(300); iview1.setFitHeight(300); iview1.setPreserveRatio(true);
@PostConstruct private void initializeDialog() { setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildMediterraneanMapDialog.title", new Object[]{}, locale.getCurrentLocal())); IMediterreanMap map = guildSettings.getMediterreanMap(); Image image = imageUtilities.createMediterraneanMap(city.getPlayer(), map); ImageView imgView = new ImageView(image); imgView.setId("mediterraneanMap"); imgView.setFitWidth(WRAPPING_WIDTH); imgView.setPreserveRatio(true); VBox box = new VBox(imgView); box.setLayoutX(2 * FRAME_BORDER); box.setLayoutY(CLOSE_BTN_Y_POS - 500); getContent().add(box); } }
@PostConstruct private void initializeControl() { clientServerEventBus.register(this); clientEventBus.register(this); setManaged(false); mapPane = new Pane(); imgView = new ImageView(); imgView.setFitWidth(236); imgView.setFitHeight(192); imgView.setPreserveRatio(false); // scale the map to the correct size add white dots on cities that have ship in them // clicking on the city changes into the other city (if there is a ship or kontor // right clicking on a point on the map sends the active ship to that location mapPane.getChildren().addAll(imgView); getChildren().add(mapPane); addEventHandlers(); } public void setDialogContoller(IDialogContoller dialogContoller) {
/** * helper function for images * @param icon * @return the BoderPane that wraps the given icon */ public BorderPane wrapImageView(ImageView icon) { BorderPane pane = new BorderPane(); pane.setCenter(icon); // resize images automatically // https://stackoverflow.com/a/12635224/1497139 icon.setPreserveRatio(true); icon.fitHeightProperty().bind(pane.heightProperty()); icon.fitWidthProperty().bind(pane.widthProperty()); return pane; }
/** * {@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; }
@Override public void initialize() { followButton.setDisable(true); userBanner.fitWidthProperty().bind(userDetailsVBox.widthProperty()); userBanner.fitHeightProperty().bind(userDetailsVBox.heightProperty()); userBanner.setPreserveRatio(false); userBanner.setImage(ImageResources.BACKGROUND_DARK_1PX.getImage()); userProfilePictureImageView.setImage(ImageResources.GENERAL_USER_AVATAR_LIGHT.getImage()); final Rectangle profilePictureClip = Clipping.getSquareClip(290.0, 50.0); userProfilePictureImageView.setClip(profilePictureClip); if (targetUserProp.getValue() == null) { this.targetUserProp.addListener((o, prev, cur) -> displayTargetUser()); } else { displayTargetUser(); } }
imageView.setPreserveRatio(true); imageView.setSmooth(true); imageView.fitWidthProperty().bind(widthProperty());
ImageView background = new ImageView(img); background.setFitWidth(200); background.setPreserveRatio(true); String portraitResouce = state.getSpouse().getPortraitResourceName(); ImageView portrait = new ImageView(imgLoader.loadImage(portraitResouce)); portrait.setFitWidth(200); portrait.setPreserveRatio(true); img = imgLoader.getImage("images/retro-gold-frame-oval"); ImageView frame = new ImageView(img); frame.setFitWidth(200); frame.setPreserveRatio(true); pane.getChildren().addAll(background, portrait, frame); PlaceHolder ph = new PlaceHolder((WRAPPING_WIDTH - 200)/2, 1);