public final class ComponentOrientation extends Object implements Serializable
从根本上说,这是管理排列在一行中的项目(如字符),然后将这些行排列在块中。 这也适用于小部件中的项目:例如,在框相对于文本定位的复选框中。
 现代语言有四种不同的方向,如下表所示。 
  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  
       方向是:
isLeftToRight()和isHorizontal()方法来确定其行为。 
       它们不应该包含与常量相关的类似切换的代码,例如: 
         if (orientation == LEFT_TO_RIGHT) {
   ...
 } else if (orientation == RIGHT_TO_LEFT) {
   ...
 } else {
   // Oops
 }  
       这是不安全的,因为将来可能添加更多的常量,因为不能保证定向对象是唯一的。 
      | Modifier and Type | Field and Description | 
|---|---|
| static ComponentOrientation | LEFT_TO_RIGHT
              项目从左到右运行,线条从上到下实例:英语,法语。 
             | 
| static ComponentOrientation | RIGHT_TO_LEFT
              项目从右到左运行,线条从上到下实例:阿拉伯语,希伯来语。 
             | 
| static ComponentOrientation | UNKNOWN
              表示组件的方向尚未设置。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| static ComponentOrientation | getOrientation(Locale locale)
              返回适合给定区域设置的方向。 
             | 
| static ComponentOrientation | getOrientation(ResourceBundle bdl) 
             已弃用 
               
              从J2SE 1.4起,使用 getOrientation(java.util.Locale)。 | 
| boolean | isHorizontal() 
             线条水平吗? 
             对于横向的,从左到右的书写系统(如Roman),这将返回true。 
             | 
| boolean | isLeftToRight() 
             HorizontalLines:项目是否从左到右运行? 
              垂直线:线从左到右行吗? 对于横向的,从左到右的书写系统(如Roman),这将返回true。 | 
public static final ComponentOrientation LEFT_TO_RIGHT
public static final ComponentOrientation RIGHT_TO_LEFT
public static final ComponentOrientation UNKNOWN
public boolean isHorizontal()
public boolean isLeftToRight()
public static ComponentOrientation getOrientation(Locale locale)
locale - 指定的区域设置 
           @Deprecated public static ComponentOrientation getOrientation(ResourceBundle bdl)
getOrientation(java.util.Locale) 。 
           Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.