Refine search
@Override public ImageView view() { return new ImageView(load()); }
private void updatePlaceholder(Node newView) { if (view.getWidth() > 0 && view.getHeight() > 0) { SnapshotParameters parameters = new SnapshotParameters(); parameters.setFill(Color.TRANSPARENT); Image placeholderImage = view.snapshot(parameters, new WritableImage((int) view.getWidth(), (int) view.getHeight())); placeholder.setImage(placeholderImage); placeholder.setFitWidth(placeholderImage.getWidth()); placeholder.setFitHeight(placeholderImage.getHeight()); } else { placeholder.setImage(null); } placeholder.setVisible(true); placeholder.setOpacity(1.0); view.getChildren().setAll(placeholder, newView); placeholder.toFront(); } }
private void updateHSLCircleColor(int x, int y) { // transform color to HSL space Color color = huesCircleView.getImage().getPixelReader().getColor(x, y); double max = Math.max(color.getRed(), Math.max(color.getGreen(), color.getBlue())); double min = Math.min(color.getRed(), Math.min(color.getGreen(), color.getBlue())); double hue = 0; if (max != min) { double d = max - min; if (max == color.getRed()) { hue = (color.getGreen() - color.getBlue()) / d + (color.getGreen() < color.getBlue() ? 6 : 0); } else if (max == color.getGreen()) { hue = (color.getBlue() - color.getRed()) / d + 2; } else if (max == color.getBlue()) { hue = (color.getRed() - color.getGreen()) / d + 4; } hue /= 6; } currentHue = map(hue, 0, 1, 0, 255); // refresh the HSL circle refreshHSLCircle(); }
/** * 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); }
@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; }
setAlignment(Pos.CENTER); try { ImageView imgv = new ImageView(new Image(new FileInputStream( "img/Remove.png"))); imgv.setFitWidth(15); imgv.setPreserveRatio(true); imgv.setSmooth(true); hb.setGraphic(imgv); hb.setTooltip(ControlFactory.getTooltip("Klient entfernen"));
Button btn2 = new Button("Two"); btn2.setTranslateX(btn.getTranslateX() + 60); Image img1 = new Image ("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/Thumbs_up_font_awesome.svg/512px-Thumbs_up_font_awesome.svg.png"); Image img2 = new Image ("https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/thumbs_down.png"); Image loadImg = new Image("http://www.ledr.com/colours/white.jpg"); ImageView imgHolder = new ImageView(loadImg); imgHolder.setVisible(false); imgHolder.setFitHeight(100); imgHolder.setFitWidth(100); imgHolder.setTranslateY(-80); imgHolder.setVisible(true); if(randomNum % 2 == 0){ imgHolder.setImage(img1); imgHolder.setImage(img2);
Image img = new Image("Img\\titleSirius.png"); title.setImage(img); title.setLayoutX(569); title.setLayoutY(146); title.fitHeightProperty().add(100); title.fitWidthProperty().add(100); title.setVisible(true);
@Override public void start(Stage stage) throws Exception { Image image = new Image( "http://icons.iconarchive.com/icons/designbolts/smurfs-movie/128/smurfette-icon.png" ); imageView.setClip(new ImageView(image)); 0, 0, imageView.getImage().getWidth(), imageView.getImage().getHeight(), Color.RED imageView.effectProperty().bind( Bindings .when(imageView.hoverProperty()) .then((Effect) blush) .otherwise((Effect) null) ); imageView.setCache(true); imageView.setCacheHint(CacheHint.SPEED);
private static final Image ledOff = new Image("/images/led_white.gif"); private static final Image ledOn = new Image("/images/led_blue.gif"); @FXML private GridPane ledPanel ; private ImageView[] leds ; public void initialize() { final int numLeds = 64 ; final int numLedsPerRow = 8 ; leds = new ImageView[numLeds]; for (int i=0; i<numLeds; i++) { ImageView led = new ImageView(ledOff); leds[i] = led ; ledPanel.add(leds[i], i % numLedsPerRow, i / numLedsPerRow); led.setOnMousePressed(event -> { if (led.getImage()==ledOff) { led.setImage(ledOn); } else { led.setImage(ledOff); } }); } }
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);
int iconNumber = this.getIndex() + 1; String iconPath = "MyProject/resources/images/icon_" + iconNumber + ".png"; icon = new Image(getClass().getClassLoader().getResourceAsStream(iconPath)); } catch(NullPointerException ex) { icon = new Image(getClass().getClassLoader().getResourceAsStream(iconPath)); iconImageView.setFitHeight(30); iconImageView.setPreserveRatio(true); setGraphic(iconImageView);
BorderPane borderPane = new BorderPane(); HBox box = new HBox(10); ImageView imageView = new ImageView(new Image("file:///home/itachi/Pictures/aaa.png")); // Replace with your image path Button button1 = new Button("Add"); Button button2 = new Button("Add"); primaryStage.setScene(scene); primaryStage.show(); System.out.println("Image height : " + imageView.getImage().getHeight()); System.out.println("Hbox height : " + box.getHeight()); System.out.println("BorderPane Height : " + borderPane.getHeight());
renderImage(img); final ImageView view = new ImageView(img); view.setPreserveRatio(true); view.setFitWidth(scene.getWidth());
containerPane.setPrefHeight(EMBEDDED_MEDIA_RECTANGLE_SIDE); final ImageView imageView = new ImageView(); imageView.setImage(imageResource.getImage()); imageView.setFitWidth(EMBEDDED_MEDIA_RECTANGLE_SIDE); imageView.setFitHeight(EMBEDDED_MEDIA_RECTANGLE_SIDE); EMBEDDED_MEDIA_RECTANGLE_CORNER_RADIUS ); clipRectangle.layoutXProperty().bind(imageView.layoutXProperty()); clipRectangle.layoutYProperty().bind(imageView.layoutYProperty()); imageView.setClip(clipRectangle); containerPane.getChildren().setAll(imageView);
final ImageView imageView = new ImageView(); imageView.setFitHeight(MEDIA_PREVIEW_IMAGE_SIZE); imageView.setFitWidth(MEDIA_PREVIEW_IMAGE_SIZE); final URL imageUrl = previewedFile.toURI().toURL(); final Image image = new Image( true ); imageView.setImage(image); final Rectangle previewClip = Clipping.getSquareClip( MEDIA_PREVIEW_IMAGE_SIZE, MEDIA_PREVIEW_IMAGE_SIZE * 0.25 ); imageView.setClip(previewClip); return imageView; } catch (final MalformedURLException e) {
@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) {
@Override public void cache(Pane node) { if (!cache.containsKey(node)) { SnapshotParameters snapShotparams = new SnapshotParameters(); snapShotparams.setFill(Color.TRANSPARENT); WritableImage temp = node.snapshot(snapShotparams, new WritableImage((int) node.getLayoutBounds().getWidth(), (int) node.getLayoutBounds().getHeight())); ImageView tempImage = new ImageView(temp); tempImage.setCache(true); tempImage.setCacheHint(CacheHint.SPEED); cache.put(node, new ArrayList<>(node.getChildren())); node.getChildren().setAll(tempImage); } }