用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: 正在从服务器检索数据...
正在从服务器检索数据...
flash.text.engine 

TextJustifier  - AS3

flash.text.engine
public class TextJustifier
继承TextJustifier Inheritance Object
子类 EastAsianJustifier, SpaceJustifier

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5, Flash Lite 4

TextJustifier 类是可应用于 TextBlock 的对齐符类型的抽象基类,特别是 EastAsianJustifier 和 SpaceJustifier 类。

无法直接实例化 TextJustifier 类。调用 new TextJustifier() 会引发 ArgumentError 异常。将 EastAsianJustifier 或 SpaceJustifier 对象应用于 TextBlock 后设置该对象的属性不会使 TextBlock 无效。

相关 API 元素



公共属性
 属性由以下参数定义
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  lineJustification : String
指定文本块中文本的行对齐方式。
TextJustifier
  locale : String
[只读] 指定用于确定文本块中文本的对齐规则的区域设置。
TextJustifier
公共方法
 方法由以下参数定义
  
TextJustifier(locale:String, lineJustification:String)
调用 new TextJustifier() 构造函数会引发 ArgumentError 异常。
TextJustifier
  
构造 TextJustifier 的克隆副本。
TextJustifier
  
[静态] 构造对应于指定的区域设置的默认 TextJustifier 子类。
TextJustifier
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
属性详细信息

lineJustification

属性
lineJustification:String

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定文本块中文本的行对齐方式。

使用 LineJustification 定义的以下常量作为此属性的有效值:

字符串值说明
LineJustification.UNJUSTIFIED生成不对齐的行。
LineJustification.ALL_BUT_LAST生成的行除最后一行之外其他所有行均对齐。
LineJustification.ALL_INCLUDING_LAST生成的所有行均对齐。
LineJustification.ALL_BUT_MANDATORY_BREAK生成的行除最后一行和强制结束的行之外其他所有行均对齐。



实现
    public function get lineJustification():String
    public function set lineJustification(value:String):void

相关 API 元素

locale

属性 
locale:String  [只读]

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定用于确定文本块中文本的对齐规则的区域设置。使用标准区域设置标识符。例如,"en"、"en_US" 和 "en-US" 均表示英语,"ja" 表示日语。



实现
    public function get locale():String

引发
ArgumentError — 指定的 localenull 或太短,不能表示有效的区域设置。
构造函数详细信息

TextJustifier

()构造函数
public function TextJustifier(locale:String, lineJustification:String)

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5, Flash Lite 4

调用 new TextJustifier() 构造函数会引发 ArgumentError 异常。但是,可以调用 TextJustifier 的以下子类的构造函数:

  • new SpaceJustifier()
  • new EastAsianJustifier()

参数
locale:String — 用于确定对齐规则的区域设置。
 
lineJustification:String — 段落的行对齐类型。将 LineJustification 常量用于此属性。

引发
ArgumentError — 指定的 localenull 或太短,不能表示有效的区域设置。
 
ArgumentError — 指定的 lineJustification 不是 LineJustification 的成员。

相关 API 元素

方法详细信息

clone

()方法
public function clone():flash.text.engine:TextJustifier

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5, Flash Lite 4

构造 TextJustifier 的克隆副本。

TextJustifier 的子类必须覆盖此方法。

返回
flash.text.engine:TextJustifierTextJustifier 对象的副本。

getJustifierForLocale

()方法 
public static function getJustifierForLocale(locale:String):flash.text.engine:TextJustifier

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5, Flash Lite 4

构造对应于指定的区域设置的默认 TextJustifier 子类。

如果区域设置为“中文”、“韩文”或“日语”,则该方法将构造默认的 EastAsianJustifier 对象。否则,文本引擎将构造一个默认的 SpaceJustifier 对象。

参数

locale:String — 用于确定所构造的对齐符的区域设置。

返回
flash.text.engine:TextJustifier — 对 TextJustifier 对象的引用。

引发
ArgumentError — 指定的 localenull 或太短,不能表示有效的区域设置。




[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。