List of usage examples for javafx.scene.control Label getStyleClass
@Override public final ObservableList<String> getStyleClass()
From source file:gov.va.isaac.gui.refexViews.refexEdit.AddRefexPopup.java
private AddRefexPopup() { super();//from w w w . j ava 2 s. c om BorderPane root = new BorderPane(); VBox topItems = new VBox(); topItems.setFillWidth(true); title_ = new Label("Create new sememe instance"); title_.getStyleClass().add("titleLabel"); title_.setAlignment(Pos.CENTER); title_.prefWidthProperty().bind(topItems.widthProperty()); topItems.getChildren().add(title_); VBox.setMargin(title_, new Insets(10, 10, 10, 10)); gp_ = new GridPane(); gp_.setHgap(10.0); gp_.setVgap(10.0); VBox.setMargin(gp_, new Insets(5, 5, 5, 5)); topItems.getChildren().add(gp_); Label referencedComponent = new Label("Referenced Component"); referencedComponent.getStyleClass().add("boldLabel"); gp_.add(referencedComponent, 0, 0); unselectableComponentLabel_ = new CopyableLabel(); unselectableComponentLabel_.setWrapText(true); AppContext.getService(DragRegistry.class).setupDragOnly(unselectableComponentLabel_, () -> { if (editRefex_ == null) { if (createRefexFocus_.getComponentNid() != null) { return createRefexFocus_.getComponentNid() + ""; } else { return createRefexFocus_.getAssemblyNid() + ""; } } else { return editRefex_.getRefex().getAssemblageNid() + ""; } }); //delay adding till we know which row Label assemblageConceptLabel = new Label("Assemblage Concept"); assemblageConceptLabel.getStyleClass().add("boldLabel"); gp_.add(assemblageConceptLabel, 0, 1); selectableConcept_ = new ConceptNode(null, true, refexDropDownOptions, null); selectableConcept_.getConceptProperty().addListener(new ChangeListener<ConceptVersionBI>() { @Override public void changed(ObservableValue<? extends ConceptVersionBI> observable, ConceptVersionBI oldValue, ConceptVersionBI newValue) { if (createRefexFocus_ != null && createRefexFocus_.getComponentNid() != null) { if (selectableConcept_.isValid().get()) { //Its a valid concept, but is it a valid assemblage concept? try { assemblageInfo_ = RefexDynamicUsageDescriptionBuilder .readRefexDynamicUsageDescriptionConcept( selectableConcept_.getConceptNoWait().getNid()); assemblageIsValid_.set(true); if (assemblageInfo_.getReferencedComponentTypeRestriction() != null) { String result = RefexDynamicValidatorType.COMPONENT_TYPE .passesValidatorStringReturn( new RefexDynamicNid(createRefexFocus_.getComponentNid()), new RefexDynamicString(assemblageInfo_ .getReferencedComponentTypeRestriction().name()), null); //component type validator doesn't use vc, so null is ok if (result.length() > 0) { selectableConcept_.isValid() .setInvalid("The selected assemblage requires the component type to be " + assemblageInfo_.getReferencedComponentTypeRestriction() .toString() + ", which doesn't match the referenced component."); logger_.info("The selected assemblage requires the component type to be " + assemblageInfo_.getReferencedComponentTypeRestriction().toString() + ", which doesn't match the referenced component."); assemblageIsValid_.set(false); } } } catch (Exception e) { selectableConcept_.isValid().setInvalid( "The selected concept is not properly constructed for use as an Assemblage concept"); logger_.info("Concept not a valid concept for a sememe assemblage", e); assemblageIsValid_.set(false); } } else { assemblageInfo_ = null; assemblageIsValid_.set(false); } buildDataFields(assemblageIsValid_.get(), null); } } }); selectableComponent_ = new TextField(); selectableComponentNodeValid_ = new ValidBooleanBinding() { { setComputeOnInvalidate(true); bind(selectableComponent_.textProperty()); invalidate(); } @Override protected boolean computeValue() { if (createRefexFocus_ != null && createRefexFocus_.getAssemblyNid() != null && !conceptNodeIsConceptType_) { //If the assembly nid was what was set - the component node may vary - validate if we are using the text field String value = selectableComponent_.getText().trim(); if (value.length() > 0) { try { if (Utility.isUUID(value)) { String result = RefexDynamicValidatorType.COMPONENT_TYPE .passesValidatorStringReturn(new RefexDynamicUUID(UUID.fromString(value)), new RefexDynamicString(assemblageInfo_ .getReferencedComponentTypeRestriction().name()), null); //component type validator doesn't use vc, so null is ok if (result.length() > 0) { setInvalidReason(result); logger_.info(result); return false; } } else if (Utility.isInt(value)) { String result = RefexDynamicValidatorType.COMPONENT_TYPE .passesValidatorStringReturn(new RefexDynamicNid(Integer.parseInt(value)), new RefexDynamicString(assemblageInfo_ .getReferencedComponentTypeRestriction().name()), null); //component type validator doesn't use vc, so null is ok if (result.length() > 0) { setInvalidReason(result); logger_.info(result); return false; } } else { setInvalidReason( "Value cannot be parsed as a component identifier. Must be a UUID or a valid NID"); return false; } } catch (Exception e) { logger_.error("Error checking component type validation", e); setInvalidReason("Unexpected error validating entry"); return false; } } else { setInvalidReason("Component identifier is required"); return false; } } clearInvalidReason(); return true; } }; selectableComponentNode_ = ErrorMarkerUtils.setupErrorMarker(selectableComponent_, null, selectableComponentNodeValid_); //delay adding concept / component till we know if / where ColumnConstraints cc = new ColumnConstraints(); cc.setHgrow(Priority.NEVER); cc.setMinWidth(FxUtils.calculateNecessaryWidthOfBoldLabel(referencedComponent)); gp_.getColumnConstraints().add(cc); cc = new ColumnConstraints(); cc.setHgrow(Priority.ALWAYS); gp_.getColumnConstraints().add(cc); Label l = new Label("Data Fields"); l.getStyleClass().add("boldLabel"); VBox.setMargin(l, new Insets(5, 5, 5, 5)); topItems.getChildren().add(l); root.setTop(topItems); sp_ = new ScrollPane(); sp_.visibleProperty().bind(assemblageIsValid_); sp_.setFitToHeight(true); sp_.setFitToWidth(true); root.setCenter(sp_); allValid_ = new UpdateableBooleanBinding() { { addBinding(assemblageIsValid_, selectableConcept_.isValid(), selectableComponentNodeValid_); } @Override protected boolean computeValue() { if (assemblageIsValid_.get() && (conceptNodeIsConceptType_ ? selectableConcept_.isValid().get() : selectableComponentNodeValid_.get())) { boolean allDataValid = true; for (ReadOnlyStringProperty ssp : currentDataFieldWarnings_) { if (ssp.get().length() > 0) { allDataValid = false; break; } } if (allDataValid) { clearInvalidReason(); return true; } } setInvalidReason("All errors must be corrected before save is allowed"); return false; } }; GridPane bottomRow = new GridPane(); //spacer col bottomRow.add(new Region(), 0, 0); Button cancelButton = new Button("Cancel"); cancelButton.setOnAction((action) -> { close(); }); GridPane.setMargin(cancelButton, new Insets(5, 20, 5, 0)); GridPane.setHalignment(cancelButton, HPos.RIGHT); bottomRow.add(cancelButton, 1, 0); Button saveButton = new Button("Save"); saveButton.disableProperty().bind(allValid_.not()); saveButton.setOnAction((action) -> { doSave(); }); Node wrappedSave = ErrorMarkerUtils.setupDisabledInfoMarker(saveButton, allValid_.getReasonWhyInvalid()); GridPane.setMargin(wrappedSave, new Insets(5, 0, 5, 20)); bottomRow.add(wrappedSave, 2, 0); //spacer col bottomRow.add(new Region(), 3, 0); cc = new ColumnConstraints(); cc.setHgrow(Priority.SOMETIMES); cc.setFillWidth(true); bottomRow.getColumnConstraints().add(cc); cc = new ColumnConstraints(); cc.setHgrow(Priority.NEVER); bottomRow.getColumnConstraints().add(cc); cc = new ColumnConstraints(); cc.setHgrow(Priority.NEVER); bottomRow.getColumnConstraints().add(cc); cc = new ColumnConstraints(); cc.setHgrow(Priority.SOMETIMES); cc.setFillWidth(true); bottomRow.getColumnConstraints().add(cc); root.setBottom(bottomRow); Scene scene = new Scene(root); scene.getStylesheets().add(AddRefexPopup.class.getResource("/isaac-shared-styles.css").toString()); setScene(scene); }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * * @param strLstPano/*from w ww. j a v a2 s . co m*/ * @param iNumPano * @return */ public static Pane paneAffichageHS(String strLstPano, int iNumPano) { Pane paneHotSpots = new Pane(); paneHotSpots.setTranslateY(10); paneHotSpots.setTranslateX(10); VBox vbHotspots = new VBox(5); paneHotSpots.getChildren().add(vbHotspots); Label lblPoint; int io; for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspots(); io++) { Label lblSep = new Label(" "); Label lblSep1 = new Label(" "); VBox vbPanneauHS = new VBox(); double deplacement = 0; vbPanneauHS.setLayoutX(deplacement); Pane paneHsPanoramique = new Pane(vbPanneauHS); paneHsPanoramique.setPrefHeight(300); paneHsPanoramique.setMinHeight(300); paneHsPanoramique.setMaxHeight(300); int iNum1 = io; Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> { Circle c1 = (Circle) panePanoramique.lookup("#point" + iNum1); if (c1 != null) { if (c1.getFill() == Color.RED) { c1.setFill(Color.YELLOW); c1.setStroke(Color.RED); } else { c1.setFill(Color.RED); c1.setStroke(Color.YELLOW); } } })); timBouge.setCycleCount(Timeline.INDEFINITE); timBouge.pause(); paneHsPanoramique.setOnMouseEntered((e) -> { timBouge.play(); }); paneHsPanoramique.setOnMouseExited((e) -> { timBouge.pause(); Circle c1 = (Circle) panePanoramique.lookup("#point" + iNum1); if (c1 != null) { c1.setFill(Color.YELLOW); c1.setStroke(Color.RED); } }); paneHsPanoramique .setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;"); paneHsPanoramique.setId("HS" + io); lblPoint = new Label("Point #" + (io + 1)); lblPoint.setPadding(new Insets(5, 10, 5, 5)); lblPoint.setTranslateX(-deplacement); lblPoint.getStyleClass().add("titreOutil"); Separator sepHotspots = new Separator(Orientation.HORIZONTAL); sepHotspots.setTranslateX(-deplacement); sepHotspots.setPrefWidth(321); sepHotspots.setTranslateX(2); paneHsPanoramique.setPrefWidth(325); vbPanneauHS.getChildren().addAll(lblPoint, sepHotspots); if (strLstPano != null) { Label lblLien = new Label(rbLocalisation.getString("main.panoramiqueDestination")); lblLien.setTranslateX(10); ComboBox cbDestPano = new ComboBox(); String[] strListe = strLstPano.split(";"); cbDestPano.getItems().addAll(Arrays.asList(strListe)); int iNum11 = getPanoramiquesProjet()[iNumPano].getHotspot(io).getNumeroPano(); cbDestPano.setTranslateX(10); cbDestPano.setId("cbpano" + io); cbDestPano.getSelectionModel().select(iNum11); cbDestPano.getSelectionModel().selectedIndexProperty().addListener((ov, t, t1) -> { valideHS(); if (dejaCharge) { dejaCharge = false; retireAffichageHotSpots(); Pane affHS1 = paneAffichageHS(strListePano(), iNumPano); affHS1.setId("labels"); vbVisuHotspots.getChildren().add(affHS1); } }); if (iNum11 != -1) { int iNumPan = iNum11; ImageView ivAfficheVignettePano = new ImageView( getPanoramiquesProjet()[iNum11].getImgPanoRect()); ivAfficheVignettePano.setPreserveRatio(true); ivAfficheVignettePano.setFitWidth(300); ivAfficheVignettePano.setLayoutY(10); ivAfficheVignettePano.setCursor(Cursor.HAND); ivAfficheVignettePano.setOnMouseClicked((e) -> { affichePanoChoisit(iNumPan); }); AnchorPane apVisuVignettePano = new AnchorPane(ivAfficheVignettePano); apVisuVignettePano.setPrefHeight(170); apVisuVignettePano.setTranslateX(10); vbPanneauHS.getChildren().addAll(lblLien, cbDestPano, apVisuVignettePano, lblSep); } else { vbPanneauHS.getChildren().addAll(lblLien, cbDestPano, lblSep); } } Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot")); lblTexteHS.setTranslateX(10); TextField tfTexteHS = new TextField(); if (getPanoramiquesProjet()[iNumPano].getHotspot(io).getStrInfo() != null) { tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspot(io).getStrInfo()); } tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable, final String oldValue, final String newValue) -> { valideHS(); }); tfTexteHS.setId("txtHS" + io); tfTexteHS.setPrefSize(200, 25); tfTexteHS.setMaxSize(200, 20); tfTexteHS.setTranslateX(60); vbPanneauHS.getChildren().addAll(lblTexteHS, tfTexteHS, lblSep1); vbHotspots.getChildren().addAll(paneHsPanoramique, lblSep); } int iNbHS = io; int iTaillePane = io * 325; for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspotImage(); io++) { Label lblSep = new Label(" "); Label lblSep1 = new Label(" "); VBox vbPanneauHsImage = new VBox(); Pane paneHsImage = new Pane(vbPanneauHsImage); int iNum = io; Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> { Circle c1 = (Circle) panePanoramique.lookup("#img" + iNum); if (c1 != null) { if (c1.getFill() == Color.BLUE) { c1.setFill(Color.YELLOW); c1.setStroke(Color.BLUE); } else { c1.setFill(Color.BLUE); c1.setStroke(Color.YELLOW); } } })); timBouge.setCycleCount(Timeline.INDEFINITE); timBouge.pause(); paneHsImage.setOnMouseEntered((e) -> { timBouge.play(); }); paneHsImage.setOnMouseExited((e) -> { Circle c1 = (Circle) panePanoramique.lookup("#img" + iNum); if (c1 != null) { c1.setFill(Color.BLUE); c1.setStroke(Color.YELLOW); } timBouge.pause(); }); paneHsImage.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;"); paneHsImage.setId("HSImg" + io); lblPoint = new Label("Image #" + (io + 1)); lblPoint.setPadding(new Insets(5, 10, 5, 5)); lblPoint.getStyleClass().add("titreOutil"); Separator sepHS = new Separator(Orientation.HORIZONTAL); sepHS.setPrefWidth(321); sepHS.setTranslateX(2); paneHsImage.setPrefWidth(325); vbPanneauHsImage.getChildren().addAll(lblPoint, sepHS); Label lblLien = new Label(rbLocalisation.getString("main.imageChoisie")); lblLien.setTranslateX(10); String strF1XML = getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrLienImg(); Image imgChoisie = new Image( "file:" + getStrRepertTemp() + File.separator + "images" + File.separator + strF1XML); ImageView ivChoisie = new ImageView(imgChoisie); ivChoisie.setTranslateX(100); ivChoisie.setFitWidth(100); ivChoisie.setFitHeight(imgChoisie.getHeight() / imgChoisie.getWidth() * 100); vbPanneauHsImage.getChildren().addAll(lblLien, ivChoisie, lblSep); Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot")); lblTexteHS.setTranslateX(10); TextField tfTexteHS = new TextField(); if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrInfo() != null) { tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrInfo()); } tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable, final String oldValue, final String newValue) -> { valideHS(); }); tfTexteHS.setId("txtHSImage" + io); tfTexteHS.setPrefSize(200, 25); tfTexteHS.setMaxSize(200, 20); tfTexteHS.setTranslateX(60); vbPanneauHsImage.getChildren().addAll(lblTexteHS, tfTexteHS, lblSep1); Label lblCoulFond = new Label(rbLocalisation.getString("diapo.couleurFond")); lblCoulFond.setTranslateX(10); Label lblOpacite = new Label(rbLocalisation.getString("diapo.opacite")); lblOpacite.setTranslateX(10); if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrCouleurFond().equals("")) { getPanoramiquesProjet()[iNumPano].getHotspotImage(io).setStrCouleurFond( "#" + getGestionnaireInterface().getCouleurFondTheme().toString().substring(2, 8)); } ColorPicker cpCouleurFond = new ColorPicker( Color.valueOf(getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getStrCouleurFond())); if (getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getOpacite() == -1) { getPanoramiquesProjet()[iNumPano].getHotspotImage(io) .setOpacite(getGestionnaireInterface().getOpaciteTheme()); } cpCouleurFond.setTranslateX(100); int i = io; cpCouleurFond.valueProperty().addListener((ov, av, nv) -> { if (getiNombrePanoramiques() != 0) { setbDejaSauve(false); getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *"); } getPanoramiquesProjet()[iNumPano].getHotspotImage(i) .setStrCouleurFond("#" + cpCouleurFond.getValue().toString().substring(2, 8)); }); Slider slOpacite = new Slider(0, 1, getPanoramiquesProjet()[iNumPano].getHotspotImage(io).getOpacite()); slOpacite.valueProperty().addListener((ov, av, nv) -> { if (getiNombrePanoramiques() != 0) { setbDejaSauve(false); getStPrincipal().setTitle(getStPrincipal().getTitle().replace(" *", "") + " *"); } getPanoramiquesProjet()[iNumPano].getHotspotImage(i).setOpacite(slOpacite.getValue()); }); slOpacite.setTranslateX(100); slOpacite.setPrefWidth(130); slOpacite.setMinWidth(130); slOpacite.setMaxWidth(130); vbPanneauHsImage.getChildren().addAll(lblCoulFond, cpCouleurFond, lblOpacite, slOpacite); vbHotspots.getChildren().addAll(paneHsImage, lblSep); iTaillePane += 225 + ivChoisie.getFitHeight(); paneHsImage.setPrefHeight(200 + ivChoisie.getFitHeight()); paneHsImage.setMinHeight(200 + ivChoisie.getFitHeight()); paneHsImage.setMaxHeight(200 + ivChoisie.getFitHeight()); } iNbHS += io; for (io = 0; io < getPanoramiquesProjet()[iNumPano].getNombreHotspotHTML(); io++) { Label lblSep = new Label(" "); int iNum = io; VBox vbPanneauHS = new VBox(); Pane paneHsHtml = new Pane(vbPanneauHS); Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> { Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum); if (c1 != null) { if (c1.getFill() == Color.DARKGREEN) { c1.setFill(Color.YELLOWGREEN); c1.setStroke(Color.DARKGREEN); } else { c1.setFill(Color.DARKGREEN); c1.setStroke(Color.YELLOWGREEN); } } })); timBouge.setCycleCount(Timeline.INDEFINITE); timBouge.pause(); paneHsHtml.setOnMouseEntered((e) -> { timBouge.play(); }); paneHsHtml.setOnMouseExited((e) -> { timBouge.pause(); Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum); if (c1 != null) { c1.setFill(Color.DARKGREEN); c1.setStroke(Color.YELLOWGREEN); } }); paneHsHtml.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;"); paneHsHtml.setId("HSHTML" + io); lblPoint = new Label("Hotspot HTML #" + (io + 1)); lblPoint.setPadding(new Insets(5, 10, 5, 5)); lblPoint.getStyleClass().add("titreOutil"); Separator sepHS = new Separator(Orientation.HORIZONTAL); sepHS.setPrefWidth(321); sepHS.setTranslateX(2); paneHsHtml.setPrefWidth(325); Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot")); lblTexteHS.setTranslateX(10); TextField tfTexteHS = new TextField(); if (getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).getStrInfo() != null) { tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotHTML(io).getStrInfo()); } tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable, final String oldValue, final String newValue) -> { valideHS(); }); tfTexteHS.setId("txtHSHTML" + io); tfTexteHS.setPrefSize(200, 25); tfTexteHS.setMaxSize(200, 20); tfTexteHS.setTranslateX(60); vbPanneauHS.getChildren().addAll(lblPoint, sepHS, lblTexteHS, tfTexteHS); Button btnEditeHSHTML = new Button(rbLocalisation.getString("main.editeHTML")); btnEditeHSHTML.setPrefWidth(80); btnEditeHSHTML.setTranslateX(paneHsHtml.getPrefWidth() - btnEditeHSHTML.getPrefWidth() - 10); vbPanneauHS.getChildren().addAll(btnEditeHSHTML); btnEditeHSHTML.setOnAction((e) -> { EditeurHTML editHTML = new EditeurHTML(); HotspotHTML HS = getPanoramiquesProjet()[iNumPano].getHotspotHTML(iNum); editHTML.setHsHTML(HS); Rectangle2D tailleEcran = Screen.getPrimary().getBounds(); int iHauteur = (int) tailleEcran.getHeight() - 100; int iLargeur = (int) tailleEcran.getWidth() - 100; editHTML.affiche(iLargeur, iHauteur); editHTML.addPropertyChangeListener("bValide", (ev) -> { if (ev.getNewValue().toString().equals("true")) { getPanoramiquesProjet()[iNumPano].setHotspotHTML(editHTML.getHsHTML(), iNum); dejaCharge = false; retireAffichageHotSpots(); Pane affHS1 = paneAffichageHS(strListePano(), iNumPano); affHS1.setId("labels"); vbVisuHotspots.getChildren().add(affHS1); } }); }); vbHotspots.getChildren().addAll(paneHsHtml, lblSep); paneHsHtml.setPrefHeight(120); paneHsHtml.setMinHeight(120); paneHsHtml.setMaxHeight(120); iTaillePane += 145; } iNbHS += io; for (io = 0; io < getPanoramiquesProjet()[iNumPano].getiNombreHotspotDiapo(); io++) { Label lblSep = new Label(" "); int iNum = io; VBox vbPanneauHS = new VBox(); Pane paneHsDiapo = new Pane(vbPanneauHS); Timeline timBouge = new Timeline(new KeyFrame(Duration.millis(500), (ActionEvent event) -> { Circle c1 = (Circle) panePanoramique.lookup("#dia" + iNum); if (c1 != null) { if (c1.getFill() == Color.TURQUOISE) { c1.setFill(Color.ORANGE); c1.setStroke(Color.TURQUOISE); } else { c1.setFill(Color.TURQUOISE); c1.setStroke(Color.ORANGE); } } })); timBouge.setCycleCount(Timeline.INDEFINITE); timBouge.pause(); paneHsDiapo.setOnMouseEntered((e) -> { timBouge.play(); }); paneHsDiapo.setOnMouseExited((e) -> { timBouge.pause(); Circle c1 = (Circle) panePanoramique.lookup("#html" + iNum); if (c1 != null) { c1.setFill(Color.TURQUOISE); c1.setStroke(Color.ORANGE); } }); paneHsDiapo.setStyle("-fx-border-color : #777777;-fx-border-width : 1px;-fx-border-radius : 3px;"); paneHsDiapo.setId("DIAPO" + io); lblPoint = new Label("Hotspot Diaporama #" + (io + 1)); lblPoint.setPadding(new Insets(5, 10, 5, 5)); lblPoint.getStyleClass().add("titreOutil"); Separator sepHS = new Separator(Orientation.HORIZONTAL); sepHS.setPrefWidth(321); sepHS.setTranslateX(2); paneHsDiapo.setPrefWidth(325); Label lblTexteHS = new Label(rbLocalisation.getString("main.texteHotspot")); lblTexteHS.setTranslateX(10); TextField tfTexteHS = new TextField(); if (getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getStrInfo() != null) { tfTexteHS.setText(getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getStrInfo()); } tfTexteHS.textProperty().addListener((final ObservableValue<? extends String> observable, final String oldValue, final String newValue) -> { valideHS(); }); tfTexteHS.setId("txtDIA" + io); tfTexteHS.setPrefSize(200, 25); tfTexteHS.setMaxSize(200, 20); tfTexteHS.setTranslateX(60); vbPanneauHS.getChildren().addAll(lblPoint, sepHS, lblTexteHS, tfTexteHS); ComboBox cbListeDiapo = new ComboBox(); for (int i = 0; i < getiNombreDiapo(); i++) { cbListeDiapo.getItems().add(diaporamas[i].getStrNomDiaporama()); } cbListeDiapo.getSelectionModel() .select(getPanoramiquesProjet()[iNumPano].getHotspotDiapo(io).getiNumDiapo()); int iii = io; cbListeDiapo.getSelectionModel().selectedIndexProperty().addListener((ov, av, nv) -> { getPanoramiquesProjet()[iNumPano].getHotspotDiapo(iii).setiNumDiapo((int) nv); }); cbListeDiapo.setTranslateX(60); vbPanneauHS.getChildren().addAll(cbListeDiapo); //Ajouter Liste Diaporamas vbHotspots.getChildren().addAll(paneHsDiapo, lblSep); paneHsDiapo.setPrefHeight(120); paneHsDiapo.setMinHeight(120); paneHsDiapo.setMaxHeight(120); iTaillePane += 145; } valideHS(); iNbHS += io; dejaCharge = true; paneHotSpots.setPrefHeight(iTaillePane); paneHotSpots.setMinHeight(iTaillePane); paneHotSpots.setMaxHeight(iTaillePane); paneHotSpots.setId("labels"); apVisuHS.setPrefHeight(paneHotSpots.getPrefHeight()); apVisuHS.setMinHeight(paneHotSpots.getPrefHeight()); apVisuHS.setMaxHeight(paneHotSpots.getPrefHeight()); vbVisuHotspots.setPrefHeight(paneHotSpots.getPrefHeight()); vbVisuHotspots.setMinHeight(paneHotSpots.getPrefHeight()); vbVisuHotspots.setMaxHeight(paneHotSpots.getPrefHeight()); return paneHotSpots; }
From source file:org.pdfsam.ui.dashboard.about.AboutDashboardPane.java
private void addSectionTitle(String title, Pane pane) { Label label = new Label(title); label.getStyleClass().add("section-title"); pane.getChildren().add(label);/* ww w .j av a 2 s . com*/ }