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);
}
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);
}
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);
}
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);
}
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();
}
Aggregations