-
Enhancement
-
Resolution: Won't Fix
-
P3
-
fx2.0
-
None
If you want to set the font of a text you invoke the Text.setFont() method. That's easy to remember.
If you want to set the wrapping width of a text you invoke the Text.setWrappingWidth() method. That's also easy to remember.
All the property setting methods of the text class follow this simple naming pattern except for the following two methods:
If you want to set the alignment of a text you cannot invoke a Text.setAlignment() method, and
If you want to set the origin of a text you cannot invoke a Text.setOrigin() method.
In these two cases you have to remember that these methods are called Text.setTextAlignment() and Text.setTextOrigin(), which is quite superfluous since there is no other alignment to a text but one, and there is no other origin to a text but one.
This naming inconsistency makes the API less intuitive to use, and I suggest you change the method names to setAlignment() and setOrigin().
If you want to set the wrapping width of a text you invoke the Text.setWrappingWidth() method. That's also easy to remember.
All the property setting methods of the text class follow this simple naming pattern except for the following two methods:
If you want to set the alignment of a text you cannot invoke a Text.setAlignment() method, and
If you want to set the origin of a text you cannot invoke a Text.setOrigin() method.
In these two cases you have to remember that these methods are called Text.setTextAlignment() and Text.setTextOrigin(), which is quite superfluous since there is no other alignment to a text but one, and there is no other origin to a text but one.
This naming inconsistency makes the API less intuitive to use, and I suggest you change the method names to setAlignment() and setOrigin().
- relates to
-
JDK-8100847 Text.setContent method does not follow common JavaFX naming pattern
- Resolved