Package javafx.scene.image

Examples of javafx.scene.image.Image


        stage.setWidth(bounds.getWidth());
        stage.setHeight(bounds.getHeight());
        stage.setX(0);
        stage.setY(0);
        stage.setTitle("AsciidocFX");
        stage.getIcons().add(new Image(getClass().getResourceAsStream("/public/favicon.ico")));

        Stage tableStage = new Stage();
        tableStage.setScene(new Scene(tableAnchor));
        tableStage.setTitle("Table Generator");
        tableStage.initModality(Modality.WINDOW_MODAL);
View Full Code Here


     *
     * @param content the content of the home item.
     * @return The home item.
     */
    public final BreadcrumbItem addHome(Node content) {
        Image icon = new Image(getClass().getResource("/jfxtras/labs/internal/scene/control/home.png").toExternalForm());
        BreadcrumbItem hItem = new BreadcrumbItem(this, "", icon, content);
        if (getHomeItem() == null) {
            ((SimpleListProperty) this.itemsProperty()).add(0, hItem);
        } else {
            ((SimpleListProperty) this.itemsProperty()).set(0, hItem);
View Full Code Here

     *
     * @see ImageView
     */
    public void setIcon(String iconFile) {
        try {
            this.icon = new ImageView(new Image(getClass().getResourceAsStream(iconFile)));
        } catch (Exception e) {
            System.err.println("Exception trying to load button icon:" + e.getMessage());
        }
    }
View Full Code Here

        }
        return DESTINATION;
    }

    public ImageView getImageView(final double W, final double H, final Shape CLIP) {
        final Image IMAGE = getImage(W, H);
        final ImageView IMAGE_VIEW = new ImageView(IMAGE);
        IMAGE_VIEW.setClip(CLIP);
        return IMAGE_VIEW;
    }
View Full Code Here

        stage.initModality(Modality.APPLICATION_MODAL);
        stage.setMaxWidth(Screen.getPrimary().getVisualBounds().getWidth() / 2);
    }
   
    private void loadIconFromResource(String fileName) {
        Image imgIcon = new Image(getClass().getResourceAsStream(fileName));
        icon.setPreserveRatio(true);
        icon.setFitHeight(48);
        icon.setImage(imgIcon);
    }
View Full Code Here

                                       false, CycleMethod.NO_CYCLE,
                                       new Stop(0, Color.rgb(53, 53, 53)),
                                       new Stop(1, Color.rgb(45, 45, 45))));
        CTX.fill();

        final Image PATTERN_IMAGE = CANVAS.snapshot(SNAPSHOT_PARAMETER, null);
        final ImagePattern PATTERN = new ImagePattern(PATTERN_IMAGE, 0, 0, WIDTH, HEIGHT, false);

        return PATTERN;
    }
View Full Code Here

        CTX.bezierCurveTo(WIDTH * 0.533333, HEIGHT * 0.466666, WIDTH * 0.466666, HEIGHT * 0.533333, WIDTH * 0.466666, HEIGHT * 0.666666);
        CTX.closePath();
        CTX.setFill(TEXTURE_COLOR.darker().darker());
        CTX.fill();

        final Image PATTERN_IMAGE = CANVAS.snapshot(SNAPSHOT_PARAMETER, null);
        final ImagePattern PATTERN = new ImagePattern(PATTERN_IMAGE, 0, 0, WIDTH, HEIGHT, false);

        return PATTERN;
    }
