Search in sources :

Example 81 with ImageView

use of javafx.scene.image.ImageView in project TestFX by TestFX.

the class JavafxRobotAdapter method getCaptureRegion.

public Image getCaptureRegion(Rectangle2D region) {
    if (!Platform.isFxApplicationThread()) {
        throw new RuntimeException("JavafxRobotAdapter#getCaptureRegion(..) must be called on JavaFX " + "application thread but was: " + Thread.currentThread());
    }
    ImageView imageView = new ImageView(scene.snapshot(null));
    imageView.setViewport(region);
    Pane pane = new Pane(imageView);
    // The imageView must be in an off-screen Scene to be snapshotted
    Scene offScreenScene = new Scene(pane);
    return imageView.snapshot(null, null);
}
Also used : ImageView(javafx.scene.image.ImageView) Scene(javafx.scene.Scene) Pane(javafx.scene.layout.Pane)

Example 82 with ImageView

use of javafx.scene.image.ImageView in project uPMT by coco35700.

the class RootInterviewTreeViewController method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    nomRoot.setText(interview.getName());
    Node icon = new ImageView(ResourceLoader.loadImage("new.png"));
    this.addInterview.setGraphic(icon);
    rootIcon.setImage(ResourceLoader.loadImage("rootInterview.gif"));
    Tooltip addInter = new Tooltip(main._langBundle.getString("add_interview"));
    addInterview.setTooltip(addInter);
}
Also used : Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip) ImageView(javafx.scene.image.ImageView)

Example 83 with ImageView

use of javafx.scene.image.ImageView in project uPMT by coco35700.

the class TypeTreeViewControllerClass method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    nomType.setText(type.getType().getName());
    couleurType.setStyle("-fx-color-label-visible: false ;");
    setColor();
    Image icon = ResourceLoader.loadImage("class.gif");
    this.classIcon.setImage(icon);
    Node iconRename = new ImageView(ResourceLoader.loadImage("rename.png"));
    this.rename.setGraphic(iconRename);
    Node iconDelete = new ImageView(ResourceLoader.loadImage("delete.gif"));
    this.deleteClass.setGraphic(iconDelete);
    Node iconAddProp = new ImageView(ResourceLoader.loadImage("addProperty.gif"));
    this.addProperty.setGraphic(iconAddProp);
    Tooltip deleteClassTip = new Tooltip("Suppression de la classe");
    deleteClass.setTooltip(deleteClassTip);
    Tooltip addPropertyTip = new Tooltip("Ajout d'une propriet� a la classe");
    addProperty.setTooltip(addPropertyTip);
    Tooltip renameTip = new Tooltip("Renommer la classe");
    rename.setTooltip(renameTip);
}
Also used : Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 84 with ImageView

use of javafx.scene.image.ImageView in project uPMT by coco35700.

the class TypeTreeViewControllerRoot method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    nomType.setText(type.getType().getName());
    /*if(Main.activateBetaDesign)
			this.nomType.setTextFill(Color.BLACK);*/
    Image icon = ResourceLoader.loadImage("schema.gif");
    this.rootIcon.setImage(icon);
    Node iconRename = new ImageView(ResourceLoader.loadImage("rename.png"));
    this.rename.setGraphic(iconRename);
    Node iconAddClass = new ImageView(ResourceLoader.loadImage("addclass.gif"));
    this.addClass.setGraphic(iconAddClass);
    Node iconAddFold = new ImageView(ResourceLoader.loadImage("newfolder.gif"));
    this.addFolder.setGraphic(iconAddFold);
    Tooltip renameTip = new Tooltip("Renommer le sch�ma");
    rename.setTooltip(renameTip);
    Tooltip addClassTip = new Tooltip("Ajouter une Classe � la racine");
    addClass.setTooltip(addClassTip);
    Tooltip addFolderTip = new Tooltip("Ajouter un Dossier � la racine");
    addFolder.setTooltip(addFolderTip);
}
Also used : Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 85 with ImageView

use of javafx.scene.image.ImageView in project CST-135 by psradke.

the class FinalSale method start.

