Package javafx.scene.image

Examples of javafx.scene.image.Image


     * @return the image
     */
    protected static Image createImage(final File file, final double width, final double height,
        boolean preserveRatio, boolean smooth) {
      try {
      return new Image(new FileInputStream(file), width, height, preserveRatio, smooth);
    } catch (final FileNotFoundException e) {
      throw new RuntimeException(e);
    }
    }
View Full Code Here


        zoomButton.setTooltip(new Tooltip(imageFullSizeToolTip));
        zoomButton.setGraphic(btnGraphic);
        zoomButton.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent e) {
            Image image;
            try {
            image = new Image(new FileInputStream(file));
          } catch (FileNotFoundException e1) {
            throw new RuntimeException(e1);
          }
            final VBox frame = new VBox(10);
            final ImageView imgView = new ImageView(image);
            frame.getStyleClass().add("displayshelfpopup");
            VBox.setMargin(imgView, new Insets(10, 10, 0, 10));
            final VBox info = new VBox();
            VBox.setMargin(info, new Insets(0, 10, 0, 10));
            final Text infoText = new Text(label.getText());
            infoText.setWrappingWidth(imgView.getImage().getWidth());
            info.setPrefHeight(imgView.getImage().getHeight() / 7);
            info.getChildren().add(infoText);
            frame.getChildren().addAll(imgView, info);
            final Popup popup = new Popup();
            popup.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
              @Override
              public void handle(MouseEvent event) {
                popup.hide();
              }
            });
            popup.setAutoHide(true);
            popup.getContent().add(frame);
            popup.setX(getScene().getWindow().getX() + getScene().getWindow().getWidth() / 2 - image.getWidth() / 2);
            popup.setY(getScene().getWindow().getY() + getScene().getWindow().getHeight() / 2 - image.getHeight() / 2);
            popup.show(getScene().getWindow());
          }
        });
        return zoomButton;
      }
View Full Code Here

      public void handle(final MouseEvent event) {
        stage.setIconified(true);
      }
    });
    final ImageView maxBtn = newTitleBarButton(RS.IMG_SKIN_MAX, 0.9, 0);
    final Image maxImage = maxBtn.getImage();
    final Image resImage = RS.img(RS.IMG_SKIN_RESTORE);
    maxBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
                final double stageY = Utils.isMac() ? stage.getY() - 22 : stage.getY(); // TODO Workaround for RT-13980
                final Screen screen = Screen.getScreensForRectangle(stage.getX(), stageY, 1, 1).get(0);
View Full Code Here

        assert sourceView != null : "fx:id=\"sourceView\" was not injected: check your FXML file 'WorkflowInstanceDetailResult.fxml'.";
        assert titleText != null : "fx:id=\"titleText\" was not injected: check your FXML file 'WorkflowInstanceDetailResult.fxml'.";
        assert treeView != null : "fx:id=\"treeView\" was not injected: check your FXML file 'WorkflowInstanceDetailResult.fxml'.";

       
        final Image icon = new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/stackframe.png"));
        treeView.setRoot(new TreeItem<DisplayableNode>(null));
        treeView.setShowRoot(false);
        treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<DisplayableNode>>() {
      @Override
      public void changed(
View Full Code Here

                return null;
            }
        }

        static public ImageView getIcon(URL url) {
            return new ImageView(new Image(url.toString()));
        }
View Full Code Here

        }
      }
    });
   
    hbox.getChildren().add(textfield);
    MenuButton defaultFilterButton = new MenuButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/date.png"))));
    defaultFilterButton.setPrefWidth(20);
    CustomMenuItem popUpMenueItem = new CustomMenuItem();
    popUpMenueItem.setHideOnClick(false);
    defaultFilterButton.getItems().add(popUpMenueItem);
    popUpMenueItem.getStyleClass().setAll("noSelectAnimationMenueItem","menu-item");