View Full Code Here

    private void gradient(){
        width  = getSkinnable().getWidth();
        height = getSkinnable().getHeight();
        if(getSkinnable().isFrameVisible()){
            Platform.runLater(()->{
                Image image = null;  
                switch (getSkinnable().getFrameDesign()) {
                    case BLACK_METAL:
                        ConicalGradient bmGradient = new ConicalGradient(new Point2D(width/2d,height/2d),
                                                                     new Stop(0.0000, Color.rgb(254, 254, 254)),
                                                                     new Stop(0.1250, Color.rgb(0, 0, 0)),
                                                                     new Stop(0.3472, Color.rgb(153, 153, 153)),
                                                                     new Stop(0.5000, Color.rgb(0, 0, 0)),
                                                                     new Stop(0.6805, Color.rgb(153, 153, 153)),
                                                                     new Stop(0.8750, Color.rgb(0, 0, 0)),
                                                                     new Stop(1.0000, Color.rgb(254, 254, 254)));
                        image = bmGradient.apply(new Rectangle(width,height)).getImage();
                        break;
                    case CHROME:
                        ConicalGradient cmGradient = new ConicalGradient(new Point2D(width/2d,height/2d),
                                                                     new Stop(0.00, Color.WHITE),
                                                                     new Stop(0.09, Color.WHITE),
                                                                     new Stop(0.12, Color.rgb(136, 136, 138)),
                                                                     new Stop(0.16, Color.rgb(164, 185, 190)),
                                                                     new Stop(0.25, Color.rgb(158, 179, 182)),
                                                                     new Stop(0.29, Color.rgb(112, 112, 112)),
                                                                     new Stop(0.33, Color.rgb(221, 227, 227)),
                                                                     new Stop(0.38, Color.rgb(155, 176, 179)),
                                                                     new Stop(0.48, Color.rgb(156, 176, 177)),
                                                                     new Stop(0.52, Color.rgb(254, 255, 255)),
                                                                     new Stop(0.63, Color.WHITE),
                                                                     new Stop(0.68, Color.rgb(156, 180, 180)),
                                                                     new Stop(0.80, Color.rgb(198, 209, 211)),
                                                                     new Stop(0.83, Color.rgb(246, 248, 247)),
                                                                     new Stop(0.87, Color.rgb(204, 216, 216)),
                                                                     new Stop(0.97, Color.rgb(164, 188, 190)),
                                                                     new Stop(1.00, Color.WHITE));
                        image = cmGradient.apply(new Rectangle(width,height)).getImage();
                        break;
                    case SHINY_METAL:
                        Color c=getSkinnable().getFrameBaseColor();
                        ConicalGradient smGradient = new ConicalGradient(new Point2D(width/2d,height/2d),
                                                                 new Stop(0.0000, Color.rgb(254, 254, 254)),
                                                                 new Stop(0.1250, Util.darker(c, 0.15)),
                                                                 new Stop(0.2500, c.darker()),
                                                                 new Stop(0.3472, c.brighter()),
                                                                 new Stop(0.5000, c.darker().darker()),
                                                                 new Stop(0.6527, c.brighter()),
                                                                 new Stop(0.7500, c.darker()),
                                                                 new Stop(0.8750, Util.darker(c, 0.15)),
                                                                 new Stop(1.0000, Color.rgb(254, 254, 254)));
                        image = smGradient.apply(new Rectangle(width,height)).getImage();
                        break;
                    case CUSTOM_DESIGN:
                        // load image
                        String pathJpg=getSkinnable().getFrameCustomPath();
                        // 1. from jar or url
                        if(pathJpg!=null && (pathJpg.contains("http") || pathJpg.startsWith("/"))){
                            image=new Image(pathJpg);
                        }
                        // 2. from local file
                        else if(pathJpg!=null){
                            File file = new File(pathJpg);
                            if(file.exists()){
                                image=new Image(file.toURI().toString());
                            } else {
                                //3. from resource
                                image=new Image(MatrixPanel.class.getResource(pathJpg).toExternalForm());
                            }
                        }
                        break;
                }
                if(image!=null){
View Full Code Here

    pane.getChildren().addAll(configureSamples(), separator, configurePropertyPane());
    body.getChildren().add(pane);
  }

  private VBox configureSamples() {
    final ImageView sample1 = new ImageView(new Image(
        MagnifierDemo.class.getResourceAsStream("/jfxtras/labs/scene/control/magnifier-sample1.jpg")));
    sample1.setFitHeight(480);
    sample1.setFitWidth(420);
    samples.put(1, configureSample(sample1));

    final ImageView sample2 = new ImageView(new Image(
        MagnifierDemo.class.getResourceAsStream("/jfxtras/labs/scene/control/magnifier-sample2.jpg")));
    sample2.setFitHeight(420);
    sample2.setFitWidth(500);
    samples.put(2, configureSample(sample2));
View Full Code Here

    public void update() {
        final URL gravatarUrl = getGravatarUrl();
        final Task<Image> task = new Task<Image>() {
            @Override
            protected Image call() throws Exception {
                return new Image(gravatarUrl.openStream());
            }
            @Override
            protected void succeeded() {
                super.succeeded();
                GravatarImageView.this.setImage(this.getValue());
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.