| パッケージ | flash.text.engine |
| クラス | public final class SpaceJustifier |
| 継承 | SpaceJustifier TextJustifier Object |
| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
SpaceJustifier オブジェクトのプロパティを設定する前に、コンストラクタ new SpaceJustifier() を使用して SpaceJustifier オブジェクトを作成する必要があります。SpaceJustifier オブジェクトが TextBlock に適用された後で SpaceJustifier オブジェクトのプロパティを設定しても、TextBlock は無効化されません。
関連項目
| プロパティ | 定義元 | ||
|---|---|---|---|
![]() | constructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクタ関数への参照です。 | Object | |
| letterSpacing : Boolean
位置揃えに文字間隔を使用するかどうかを指定します。 | SpaceJustifier | ||
![]() | lineJustification : String
テキストブロック内のテキストの行の位置揃えを指定します。 | TextJustifier | |
![]() | locale : String [読み取り専用]
テキストブロック内のテキストの位置揃え規則を決定するためのロケールを指定します。 | TextJustifier | |
![]() | prototype : Object [静的]
クラスまたは関数オブジェクトのプロトタイプオブジェクトへの参照です。 | Object | |
| メソッド | 定義元 | ||
|---|---|---|---|
SpaceJustifier(locale:String = "en", lineJustification:String = "unjustified", letterSpacing:Boolean = false)
SpaceJustifier オブジェクトを作成します。 | SpaceJustifier | ||
[override]
SpaceJustifier のクローンコピーを構築します。 | SpaceJustifier | ||
![]() | [静的]
指定されたロケールに適切なデフォルトの TextJustifier サブクラスを作成します。 | TextJustifier | |
![]() |
オブジェクトに指定されたプロパティが定義されているかどうかを示します。 | Object | |
![]() |
Object クラスのインスタンスが、パラメータとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。 | Object | |
![]() |
指定されたプロパティが存在し、列挙できるかどうかを示します。 | Object | |
![]() |
ループ処理に対するダイナミックプロパティの可用性を設定します。 | Object | |
![]() |
指定されたオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのプリミティブな値を返します。 | Object | |
| letterSpacing | プロパティ |
letterSpacing:Boolean| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
位置揃えに文字間隔を使用するかどうかを指定します。
public function get letterSpacing():Boolean public function set letterSpacing(value:Boolean):void| SpaceJustifier | () | コンストラクタ |
public function SpaceJustifier(locale:String = "en", lineJustification:String = "unjustified", letterSpacing:Boolean = false)| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
SpaceJustifier オブジェクトを作成します。LineJustification クラスには、適用可能な行の位置揃えのタイプを指定する定数が含まれます。
パラメータlocale:String (default = "en") — 位置揃え規則を決定するためのロケールです。デフォルト値は「en」です。
| |
lineJustification:String (default = "unjustified") — 段落に対する行の位置揃えタイプです。このプロパティには、LineJustification 定数を使用します。デフォルト値は LineJustification.UNJUSTIFIED です。
| |
letterSpacing:Boolean (default = false) — 位置揃えに文字間隔を使用するかどうかを指定します。 デフォルト値は false です。
|
ArgumentError — 指定された locale が null であるか、有効なロケールを表すには短すぎます。
| |
ArgumentError — 指定された lineJustification は、LineJustification のメンバーではありません。
|
関連項目
| clone | () | メソッド |
override public function clone():TextJustifier| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
SpaceJustifier のクローンコピーを構築します。
戻り値TextJustifier — SpaceJustifier オブジェクトのコピーです。
|
package {
import flash.display.Sprite;
import flash.text.engine.TextBlock;
import flash.text.engine.TextElement;
import flash.text.engine.TextLine;
import flash.text.engine.ElementFormat;
import flash.text.engine.SpaceJustifier;
import flash.text.engine.LineJustification;
public class SpaceJustifierExample extends Sprite {
public function SpaceJustifierExample():void {
var str:String = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut " +
"enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " +
"aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit " +
"in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur " +
"sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt " +
"mollit anim id est laborum.";
var format:ElementFormat = new ElementFormat(null, 12, 0xCC0000);
var textElement:TextElement = new TextElement(str, format);
var spaceJustifier:SpaceJustifier = new SpaceJustifier("en", LineJustification.ALL_BUT_LAST);
spaceJustifier.letterSpacing = true;
var textBlock:TextBlock = new TextBlock();
textBlock.content = textElement;
textBlock.textJustifier = spaceJustifier;
createLines(textBlock);
}
private function createLines(textBlock:TextBlock):void {
var yPos = 20;
var textLine:TextLine = textBlock.createTextLine (null, 150);
while (textLine)
{
addChild(textLine);
textLine.x = 15;
yPos += textLine.textHeight+2;
textLine.y = yPos;
textLine = textBlock.createTextLine(textLine, 150);
}
}
}
}
このページに新しいコメントが追加された場合に、電子メールでの通知を希望する。 | コメントレポート
現在のページ: http://livedocs.adobe.com/flex/3_jp/langref/flash/text/engine/SpaceJustifier.html