View Full Code Here

    Orientation orientation = verticalRightButton?Orientation.HORIZONTAL:Orientation.VERTICAL;

    buttonsPane.getChildren().addAll(resultForm.getController().getContributedButtons(messageProvider));   
    buttonsPane.getChildren().add(new Separator(orientation));
   
    MenuButton defaultFilterButton = new MenuButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/filter.png"))));
    defaultFilterButton.setPrefWidth(20);
    CustomMenuItem defaultFilterContent = new CustomMenuItem();
    defaultFilterContent.setHideOnClick(false);
    defaultFilterButton.getItems().add(defaultFilterContent);
    defaultFilterContent.getStyleClass().setAll("noSelectAnimationMenueItem","menu-item");
    buttonsPane.getChildren().add(defaultFilterButton);
    if (filterForm.getController().createDefaultFilter()!=null){
      defaultFilterContent.setContent(filterForm.getController().createDefaultFilter());
    } else {
      defaultFilterButton.setDisable(true);
    }
   
    buttonsPane.getChildren().add(new Separator(orientation));
   
 
    final Button clearButton = new Button("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/clear.png"))));
    clearButton.setTooltip(new Tooltip(messageProvider.getText(MessageKey.filterAbleForm_button_clear)));
    clearButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent e) {
          resultForm.getController().clear();
        }
    });
    if(resultForm.getController().supportsClear()) {
      buttonsPane.getChildren().add(clearButton);
    }

    final Button refreshButton = new Button("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/refresh.png"))));
    refreshButton.setId(REFRESH_BUTTON_ID);
    HBox.setMargin(refreshButton, new Insets(4,0,4,0));
    refreshButton.setTooltip(new Tooltip(messageProvider.getText(MessageKey.filterAbleForm_button_refresh)));
    refreshButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
          refresh();
        }
    });
    buttonsPane.getChildren().add(refreshButton);
   
    final ProgressIndicator repeatProgressIndicator = new ProgressBar();
    progressbarDisplayTarget.getChildren().add(repeatProgressIndicator);
    final ToggleButton toggleButton = new ToggleButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/repeat.png"))));
    repeatProgressIndicator.setVisible(false);
    repeatProgressIndicator.setPrefWidth(300);
    repeatProgressIndicator.progressProperty().bind(repeatFilterService.progressProperty());
    toggleButton.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        if (toggleButton.isSelected()){
          repeatFilterService.setRefreshIntervall(Long.valueOf(refreshRateInMs.get()));
          repeatFilterService.reset();
          repeatFilterService.start();
        } else {
          repeatFilterService.cancel();
        }
      }
    });
    repeatFilterService.setOnCancelled(new EventHandler<WorkerStateEvent>() {
      @Override
      public void handle(WorkerStateEvent event) {
        repeatProgressIndicator.setVisible(false);
      }
    });
    repeatFilterService.stateProperty().addListener(new ChangeListener<State>() {
      @Override
      public void changed(ObservableValue<? extends State> observable, State oldValue, State newValue) {
        if (newValue==State.CANCELLED || newValue == State.FAILED || newValue == State.SUCCEEDED){
          repeatProgressIndicator.setVisible(false);
        } else {
          repeatProgressIndicator.setVisible(true);
        }
       
      }
    });
   
    repeatFilterService.runningProperty().addListener(new ChangeListener<Boolean>() {
      @Override
      public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
        if (newValue!=null){
          toggleButton.setSelected(newValue);
        }
      }
    });
    buttonsPane.getChildren().add(toggleButton);
   
   
    MenuButton settings = new MenuButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/settings.png"))));
    settings.setPrefWidth(20);
    CustomMenuItem customMenuItem = new CustomMenuItem();
    settings.getItems().add(customMenuItem);
    customMenuItem.getStyleClass().setAll("noSelectAnimationMenueItem","menu-item");
    HBox hbox = new HBox(3);
View Full Code Here

        }
      }
    });
    pause.disableProperty().bind(play.selectedProperty().not());
       
        play.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/play.png"))));
        pause.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/pause.png"))));
  }
View Full Code Here

        assert filterPane !=null;
       
        workflowClass.textProperty().bindBidirectional(model.version.classname );
       
        searchMenueItem.setContent(formContext.createWorkflowClassesTreeForm(this).createContent());
        serachbutton.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/search.png"))));
       
        searchMenueItem.getStyleClass().setAll("noSelectAnimationMenueItem","menu-item");
  }
View Full Code Here

  @Override
  public List<? extends Node> getContributedButtons(MessageProvider messageProvider) {
    List<Button> contributedButtons = new ArrayList<Button>();
   
    final Button expandButton = new Button("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/expandall.png"))));
    expandButton.setTooltip(new Tooltip(messageProvider.getText(MessageKey.filterAbleForm_button_expandall)));
    expandButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent e) {         
          expandAll(workflowView.getRoot());
        }
    });
    contributedButtons.add(expandButton);
   
    final Button collapseButton = new Button("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/collapseall.png"))));
    collapseButton.setTooltip(new Tooltip(messageProvider.getText(MessageKey.filterAbleForm_button_collapseall)));
    collapseButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent e) {         
        for(TreeItem<DisplayWorkflowClassesModel> child : workflowView.getRoot().getChildren()) {
          collapseAll(child);
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.