25
25
26
26
package javafx .scene .control ;
27
27
28
-
29
28
import com .sun .javafx .css .StyleManager ;
30
29
import com .sun .javafx .scene .NodeHelper ;
31
30
import javafx .css .converter .BooleanConverter ;
68
67
import javafx .css .StyleableProperty ;
69
68
import javafx .css .StyleableStringProperty ;
70
69
71
-
72
70
/**
73
71
* A Labeled {@link Control} is one which has as part of its user interface
74
72
* a textual content associated with it. For example, a {@link Button} displays
@@ -135,7 +133,9 @@ public Labeled(String text, Node graphic) {
135
133
**************************************************************************/
136
134
/**
137
135
* The text to display in the label. The text may be null.
136
+ *
138
137
* @return the text to display in the label
138
+ * @defaultValue empty string
139
139
*/
140
140
public final StringProperty textProperty () {
141
141
if (text == null ) {
@@ -150,7 +150,9 @@ public final StringProperty textProperty() {
150
150
/**
151
151
* Specifies how the text and graphic within the Labeled should be
152
152
* aligned when there is empty space within the Labeled.
153
+ *
153
154
* @return the alignment within this labeled
155
+ * @defaultValue {@code Pos.CENTER_LEFT}
154
156
*/
155
157
public final ObjectProperty <Pos > alignmentProperty () {
156
158
if (alignment == null ) {
@@ -182,7 +184,9 @@ public String getName() {
182
184
* Specifies the behavior for lines of text <em>when text is multiline</em>.
183
185
* Unlike {@link #contentDisplayProperty} which affects the graphic and text, this setting
184
186
* only affects multiple lines of text relative to the text bounds.
187
+ *
185
188
* @return the alignment of lines of text within this labeled
189
+ * @defaultValue {@code TextAlignment.LEFT}
186
190
*/
187
191
public final ObjectProperty <TextAlignment > textAlignmentProperty () {
188
192
if (textAlignment == null ) {
@@ -213,7 +217,9 @@ public String getName() {
213
217
/**
214
218
* Specifies the behavior to use if the text of the {@code Labeled}
215
219
* exceeds the available space for rendering the text.
220
+ *
216
221
* @return the overrun behavior if the text exceeds the available space
222
+ * @defaultValue {@code OverrunStyle.ELLIPSIS}
217
223
*/
218
224
public final ObjectProperty <OverrunStyle > textOverrunProperty () {
219
225
if (textOverrun == null ) {
@@ -259,6 +265,7 @@ public String getName() {
259
265
* @return the ellipsis property on the string to display for the ellipsis
260
266
* when text is truncated
261
267
* @see <a href="http://en.wikipedia.org/wiki/Ellipsis#Computer_representations">Wikipedia:ellipsis</a>
268
+ * @defaultValue {@code "..."}
262
269
* @since JavaFX 2.2
263
270
*/
264
271
public final StringProperty ellipsisStringProperty () {
@@ -287,7 +294,9 @@ public final StringProperty ellipsisStringProperty() {
287
294
/**
288
295
* If a run of text exceeds the width of the Labeled, then this variable
289
296
* indicates whether the text should wrap onto another line.
297
+ *
290
298
* @return the wrap property if a run of text exceeds the width of the Labeled
299
+ * @defaultValue {@code false}
291
300
*/
292
301
public final BooleanProperty wrapTextProperty () {
293
302
if (wrapText == null ) {
@@ -328,7 +337,9 @@ public String getName() {
328
337
* rich text then this font may or may not be used depending on the font
329
338
* information embedded in the rich text, but in any case where a default
330
339
* font is required, this font will be used.
340
+ *
331
341
* @return the default font to use for text in this labeled
342
+ * @defaultValue {@link Font#getDefault()}
332
343
*/
333
344
public final ObjectProperty <Font > fontProperty () {
334
345
@@ -403,8 +414,10 @@ public String getName() {
403
414
* text by using {@link #setContentDisplay}. The node specified for this
404
415
* variable cannot appear elsewhere in the scene graph, otherwise
405
416
* 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
+ *
407
419
* @return the optional icon for this labeled
420
+ * @defaultValue {@code null}
408
421
*/
409
422
public final ObjectProperty <Node > graphicProperty () {
410
423
if (graphic == null ) {
@@ -562,7 +575,9 @@ public CssMetaData<Labeled,String> getCssMetaData() {
562
575
563
576
/**
564
577
* Whether all text should be underlined.
578
+ *
565
579
* @return the underline property of all text in this labeled
580
+ * @defaultValue {@code false}
566
581
*/
567
582
public final BooleanProperty underlineProperty () {
568
583
if (underline == null ) {
@@ -592,7 +607,9 @@ public String getName() {
592
607
593
608
/**
594
609
* Specifies the space in pixel between lines.
610
+ *
595
611
* @return the line spacing property between lines in this labeled
612
+ * @defaultValue 0
596
613
* @since JavaFX 8.0
597
614
*/
598
615
public final DoubleProperty lineSpacingProperty () {
@@ -623,7 +640,9 @@ public String getName() {
623
640
624
641
/**
625
642
* Specifies the positioning of the graphic relative to the text.
643
+ *
626
644
* @return content display property of this labeled
645
+ * @defaultValue {@code ContentDisplay.LEFT}
627
646
*/
628
647
public final ObjectProperty <ContentDisplay > contentDisplayProperty () {
629
648
if (contentDisplay == null ) {
@@ -657,7 +676,9 @@ public String getName() {
657
676
* Subclasses may add nodes outside this padding and inside the Labeled's padding.
658
677
*
659
678
* 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}
661
682
*/
662
683
public final ReadOnlyObjectProperty <Insets > labelPaddingProperty () {
663
684
return labelPaddingPropertyImpl ();
@@ -702,7 +723,9 @@ public String getName() {
702
723
703
724
/**
704
725
* The amount of space between the graphic and text
726
+ *
705
727
* @return the graphics text gap property of this labeled
728
+ * @defaultValue 4
706
729
*/
707
730
public final DoubleProperty graphicTextGapProperty () {
708
731
if (graphicTextGap == null ) {
@@ -733,6 +756,8 @@ public String getName() {
733
756
734
757
/**
735
758
* The {@link Paint} used to fill the text.
759
+ *
760
+ * @defaultValue {@code Color.BLACK}
736
761
*/
737
762
private ObjectProperty <Paint > textFill ; // TODO for now change this
738
763
@@ -776,10 +801,7 @@ public String getName() {
776
801
* be determined based on the succeeding character, and the mnemonic
777
802
* added.
778
803
*
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.
783
805
*/
784
806
private BooleanProperty mnemonicParsing ;
785
807
public final void setMnemonicParsing (boolean value ) {
0 commit comments