public final class ComponentOrientation extends Object implements Serializable
从根本上说,这个管理的项目(如字符),这是奠定了在线,然后奠定了在一个块。这也适用于一个小部件中的项目:例如,在一个复选框中,框位于相对于文本的位置。
有四个不同的方向,用现代语言,如下面的table.
LT RT TL,TRA B一一D G D A电子与电子的开发与开发我是我的好,我是我的好
方向是:
isLeftToRight()
和
isHorizontal()
方法来决定自己的行为。他们不应该包括开关一样的代码,钥匙掉的常数,如:
如果(方向= = left_to_right){…} else if(方向= = right_to_left){…其他{ }//哎呀}这是不安全的,因为更多的常数可能会增加在未来,由于不能保证定位的对象将是独一无二的。
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()
是水平线吗?这将返回真正的水平,左到右的书写系统,如罗马。
|
boolean |
isLeftToRight()
horizontallines:做项目从左到右?
垂直线:做线从左到右? 这将回归真实水平,从左到右的书写系统,如古罗马。 |
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.