[API Review] RT-26140: Node Orientation - API issue: Should effective orientation be a property?

Lubomir Nerad lubomir.nerad at oracle.com
Tue Jan 22 05:19:30 PST 2013


Hi All,

Node and Scene have property called nodeOrientation which can be set to 
LEFT_TO_RIGHT, RIGHT_TO_LEFT or INHERIT. These values are specified by 
the NodeOrientation enum. Currently both these classes allow to get 
another property called effectiveNodeOrientation which is derived from 
nodeOrientation and has the same value as nodeOrientation except for the 
case when the nodeOrientation is set to INHERIT. Then the 
effectiveNodeOrientation contains the final inherited (from parent 
hierarchy) value which is either LEFT_TO_RIGHT or RIGHT_TO_LEFT. 
Currently the effectiveNodeOrientation is not a full JavaFX property 
(there is only getter for it) and so it is not observable.

Because this property might be useful for creating custom nodes/controls 
or other user code which needs to react to node orientation changes, it 
seems beneficial to convert it into ReadOnlyObjectProperty.

So the proposed methods to add are:

Scene:
final ReadOnlyObjectProperty<NodeOrientation> 
effectiveNodeOrientationProperty();

Node:
final ReadOnlyObjectProperty<NodeOrientation> 
effectiveNodeOrientationProperty();

Further discussion can be found on 
http://javafx-jira.kenai.com/browse/RT-26140.

Thanks,
Lubo


More information about the openjfx-dev mailing list