TextVisual (クラス)
public abstract sealed shared TextVisual {inherits Visual, EventForwarder}
インポート元: CURL.GUI.STANDARD. package 内で定義されています CURL.GUI.BASE.
直接継承しているサブクラス: ParagraphVisual

テキストオブジェクトを表すVisualのサブクラス

説明

このクラスは、TextFlowBoxのようなテキストコンテナによってレンダリングされるテキストを含むオブジェクトのコンテンツ意アクセスする為のパブリックAPIを提供します。Curlテキストフォーマットで返される値は、一般的に TextVisualのサブクラスのインスタンスになります。
導入: バージョン 7.0

コンストラクタ
clone-appearance-from:このタイプの新しいオブジェクトを作成するために Visual.clone-appearance が使用するコンストラクタ。
コンストラクタ protected {TextVisual.clone-appearance-from other:TextVisual}
default:TextVisual オブジェクトを作成します。
コンストラクタ protected {TextVisual.default ...}

プロパティ
background:TextVisual の背景の色またはパターン。
ローカル オプション public TextVisual.background:Background =Background.transparent
text-receiver:このTextVisualと現在関連を持っているTextReceiver
フィールド public-get protected-set TextVisual.text-receiver:#TextReceiver
text-visual-tag:これがTextVisualのどんなタイプかを示すTextVisualTagオブジェクトを返します。
アクセサ public abstract TextVisual.text-visual-tag:TextVisualTag
visual-children:このTextVisualの子オブジェクトのイテレーターを返します。
アクセサ public abstract TextVisual.visual-children:{Iterator-of Visual}
プロパティ 継承 Visual: _style-element, clonable-class?, completely-clonable-children?, cursor, data-source, display-context, dragee, font-size, graphical-parent, has-key-focus?, input-method-enabled?, input-method-keyboard-mode, name, options, possibly-displayed?, style-class, style-element, style-manager, style-options, test-child?, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data, visual-parent
プロパティ 継承 DataBindingTarget: data-binding-context, data-bindings
プロパティ 継承 EventTarget: event-handlers
プロパティ 継承 OptionListInterface: option-parent, option-register-proc, options-present-here, registered-option-keys

