List of usage examples for javafx.scene.layout HBox getStyleClass
@Override public final ObservableList<String> getStyleClass()
From source file:com.github.drbookings.ui.controller.BookingDetailsController.java
private void addRowNetEarnings(final Pane content, final BookingBean be) { final HBox box = new HBox(); box.setSpacing(boxSpacing);// ww w .j a v a 2s. c o m box.setPadding(boxPadding); box.setAlignment(Pos.CENTER_LEFT); box.setFillHeight(true); final TextField grossEarningsExpression = new TextField(be.getGrossEarningsExpression()); grossEarningsExpression.setPrefWidth(prefTextInputFieldWidth * 1.5); booking2GrossEarnings.put(be, grossEarningsExpression); final Text grossEarnings = new Text(decimalFormat.format(be.getGrossEarnings())); final TextFlow tf = new TextFlow(new Text("Gross Earnings: "), grossEarningsExpression, new Text(" = "), grossEarnings, new Text("")); box.getChildren().addAll(tf); if (be.getGrossEarnings() <= 0) { box.getStyleClass().addAll("warning", "warning-bg"); } final HBox box2 = new HBox(); box2.setSpacing(boxSpacing); box2.setPadding(boxPadding); box2.setAlignment(Pos.CENTER_LEFT); box2.setFillHeight(true); Text text = new Text("Amount received: "); TextField textField = new TextField(); textField.setText(new NumberStringConverter().toString(be.getPaymentSoFar())); textField.setEditable(false); be.paymentSoFarProperty().addListener((c, o, n) -> { textField.setText(new NumberStringConverter().toString(n)); }); box2.getChildren().addAll(text, textField); content.getChildren().addAll(box, box2); }
From source file:com.github.drbookings.ui.controller.BookingDetailsController.java
private void addRow5(final Pane content, final BookingBean be) { final HBox box = new HBox(); box.setPadding(new Insets(4)); box.setFillHeight(true);//w w w . jav a 2s. c o m final Text text = new Text("Welcome Mail sent: "); final CheckBox checkBox = new CheckBox(); checkBox.setSelected(be.isWelcomeMailSend()); booking2WelcomeMail.put(be, checkBox); final Text t1 = new Text(" \tPayment done: "); final CheckBox cb1 = new CheckBox(); cb1.setSelected(be.isPaymentDone()); //if (logger.isDebugEnabled()) { // logger.debug("DateOfPayment for " + be + "(" + be.hashCode() + ") is " + be.getDateOfPayment()); //} final DatePicker dp = new DatePicker(); dp.setValue(be.getDateOfPayment()); dp.setPrefWidth(140); booking2PaymentDate.put(be, dp); booking2Payment.put(be, cb1); final TextFlow tf = new TextFlow(); tf.getChildren().addAll(text, checkBox, t1, cb1, dp); box.getChildren().add(tf); if (!be.isWelcomeMailSend() || !be.isPaymentDone()) { box.getStyleClass().addAll("warning", "warning-bg"); } else { box.getStyleClass().removeAll("warning", "warning-bg"); } HBox box2 = new HBox(); box2.setPadding(new Insets(4)); box2.setFillHeight(true); TextField newPayment = new TextField(); Button addNewPaymentButton = new Button("Add payment"); addNewPaymentButton.setOnAction(e -> { addNewPayment(newPayment.getText(), be); }); box2.getChildren().addAll(newPayment, addNewPaymentButton); content.getChildren().addAll(box, box2); }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * * @param primaryStage//from w w w . j ava2s .c om * @param racine * @param taille * @throws Exception */ private void creeMenu(VBox racine, int taille) throws Exception { //Pane myPane = (Pane) FXMLLoader.load(getClass().getResource("menuPrincipal.fxml")); VBox myPane = new VBox(); myPane.setPrefHeight(80); myPane.setPrefWidth(3000); MenuBar menuPrincipal = new MenuBar(); menuPrincipal.setMinHeight(25); menuPrincipal.setPrefHeight(29); menuPrincipal.setPrefWidth(3000); /* Menu projets */ Menu menuProjet = new Menu(rb.getString("projets")); menuPrincipal.getMenus().add(menuProjet); nouveauProjet = new MenuItem(rb.getString("nouveauProjet")); nouveauProjet.setAccelerator(KeyCombination.keyCombination("Ctrl+N")); menuProjet.getItems().add(nouveauProjet); chargeProjet = new MenuItem(rb.getString("ouvrirProjet")); chargeProjet.setAccelerator(KeyCombination.keyCombination("Ctrl+O")); menuProjet.getItems().add(chargeProjet); sauveProjet = new MenuItem(rb.getString("sauverProjet")); sauveProjet.setDisable(true); sauveProjet.setAccelerator(KeyCombination.keyCombination("Ctrl+S")); menuProjet.getItems().add(sauveProjet); sauveSousProjet = new MenuItem(rb.getString("sauverProjetSous")); sauveSousProjet.setDisable(true); sauveSousProjet.setAccelerator(KeyCombination.keyCombination("Shift+Ctrl+S")); menuProjet.getItems().add(sauveSousProjet); derniersProjets = new Menu(rb.getString("derniersProjets")); // derniersProjets.setDisable(true); menuProjet.getItems().add(derniersProjets); fichHistoFichiers = new File(repertConfig.getAbsolutePath() + File.separator + "derniersprojets.cfg"); nombreHistoFichiers = 0; if (fichHistoFichiers.exists()) { FileReader fr; fr = new FileReader(fichHistoFichiers); try (BufferedReader br = new BufferedReader(fr)) { while ((texteHisto = br.readLine()) != null) { MenuItem menuDerniersFichiers = new MenuItem(texteHisto); derniersProjets.getItems().add(menuDerniersFichiers); histoFichiers[nombreHistoFichiers] = texteHisto; nombreHistoFichiers++; menuDerniersFichiers.setOnAction((ActionEvent e) -> { MenuItem mnu = (MenuItem) e.getSource(); try { try { projetChargeNom(mnu.getText()); } catch (InterruptedException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); } } } SeparatorMenuItem sep1 = new SeparatorMenuItem(); menuProjet.getItems().add(sep1); fermerProjet = new MenuItem(rb.getString("quitterApplication")); fermerProjet.setAccelerator(KeyCombination.keyCombination("Ctrl+Q")); menuProjet.getItems().add(fermerProjet); /* Menu affichage */ Menu menuAffichage = new Menu(rb.getString("affichage")); menuPrincipal.getMenus().add(menuAffichage); affichageVisite = new MenuItem(rb.getString("main.creationVisite")); affichageVisite.setAccelerator(KeyCombination.keyCombination("Ctrl+1")); menuAffichage.getItems().add(affichageVisite); affichageInterface = new MenuItem(rb.getString("main.creationInterface")); affichageInterface.setAccelerator(KeyCombination.keyCombination("Ctrl+2")); menuAffichage.getItems().add(affichageInterface); affichagePlan = new MenuItem(rb.getString("main.tabPlan")); affichagePlan.setAccelerator(KeyCombination.keyCombination("Ctrl+3")); affichagePlan.setDisable(true); menuAffichage.getItems().add(affichagePlan); SeparatorMenuItem sep3 = new SeparatorMenuItem(); menuAffichage.getItems().add(sep3); configTransformation = new MenuItem(rb.getString("affichageConfiguration")); menuAffichage.getItems().add(configTransformation); /* Menu panoramiques */ menuPanoramique = new Menu(rb.getString("panoramiques")); menuPanoramique.setDisable(true); menuPrincipal.getMenus().add(menuPanoramique); ajouterPano = new MenuItem(rb.getString("ajouterPanoramiques")); ajouterPano.setAccelerator(KeyCombination.keyCombination("Ctrl+A")); menuPanoramique.getItems().add(ajouterPano); ajouterPlan = new MenuItem(rb.getString("ajouterPlan")); ajouterPlan.setAccelerator(KeyCombination.keyCombination("Ctrl+P")); menuPanoramique.getItems().add(ajouterPlan); ajouterPlan.setDisable(true); SeparatorMenuItem sep2 = new SeparatorMenuItem(); menuPanoramique.getItems().add(sep2); visiteGenere = new MenuItem(rb.getString("genererVisite")); visiteGenere.setDisable(true); visiteGenere.setAccelerator(KeyCombination.keyCombination("Ctrl+V")); menuPanoramique.getItems().add(visiteGenere); /* Menu Modles */ menuModeles = new Menu(rb.getString("menuModele")); menuPrincipal.getMenus().add(menuModeles); chargerModele = new MenuItem(rb.getString("modeleCharger")); menuModeles.getItems().add(chargerModele); sauverModele = new MenuItem(rb.getString("modeleSauver")); menuModeles.getItems().add(sauverModele); /* Menu transformations */ menuTransformation = new Menu(rb.getString("outils")); menuPrincipal.getMenus().add(menuTransformation); equi2CubeTransformation = new MenuItem(rb.getString("outilsEqui2Cube")); menuTransformation.getItems().add(equi2CubeTransformation); cube2EquiTransformation = new MenuItem(rb.getString("outilsCube2Equi")); menuTransformation.getItems().add(cube2EquiTransformation); /* Menu Aide */ Menu menuAide = new Menu(rb.getString("aide")); menuPrincipal.getMenus().add(menuAide); aide = new MenuItem(rb.getString("aideAide")); aide.setAccelerator(KeyCombination.keyCombination("Ctrl+H")); menuAide.getItems().add(aide); SeparatorMenuItem sep4 = new SeparatorMenuItem(); menuAide.getItems().add(sep4); aPropos = new MenuItem(rb.getString("aideAPropos")); menuAide.getItems().add(aPropos); /* barre de boutons */ HBox barreBouton = new HBox(); barreBouton.getStyleClass().add("menuBarreOutils1"); barreBouton.setPrefHeight(50); barreBouton.setMinHeight(50); barreBouton.setPrefWidth(3000); /* Bouton nouveau Projet */ ScrollPane spBtnNouvprojet = new ScrollPane(); spBtnNouvprojet.getStyleClass().add("menuBarreOutils"); spBtnNouvprojet.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnNouvprojet.setPrefHeight(35); spBtnNouvprojet.setMaxHeight(35); spBtnNouvprojet.setPadding(new Insets(2)); spBtnNouvprojet.setPrefWidth(35); HBox.setMargin(spBtnNouvprojet, new Insets(5, 15, 0, 15)); imgNouveauProjet = new ImageView( new Image("file:" + repertAppli + File.separator + "images/nouveauProjet.png")); spBtnNouvprojet.setContent(imgNouveauProjet); Tooltip t0 = new Tooltip(rb.getString("nouveauProjet")); t0.setStyle(tooltipStyle); spBtnNouvprojet.setTooltip(t0); barreBouton.getChildren().add(spBtnNouvprojet); /* Bouton ouvrir Projet */ ScrollPane spBtnOuvrirProjet = new ScrollPane(); spBtnOuvrirProjet.getStyleClass().add("menuBarreOutils"); spBtnOuvrirProjet.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnOuvrirProjet.setPrefHeight(35); spBtnOuvrirProjet.setMaxHeight(35); spBtnOuvrirProjet.setPadding(new Insets(2)); spBtnOuvrirProjet.setPrefWidth(35); HBox.setMargin(spBtnOuvrirProjet, new Insets(5, 15, 0, 0)); imgChargeProjet = new ImageView( new Image("file:" + repertAppli + File.separator + "images/ouvrirProjet.png")); spBtnOuvrirProjet.setContent(imgChargeProjet); Tooltip t1 = new Tooltip(rb.getString("ouvrirProjet")); t1.setStyle(tooltipStyle); spBtnOuvrirProjet.setTooltip(t1); barreBouton.getChildren().add(spBtnOuvrirProjet); /* Bouton sauve Projet */ ScrollPane spBtnSauveProjet = new ScrollPane(); spBtnSauveProjet.getStyleClass().add("menuBarreOutils"); spBtnSauveProjet.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnSauveProjet.setPrefHeight(35); spBtnSauveProjet.setMaxHeight(35); spBtnSauveProjet.setPadding(new Insets(2)); spBtnSauveProjet.setPrefWidth(35); HBox.setMargin(spBtnSauveProjet, new Insets(5, 15, 0, 0)); imgSauveProjet = new ImageView( new Image("file:" + repertAppli + File.separator + "images/sauveProjet.png")); spBtnSauveProjet.setContent(imgSauveProjet); Tooltip t2 = new Tooltip(rb.getString("sauverProjet")); t2.setStyle(tooltipStyle); spBtnSauveProjet.setTooltip(t2); barreBouton.getChildren().add(spBtnSauveProjet); Separator sepImages = new Separator(Orientation.VERTICAL); sepImages.prefHeight(200); barreBouton.getChildren().add(sepImages); imgSauveProjet.setDisable(true); imgSauveProjet.setOpacity(0.3); /* Bouton Ajoute Panoramique */ ScrollPane spBtnAjoutePano = new ScrollPane(); spBtnAjoutePano.getStyleClass().add("menuBarreOutils"); spBtnAjoutePano.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnAjoutePano.setPrefHeight(35); spBtnAjoutePano.setMaxHeight(35); spBtnAjoutePano.setPadding(new Insets(2)); spBtnAjoutePano.setPrefWidth(35); HBox.setMargin(spBtnAjoutePano, new Insets(5, 15, 0, 15)); imgAjouterPano = new ImageView( new Image("file:" + repertAppli + File.separator + "images/ajoutePanoramique.png")); spBtnAjoutePano.setContent(imgAjouterPano); Tooltip t3 = new Tooltip(rb.getString("ajouterPanoramiques")); t3.setStyle(tooltipStyle); spBtnAjoutePano.setTooltip(t3); barreBouton.getChildren().add(spBtnAjoutePano); imgAjouterPano.setDisable(true); imgAjouterPano.setOpacity(0.3); /* Bouton Ajoute Panoramique */ ScrollPane spBtnAjoutePlan = new ScrollPane(); spBtnAjoutePlan.getStyleClass().add("menuBarreOutils"); spBtnAjoutePlan.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnAjoutePlan.setPrefHeight(35); spBtnAjoutePlan.setMaxHeight(35); spBtnAjoutePlan.setPadding(new Insets(2)); spBtnAjoutePlan.setPrefWidth(35); HBox.setMargin(spBtnAjoutePlan, new Insets(5, 15, 0, 15)); imgAjouterPlan = new ImageView(new Image("file:" + repertAppli + File.separator + "images/ajoutePlan.png")); spBtnAjoutePlan.setContent(imgAjouterPlan); Tooltip t31 = new Tooltip(rb.getString("ajouterPlan")); t31.setStyle(tooltipStyle); spBtnAjoutePlan.setTooltip(t31); barreBouton.getChildren().add(spBtnAjoutePlan); imgAjouterPlan.setDisable(true); imgAjouterPlan.setOpacity(0.3); /* Bouton Gnre */ ScrollPane spBtnGenereVisite = new ScrollPane(); spBtnGenereVisite.getStyleClass().add("menuBarreOutils"); spBtnGenereVisite.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnGenereVisite.setPrefHeight(35); spBtnGenereVisite.setMaxHeight(35); spBtnGenereVisite.setPadding(new Insets(2)); spBtnGenereVisite.setPrefWidth(70); HBox.setMargin(spBtnGenereVisite, new Insets(5, 15, 0, 0)); imgVisiteGenere = new ImageView( new Image("file:" + repertAppli + File.separator + "images/genereVisite.png")); spBtnGenereVisite.setContent(imgVisiteGenere); Tooltip t4 = new Tooltip(rb.getString("genererVisite")); t4.setStyle(tooltipStyle); spBtnGenereVisite.setTooltip(t4); barreBouton.getChildren().add(spBtnGenereVisite); imgVisiteGenere.setDisable(true); imgVisiteGenere.setOpacity(0.3); Separator sepImages1 = new Separator(Orientation.VERTICAL); sepImages1.prefHeight(200); barreBouton.getChildren().add(sepImages1); /* Bouton equi -> faces de Cube */ ScrollPane spBtnEqui2Cube = new ScrollPane(); spBtnEqui2Cube.getStyleClass().add("menuBarreOutils"); spBtnEqui2Cube.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnEqui2Cube.setPrefHeight(35); spBtnEqui2Cube.setMaxHeight(35); spBtnEqui2Cube.setPadding(new Insets(2)); spBtnEqui2Cube.setPrefWidth(109); HBox.setMargin(spBtnEqui2Cube, new Insets(5, 15, 0, 250)); imgEqui2Cube = new ImageView(new Image("file:" + repertAppli + File.separator + "images/equi2cube.png")); spBtnEqui2Cube.setContent(imgEqui2Cube); Tooltip t6 = new Tooltip(rb.getString("outilsEqui2Cube")); t6.setStyle(tooltipStyle); spBtnEqui2Cube.setTooltip(t6); barreBouton.getChildren().add(spBtnEqui2Cube); /* Bouton faces de cube -> equi */ ScrollPane spBtnCube2Equi = new ScrollPane(); spBtnCube2Equi.getStyleClass().add("menuBarreOutils"); spBtnCube2Equi.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); spBtnCube2Equi.setPrefHeight(35); spBtnCube2Equi.setMaxHeight(35); spBtnCube2Equi.setPadding(new Insets(2)); spBtnCube2Equi.setPrefWidth(109); HBox.setMargin(spBtnCube2Equi, new Insets(5, 25, 0, 0)); imgCube2Equi = new ImageView(new Image("file:" + repertAppli + File.separator + "images/cube2equi.png")); spBtnCube2Equi.setContent(imgCube2Equi); Tooltip t5 = new Tooltip(rb.getString("outilsCube2Equi")); t5.setStyle(tooltipStyle); spBtnCube2Equi.setTooltip(t5); barreBouton.getChildren().add(spBtnCube2Equi); myPane.getChildren().addAll(menuPrincipal, barreBouton); racine.getChildren().add(myPane); nouveauProjet.setOnAction((ActionEvent e) -> { projetsNouveau(); }); chargeProjet.setOnAction((ActionEvent e) -> { try { try { projetCharge(); } catch (InterruptedException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); sauveProjet.setOnAction((ActionEvent e) -> { try { projetSauve(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); sauveSousProjet.setOnAction((ActionEvent e) -> { try { projetSauveSous(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); visiteGenere.setOnAction((ActionEvent e) -> { try { genereVisite(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); fermerProjet.setOnAction((ActionEvent e) -> { try { projetsFermer(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); ajouterPano.setOnAction((ActionEvent e) -> { try { panoramiquesAjouter(); } catch (InterruptedException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); ajouterPlan.setOnAction((ActionEvent e) -> { planAjouter(); }); aPropos.setOnAction((ActionEvent e) -> { aideapropos(); }); aide.setOnAction((ActionEvent e) -> { AideDialogController.affiche(); }); chargerModele.setOnAction((ActionEvent e) -> { try { modeleCharger(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); sauverModele.setOnAction((ActionEvent e) -> { try { modeleSauver(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); cube2EquiTransformation.setOnAction((ActionEvent e) -> { transformationCube2Equi(); }); equi2CubeTransformation.setOnAction((ActionEvent e) -> { transformationEqui2Cube(); }); affichageVisite.setOnAction((ActionEvent e) -> { tabPaneEnvironnement.getSelectionModel().select(0); }); affichageInterface.setOnAction((ActionEvent e) -> { tabPaneEnvironnement.getSelectionModel().select(1); }); affichagePlan.setOnAction((ActionEvent e) -> { if (!tabPlan.isDisabled()) { tabPaneEnvironnement.getSelectionModel().select(2); } }); configTransformation.setOnAction((ActionEvent e) -> { try { ConfigDialogController cfg = new ConfigDialogController(); cfg.afficheFenetre(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); spBtnNouvprojet.setOnMouseClicked((MouseEvent t) -> { projetsNouveau(); }); spBtnOuvrirProjet.setOnMouseClicked((MouseEvent t) -> { try { try { projetCharge(); } catch (InterruptedException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); spBtnSauveProjet.setOnMouseClicked((MouseEvent t) -> { try { projetSauve(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); spBtnAjoutePano.setOnMouseClicked((MouseEvent t) -> { try { panoramiquesAjouter(); } catch (InterruptedException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); spBtnAjoutePlan.setOnMouseClicked((MouseEvent t) -> { planAjouter(); }); spBtnGenereVisite.setOnMouseClicked((MouseEvent t) -> { try { genereVisite(); } catch (IOException ex) { Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex); } }); spBtnEqui2Cube.setOnMouseClicked((MouseEvent t) -> { transformationEqui2Cube(); }); spBtnCube2Equi.setOnMouseClicked((MouseEvent t) -> { transformationCube2Equi(); }); }
From source file:org.pdfsam.alternatemix.AlternateMixOptionsPane.java
AlternateMixOptionsPane() { super(Style.DEFAULT_SPACING); this.reverseFirst.setId("reverseFirst"); this.reverseSecond.setId("reverseSecond"); this.reverseSecond.setSelected(true); this.firstStep.setId("alternateMixFirstStep"); this.secondStep.setId("alternateMixSecondStep"); initialState();/*www . ja va 2s. c om*/ getStyleClass().addAll(Style.CONTAINER.css()); HBox firstStepContainer = new HBox( new Label(DefaultI18nContext.getInstance() .i18n("Switch from the first document to the second one after the following pages")), firstStep); firstStepContainer.getStyleClass().addAll(Style.HCONTAINER.css()); HBox secondStepContainer = new HBox( new Label(DefaultI18nContext.getInstance() .i18n("Switch from the second document to the first one after the following pages")), secondStep); secondStepContainer.getStyleClass().addAll(Style.HCONTAINER.css()); getChildren().addAll(this.reverseFirst, this.reverseSecond, firstStepContainer, secondStepContainer); }
From source file:org.pdfsam.merge.MergeOptionsPane.java
MergeOptionsPane() { super(5);//from ww w.j a v a 2 s .co m this.containsForms = new CheckBox(DefaultI18nContext.getInstance().i18n("Merge form fields")); this.containsForms.setId("containsFormCheck"); this.containsForms.setTooltip(new Tooltip(DefaultI18nContext.getInstance() .i18n("Some of the selected PDF documents contain forms, merge them"))); this.blankIfOdd = new CheckBox( DefaultI18nContext.getInstance().i18n("Add a blank page if page number is odd")); this.blankIfOdd.setId("blankIfOddCheck"); this.blankIfOdd.setTooltip(new Tooltip(DefaultI18nContext.getInstance() .i18n("Adds a blank page after each merged document if the document has an odd number of pages"))); outline.getItems() .add(keyValue(OutlinePolicy.RETAIN, DefaultI18nContext.getInstance().i18n("Retain bookmarks"))); outline.getItems() .add(keyValue(OutlinePolicy.DISCARD, DefaultI18nContext.getInstance().i18n("Discard bookmarks"))); outline.getItems().add(keyValue(OutlinePolicy.ONE_ENTRY_EACH_DOC, DefaultI18nContext.getInstance().i18n("Create one entry for each merged document"))); outline.getSelectionModel().selectFirst(); outline.setId("outlineCombo"); HBox bookmarksPolicy = new HBox(new Label(DefaultI18nContext.getInstance().i18n("Bookmarks handling:")), outline); bookmarksPolicy.getStyleClass().addAll(Style.VITEM.css()); bookmarksPolicy.getStyleClass().addAll(Style.HCONTAINER.css()); getStyleClass().addAll(Style.CONTAINER.css()); getChildren().addAll(this.containsForms, this.blankIfOdd, bookmarksPolicy); }
From source file:org.pdfsam.splitbybookmarks.SplitOptionsPane.java
private HBox createLine(Node... items) { HBox item = new HBox(items); item.getStyleClass().addAll(Style.VITEM.css()); item.getStyleClass().addAll(Style.HCONTAINER.css()); return item;//w ww . j a v a 2s .c om }
From source file:org.pdfsam.ui.banner.BannerPane.java
@Inject public BannerPane(BannerButtons buttons, ImageView payoff, @Named("logo32") Image logo) { getStyleClass().add("pdfsam-banner"); current.getStyleClass().add("header-title"); HBox.setHgrow(buttons, Priority.ALWAYS); HBox logoView = new HBox(); logoView.getStyleClass().add("pdfsam-logo"); logoView.getChildren().addAll(new ImageView(logo), payoff); getChildren().addAll(logoView, current, buttons); eventStudio().addAnnotatedListeners(this); }
From source file:org.pdfsam.ui.dashboard.preference.PreferenceWorkspacePane.java
@Inject public PreferenceWorkspacePane(@Named("workingDirectory") PreferenceBrowsableDirectoryField workingDirectory, @Named("workspace") PreferenceBrowsableFileField workspace, @Named("saveWorkspaceOnExit") PreferenceCheckBox saveWorkspaceOnExit) { I18nContext i18n = DefaultI18nContext.getInstance(); workingDirectory.getTextField()//from ww w.j av a 2 s.c om .setPromptText(i18n.i18n("Select a directory where documents will be saved and loaded by default")); workingDirectory.setBrowseWindowTitle(i18n.i18n("Select a directory")); HBox workigDirPane = new HBox(workingDirectory, helpIcon(i18n.i18n("Select a directory where documents will be saved and loaded by default"))); HBox.setHgrow(workingDirectory, Priority.ALWAYS); workigDirPane.getStyleClass().add("with-help-hcontainer"); workspace.getTextField().setPromptText( i18n.i18n("Select a previously saved workspace that will be automatically loaded at startup")); workspace.setBrowseWindowTitle(i18n.i18n("Select a workspace")); HBox workspaceDirPane = new HBox(workspace, helpIcon( i18n.i18n("Select a previously saved workspace that will be automatically loaded at startup"))); HBox.setHgrow(workspace, Priority.ALWAYS); workspaceDirPane.getStyleClass().add("with-help-hcontainer"); workspace.getTextField().validProperty().addListener((o, oldVal, newVal) -> { saveWorkspaceOnExit .setDisable(isBlank(workspace.getTextField().getText()) || newVal != ValidationState.VALID); }); workspace.getTextField().validate(); getChildren().addAll(new Label(i18n.i18n("Default working directory:")), workigDirPane, new Label(i18n.i18n("Load default workspace at startup:")), workspaceDirPane, saveWorkspaceOnExit); getStyleClass().addAll(Style.CONTAINER.css()); }
From source file:org.pdfsam.ui.io.PdfDestinationPane.java
public PdfDestinationPane(BrowsableField destination, String ownerModule) { super(destination); this.ownerModule = defaultString(ownerModule); version = new PdfVersionCombo(ownerModule); compress = new PdfVersionConstrainedCheckBox(PdfVersion.VERSION_1_5, ownerModule); compress.setText(DefaultI18nContext.getInstance().i18n("Compress output file/files")); HBox versionPane = new HBox(2, new Label(DefaultI18nContext.getInstance().i18n("Output document pdf version:")), version); versionPane.setAlignment(Pos.BOTTOM_LEFT); versionPane.getStyleClass().addAll(Style.VITEM.css()); getHChildren().add(compress);// ww w. j av a2 s. co m getChildren().addAll(versionPane); eventStudio().addAnnotatedListeners(this); }
From source file:org.pdfsam.ui.news.News.java
News(NewsData data) { this.getStyleClass().add("news-box"); TextFlow flow = new TextFlow(); if (data.isImportant()) { Text megaphone = GlyphsDude.createIcon(FontAwesomeIcon.BULLHORN, "1.2em"); megaphone.getStyleClass().clear(); megaphone.getStyleClass().add("news-box-title-important"); flow.getChildren().addAll(megaphone, new Text(" ")); }/* w w w. j a v a 2s . c om*/ Text titleText = new Text(data.getTitle() + System.lineSeparator()); titleText.setOnMouseClicked(e -> eventStudio().broadcast(new OpenUrlRequest(data.getLink()))); titleText.getStyleClass().add("news-box-title"); Text contentText = new Text(data.getContent()); contentText.setTextAlignment(TextAlignment.JUSTIFY); contentText.getStyleClass().add("news-content"); flow.getChildren().addAll(titleText, contentText); flow.setTextAlignment(TextAlignment.JUSTIFY); Label labelDate = new Label(FORMATTER.format(data.getDate()), GlyphsDude.createIcon(MaterialDesignIcon.CLOCK)); labelDate.setPrefWidth(Integer.MAX_VALUE); HBox.setHgrow(labelDate, Priority.ALWAYS); HBox bottom = new HBox(labelDate); bottom.setAlignment(Pos.CENTER_LEFT); bottom.getStyleClass().add("news-box-footer"); if (isNotBlank(data.getLink())) { Button link = UrlButton.urlButton(null, data.getLink(), FontAwesomeIcon.EXTERNAL_LINK_SQUARE, "pdfsam-toolbar-button"); bottom.getChildren().add(link); } getChildren().addAll(flow, bottom); }