2525
2626package javafx .scene .control ;
2727
28-
2928import com .sun .javafx .css .StyleManager ;
3029import com .sun .javafx .scene .NodeHelper ;
3130import javafx .css .converter .BooleanConverter ;
6867import javafx .css .StyleableProperty ;
6968import javafx .css .StyleableStringProperty ;
7069
71-
7270/**
7371 * A Labeled {@link Control} is one which has as part of its user interface
7472 * a textual content associated with it. For example, a {@link Button} displays
@@ -135,7 +133,9 @@ public Labeled(String text, Node graphic) {
135133 **************************************************************************/
136134 /**
137135 * The text to display in the label. The text may be null.
136+ *
138137 * @return the text to display in the label
138+ * @defaultValue empty string
139139 */
140140 public final StringProperty textProperty () {
141141 if (text == null ) {
@@ -150,7 +150,9 @@ public final StringProperty textProperty() {
150150 /**
151151 * Specifies how the text and graphic within the Labeled should be
152152 * aligned when there is empty space within the Labeled.
153+ *
153154 * @return the alignment within this labeled
155+ * @defaultValue {@code Pos.CENTER_LEFT}
154156 */
155157 public final ObjectProperty <Pos > alignmentProperty () {
156158 if (alignment == null ) {
@@ -182,7 +184,9 @@ public String getName() {
182184 * Specifies the behavior for lines of text <em>when text is multiline</em>.
183185 * Unlike {@link #contentDisplayProperty} which affects the graphic and text, this setting
184186 * only affects multiple lines of text relative to the text bounds.
187+ *
185188 * @return the alignment of lines of text within this labeled
189+ * @defaultValue {@code TextAlignment.LEFT}
186190 */
187191 public final ObjectProperty <TextAlignment > textAlignmentProperty () {
188192 if (textAlignment == null ) {
@@ -213,7 +217,9 @@ public String getName() {
213217 /**
214218 * Specifies the behavior to use if the text of the {@code Labeled}
215219 * exceeds the available space for rendering the text.
220+ *
216221 * @return the overrun behavior if the text exceeds the available space
222+ * @defaultValue {@code OverrunStyle.ELLIPSIS}
217223 */
218224 public final ObjectProperty <OverrunStyle > textOverrunProperty () {
219225 if (textOverrun == null ) {
@@ -259,6 +265,7 @@ public String getName() {
259265 * @return the ellipsis property on the string to display for the ellipsis
260266 * when text is truncated
261267 * @see <a href="http://en.wikipedia.org/wiki/Ellipsis#Computer_representations">Wikipedia:ellipsis</a>
268+ * @defaultValue {@code "..."}
262269 * @since JavaFX 2.2
263270 */
264271 public final StringProperty ellipsisStringProperty () {
@@ -287,7 +294,9 @@ public final StringProperty ellipsisStringProperty() {
287294 /**
288295 * If a run of text exceeds the width of the Labeled, then this variable
289296 * indicates whether the text should wrap onto another line.
297+ *
290298 * @return the wrap property if a run of text exceeds the width of the Labeled
299+ * @defaultValue {@code false}
291300 */
292301 public final BooleanProperty wrapTextProperty () {
293302 if (wrapText == null ) {
@@ -328,7 +337,9 @@ public String getName() {
328337 * rich text then this font may or may not be used depending on the font
329338 * information embedded in the rich text, but in any case where a default
330339 * font is required, this font will be used.
340+ *
331341 * @return the default font to use for text in this labeled
342+ * @defaultValue {@link Font#getDefault()}
332343 */
333344 public final ObjectProperty <Font > fontProperty () {
334345
@@ -403,8 +414,10 @@ public String getName() {
403414 * text by using {@link #setContentDisplay}. The node specified for this
404415 * variable cannot appear elsewhere in the scene graph, otherwise
405416 * the {@code IllegalArgumentException} is thrown. See the class
406- * description of {@link javafx.scene.Node Node} for more detail.
417+ * description of {@link Node} for more detail.
418+ *
407419 * @return the optional icon for this labeled
420+ * @defaultValue {@code null}
408421 */
409422 public final ObjectProperty <Node > graphicProperty () {
410423 if (graphic == null ) {
@@ -562,7 +575,9 @@ public CssMetaData<Labeled,String> getCssMetaData() {
562575
563576 /**
564577 * Whether all text should be underlined.
578+ *
565579 * @return the underline property of all text in this labeled
580+ * @defaultValue {@code false}
566581 */
567582 public final BooleanProperty underlineProperty () {
568583 if (underline == null ) {
@@ -592,7 +607,9 @@ public String getName() {
592607
593608 /**
594609 * Specifies the space in pixel between lines.
610+ *
595611 * @return the line spacing property between lines in this labeled
612+ * @defaultValue 0
596613 * @since JavaFX 8.0
597614 */
598615 public final DoubleProperty lineSpacingProperty () {
@@ -623,7 +640,9 @@ public String getName() {
623640
624641 /**
625642 * Specifies the positioning of the graphic relative to the text.
643+ *
626644 * @return content display property of this labeled
645+ * @defaultValue {@code ContentDisplay.LEFT}
627646 */
628647 public final ObjectProperty <ContentDisplay > contentDisplayProperty () {
629648 if (contentDisplay == null ) {
@@ -657,7 +676,9 @@ public String getName() {
657676 * Subclasses may add nodes outside this padding and inside the Labeled's padding.
658677 *
659678 * This property can only be set from CSS.
660- * @return the label padding property of this labeled
679+ *
680+ * @return the label padding property of this labeled
681+ * @defaultValue {@code Insets.EMPTY}
661682 */
662683 public final ReadOnlyObjectProperty <Insets > labelPaddingProperty () {
663684 return labelPaddingPropertyImpl ();
@@ -702,7 +723,9 @@ public String getName() {
702723
703724 /**
704725 * The amount of space between the graphic and text
726+ *
705727 * @return the graphics text gap property of this labeled
728+ * @defaultValue 4
706729 */
707730 public final DoubleProperty graphicTextGapProperty () {
708731 if (graphicTextGap == null ) {
@@ -733,6 +756,8 @@ public String getName() {
733756
734757 /**
735758 * The {@link Paint} used to fill the text.
759+ *
760+ * @defaultValue {@code Color.BLACK}
736761 */
737762 private ObjectProperty <Paint > textFill ; // TODO for now change this
738763
@@ -776,10 +801,7 @@ public String getName() {
776801 * be determined based on the succeeding character, and the mnemonic
777802 * added.
778803 *
779- * <p>
780- * The default value for Labeled is false, but it
781- * is enabled by default on some Controls.
782- * </p>
804+ * @defaultValue {@code false}; {@code true} for some {@code Control}s.
783805 */
784806 private BooleanProperty mnemonicParsing ;
785807 public final void setMnemonicParsing (boolean value ) {
0 commit comments