メソッド
attach-receiver:このTextVisualとその子孫をTextReceiverにアタッチします。
public {TextVisual.attach-receiver tr:TextReceiver}:void
detach-receiver:このTextVisualとその子孫を全てのTextReceiverからデタッチします。
public {TextVisual.detach-receiver}:void
get-visual-child-index:このTextVisualの子オブジェクト内で、指定されたVisualのインデックスを取得します。
public abstract {TextVisual.get-visual-child-index c:Visual}:int
local-add-notify:このオブジェクトでバインディング オプションが追加または変更されたときに呼び出されます。
protected {TextVisual.local-add-notify item:OptionItem}:void
local-remove-notify:このオブジェクトでバインディング オプションが削除されると呼び出されます。
protected {TextVisual.local-remove-notify item:OptionItem}:void
remove-child:このTextVisual子オブジェクトを削除します。
public abstract {TextVisual.remove-child c:Visual}:void
replace-child-graphic:この TextVisualGraphic の子を置き換えます。
public abstract {TextVisual.replace-child-graphic
old-child:Graphic,
new-child:Graphic
}:void
stream-contents-to:このTextVisualとその子孫のコンテンツに関する情報を提供します。
public {TextVisual.stream-contents-to tr:TextReceiver}:void
visit-visual-children:このTextVisualの子ごとにプロシージャを呼び出します。
public abstract {TextVisual.visit-visual-children
visit-proc:{proc-type {Visual}:bool}
}:void
wrap-graphic:このオブジェクトに適した ラッパー Graphic を返します。
public {TextVisual.wrap-graphic g:Graphic}:Graphic
メソッド 継承 Visual: add, add-from-init-args, animate, change-cursor, clear, clonable-appearance?, clone-appearance, clone-appearance-helper, find-graphical-ancestor, find-test-children, get-focus-manager, get-graphical-root, get-gui-path, get-gui-path-to-child, get-layout-context, get-origin-in-graphical-ancestor, get-origin-in-root, get-test-parent, get-test-property, get-text, get-top-left-in-ancestor, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-attached, note-caret-position, note-detaching, on-drag-enter, on-drag-leave, on-pointer-enter, on-pointer-envelope-event, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, refresh-style-options, release-key-focus, request-draw, request-key-focus, scroll-to-include, test-record, test-run, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-to-display-coordinates, transform-to-graphical-root-coordinates, xy-offset-to
メソッド 継承 EventForwarder: fire-crossing-event, fire-in-child
メソッド 継承 GraphicOptions: any-to-Distance, get-display-context
メソッド 継承 GuiEventTarget: handle-delegate-event, handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-over, on-drag-pointer, on-drag-started, on-drop, on-end-composition-event, on-focus-event, on-focus-in, on-focus-out, on-gesture, on-gesture-begin, on-gesture-end, on-gesture-magnify, on-gesture-pan, on-gesture-rotate, on-gesture-swipe, on-gesture-tap, on-gesture-touch, on-grab-release, on-gui-event, on-input-method-event, on-inspection, on-key-event, on-key-press, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-motion, on-pointer-press, on-pointer-release, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-changed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class
メソッド 継承 DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
メソッド 継承 EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
メソッド 継承 OptionListInterface: add-option, add-style-option, change-option-parent-notify, clone-options, get-option, get-option-by-name, keyword-init-arg, name-to-option-key, new-option-item, notify-option-children, option-change-notify, option-changed, option-lookup, option-lookup-here, option-propagate-notify, option-set?, propagate-option-change, register-options, remove-option, remove-style-option, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
メソッド 継承 BasicEventTarget: enqueue-event
メソッド 継承 InitRestArgParser: process-rest-args
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
clone-appearance-from (コンストラクタ)
protected {TextVisual.clone-appearance-from other:TextVisual}

このタイプの新しいオブジェクトを作成するために Visual.clone-appearance が使用するコンストラクタ。

other: クローンする TextVisual

プログラミング注意事項

クローニングをサポートするTextVisualのサブクラスは、このコンストラクタを呼び出すコンストラクタを持つ必要があります。


default (コンストラクタ)
protected {TextVisual.default ...}

TextVisual オブジェクトを作成します。

...: Visualのデフォルト コンストラクタによって処理されるオプションとイベントハンドラの記述



プロパティ詳細
background (ローカル オプション)
public TextVisual.background:Background =Background.transparent

TextVisual の背景の色またはパターン。

説明

TextVisual の背後に描画されるべき背景(background)を記述する為にこのオプションを設定します。
詳細の情報は、Graphic.background を参照してください。

注意事項

多くのテキストコンテナは TextVisual に対する全ての背景型を実装しているわけではありません。例えば、一部のコンテナは背景を塗りつぶします。その一方で背景のオプションは全て無視されます。


text-receiver (フィールド)
public-get protected-set TextVisual.text-receiver:#TextReceiver

このTextVisualと現在関連を持っているTextReceiver

説明

この値は、TextVisual.stream-contents-toTextVisual.detach-receiver メソッドによって、設定またはリセットされます。

プログラミング注意事項

このフィールドから参照されるTextReceiverは、現在このTextVisualを含むテキストコンテナに対応するオブジェクトです。TextVisualのサブクラスで定義されたメソッドは、コンテナオブジェクトの場所のような、このTextVisual の管理するコンテナの情報へのアクセスと得る為に、この値を使うことが出来ます。


text-visual-tag (アクセサ)
アクセサ public abstract TextVisual.text-visual-tag:TextVisualTag

これがTextVisualのどんなタイプかを示すTextVisualTagオブジェクトを返します。



visual-children (アクセサ)
アクセサ public abstract TextVisual.visual-children:{Iterator-of Visual}

このTextVisualの子オブジェクトのイテレーターを返します。

