< prev index next >

src/java.desktop/share/classes/java/awt/ComponentOrientation.java

Print this page




  55   * as in the following table.<br>
  56   * <pre>
  57   * LT          RT          TL          TR
  58   * A B C       C B A       A D G       G D A
  59   * D E F       F E D       B E H       H E B
  60   * G H I       I H G       C F I       I F C
  61   * </pre><br>
  62   * (In the header, the two-letter abbreviation represents the item direction
  63   * in the first letter, and the line direction in the second. For example,
  64   * LT means "items left-to-right, lines top-to-bottom",
  65   * TL means "items top-to-bottom, lines left-to-right", and so on.)
  66   * <p>
  67   * The orientations are:
  68   * <ul>
  69   * <li>LT - Western Europe (optional for Japanese, Chinese, Korean)
  70   * <li>RT - Middle East (Arabic, Hebrew)
  71   * <li>TR - Japanese, Chinese, Korean
  72   * <li>TL - Mongolian
  73   * </ul>
  74   * Components whose view and controller code depends on orientation
  75   * should use the <code>isLeftToRight()</code> and
  76   * <code>isHorizontal()</code> methods to
  77   * determine their behavior. They should not include switch-like
  78   * code that keys off of the constants, such as:
  79   * <pre>
  80   * if (orientation == LEFT_TO_RIGHT) {
  81   *   ...
  82   * } else if (orientation == RIGHT_TO_LEFT) {
  83   *   ...
  84   * } else {
  85   *   // Oops
  86   * }
  87   * </pre>
  88   * This is unsafe, since more constants may be added in the future and
  89   * since it is not guaranteed that orientation objects will be unique.
  90   */
  91 public final class ComponentOrientation implements java.io.Serializable
  92 {
  93     /*
  94      * serialVersionUID
  95      */
  96     private static final long serialVersionUID = -4113291392143563828L;




  55   * as in the following table.<br>
  56   * <pre>
  57   * LT          RT          TL          TR
  58   * A B C       C B A       A D G       G D A
  59   * D E F       F E D       B E H       H E B
  60   * G H I       I H G       C F I       I F C
  61   * </pre><br>
  62   * (In the header, the two-letter abbreviation represents the item direction
  63   * in the first letter, and the line direction in the second. For example,
  64   * LT means "items left-to-right, lines top-to-bottom",
  65   * TL means "items top-to-bottom, lines left-to-right", and so on.)
  66   * <p>
  67   * The orientations are:
  68   * <ul>
  69   * <li>LT - Western Europe (optional for Japanese, Chinese, Korean)
  70   * <li>RT - Middle East (Arabic, Hebrew)
  71   * <li>TR - Japanese, Chinese, Korean
  72   * <li>TL - Mongolian
  73   * </ul>
  74   * Components whose view and controller code depends on orientation
  75   * should use the {@code isLeftToRight()} and
  76   * {@code isHorizontal()} methods to
  77   * determine their behavior. They should not include switch-like
  78   * code that keys off of the constants, such as:
  79   * <pre>
  80   * if (orientation == LEFT_TO_RIGHT) {
  81   *   ...
  82   * } else if (orientation == RIGHT_TO_LEFT) {
  83   *   ...
  84   * } else {
  85   *   // Oops
  86   * }
  87   * </pre>
  88   * This is unsafe, since more constants may be added in the future and
  89   * since it is not guaranteed that orientation objects will be unique.
  90   */
  91 public final class ComponentOrientation implements java.io.Serializable
  92 {
  93     /*
  94      * serialVersionUID
  95      */
  96     private static final long serialVersionUID = -4113291392143563828L;


< prev index next >