com.jfoenix.controls.JFXButton Java Examples
The following examples show how to use
com.jfoenix.controls.JFXButton.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ManageWorkspacesDialog.java From milkman with MIT License | 6 votes |
private HBox createEntry(String workspaceName) { JFXButton renameButton = new JFXButton(); renameButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.PENCIL, "1.5em")); renameButton.setTooltip(new Tooltip("Rename workspace")); renameButton.setOnAction(e -> triggerRenameDialog(workspaceName)); JFXButton deleteButton = new JFXButton(); deleteButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.TIMES, "1.5em")); deleteButton.setTooltip(new Tooltip("Delete workspace")); deleteButton.setOnAction(e -> { onCommand.invoke(new AppCommand.DeleteWorkspace(workspaceName)); Platform.runLater(() -> workspaces.remove(workspaceName)); }); JFXButton exportButton = new JFXButton(); exportButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.UPLOAD, "1.5em")); exportButton.setTooltip(new Tooltip("Export workspace")); exportButton.setOnAction(e -> triggerExportWorkspaceDialog(workspaceName)); Label wsName = new Label(workspaceName); HBox.setHgrow(wsName, Priority.ALWAYS); return new HBox(wsName, renameButton, deleteButton, exportButton); }
Example #2
Source File: AdminAddUserViewController.java From Corendon-LostLuggage with MIT License | 6 votes |
public void showConfirmedMessage(String headerString, String messageString, String buttonString) { Text header = new Text(headerString); header.setFont(new Font("System", 18)); header.setFill(Paint.valueOf("#495057")); MESSAGE_FLOW.getChildren().clear(); MESSAGE_FLOW.getChildren().add(new Text(messageString)); DIALOG_LAYOUT.getActions().clear(); DIALOG_LAYOUT.setHeading(header); DIALOG_LAYOUT.setBody(MESSAGE_FLOW); JFXButton okButton = new JFXButton(buttonString); okButton.setStyle("-fx-background-color: #4dadf7"); okButton.setTextFill(Paint.valueOf("#FFFFFF")); okButton.setRipplerFill(Paint.valueOf("#FFFFFF")); okButton.setButtonType(JFXButton.ButtonType.RAISED); DIALOG_LAYOUT.setActions(okButton); okButton.setOnAction(e -> { alertView.close(); stackPane.setVisible(false); }); }
Example #3
Source File: JfxTableEditor.java From milkman with MIT License | 6 votes |
public JfxTableEditor() { table.setShowRoot(false); table.setEditable(true); table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); JavaFxUtils.publishEscToParent(table); this.getChildren().add(table); addItemBtn = new JFXButton(); addItemBtn.setContentDisplay(ContentDisplay.GRAPHIC_ONLY); addItemBtn.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.PLUS, "1.5em")); addItemBtn.getStyleClass().add("btn-add-entry"); StackPane.setAlignment(addItemBtn, Pos.BOTTOM_RIGHT); StackPane.setMargin(addItemBtn, new Insets(0, 20, 20, 0)); this.getChildren().add(addItemBtn); final KeyCombination keyCodeCopy = PlatformUtil.getControlKeyCombination(KeyCode.C); final KeyCombination keyCodePaste = PlatformUtil.getControlKeyCombination(KeyCode.V); table.setOnKeyPressed(event -> { if (keyCodeCopy.match(event)) { copySelectionToClipboard(); } if (keyCodePaste.match(event)) { pasteSelectionFromClipboard(); } }); }
Example #4
Source File: LibraryAssistantUtil.java From Library-Assistant with Apache License 2.0 | 6 votes |
public static void initPDFExprot(StackPane rootPane, Node contentPane, Stage stage, List<List> data) { FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Save as PDF"); FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("PDF files (*.pdf)", "*.pdf"); fileChooser.getExtensionFilters().add(extFilter); File saveLoc = fileChooser.showSaveDialog(stage); ListToPDF ltp = new ListToPDF(); boolean flag = ltp.doPrintToPdf(data, saveLoc, ListToPDF.Orientation.LANDSCAPE); JFXButton okayBtn = new JFXButton("Okay"); JFXButton openBtn = new JFXButton("View File"); openBtn.setOnAction((ActionEvent event1) -> { try { Desktop.getDesktop().open(saveLoc); } catch (Exception exp) { AlertMaker.showErrorMessage("Could not load file", "Cant load file"); } }); if (flag) { AlertMaker.showMaterialDialog(rootPane, contentPane, Arrays.asList(okayBtn, openBtn), "Completed", "Member data has been exported."); } }
Example #5
Source File: SidePanelController.java From JavaFX-Tutorial-Codes with Apache License 2.0 | 6 votes |
@FXML private void changeColor(ActionEvent event) { JFXButton btn = (JFXButton) event.getSource(); System.out.println(btn.getText()); switch (btn.getText()) { case "Color 1": callback.updateColor("#00FF00"); break; case "Color 2": callback.updateColor("#0000FF"); break; case "Color 3": callback.updateColor("#FF0000"); break; } }
Example #6
Source File: ConfirmationInputDialog.java From milkman with MIT License | 6 votes |
public ConfirmationInputDialogFxml(ConfirmationInputDialog controller){ controller.title = new Label("title"); setHeading(controller.title); controller.promptLabel = new Label(); setBody(new VBox(controller.promptLabel)); JFXButton apply = new JFXButton("Apply"); apply.setDefaultButton(true); apply.setOnAction(e -> controller.onSave()); JFXButton cancel = new JFXButton("Cancel"); cancel.setCancelButton(true); cancel.setOnAction(e -> controller.onCancel()); setActions(submit(controller::onSave), cancel(controller::onCancel)); }
Example #7
Source File: ManageWorkspacesDialog.java From milkman with MIT License | 6 votes |
public ManageWorkspacesDialogFxml(ManageWorkspacesDialog controller){ setHeading(label("Workspaces")); StackPane stackPane = new StackPane(); var list = controller.workspaceList = new JFXListView<>(); list.setVerticalGap(10.0); list.setMinHeight(400); stackPane.getChildren().add(list); var btn = button(icon(FontAwesomeIcon.PLUS, "1.5em"), controller::onCreateWorkspace); btn.getStyleClass().add("btn-add-entry"); StackPane.setAlignment(btn, Pos.BOTTOM_RIGHT); stackPane.getChildren().add(btn); setBody(stackPane); JFXButton close = cancel(controller::onClose, "Close"); close.getStyleClass().add("dialog-accept"); setActions(close); }
Example #8
Source File: AlertMaker.java From Library-Assistant with Apache License 2.0 | 6 votes |
public static void showMaterialDialog(StackPane root, Node nodeToBeBlurred, List<JFXButton> controls, String header, String body) { BoxBlur blur = new BoxBlur(3, 3, 3); if (controls.isEmpty()) { controls.add(new JFXButton("Okay")); } JFXDialogLayout dialogLayout = new JFXDialogLayout(); JFXDialog dialog = new JFXDialog(root, dialogLayout, JFXDialog.DialogTransition.TOP); controls.forEach(controlButton -> { controlButton.getStyleClass().add("dialog-button"); controlButton.addEventHandler(MouseEvent.MOUSE_CLICKED, (MouseEvent mouseEvent) -> { dialog.close(); }); }); dialogLayout.setHeading(new Label(header)); dialogLayout.setBody(new Label(body)); dialogLayout.setActions(controls); dialog.show(); dialog.setOnDialogClosed((JFXDialogEvent event1) -> { nodeToBeBlurred.setEffect(null); }); nodeToBeBlurred.setEffect(blur); }
Example #9
Source File: Main.java From JFX-Browser with MIT License | 6 votes |
public static void setDialouge(JFXButton applyButton , String heading , String text , Node ob) { JFXButton button = applyButton; content.setHeading(new Text(heading)); content.setBody(new Text(text)); JFXDialog dialoge = new JFXDialog(pane, content, JFXDialog.DialogTransition.CENTER); button.addEventHandler(MouseEvent.MOUSE_CLICKED, (e6) -> { dialoge.close(); }); content.setActions(ob, button); // To show overlay dialougge box dialoge.show(); }
Example #10
Source File: OverdueNotificationController.java From Library-Assistant with Apache License 2.0 | 5 votes |
private void checkForMailServerConfig() { JFXButton button = new JFXButton("Okay"); button.setOnAction((ActionEvent event) -> { ((Stage) rootPane.getScene().getWindow()).close(); }); MailServerInfo mailServerInfo = DataHelper.loadMailServerInfo(); System.out.println(mailServerInfo); if (mailServerInfo == null || !mailServerInfo.validate()) { System.out.println("Mail server not configured"); AlertMaker.showMaterialDialog(rootPane, contentPane, ImmutableList.of(button), "Mail server is not configured", "Please configure mail server first.\nIt is available under Settings"); } }
Example #11
Source File: ButtonDemo.java From JFoenix with Apache License 2.0 | 5 votes |
@Override public void start(Stage stage) { FlowPane main = new FlowPane(); main.setVgap(20); main.setHgap(20); main.getChildren().add(new Button("Java Button")); JFXButton jfoenixButton = new JFXButton("JFoenix Button"); main.getChildren().add(jfoenixButton); JFXButton button = new JFXButton("RAISED BUTTON"); button.getStyleClass().add("button-raised"); main.getChildren().add(button); JFXButton button1 = new JFXButton("DISABLED"); button1.setDisable(true); main.getChildren().add(button1); StackPane pane = new StackPane(); pane.getChildren().add(main); StackPane.setMargin(main, new Insets(100)); pane.setStyle("-fx-background-color:WHITE"); final Scene scene = new Scene(pane, 800, 200); scene.getStylesheets().add(ButtonDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); stage.setTitle("JFX Button Demo"); stage.setScene(scene); stage.show(); }
Example #12
Source File: LogInViewController.java From Corendon-LostLuggage with MIT License | 5 votes |
private void showAlertMessage() { stackPane.setVisible(true); MESSAGE_FLOW.getChildren().clear(); //Customize header Text header = new Text(alertHeader); header.setFont(new Font("System", 18)); header.setFill(Paint.valueOf(headerColor)); JFXButton hideMessageButton = new JFXButton(buttonText); //Customize button hideMessageButton.setStyle("-fx-background-color: #4dadf7"); hideMessageButton.setTextFill(Paint.valueOf("#FFFFFF")); hideMessageButton.setRipplerFill(Paint.valueOf("#FFFFFF")); hideMessageButton.setButtonType(JFXButton.ButtonType.RAISED); MESSAGE_FLOW.getChildren().add(new Text(alert)); DIALOG_LAYOUT.setHeading(header); DIALOG_LAYOUT.setBody(MESSAGE_FLOW); DIALOG_LAYOUT.setActions(hideMessageButton); JFXDialog alertView = new JFXDialog(stackPane, DIALOG_LAYOUT, JFXDialog.DialogTransition.CENTER); alertView.setOverlayClose(false); hideMessageButton.setOnAction(e -> { alertView.close(); stackPane.setVisible(false); }); alertView.show(); }
Example #13
Source File: RequestCollectionComponent.java From milkman with MIT License | 5 votes |
private HBox createCollectionEntry(Collection collection, TreeItem<Node> item) { Label collectionName = new Label(collection.getName()); HBox.setHgrow(collectionName, Priority.ALWAYS); JFXButton starringBtn = new JFXButton(); starringBtn.getStyleClass().add("btn-starring"); starringBtn.setGraphic(collection.isStarred() ? new FontAwesomeIconView(FontAwesomeIcon.STAR, "1em") : new FontAwesomeIconView(FontAwesomeIcon.STAR_ALT, "1em")); starringBtn.setOnAction( e -> { collection.setStarred(!collection.isStarred()); //HACK invoke directly bc we want to trigger sorting (see further up). //this does not change the dirty-state as the //dirty state in collection is not used any further collection.onDirtyChange.invoke(false, true); starringBtn.setGraphic(collection.isStarred() ? new FontAwesomeIconView(FontAwesomeIcon.STAR, "1em") : new FontAwesomeIconView(FontAwesomeIcon.STAR_ALT, "1em")); }); HBox hBox = new HBox(new FontAwesomeIconView(FontAwesomeIcon.FOLDER_ALT, "1.5em"), collectionName, starringBtn); hBox.setOnMouseClicked(e -> { if (e.getButton() == MouseButton.PRIMARY) { item.setExpanded(!item.isExpanded()); e.consume(); } if (e.getButton() == MouseButton.SECONDARY) { collectionCtxMenu.show(collection, hBox, e.getScreenX(), e.getScreenY()); e.consume(); } }); return hBox; }
Example #14
Source File: DashboardController.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public void createTimer() { // Bind the timerLabel text property to the timeSeconds property timerLabel = new Label(); timerLabel.textProperty().bind(timeSeconds.asString()); timerLabel.setTextFill(Color.WHITE); //timerLabel.setStyle("-fx-font-size: 4em;"); timeSeconds.set(STARTTIME); timeline = new Timeline(); timeline.getKeyFrames().add( new KeyFrame(Duration.seconds(STARTTIME+1), new KeyValue(timeSeconds, 0))); timeline.playFromStart(); btnRefresh = new JFXButton(); btnRefresh.setText("Refresh"); btnRefresh.setOnAction(e -> handleRefresh()); // btnRefresh.setOnAction(new EventHandler<ActionEvent>() { // // public void handle(ActionEvent event) { // if (timeline != null) { // timeline.stop(); // } // timeSeconds.set(STARTTIME); // timeline = new Timeline(); // timeline.getKeyFrames().add( // new KeyFrame(Duration.seconds(STARTTIME+1), // new KeyValue(timeSeconds, 0))); // timeline.playFromStart(); // } // }); }
Example #15
Source File: ManagerRetrievedViewController.java From Corendon-LostLuggage with MIT License | 5 votes |
private void showAlertMessage() { stackPane.setVisible(true); MESSAGE_FLOW.getChildren().clear(); //Customize header Text header = new Text(alertHeader); header.setFont(new Font("System", 18)); header.setFill(Paint.valueOf(headerColor)); JFXButton hideMessageButton = new JFXButton(buttonText); //Customize button hideMessageButton.setStyle("-fx-background-color: #4dadf7"); hideMessageButton.setTextFill(Paint.valueOf("#FFFFFF")); hideMessageButton.setRipplerFill(Paint.valueOf("#FFFFFF")); hideMessageButton.setButtonType(JFXButton.ButtonType.RAISED); MESSAGE_FLOW.getChildren().add(new Text(alert)); DIALOG_LAYOUT.setHeading(header); DIALOG_LAYOUT.setBody(MESSAGE_FLOW); DIALOG_LAYOUT.setActions(hideMessageButton); JFXDialog alertView = new JFXDialog(stackPane, DIALOG_LAYOUT, JFXDialog.DialogTransition.CENTER); alertView.setOverlayClose(false); hideMessageButton.setOnAction(e -> { alertView.close(); stackPane.setVisible(false); }); alertView.show(); }
Example #16
Source File: EditEnvironmentDialog.java From milkman with MIT License | 5 votes |
public EditEnvironmentDialogFxml(EditEnvironmentDialog controller){ setHeading(label("Edit Environment")); var editor = controller.editor = new JfxTableEditor<>(); editor.setMinHeight(500); editor.setMinWidth(800); setBody(editor); JFXButton close = cancel(controller::onClose, "Close"); close.getStyleClass().add("dialog-accept"); setActions(close); }
Example #17
Source File: JFXButtonSkin.java From JFoenix with Apache License 2.0 | 5 votes |
@Override protected void layoutChildren(final double x, final double y, final double w, final double h) { if (invalid) { if (((JFXButton) getSkinnable()).getRipplerFill() == null) { // change rippler fill according to the last LabeledText/Label child for (int i = getChildren().size() - 1; i >= 1; i--) { if (getChildren().get(i) instanceof LabeledText) { buttonRippler.setRipplerFill(((LabeledText) getChildren().get(i)).getFill()); ((LabeledText) getChildren().get(i)).fillProperty() .addListener((o, oldVal, newVal) -> buttonRippler.setRipplerFill( newVal)); break; } else if (getChildren().get(i) instanceof Label) { buttonRippler.setRipplerFill(((Label) getChildren().get(i)).getTextFill()); ((Label) getChildren().get(i)).textFillProperty() .addListener((o, oldVal, newVal) -> buttonRippler.setRipplerFill( newVal)); break; } } } else { buttonRippler.setRipplerFill(((JFXButton) getSkinnable()).getRipplerFill()); } invalid = false; } buttonRippler.resizeRelocate( getSkinnable().getLayoutBounds().getMinX(), getSkinnable().getLayoutBounds().getMinY(), getSkinnable().getWidth(), getSkinnable().getHeight()); layoutLabelInArea(x, y, w, h); }
Example #18
Source File: MainMenu.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public static StackPane getExitDialogPane(JFXButton b1, JFXButton b2, JFXButton b3) { Label l = new Label("Do you really want to exit ?");// mainScene.createBlendLabel(Msg.getString("MainScene.exit.header")); // l.setPadding(new Insets(10, 10, 10, 10)); l.setFont(Font.font(null, FontWeight.BOLD, 14)); l.setStyle("-fx-text-fill: white;"); b1.setStyle("-fx-background-color: grey;-fx-text-fill: white;"); b2.setStyle("-fx-background-color: grey;-fx-text-fill: white;"); if (b3 != null) b3.setStyle("-fx-background-color: grey;-fx-text-fill: white;"); HBox hb = new HBox(); hb.setAlignment(Pos.CENTER); if (b3 != null) hb.getChildren().addAll(b1, b2, b3); else hb.getChildren().addAll(b1, b2); HBox.setMargin(b1, new Insets(3, 3, 3, 3)); HBox.setMargin(b2, new Insets(3, 3, 3, 3)); if (b3 != null) HBox.setMargin(b3, new Insets(3, 3, 3, 3)); VBox vb = new VBox(); vb.setAlignment(Pos.CENTER); vb.setPadding(new Insets(5, 5, 5, 5)); vb.getChildren().addAll(l, hb); StackPane sp = new StackPane(vb); sp.setStyle("-fx-background-color: black;"); StackPane.setMargin(vb, new Insets(10, 10, 10, 10)); return sp; }
Example #19
Source File: SettingsViewController.java From Corendon-LostLuggage with MIT License | 5 votes |
private void showAlertMessage() { stackPane.setVisible(true); MESSAGE_FLOW.getChildren().clear(); //Customize header Text header = new Text(alertHeader); header.setFont(new Font("System", 18)); header.setFill(Paint.valueOf(headerColor)); JFXButton hideMessageButton = new JFXButton(buttonText); //Customize button hideMessageButton.setStyle("-fx-background-color: #4dadf7"); hideMessageButton.setTextFill(Paint.valueOf("#FFFFFF")); hideMessageButton.setRipplerFill(Paint.valueOf("#FFFFFF")); hideMessageButton.setButtonType(JFXButton.ButtonType.RAISED); MESSAGE_FLOW.getChildren().add(new Text(alert)); DIALOG_LAYOUT.setHeading(header); DIALOG_LAYOUT.setBody(MESSAGE_FLOW); DIALOG_LAYOUT.setActions(hideMessageButton); JFXDialog alertView = new JFXDialog(stackPane, DIALOG_LAYOUT, JFXDialog.DialogTransition.CENTER); alertView.setOverlayClose(false); hideMessageButton.setOnAction(e -> { alertView.close(); stackPane.setVisible(false); }); alertView.show(); }
Example #20
Source File: ScenarioConfigEditorFX.java From mars-sim with GNU General Public License v3.0 | 5 votes |
/** * Open the exit dialog box * * @param pane */ public void dialogOnExit(StackPane pane) { isShowingDialog = true; JFXButton b1 = new JFXButton("Exit"); JFXButton b2 = new JFXButton("Back"); StackPane sp = MainMenu.getExitDialogPane(b1, b2, null); JFXDialog exitDialog = new JFXDialog(); exitDialog.setTransitionType(DialogTransition.TOP); exitDialog.setDialogContainer(pane); exitDialog.setContent(sp); exitDialog.show(); b1.setOnAction(e -> { isExit = true; exitDialog.close(); Platform.exit(); System.exit(0); }); b2.setOnAction(e -> { exitDialog.close(); isShowingDialog = false; e.consume(); }); }
Example #21
Source File: DashboardController.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public void initSButtons() { //System.out.println("initSButtons()"); // num = unitManager.getSettlementNum(); num = settlements.size(); //buttonVBox.getChildren().add(btnMars); for (int i=0; i<num; i++) { // final ImageView imageView = new ImageView(new Image("http://icons.iconarchive.com/icons/eponas-deeway/colobrush/128/heart-2-icon.png") ); IconNode icon = new IconNode(FontAwesome.USERS);//.ADDRESS_BOOK_O); icon.setIconSize(17); icon.setFill(Color.web(PALE_BLUE)); icon.setWrappingWidth(25); //size="17.0" wrappingWidth="43.0" // icon.setStroke(Color.WHITE); JFXButton btn = new JFXButton(settlements.get(i).getName(), icon); //btn.setMaxSize(20, 20); //btn.setGraphic(icon); buttonVBox.getChildren().add(btn); btn.setLayoutX(10); btn.setLayoutY(109); btn.setPrefHeight(42); //btn.setPrefWidth(250); btn.setAlignment(Pos.CENTER_LEFT); btn.setStyle("jfxbutton"); btn.setTextFill(Color.LIGHTBLUE); // layoutX="10.0" layoutY="109.0" onAction="#handleS0" prefHeight="42.0" prefWidth="139.0" // style="-fx-alignment: center-left;" styleClass="jfxbutton" text="s0" textFill="#a1aec4" final int x = i; btn.setOnAction(e -> handleList(settlements.get(x))); } }
Example #22
Source File: MainScene.java From mars-sim with GNU General Public License v3.0 | 5 votes |
/** * Create the tool windows tool bar */ public void createJFXToolbar() { // JFXButton b0 = new JFXButton("Help"); JFXButton b1 = new JFXButton("Search"); JFXButton b2 = new JFXButton("Time"); JFXButton b3 = new JFXButton("Monitor"); JFXButton b4 = new JFXButton("Mission"); JFXButton b5 = new JFXButton("Science"); JFXButton b6 = new JFXButton("Resupply"); // setQuickToolTip(b0, "Open Help Browser"); setQuickToolTip(b1, "Search Box"); setQuickToolTip(b2, "Time Tool"); setQuickToolTip(b3, "Monitor Tool"); setQuickToolTip(b4, "Mission Wizard"); setQuickToolTip(b5, "Science Tool"); setQuickToolTip(b6, "Resupply Tool"); toolbar = new HBox(); toolbar.setPadding(new Insets(5,5,5,5)); // toolbar.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT); toolbar.getChildren().addAll(b1, b2, b3, b4, b5, b6); // b0.setOnAction(e -> desktop.openToolWindow(GuideWindow.NAME)); b1.setOnAction(e -> desktop.openToolWindow(SearchWindow.NAME)); b2.setOnAction(e -> desktop.openToolWindow(TimeWindow.NAME)); b3.setOnAction(e -> desktop.openToolWindow(MonitorWindow.NAME)); b4.setOnAction(e -> desktop.openToolWindow(MissionWindow.NAME)); b5.setOnAction(e -> desktop.openToolWindow(ScienceWindow.NAME)); b6.setOnAction(e -> desktop.openToolWindow(ResupplyWindow.NAME)); // b0.setOnAction(toolbarHandler); // EventHandler<ActionEvent> toolbarHandler = new EventHandler<ActionEvent>() { // public void handle(ActionEvent ae) { // String s = ((JFXButton)ae.getTarget()).getText(); // } // } }
Example #23
Source File: Flyout.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public void setButtonStyle() { JFXButton b = mainScene.getChatBox().getBroadcastButton();//((ChatBox)flyoutContents).getBroadcastButton(); b.getStyleClass().clear(); b.getStyleClass().add("button-broadcast"); String cssFile = "/fxui/css/nimrodskin.css"; b.getStylesheets().add(getClass().getResource(cssFile).toExternalForm()); }
Example #24
Source File: DeleteDialog.java From Jupiter with GNU General Public License v3.0 | 5 votes |
/** * Creates a new delete dialog * * @param stage dialog stage */ public DeleteDialog(Stage stage) { super(stage); // set content body = new Text(); HBox box = new HBox(); box.setSpacing(10); box.setAlignment(Pos.CENTER); JFXButton delete = new JFXButton("Delete"); delete.setGraphic(Icons.btn("trash")); delete.getStyleClass().add("dont-save"); JFXButton cancel = new JFXButton("Cancel"); cancel.setGraphic(Icons.btn("stop")); cancel.getStyleClass().add("cancel"); box.getChildren().addAll(delete, cancel); // set layout JFXDialogLayout layout = new JFXDialogLayout(); layout.setHeading(new Text("Are you sure you want to delete the selected item permanently ?")); layout.setBody(body); layout.setActions(box); /// set alert setContent(layout); initModality(Modality.NONE); setOverlayClose(false); setAnimation(JFXAlertAnimation.CENTER_ANIMATION); // save actions delete.setOnAction(e -> delete()); delete.setOnKeyPressed(e -> { if (ENTER.match(e)) { delete(); } }); // cancel actions cancel.setOnAction(e -> cancel()); cancel.setOnKeyPressed(e -> { if (ENTER.match(e)) { cancel(); } }); }
Example #25
Source File: MainScene.java From mars-sim with GNU General Public License v3.0 | 5 votes |
/** * Creates and returns a {@link Flyout} * * @return a new {@link Flyout} */ public JFXPopup createFlyout() { marsNetBtn = new JFXButton(); // marsNetBtn.getStyleClass().add("menu-button");//"button-raised"); marsNetIcon = new IconNode(FontAwesome.COMMENTING_O); marsNetIcon.setIconSize(20); // marsNetButton.setPadding(new Insets(0, 0, 0, 0)); // Warning : this // significantly reduce the size of the button image setQuickToolTip(marsNetBtn, "Click to open MarsNet Chat Box"); marsNetBox = new JFXPopup(createChatBox()); marsNetBox.setOpacity(.9); marsNetBtn.setOnAction(e -> { if (!flag) chatBox.update(); if (marsNetBox.isShowing()) {// .isVisible()) { marsNetBox.hide();// .close(); } else { openChatBox(); } e.consume(); }); return marsNetBox; }
Example #26
Source File: LSPSettingItem.java From MSPaintIDE with MIT License | 5 votes |
private JFXButton createButton(String title) { var button = new JFXButton(title); button.setButtonType(JFXButton.ButtonType.RAISED); button.setMnemonicParsing(false); button.setPrefHeight(30); button.setPrefWidth(150); button.getStyleClass().add("primary-button"); return button; }
Example #27
Source File: MainScene.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public void createMapButtons() { rotateCWBtn = new JFXButton(); rotateCWBtn.setOpacity(1); rotateCWBtn.setGraphic(new ImageView(new Image(this.getClass().getResourceAsStream(Msg.getString("img.cw"))))); //$NON-NLS-1$ rotateCWBtn.setStyle("-fx-background-color: transparent; "); setQuickToolTip(rotateCWBtn, Msg.getString("SettlementTransparentPanel.tooltip.clockwise")); rotateCWBtn.setOnAction(e -> { mapPanel.setRotation(mapPanel.getRotation() + ROTATION_CHANGE); e.consume(); }); rotateCCWBtn = new JFXButton(); rotateCCWBtn.setOpacity(1); rotateCCWBtn .setGraphic(new ImageView(new Image(this.getClass().getResourceAsStream(Msg.getString("img.ccw"))))); //$NON-NLS-1$ rotateCCWBtn.setStyle("-fx-background-color: transparent; "); setQuickToolTip(rotateCCWBtn, Msg.getString("SettlementTransparentPanel.tooltip.counterClockwise")); rotateCCWBtn.setOnAction(e -> { mapPanel.setRotation(mapPanel.getRotation() - ROTATION_CHANGE); e.consume(); }); recenterBtn = new JFXButton(); recenterBtn.setOpacity(1); recenterBtn.setGraphic( new ImageView(new Image(this.getClass().getResourceAsStream(Msg.getString("img.recenter"))))); //$NON-NLS-1$ recenterBtn.setStyle("-fx-background-color: transparent; "); setQuickToolTip(recenterBtn, Msg.getString("SettlementTransparentPanel.tooltip.recenter")); recenterBtn.setOnAction(e -> { mapPanel.reCenter(); zoomSlider.setValue(DEFAULT_ZOOM); e.consume(); }); }
Example #28
Source File: SignUpController.java From JFX-Browser with MIT License | 4 votes |
public void setBackLoginView(JFXButton backLoginView) { this.backLoginView = backLoginView; }
Example #29
Source File: ChatBox.java From mars-sim with GNU General Public License v3.0 | 4 votes |
/** * Constructor for ChatBox * * @param {{@link MainScene} */ public ChatBox(MainScene mainScene) { this.mainScene = mainScene; masterClock = sim.getMasterClock(); this.setStyle("-fx-background-color: grey;"// #7ebcea;" //#426ab7;"// + "-fx-background-color: linear-gradient(to bottom, -fx-base, derive(-fx-base,30%));" + "-fx-background-radius: 3px;" + "-fx-text-fill: black;" + "-fx-border-color: white;" + "-fx-border-radius: 3px;" + "-fx-border-width: 1px;" + "-fx-border-style: solid; "); box_height[0] = 256; // mainScene.getFlyout().getContainerHeight(); box_height[1] = 512;// box_height[0] * 1.5D; box_height[2] = 768;// box_height[0] * 3D; box_height[3] = 1024;// box_height[0] * 4D; // Added autoCompleteData ObservableList<String> autoCompleteData = FXCollections.observableArrayList(CollectionUtils.createAutoCompleteKeywords()); textArea = new TextArea(); textArea.textProperty().addListener(new ChangeListener<Object>() { @Override public void changed(ObservableValue<?> observable, Object oldValue, Object newValue) { textArea.setScrollTop(Double.MAX_VALUE); // Note : this will scroll to the bottom // while Double.MIN_VALUE to scroll to the top } }); // textArea.setPadding(new Insets(2, 0, 2, 0)); // textArea.setPrefWidth(560); textArea.setEditable(false); textArea.setWrapText(true); mainScene.setQuickToolTip(textArea, "Conversations on MarsNet"); // ta.appendText("System : WARNING! A small dust storm 20 km away NNW may be // heading toward the Alpha Base" + System.lineSeparator()); // Replaced textField with autoFillTextBox autoFillTextBox = new AutoFillTextBox<String>(autoCompleteData); autoFillTextBox.setPadding(new Insets(2, 0, 0, 0)); autoFillTextBox.getStylesheets().addAll(AUTOFILL); autoFillTextBox.setStyle( // "-fx-background-color: white;" // + "-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.8), 10, 0, 0, 0);" // + "-fx-text-fill: white;" "-fx-background-radius: 5px;"); autoFillTextBox.setFilterMode(false); autoFillTextBox.getTextbox().addEventHandler(KeyEvent.KEY_RELEASED, keyEvent -> { keyHandler(keyEvent); }); autoFillTextBox.getTextbox().setMaxWidth(565); autoFillTextBox.getTextbox().setMinWidth(565); autoFillTextBox.getTextbox().setPrefWidth(565); // autoFillTextBox.setStyle("-fx-font: 11pt 'Corbel';"); // autoFillTextBox.setTooltip(new Tooltip ("Use UP/DOWN arrows to scroll // history")); mainScene.setQuickToolTip(autoFillTextBox, "Use UP/DOWN arrows to scroll history"); autoFillTextBox.getTextbox().setPromptText("Type your msg here");// to broadcast to a channel"); broadcastButton = new JFXButton(" Broadcast ".toUpperCase()); broadcastButton.getStyleClass().clear(); broadcastButton.getStyleClass().add("button-broadcast"); // broadcastButton.setTooltip(new Tooltip ("Click or press Enter to send msg")); mainScene.setQuickToolTip(broadcastButton, "Click or press Enter to send msg"); broadcastButton.setOnAction(e -> { String text = autoFillTextBox.getTextbox().getText(); if (text != "" && text != null && !text.trim().isEmpty()) { hitEnter(); } else { autoFillTextBox.getTextbox().clear(); } }); HBox hbox = new HBox(); hbox.setSpacing(1); hbox.setPadding(new Insets(0, 0, 0, 0)); hbox.getChildren().addAll(broadcastButton, autoFillTextBox);// .getTextbox()); titleLabel = new Label(" " + Msg.getString("ChatBox.title")); //$NON-NLS-1$ setCenter(textArea); setBottom(hbox); }
Example #30
Source File: LoginController.java From JFX-Browser with MIT License | 4 votes |
public JFXButton getLogin() { return login; }