戻り値

最初から最後まで昇順で、このTextVisualの子オブジェクトをトラーバースするイテレータ。

プログラミング注意事項

一般的に、このイテレーターを作成することはヒープ領域からイテレーターオブジェクトを配置することが必要になります。ヒープ領域に対するアロケーションを避けることは重要なので、代わりにTextVisual.visit-visual-childrenを使うことを検討してください。





メソッド詳細
attach-receiver (メソッド)
public {TextVisual.attach-receiver tr:TextReceiver}:void

このTextVisualとその子孫をTextReceiverにアタッチします。

tr: アタッチされるTextReceiver

説明

このメソッドは、このTextVisualオブジェクトに根ざしたTextVisualのツリーを走査し、それらを全てtrにアタッチします。走査は、子孫のTextVisualで再帰的に行われますが、GraphicのようなTextVisualでないオブジェクトを超えて深く実行されることはありません。この呼び出しの後、走査中に見つかった各TextVisualオブジェクトのtext-receiverフィールドは、trにポイントされます。

プログラミング注意事項

このメソッドは、このTextVisualまたは、tr以外に現在TextReceiver にアタッチされている子孫から呼び出されてはいけません。何故ならば、その様にすると、このTextVisualがもはやアタッチされていない以前のTextReceiverに通知しないからです、このような場合、detach-receiverがまず最初に呼び出されなければならず、その後attach-receiverを呼び出すことが出来るようになります。

オーバーライド

TextVisualでのこのメソッドの基本の実装は、text-receiverフィールドをセットすることです。ですから、このメソッドをオーバーライドするメソッドがsuper.attach-receiverを呼び出すことは重要です。


detach-receiver (メソッド)
public {TextVisual.detach-receiver}:void

このTextVisualとその子孫を全てのTextReceiverからデタッチします。

説明

このメソッドは、このTextVisualに根ざしたTextVisualオブジェクトのツリーを走査し、現在それらにアタッチされているTextReceiverを全てデタッチします。走査は、子孫のTextVisualで再帰的に行われますが、GraphicのようなTextVisualでないオブジェクトを超えて深く実行されることはありません。
この呼び出しの後、走査中に見つかった各TextVisualオブジェクトのtext-receiverフィールドは、null を含みます。

オーバーライド

TextVisualでのこのメソッドの基本の実装は、text-receiverフィールドをセットし、必要に応じてTextReceiver.note-receiver-detachedを呼び出すことです。ですから、このメソッドをオーバーライドするメソッドが、super.detach-receiverを呼び出すことは重要です。


get-visual-child-index (メソッド)
public abstract {TextVisual.get-visual-child-index c:Visual}:int

このTextVisualの子オブジェクト内で、指定されたVisualのインデックスを取得します。

c: インデックスが必要とされる子オブジェクト

戻り値

このTextVisual内でのcのインデックス。cが、このTextVisualの子でない場合には、-1が返されます。


local-add-notify (メソッド)
protected {TextVisual.local-add-notify item:OptionItem}:void

このオブジェクトでバインディング オプションが追加または変更されたときに呼び出されます。

item: 新しいバインディング オプション。

注意事項

OptionListInterface.propagate-option-change を呼び出して、このオプションの変更を関連オブジェクトに通知します。

プログラミング注意事項

OptionListInterface.add-option によってのみ呼び出されます。

オーバーライド

通常はオーバーライドされません。


local-remove-notify (メソッド)
protected {TextVisual.local-remove-notify item:OptionItem}:void

このオブジェクトでバインディング オプションが削除されると呼び出されます。

item: 削除されたバインディング オプション。

注意事項

このメソッドは、バインディング オプションの変更に関する通知の内容を決定します。これらの通知により、オブションのバインド解除をオブジェクトに知らせることができます。また、祖先も同じオプション キーをバインドする場合に、オプションの値が変更されたことをオブジェクトに知らせることができます。いずれの場合も、OptionListInterface.propagate-option-change が呼び出されて通知が実際に行なわれます。

