Package javafx.scene.image

Examples of javafx.scene.image.Image


      double requestedHeight, boolean preserveRatio, boolean smooth) {
    final String key = fileName + requestedWidth + 'x' + requestedHeight;
    if (IMGS.containsKey(key)) {
      return IMGS.get(key);
    } else {
      final Image img = requestedWidth <= 0 || requestedHeight <= 0 ? new Image(
          path(fileName)) : new Image(path(fileName), requestedWidth,
          requestedHeight, preserveRatio, smooth);
      IMGS.put(key, img);
      return img;
    }
  }
View Full Code Here


                if (item == null) {
                    super.setText(null);
                    super.setGraphic(null);
                } else {
                    final String filename = FLAG_ICON_LOCATION + item.name().toLowerCase() + FLAG_ICON_EXTENSION;
                    final Image countryImage = new Image(MainController.class.getClassLoader().getResourceAsStream(filename));
                    final ImageView imageView = new ImageView();
                    imageView.setImage(countryImage);
                    // create tooltip with country code
                    final Tooltip tooltip = new Tooltip();
                    tooltip.setText(item.name());
View Full Code Here

        // create scene and display window
        final Scene scene = new Scene(root, 1300, 900);
        scene.getStylesheets().add(FILE_STYLESHEETS);
        stage.setTitle(APPLICATION_TITLE);
        stage.getIcons().add(new Image(getClass().getResource(APPLICATION_ICON).toString()));
        stage.setScene(scene);
        stage.show();
    }
View Full Code Here

        checkLocalImage(TestImages.TEST_LOCAL_IMAGE_2);
        checkLocalImage(TestImages.TEST_LOCAL_IMAGE_3);
    }

    private void checkLocalImage(final ImageItem imageItem) {
        final Image image = imageItem.get();
        final LocalImage wc = (LocalImage) ResourceBuilders.IMAGE_BUILDER.getParam(imageItem);

        assertEquals(image.getProgress(), 1.0, 0.0);

    }
View Full Code Here

        checkWebImage(TestImages.TEST_WEB_IMAGE_2);
        checkWebImage(TestImages.TEST_WEB_IMAGE_3);
    }

    private void checkWebImage(final ImageItem imageItem) {
        final Image image = imageItem.get();
        final AbstractBaseParams wc = (AbstractBaseParams) ResourceBuilders.IMAGE_BUILDER.getParam(imageItem);

        assertEquals(image.getProgress(), 1.0, 0.0);
    }
View Full Code Here

    @Override public void start(Stage primaryStage) throws IOException {
        tools = new Tool[]{
            new Tool(
                "Caspian Styler",
                (Parent) FXMLLoader.load(CaspianStylerMainFrame.class.getResource("CaspianStylerMainFrame.fxml")),
                new Image(ToolsApp.class.getResourceAsStream("images/caspianstyler-icon.png"))
            ),
            new Tool(
                "Animation Spline Editor",
                new SplineEditor(),
                new Image(ToolsApp.class.getResourceAsStream("images/spline-editor-icon.png"))
            ),
            new Tool(
                "Derived Color Calculator",
                (Parent) FXMLLoader.load(DerivationCalcContent.class.getResource("DerivationCalcContent.fxml")),
                new Image(ToolsApp.class.getResourceAsStream("images/derive-color-icon.png"))
            )
        };
       
        //create root node
        root = new Pane() {
View Full Code Here

            node = web; // StackPaneBuilder.create().children(web).style("-fx-border-width:2;-fx-border-color:#000000").build();

        } else if (item.getImage() != null) {

            final Image image = Resources.create(new LocalImage(item.getImage())).get();
            final ImageView imageViewer = ImageViewBuilder.create()
                    .styleClass(ITEM_CLASS_PREFIX + item.getLevel())
                    .image(image)
                    // .effect(ReflectionBuilder.create().fraction(0.9).build())
                    .build();
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    protected Image buildResource(final ImageItem imageItem, final ImageParams jrImage) {
        Image image = null;
        if (jrImage instanceof LocalImage) {
            // Build the requested font
            image = buildLocalImage((LocalImage) jrImage);
        } else if (jrImage instanceof WebImage) {
            // Build the requested font
View Full Code Here

     */
    private Image buildWebImage(final WebImage jrImage) {

        final String url = jrImage.getUrl();

        Image image = null;
        if (url == null || url.isEmpty()) {
            LOGGER.error("Image : {} not found !", url);
        } else {
            image = new Image(url);
        }
        return image;
    }
View Full Code Here

     * @param resourceName the name of the image, path must be separated by '/'
     *
     * @return the image loaded
     */
    private Image loadImage(final String resourceName) {
        Image image = null;
        final InputStream imageInputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(JRebirthParameters.IMAGE_FOLDER.get() + Resources.PATH_SEP + resourceName);
        if (imageInputStream != null) {
            image = new Image(imageInputStream);
        }
        if (image == null) {
            LOGGER.error("Image : {} not found into base folder: {}", resourceName, JRebirthParameters.IMAGE_FOLDER.get() + Resources.PATH_SEP);
        }
        return image;
View Full Code Here

TOP

Related Classes of javafx.scene.image.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.