private HBox createActionPane() { HBox actionBox = new HBox(); actionBox.setSpacing(10); actionBox.setPadding(new Insets(20, 0, 10, 0)); actionBox.setAlignment(Pos.CENTER); startBtn.setMinWidth(80); pauseBtn.setMinWidth(80); startBtn.setOnAction(btnHandler); pauseBtn.setOnAction(btnHandler); actionBox.getChildren().addAll(startBtn, pauseBtn); return actionBox; }
public ViewChat() { // chatWindow properties chatWindow.setMinHeight(240); chatWindow.setEditable(false); // send group chatBox.setMinWidth(480); sendButton.setMinWidth(100); sendButton.setOnAction(this::sendButtonAction); chatBox.setOnKeyPressed(this::chatBoxKey); HBox sendGroup = new HBox(chatBox, sendButton); sendGroup.setPadding(new javafx.geometry.Insets(10, 10, 10, 10)); // add all controllers to view this.setMinWidth(600); this.getChildren().add(chatWindow); this.getChildren().add(sendGroup); // start chat client try { chatClient = new ChatClient(); chatClient.initialize(getUserName(), chatWindow); } catch (RemoteException e) { e.printStackTrace(); } // chatBox focus Platform.runLater(chatBox::requestFocus); }
public Scene initialize(Stage s) { stage = s; Group root = new Group(); Text t = new Text( 260, 100, " Escape From New Pangea The Survival of Humankind"); t.setWrappingWidth(500); t.setFont(Font.font("Verdana", 20)); t.setFill(Color.AZURE); Button b = new Button("Click to start"); ImageView im = new ImageView(new Image("images/Gobi_Desert.jpg")); b.setLayoutX(300); b.setLayoutY(275); b.setMinWidth(200); b.setMinHeight(50); b.setOnMouseClicked(e -> startGame(e)); root.getChildren().add(im); root.getChildren().add(t); root.getChildren().add(b); Scene scene = new Scene(root, 800, 600, Color.WHITE); return scene; }
private Button createCharacterBtn(String imgPath, double imgWidth, double imgHeight) { Button characterBtn = new Button(); characterBtn.setMaxWidth(400.0d); characterBtn.setMaxHeight(100.0d); characterBtn.setMinWidth(400.0d); characterBtn.setMinHeight(100.0d); characterBtn.setTextAlignment(TextAlignment.LEFT); ImageView avatarImgBtnLayout = createImageBtnLayout(imgPath, imgWidth, imgHeight); characterBtn.setGraphic(avatarImgBtnLayout); return characterBtn; }
protected ConfigurationsDialogBuilder addConfirmationButton( String buttonCaption, final EventHandler<ActionEvent> actionHandler) { Button confirmationButton = new Button(buttonCaption); confirmationButton.setMinWidth(BUTTON_WIDTH); confirmationButton.setOnAction( new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { dialog.close(); if (actionHandler != null) { actionHandler.handle(t); } } }); dialog.buttonsPanel.getChildren().add(confirmationButton); return this; }
protected FxSidebarPasswordbox(ApplicationInstance instance) { final JavaFxUserInterfaceApi fxUI = JavaFxUserInterface.getInstance(instance); row = new BorderPane(); inputElement = createPasswordbox(instance, true); row.setCenter(inputElement); CheckBox showPw = new CheckBox(fxUI.getLocaleBundleString("passwordfield.show_password")); showPw.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (showPw.isSelected()) { TextField t = new TextField(getUIValue()); t.addEventFilter( KeyEvent.KEY_RELEASED, new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent event) { storeData(instance.getTree().getSelectedNode()); } }); inputElement = t; } else { inputElement = createPasswordbox(instance, false); } row.setCenter(inputElement); } }); row.setBottom(showPw); Button copy = new Button("", ImageMap.getFxImageView(("icon_copy"))); copy.setMinWidth(16); copy.setMaxWidth(16); copy.setTooltip(new Tooltip(fxUI.getLocaleBundleString("mainwindow.menu.edit.copy_text"))); copy.getStyleClass().add("noBorder"); copy.setFocusTraversable(false); copy.setOnAction((event) -> fxUI.setClipboardText(getUIValue())); row.setRight(copy); }
private void erzeugeDetailAnsicht(PolizistDaten SpaltenDaten) { Label LabelA = new Label("PersonenID"); Label LabelAWert = new Label(Integer.toString(SpaltenDaten.getPersonenID())); Label LabelB = new Label("Name"); Label LabelBWert = new Label(SpaltenDaten.getName()); Label LabelC = new Label("Geburtsdatum"); Label LabelCWert = new Label(SpaltenDaten.getGebDatum()); Label LabelD = new Label("Nationalität"); Label LabelDWert = new Label(SpaltenDaten.getNation()); Label LabelE = new Label("Geschlecht"); Label LabelEWert = new Label(SpaltenDaten.getGeschlecht()); Label LabelF = new Label("Todesdatum"); Label LabelFWert = new Label(SpaltenDaten.getTodDatum()); Label LabelG = new Label("Dienstgrad"); Label LabelGWert = new Label(SpaltenDaten.getDienstgrad()); Button ButtonBearbeiten = new Button("Bearbeiten..."); Button ButtonLoeschen = new Button("Löschen"); Button ButtonSuchePerson = new Button("Suche nach Person"); Button ButtonSucheArbeit = new Button("Suche nach Arbeitsverhältnissen"); Button ButtonSucheArbeitAn = new Button("Suche nach zugewiesenen Fällen"); Button ButtonSucheNotizen = new Button("Suche nach erstellten Notizen"); Button ButtonSucheIndizien = new Button("Suche nach eingestellten Indizien"); Button ButtonClose = new Button("Detailansicht verlassen"); ButtonBearbeiten.setOnAction( event -> { Tabelle.getSelectionModel().clearSelection(); Tabelle.getSelectionModel().select(SpaltenDaten); updateSelectedEntry(); Hauptprogramm.setRechteAnsicht(null); }); ButtonLoeschen.setOnAction( event -> { Tabelle.getSelectionModel().clearSelection(); Tabelle.getSelectionModel().select(SpaltenDaten); deleteSelectedEntrys(); Hauptprogramm.setRechteAnsicht(null); }); ButtonSuchePerson.setOnAction( event -> { Hauptprogramm.setRechteAnsicht(null); PersonenAM.PersonenSuchAnsicht(SpaltenDaten.getPersonenID()); }); ButtonSucheArbeit.setOnAction( event -> { Hauptprogramm.setRechteAnsicht(null); ArbeitenAM.SucheNachPersonenID(SpaltenDaten.getPersonenID()); }); ButtonSucheArbeitAn.setOnAction( event -> { Hauptprogramm.setRechteAnsicht(null); ArbeitenAnAM.SucheNachPersonenID(SpaltenDaten.getPersonenID()); }); ButtonSucheNotizen.setOnAction( event -> { Hauptprogramm.setRechteAnsicht(null); NotizAM.SucheNachAnlegendem(SpaltenDaten.getPersonenID()); }); ButtonSucheIndizien.setOnAction( event -> { Hauptprogramm.setRechteAnsicht(null); IndizAM.SucheNachAnlegendem(SpaltenDaten.getPersonenID()); }); ButtonClose.setOnAction(event -> Hauptprogramm.setRechteAnsicht(null)); ButtonBearbeiten.setMaxWidth(Double.MAX_VALUE); ButtonBearbeiten.setMinWidth(150); ButtonLoeschen.setMaxWidth(Double.MAX_VALUE); ButtonLoeschen.setMinWidth(150); ButtonSuchePerson.setMaxWidth(Double.MAX_VALUE); ButtonSucheArbeit.setMaxWidth(Double.MAX_VALUE); ButtonSucheArbeitAn.setMaxWidth(Double.MAX_VALUE); ButtonSucheNotizen.setMaxWidth(Double.MAX_VALUE); ButtonSucheIndizien.setMaxWidth(Double.MAX_VALUE); ButtonClose.setMaxWidth(Double.MAX_VALUE); // Wir haben ein Gridpane oben, eine HBox unten in einer VBox in einem ScrollPane GridPane Oben = new GridPane(); Oben.setHgap(10); Oben.setVgap(10); Oben.addColumn(0, LabelA, LabelB, LabelC, LabelD, LabelE, LabelF, LabelG); Oben.addColumn( 1, LabelAWert, LabelBWert, LabelCWert, LabelDWert, LabelEWert, LabelFWert, LabelGWert); Oben.getColumnConstraints().add(new ColumnConstraints(100)); Oben.getColumnConstraints().add(new ColumnConstraints(200)); HBox Unten = new HBox(10); Unten.getChildren().addAll(ButtonBearbeiten, ButtonLoeschen); Unten.setMaxWidth(300); Unten.alignmentProperty().setValue(Pos.CENTER); VBox Mittelteil = new VBox(10); Mittelteil.setPadding(new Insets(10, 20, 10, 10)); Mittelteil.getChildren() .addAll( Oben, Unten, ButtonSuchePerson, ButtonSucheArbeit, ButtonSucheArbeitAn, ButtonSucheNotizen, ButtonSucheIndizien, ButtonClose); ScrollPane Aussen = new ScrollPane(); Aussen.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); Aussen.setContent(Mittelteil); Hauptprogramm.setRechteAnsicht(Aussen); }
public void initComponents(final Stage parentStage) throws MalformedURLException { this.root = new StackPane(); this.root.autosize(); this.scene = new Scene(root, aboutWindowsWidth, aboutWindowsHeight, Color.web("#FFFFFF")); this.scene.getStylesheets().add(FileUtil.getStyleAsUrl("style")); this.scene.setFill(Color.TRANSPARENT); this.stage = new Stage(); this.stage.setScene(scene); this.stage.initOwner(parentStage); this.stage.initModality(Modality.NONE); this.stage.initStyle(StageStyle.UNDECORATED); Group mainRoot = new Group(); StackPane rootStack = new StackPane() { @Override protected void layoutChildren() { super.layoutChildren(); stage.setWidth(scene.getWidth()); stage.setHeight(scene.getHeight()); stage.setX(parentStage.getX()); stage.setY(parentStage.getY() + aboutWindowsPos); } }; mainRoot.getChildren().add(rootStack); this.root.getChildren().add(mainRoot); HBox vb = new HBox(); addDragListeners(vb); VBox leftContent = new VBox(); leftContent.getStyleClass().add("about-content"); Text aboutTitle = new Text("Our Address"); Text company = new Text("MAP Consultancy Services"); Text address1 = new Text("A/201, Yugandhar Sudama, Manpada Road,"); Text address2 = new Text("Dombivli (E), Thane, Maharashtra"); Text telephone = new Text("+91 9324788024 / +91 7738610004"); Text email = new Text("*****@*****.**"); Text website = new Text("website : http://www.mapconsultancyservices.com/"); Button submitBtn = new Button("Submit"); submitBtn.getStyleClass().add("map-submit-button"); submitBtn.setMinWidth(79); submitBtn.setPrefHeight(29); leftContent .getChildren() .addAll(aboutTitle, company, address1, address2, telephone, email, website, submitBtn); VBox rightContent = new VBox(); rightContent.setPrefSize(515, 410); rightContent.getStyleClass().add("map-content"); File aboutUsFile = new File("resources/aboutus/aboutus.html"); final URL urlGoogleMaps = aboutUsFile.toURI().toURL(); WebView webView = new WebView(); WebEngine webEngine = webView.getEngine(); webEngine.load(urlGoogleMaps.toExternalForm()); rightContent.getChildren().addAll(webView); vb.getChildren().addAll(leftContent, rightContent); rootStack.getChildren().add(vb); }
/** Done by Marco */ public void searchForPubs() { pubLayout.getChildren().remove(noPub); int y = 1; int x = 1; searchName = searchNameInput.getText(); searchStreet = searchStreetInput.getText(); /** End of marco's work */ /** Done by Ahmad */ if (!searchAgeInput.getText().equals("")) { searchAge = Integer.valueOf(searchAgeInput.getText()); } else searchAge = 100; pubs.getChildren().clear(); /* Random pub search */ randomPub = new Button("- Random Pub -"); randomPub.setId("randomPub-button"); randomPub.setMinWidth(230); randomPub.setMinHeight(100); Random random = new Random(); randomPub.setOnAction( (event) -> { idOfButton(random.nextInt(PubDataAccessor.pubs.size())); primaryStage.setScene(pubPage); setPubScene(); }); randomPub.setAlignment(Pos.CENTER); pubs.getChildren().add(randomPub); GridPane.setRowIndex(randomPub, 1); GridPane.setColumnIndex(randomPub, 0); /** End of Ahmad's Work */ /** Done by Shafiq & Antonino & Marco */ for (Pub pub : PubDataAccessor.pubs) { if (searchEvent && pub.eventName.isEmpty()) { continue; } if (area_checker != 2 && pub.location_id != area) { continue; } if (pub.name != null && (pub.name.toLowerCase().contains(searchName.toLowerCase())) && pub.street != null && (pub.street.toLowerCase().contains(searchStreet.toLowerCase())) && pub.age <= searchAge && pub.nrStars >= numberOfStars && pub.hasStudentDiscount >= discount && pub.hasFee <= fee) { /** End of Shafiq & Antonini & Marco's Work */ /** Done by Marco */ pubButton = new Button("- " + pub.name + " -"); pubButton.setId("pub-button"); pubButton.setMinWidth(230); pubButton.setMinHeight(100); pubButton.setOnAction( (event) -> { idOfButton(pub.id); primaryStage.setScene(pubPage); setPubScene(); }); pubButton.setStyle("-fx-background-image: url(" + "\"" + pub.picture + "\"" + "); "); pubButton.setAlignment(Pos.CENTER); pubs.getChildren().add(pubButton); GridPane.setRowIndex(pubButton, y); GridPane.setColumnIndex(pubButton, x); x++; } } if (pubs.getChildren().size() == 0) { pubLayout.getChildren().add(noPub); noPub.setId("nopubs_message"); } /* new elements */ pubs.setHgap(30); /** End of Marco's work */ }
public Veld1RijtechniekKijktechniek( SchermController schermCtrl, EvaController evaCtrl, LeerlingController llnCtrl) { evaController = evaCtrl; schermController = schermCtrl; llnController = llnCtrl; this.llnController.getLeerling().addView(this); aandachtBtn = new Button("Aandachtspunt"); aandachtBtn.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { aandacht(); } }); commentaarCol = new TableColumn("Commentaar"); commentaarCol.setCellValueFactory(new PropertyValueFactory<Rijtechniek, String>("commentaar")); commentaarCol.setCellFactory(TextFieldTableCell.forTableColumn()); commentaarCol.setOnEditCommit( new EventHandler<CellEditEvent<Rijtechniek, String>>() { @Override public void handle(CellEditEvent<Rijtechniek, String> t) { ((Rijtechniek) t.getTableView().getItems().get(t.getTablePosition().getRow())) .setCommentaar(t.getNewValue()); } }); table.setItems(data); table.getColumns().addAll(commentaarCol); commentaarFld = new TextField(); commentaarFld.setPromptText("Commentaar"); addButton = new Button("Voeg toe"); addButton.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { resetAandachtBtn(); if (!"".equals(commentaarFld.getText())) { data.add(new Rijtechniek(commentaarFld.getText())); commentaarFld.clear(); } } }); table.setItems(data); table.setOnMouseClicked( new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent e) { resetAandachtBtn(); } }); table.setEditable(true); vBox2.getChildren().addAll(table, commentaarFld); exit = new Button("Ga terug"); exit.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { evaController.saveListDataRijtechniek("Stuurtechniek", data); Veld1RijtechniekKijktechniek.this.schermController.setScherm(MainApp.RIJTECHNIEK_ID); resetAandachtBtn(); } }); delBtn = new Button("Verwijder"); delBtn.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { resetAandachtBtn(); table.getItems().remove(table.getSelectionModel().getSelectedItem()); } }); delBtn.setMinHeight(30); delBtn.setMaxHeight(30); delBtn.setMinWidth(125); delBtn.setMaxWidth(125); delBtn.setAlignment(Pos.CENTER); delBtn.setTranslateX(-47); delBtn.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white"); table.getStylesheets().add("resource/tableView.css"); commentaarFld.setStyle("-fx-background-color:#789EBF; -fx-text-fill:white"); commentaarCol.setMaxWidth(496); commentaarCol.setMinWidth(496); hBox1.getChildren().addAll(titelAfb, titel); hBox1.setMinHeight(50); hBox1.setMaxHeight(50); hBox1.setMinWidth(600); hBox1.setMaxWidth(600); hBox1.setSpacing(15); hBox1.setAlignment(Pos.CENTER); titelAfb.setFitHeight(50); titelAfb.setFitWidth(50); titel.setStyle("-fx-font: 40px Tahoma; -fx-text-fill:white"); table.setMinWidth(500); table.setMaxWidth(500); table.setMinHeight(400); table.setMaxHeight(400); addButton.setMinHeight(30); addButton.setMaxHeight(30); addButton.setMinWidth(150); addButton.setMaxWidth(150); addButton.setAlignment(Pos.CENTER); aandachtBtn.setMinHeight(30); aandachtBtn.setMaxHeight(30); aandachtBtn.setMinWidth(150); aandachtBtn.setMaxWidth(150); aandachtBtn.setAlignment(Pos.CENTER); exit.setMinHeight(30); exit.setMaxHeight(30); exit.setMinWidth(150); exit.setMaxWidth(150); exit.setAlignment(Pos.CENTER); commentaarFld.setMinHeight(30); commentaarFld.setMaxHeight(30); commentaarFld.setMinWidth(250); commentaarFld.setMaxWidth(250); commentaarFld.setAlignment(Pos.CENTER); table.setTranslateX(70); commentaarFld.setTranslateX(90); addButton.setTranslateX(90); aandachtBtn.setTranslateX(90); exit.setTranslateX(90); addButton.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white"); exit.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white"); aandachtBtn.setStyle("-fx-background-color: #5F6A95; -fx-text-fill:white"); gp.setStyle( "-fx-border-color: #282E54; -fx-border-radius:10 10 10 10;" + "-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 0);" + "-fx-background-color: #282B3A;" + "-fx-background-radius: 5;"); gp.setMaxWidth(900); gp.setMinWidth(900); gp.setMinHeight(600); gp.setMaxHeight(600); gp.setHgap(50); gp.setVgap(20); gp.setAlignment(Pos.CENTER); gp.add(hBox1, 0, 0, 2, 1); gp.add(table, 0, 1, 2, 1); gp.add(commentaarFld, 0, 2); gp.add(addButton, 1, 2); gp.add(aandachtBtn, 0, 3); gp.add(exit, 1, 3); gp.add(delBtn, 1, 3); this.setAlignment(Pos.CENTER); this.getChildren().add(gp); this.setStyle("-fx-background-image: url('resource/achtergrondStandaard.png')"); update(); }