@Override
public void start(Stage primaryStage) throws Exception {
    // Background image
    BackgroundImage backImg = new BackgroundImage(new Image("file:src/DispenserDesign/Background&ButtonImages/FinalSalePage/FinalSaleBackground.png", 810, 720, false, true), BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);
    // PANE CREATION
    // Home and Back Buttons Pane
    GridPane buttons = new GridPane();
    buttons.setHgap(10);
    buttons.setVgap(10);
    buttons.setPadding(new Insets(0, 10, 0, 10));
    // TableView Cart Pane
    GridPane cartView = new GridPane();
    cartView.setHgap(9);
    cartView.setVgap(9);
    cartView.setOpacity(0.9);
    cartView.setPadding(new Insets(0, 10, 0, 10));
    // Delete and Purchase Buttons Pane
    GridPane buttons2 = new GridPane();
    buttons2.setHgap(10);
    buttons2.setVgap(10);
    buttons2.setPadding(new Insets(0, 10, 0, 10));
    // Main Pane for arrangement
    VBox vBox = new VBox();
    vBox.setPadding(new Insets(10, 10, 10, 10));
    vBox.getChildren().addAll(buttons, cartView, buttons2);
    // Background Pane
    StackPane root = new StackPane();
    root.setMaxSize(800, 610);
    root.setMinSize(800, 610);
    root.setBackground(new Background(backImg));
    root.setPadding(new Insets(0, 10, 0, 10));
    root.getChildren().add(vBox);
    // BUTTON CREATION
    // Home Button
    Button home = new Button("", new ImageView(new Image("file:src/DispenserDesign/Background&ButtonImages/NavigationButtons/HomeButton.png")));
    home.setBackground(Background.EMPTY);
    home.setMaxSize(5, 10);
    home.setMinSize(5, 10);
    buttons.add(home, 9, 2);
    // home.setOnAction(e -> {
    // homePage.setScene(scene);
    // });
    // Back Button
    Button back = new Button("", new ImageView(new Image("file:src/DispenserDesign/Background&ButtonImages/NavigationButtons/BackButton.png")));
    back.setBackground(Background.EMPTY);
    back.setMaxSize(5, 10);
    back.setMinSize(5, 10);
    buttons.add(back, 64, 2);
    back.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            System.out.println("Back");
        }
    });
    // Purchase Button
    Button purchase = new Button("", new ImageView(new Image("file:src/DispenserDesign/Background&ButtonImages/FinalSalePage/Purchase.png")));
    purchase.setBackground(Background.EMPTY);
    purchase.setMaxSize(5, 10);
    purchase.setMinSize(5, 10);
    buttons2.add(purchase, 36, 11);
    purchase.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            System.out.println("Purcahse");
        }
    });
    // Delete Button
    // Button delete = new Button("Delete Product");
    // delete.setOnAction(e -> deleteClicked());
    // CREATE TABLE FOR DISPLAYING CART
    TableView<Product> table;
    // Name column
    TableColumn<Product, String> nameCol = new TableColumn<>("Name");
    nameCol.setMinWidth(150);
    nameCol.setCellValueFactory(new PropertyValueFactory<>("name"));
    // Price column
    TableColumn<Product, Double> priceCol = new TableColumn<>("Price");
    priceCol.setMinWidth(20);
    priceCol.setCellValueFactory(new PropertyValueFactory<>("price"));
    // Weight column
    TableColumn<Product, Double> weightCol = new TableColumn<>("Weight");
    weightCol.setMinWidth(50);
    weightCol.setCellValueFactory(new PropertyValueFactory<>("weight"));
    // Quantity column
    TableColumn<Product, Double> quantityCol = new TableColumn<>("Quantity");
    quantityCol.setMinWidth(20);
    quantityCol.setCellValueFactory(new PropertyValueFactory<>("quantity"));
    table = new TableView<>();
    table.setItems(getProduct());
    table.setBackground(Background.EMPTY);
    table.setMaxSize(620, 313);
    table.setMinSize(620, 313);
    table.getColumns().addAll(nameCol, priceCol, weightCol, quantityCol);
    cartView.add(table, 7, 18);
    Scene scene = new Scene(root, 800, 710);
    primaryStage.setTitle("Checkout");
    primaryStage.setScene(scene);
    primaryStage.setResizable(false);
    primaryStage.show();
}
Also used : GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) ActionEvent(javafx.event.ActionEvent) BackgroundImage(javafx.scene.layout.BackgroundImage) Image(javafx.scene.image.Image) Scene(javafx.scene.Scene) TableColumn(javafx.scene.control.TableColumn) BackgroundImage(javafx.scene.layout.BackgroundImage) Button(javafx.scene.control.Button) ImageView(javafx.scene.image.ImageView) VBox(javafx.scene.layout.VBox) StackPane(javafx.scene.layout.StackPane)

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