プログラミング注意事項

OptionListInterface.remove-option によってのみ呼び出されます。

オーバーライド

通常はオーバーライドされません。


remove-child (メソッド)
public abstract {TextVisual.remove-child c:Visual}:void

このTextVisual子オブジェクトを削除します。

c: 削除される子オブジェクト

説明

cが、TextVisualの場合、そのvisual-parentは、nullに設定されます。
cがこのTextVisualでない場合には、エラーが発生します。


replace-child-graphic (メソッド)
public abstract {TextVisual.replace-child-graphic
old-child:Graphic,
new-child:Graphic
}:void

この TextVisualGraphic の子を置き換えます。

old-child: 削除される子オブジェクト
new-child: old-child の代わりに挿入される子オブジェクト。

注意事項

old-child がこの TextVisual の子でない場合、エラーがスローされます。

プログラミング注意事項

このメソッドは、主として Layout.replace-with の実装から呼び出されるように設計されており、通常、他の場所から直接呼び出されることはありません。


stream-contents-to (メソッド)
public {TextVisual.stream-contents-to tr:TextReceiver}:void

このTextVisualとその子孫のコンテンツに関する情報を提供します。

tr: 情報が提供されるTextReceiver

説明

このメソッドは、このTextVisualに根ざしたTextVisualオブジェクトのツリーを走査し、ツリーのコンテンツに関する情報を伝える為にtr上で呼び出されます。TextReceiverメソッドは、start-elementend-elementcharactersembedded-graphicを含むこの走査の間中呼び出されます。走査は、子孫のTextVisualで再帰的に行われますが、GraphicのようなTextVisualでないオブジェクトを超えて深く実行されることはありません。
このメソッドは、この走査中に見つかった各TextVisualオブジェクトのtext-receiverフィールドにtrをセットする副作用を持っています。

プログラミング注意事項

このメソッドは、このTextVisualまたは、tr以外に現在TextReceiver にアタッチされている子孫から呼び出されてはいけません。何故ならば、その様にすると、このTextVisualがもはやアタッチされていない以前のTextReceiverに通知しないからです、このような場合、detach-receiverがまず最初に呼び出されなければならず、その後stream-contents-toを呼び出すことが出来るようになります。

オーバーライド

TextVisualでのこのメソッドの基本の実装は、text-receiverフィールドをセットすることです。ですから、このメソッドをオーバーライドするメソッドがsuper.stream-contents-toを呼び出すことは重要です。


visit-visual-children (メソッド)
public abstract {TextVisual.visit-visual-children
visit-proc:{proc-type {Visual}:bool}
}:void

このTextVisualの子ごとにプロシージャを呼び出します。

visit-proc: 呼び出されるプロシージャ

説明

プロシージャvisit-procは、昇順でこのTextVisualの各子オブジェクトで呼び出されます。visit-procを呼び出して、trueが返ってきたら、子オブジェクトが存在する限り、次の子の為のvisit-procの呼び出しによってイテレーションは継続します。 visit-procの呼び出しが falseを返す場合、イテレーションは終了します。


wrap-graphic (メソッド)
public {TextVisual.wrap-graphic g:Graphic}:Graphic

このオブジェクトに適した ラッパー Graphic を返します。

g: このオブジェクトを含むテキストコンテナの単純な Graphic

戻り値

g が直接返されるか、g を含むグラフィック階層のどちらかです。多くの TextVisual はこのメソッドで、 g を返します。しかし、centerleft-justify のテキストプロシージャによって返されるオブジェクトのような一部の TextVisual のサブクラスは、指定された追加のフォーマットのコンテナで g をラップします。それは、返された Graphic 内で g を中央に位置させることになります。

プログラミング注意事項

このメソッドは、Graphic.from-TextVisual#factory ファクトリから呼び出されます。

オーバーライド

このメソッドの既定の実装は、その引数を変更せずに返します。より複雑なラッパーを提供する必要があるサブクラスは、このメソッドをオーバーライドすることが出来ます。