@Override public void initialize(URL location, ResourceBundle resources) { this.resources = resources; this.merchantService = new MerchantService(); cancelButton.setOnMouseClicked(event -> handleCancelButton()); submitButton.setOnMouseClicked(event -> handleSubmitButton()); }
public DrawerLayout() { AnchorPane.setTopAnchor(toggleLayer, 0d); AnchorPane.setRightAnchor(toggleLayer, 0d); AnchorPane.setBottomAnchor(toggleLayer, 0d); AnchorPane.setLeftAnchor(toggleLayer, 0d); toggleLayer.setBackground( new Background(new BackgroundFill(Color.BLACK, new CornerRadii(0d), new Insets(0)))); toggleLayer.setOpacity(0); toggleLayer.setVisible(false); toggleLayer.setOnMouseClicked( evt -> { if (evt.getButton().equals(MouseButton.PRIMARY)) { if (drawerOpened) { closeDrawer(); } } }); tableScreen.bind(widthProperty().lessThan(responsiveWidth).or(responsiveWidth.isEqualTo(0))); tableScreen.addListener( (observable, oldValue, newValue) -> { responsiveBehavior(newValue); }); }
/** ********************************************************** */ public void setObstacles() { drawPane.setOnMouseClicked( e -> { if (Init) { object obj = new object(33, 33); obj.get().setX(e.getX()); obj.get().setY(e.getY()); obj.get().setFill(new Color(0.1, 0.1, 0.7, 0.5)); obj.setSpeed(3); drawPane.getChildren().add(obj); Algorithm.add(obj); } else { TargetPoint.setCenterX(e.getX()); TargetPoint.setCenterY(e.getY()); Algorithm.setTarget(e.getX(), e.getY()); } }); }
public void changeLayout(Layout layout) { // destruindo o layout anterior if (currentLayout != null) { currentLayout.destroy(); } currentLayout = layout; Pane root = currentLayout.create(); root.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent t) { if (t.isMiddleButtonDown() || t.getButton().ordinal() == 2) { self.hide(); } } }); root.setId("root"); currentLayout.applyTheme(); Scene scene = new Scene(root, display.getWidth(), display.getHeight()); scene.getStylesheets().add(PainelFx.class.getResource("style.css").toExternalForm()); stage.setScene(scene); update(); }