Search in sources :

Example 91 with ImageView

use of javafx.scene.image.ImageView in project trex-stateless-gui by cisco-system-traffic-generator.

the class CustomTreeItem method buildItemWithMenu.

/**
 * build default tree item
 *
 * @param title
 */
private void buildItemWithMenu(String title) {
    Image itemIcon = new Image("/icons/" + treeItemType.getIcon());
    ImageView itemIconContainer = new ImageView(itemIcon);
    itemTitle = new Label(title);
    itemTitle.getStyleClass().add("treeItemTitle");
    setValue(itemTitle);
    setGraphic(itemIconContainer);
}
Also used : Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 92 with ImageView

use of javafx.scene.image.ImageView in project trex-stateless-gui by cisco-system-traffic-generator.

the class NotificationPanel method buildUI.

/**
 * Build component UI
 */
private void buildUI() {
    this.setSpacing(5);
    // add notification message
    notificationContainer = new Pane();
    notificationContainer.setPrefSize(184, 64);
    notificationContainer.getStyleClass().add("notificationContainer");
    notificationLabel = new Label();
    notificationLabel.setPrefSize(155, 60);
    notificationLabel.setWrapText(true);
    notificationLabel.getStyleClass().add("notificationMsg");
    notificationContainer.getChildren().add(notificationLabel);
    getChildren().add(notificationContainer);
    // add notification icon
    VBox iconHolder = new VBox();
    iconHolder.setPrefHeight(68);
    iconHolder.setAlignment(Pos.CENTER);
    ImageView notificationIcon = new ImageView(new Image("/icons/info_icon.png"));
    notificationIcon.getStyleClass().add("notificationIcon");
    notificationIcon.setOnMouseClicked((MouseEvent event) -> {
        notificationContainer.setVisible(!notificationContainer.isVisible());
    });
    iconHolder.getChildren().add(notificationIcon);
    getChildren().add(iconHolder);
}
Also used : MouseEvent(javafx.scene.input.MouseEvent) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) Pane(javafx.scene.layout.Pane) VBox(javafx.scene.layout.VBox)

Example 93 with ImageView

use of javafx.scene.image.ImageView in project trex-stateless-gui by cisco-system-traffic-generator.

the class TrafficProfileDialogController method initializeProfileBtn.

/**
 * Initialize profile buttons
 */
private void initializeProfileBtn() {
    createProfileBtn.setGraphic(new ImageView(new Image("/icons/add.png")));
    duplicateProfileBtn.setGraphic(new ImageView(new Image("/icons/clone.png")));
    deleteProfileBtn.setGraphic(new ImageView(new Image("/icons/delete.png")));
    exportProfileBtn.setGraphic(new ImageView(new Image("/icons/export_profile_icon.png")));
    exportToYamlBtn.setGraphic(new ImageView(new Image("/icons/export_profile_icon.png")));
    loadProfileBtn.setGraphic(new ImageView(new Image("/icons/load_profile.png")));
    trafficProfile = new TrafficProfile();
}
Also used : ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 94 with ImageView

use of javafx.scene.image.ImageView in project intellij-plugins by StepicOrg.

the class AuthDialog method createButtonWithImage.

@NotNull
private Button createButtonWithImage(@NotNull Icon icon) {
    BufferedImage bImg = UIUtil.createImage(icon.getIconWidth(), icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
    Graphics2D graphics = bImg.createGraphics();
    icon.paintIcon(null, graphics, 0, 0);
    graphics.dispose();
    WritableImage image = SwingFXUtils.toFXImage(bImg, null);
    return new Button(null, new ImageView(image));
}
Also used : WritableImage(javafx.scene.image.WritableImage) Button(javafx.scene.control.Button) ImageView(javafx.scene.image.ImageView) BufferedImage(java.awt.image.BufferedImage) NotNull(org.jetbrains.annotations.NotNull)

Example 95 with ImageView

use of javafx.scene.image.ImageView in project jgnash by ccavanaugh.

the class ReportViewerDialogController method refresh.

private void refresh() {
    final List<Node> children = pagePane.getChildren();
    children.clear();
    pageCount.set(0);
    reportExecutor.schedule(() -> {
        if (reportExecutor.getQueue().size() < 1) {
            // ignore if we already have one waiting in the queue
            final Task<Void> task = new Task<>() {

                @Override
                protected Void call() {
                    updateMessage(resources.getString("Message.CompilingReport"));
                    updateProgress(-1, Long.MAX_VALUE);
                    if (report.get() != null) {
                        for (int i = 0; i < report.get().getPageCount(); i++) {
                            // report resolution is fixed and the ImageView width and height are adjusted to the zoom value
                            final BufferedImage bufferedImage = report.get().renderImage(i, REPORT_RESOLUTION * UP_SCALING);
                            JavaFXUtils.runLater(() -> {
                                final ImageView imageView = new ImageView(SwingFXUtils.toFXImage(bufferedImage, null));
                                imageView.setEffect(dropShadow);
                                // bind the width and height to the zoom level
                                imageView.fitWidthProperty().bind(zoomProperty.multiply(bufferedImage.getWidth() / UP_SCALING));
                                imageView.fitHeightProperty().bind(zoomProperty.multiply(bufferedImage.getHeight() / UP_SCALING));
                                children.add(imageView);
                                pageCount.set(pageCount.get() + 1);
                            });
                        }
                    }
                    JavaFXUtils.runLater(() -> setPageIndex(0));
                    return null;
                }
            };
            JavaFXUtils.runLater(() -> {
                busyPane.setTask(task);
                new Thread(task).start();
            });
        }
    }, UPDATE_PERIOD, TimeUnit.MILLISECONDS);
}
Also used : Task(javafx.concurrent.Task) Node(javafx.scene.Node) ImageView(javafx.scene.image.ImageView) BufferedImage(java.awt.image.BufferedImage)

Aggregations

ImageView (javafx.scene.image.ImageView)219 Image (javafx.scene.image.Image)98 Button (javafx.scene.control.Button)46 Label (javafx.scene.control.Label)44 Insets (javafx.geometry.Insets)36 Tooltip (javafx.scene.control.Tooltip)32 VBox (javafx.scene.layout.VBox)29 Scene (javafx.scene.Scene)28 File (java.io.File)26 ChangeListener (javafx.beans.value.ChangeListener)24 Node (javafx.scene.Node)21 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)20 AnchorPane (javafx.scene.layout.AnchorPane)20 Pane (javafx.scene.layout.Pane)20 StackPane (javafx.scene.layout.StackPane)20 Callback (javafx.util.Callback)20 BorderPane (javafx.scene.layout.BorderPane)18 HBox (javafx.scene.layout.HBox)18 ActionEvent (javafx.event.ActionEvent)17 FXML (javafx.fxml.FXML)17