Programmiamo.it said:
Hi,
how should be used this class?
Thanks.
Giovanni
From the API:
The ComponentOrientation class encapsulates the language-sensitive
orientation that is to be used to order the elements of a component or of
text. It is used to reflect the differences in this ordering between Western
alphabets, Middle Eastern (such as Hebrew), and Far Eastern (such as
Japanese).
Fundamentally, this governs items (such as characters) which are laid out in
lines, with the lines then laid out in a block. This also applies to items
in a widget: for example, in a check box where the box is positioned
relative to the text.
There are four different orientations used in modern languages as in the
following table.
LT RT TL TR
A B C C B A A D G G D A
D E F F E D B E H H E B
G H I I H G C F I I F C
(In the header, the two-letter abbreviation represents the item direction in
the first letter, and the line direction in the second. For example, LT
means "items left-to-right, lines top-to-bottom", BL means "items
bottom-to-top, lines bottom-to-top", and so on.)
The orientations are:
a.. LT - Western Europe (optional for Japanese, Chinese, Korean)
b.. RT - Middle East (Arabic, Hebrew)
c.. TR - Japanese, Chinese, Korean
d.. TL - Mongolian
Components whose view and controller code depends on orientation should use
the isLeftToRight() and isHorizontal() methods to determine their behavior.
They should not include switch-like code that keys off of the constants,
such as: