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

Renderer2dGraphicRenderer3dGraphic の抽象基本クラス。


プロパティ
display-context:このオブジェクトに関連付けられている DisplayContext
非ローカル オプション public DrawableGraphic.display-context:#DisplayContext
draw-operation:このパラメータは、ユーザーが描画した Drawable の内容をディスプレイへコピーするときに影響します。特に、ユーザーが描画した Drawable の色要素 (赤、緑、青、およびアルファ) が、DrawableGraphic の下でどのように混合されるかを決定します。

詳細については、DrawOperation を参照してください。
アクセサ public DrawableGraphic.draw-operation:DrawOperation
セッター public DrawableGraphic.draw-operation:DrawOperation
drawable:repaint-handler が描画する対象の Drawable
フィールド public-get private-set DrawableGraphic.drawable:#Drawable
drawable-changed?:最後に再ペイント ハンドラが呼び出された後に、基礎的な描画対象が変更されたかどうかを示します。
フィールド public-get private-set DrawableGraphic.drawable-changed?:bool
occlusion-performance-mode:DrawableGraphic がウィンドウ処理の最適化を使用するかどうかを示します。
アクセサ public final DrawableGraphic.occlusion-performance-mode:OcclusionPerformanceMode
セッター public final DrawableGraphic.occlusion-performance-mode:OcclusionPerformanceMode
visible?:描画や PointerEvent ディスパッチの目的でこのオブジェクトを透明にして不可視にするかどうかを示す bool
ローカル オプション public DrawableGraphic.visible?:bool
プロパティ 継承 Graphic: avoid-page-break?, background, border-color, border-spec, border-style, border-width, cell-border-spec, cell-border-width, cell-margin, clip-child-shadows?, discrete-select-in-range?, enabled?, graphic-selectable, height, horigin, is-paginating?, layout, margin, opaque-to-events?, option-parent, outside-margin, pagination-state, parent, possibly-displayed?, selection-context, shadow-color, shadow-spec, visual-parent, vorigin, width
プロパティ 継承 Visual: _style-element, clonable-class?, completely-clonable-children?, cursor, data-source, dragee, font-size, graphical-parent, has-key-focus?, input-method-enabled?, input-method-keyboard-mode, name, options, style-class, style-element, style-manager, style-options, test-child?, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data
プロパティ 継承 DataBindingTarget: data-binding-context, data-bindings
プロパティ 継承 EventTarget: event-handlers
プロパティ 継承 OptionListInterface: option-register-proc, options-present-here, registered-option-keys

メソッド
draw:DrawableGraphic の表示領域の更新が必要な場合に、GUI Toolkit により呼び出されます。通常、DrawableGraphic を使用するときに、これを意識する必要はありません。その代わり、DrawableGraphic の repaint-handler (再ペイント ハンドラ) を設定する必要があります。
public {DrawableGraphic.draw gc:Renderer2d}:void
get-height-preference:この Graphic の高さ設定を返します。
public {DrawableGraphic.get-height-preference}:Dimension
get-width-preference:この Graphic の幅設定を返します。
public {DrawableGraphic.get-width-preference}:Dimension
set-size:このオブジェクトにレイアウト幅と高さを代入します。
public {DrawableGraphic.set-size lc:LayoutContext, bounds:GRect}:void
update-drawable:この DrawableGraphic に関連する、オフスクリーン Drawable の再ペイントを要求します。
public {DrawableGraphic.update-drawable area:#RectangleSet = null}:void
メソッド 継承 Graphic: after-reposition, attempt-revalidate-layout, before-reposition, constrain-height, constrain-width, contains-point?, create-pagination-state, detach, draw-range-as-selected, draw-shadow, end-pagination, find-ancestor, find-graphic-at, find-graphical-ancestor, fire-inferior-crossing-event, get-graphical-root, get-gui-path, get-origin-in-graphical-ancestor, get-origin-in-root, get-pagination-state, get-range-as-selected-text, get-top-left-in-ancestor, get-visible-bounds-into, graphical-child-visible-at, make-gui-mark, on-drag-enter, on-inspection, on-pointer-enter, option-changed, paginate, paint-with-decorations, pointer-enter-occurred, pointer-leave-occurred, replace-with, request-draw, request-draw-rect, request-layout, request-pointer-trace, search-next, search-next-here, search-prev, search-prev-here, set-layout, start-pagination, xy-offset-to
メソッド 継承 Visual: add, add-from-init-args, animate, change-cursor, clear, clonable-appearance?, clone-appearance, clone-appearance-helper, find-test-children, get-focus-manager, get-gui-path-to-child, get-layout-context, get-test-parent, get-test-property, get-text, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-attached, note-caret-position, note-detaching, on-drag-leave, 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-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
メソッド 継承 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-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, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, notify-option-children, option-change-notify, 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




プロパティ詳細
display-context (非ローカル オプション)
public DrawableGraphic.display-context:#DisplayContext

このオブジェクトに関連付けられている DisplayContext

プログラミング注意事項

このオプションは、Curl グラフィック システム内での通信のために使用されます。これは、ユーザー コードで不用意に設定や設定解除を行わないでください。また、通常は、ユーザー コードで直接読み取るべきではありません。現在の DisplayContext が必要な場合は、Visual.get-display-context を呼び出すことによりフェッチしてください。

画面上のウィンドウまたは印刷されたページで表示可能なすべてのグラフィック階層は、そのルートにおいて、display-context オプションを DisplayContext オブジェクトに設定するオブジェクトを持つ必要があります。このオブジェクトは、グラフィック階層の表示に使用される表示媒体に適しています。つまり、オブジェクトは、display-context オプションの値が null から非 null DisplayContext オブジェクトに変更されるのをモニタリングすることにより、表示不可能なグラフィック階層に連結されていることを認識します。したがって、特定の動作を実行する必要のある Visual のサブクラスは、表示不可能なグラフィック階層に接続された場合、次のようなオプション宣言を含むことにより display-context オプションをモニタリングします。

{nonlocal-option public display-context:#DisplayContext
change handler}


ここで、change handler 内のコードは display-context オプションの現在値 (変数 display-context の値として、変更ハンドラ内にある) を取得し、null および非 null の値の間で行われる変更をモニタリングし、必要とされる動作を実行します。

ただし、このプログラミング熟語を使用するプログラマーは、グラフィカル表示を再配列する際、グラフィック階層からグラフィカル オブジェクトを一時的に分離し、これらを同じ階層に再アタッチすることが、割に一般的であることを理解するべきです。この処理により、一時的に分離されたオブジェクトは、display-context オブジェクトが null になり、再び非 null になるのを観察します。display-context オプションでの変更をモニタリングするコードは、この可能性を考慮に入れ、この状況における望ましくない動作の実行を回避しなくてはなりません。


draw-operation (アクセサ)
アクセサ public DrawableGraphic.draw-operation:DrawOperation
セッター public DrawableGraphic.draw-operation:DrawOperation

このパラメータは、ユーザーが描画した Drawable の内容をディスプレイへコピーするときに影響します。特に、ユーザーが描画した Drawable の色要素 (赤、緑、青、およびアルファ) が、DrawableGraphic の下でどのように混合されるかを決定します。

詳細については、DrawOperation を参照してください。

注意事項

このパラメータは、現在、DrawableGraphic.occlusion-performance-modeOcclusionPerformanceMode.high-performance または OcclusionPerformanceMode.best-effortに設定されているときには無効です。


drawable (フィールド)
public-get private-set DrawableGraphic.drawable:#Drawable

repaint-handler が描画する対象の Drawable

注意事項

この値はキャッシュできません。また、repaint-handler の外からはアクセスできません。値はいつでも変更できます。

DrawableGraphic.drawable-changed? にアクセスして、最後の repaint-handler の呼び出しより後に、drawable が変更されたかどうかを判定できます。

high-performance モードのときは (DrawableGraphic.occlusion-performance-mode を参照)、drawable-changed? は、Drawable のパラメータが変更されたかどうかだけを示すことに注意してください。Drawable の内容は、通知なしに変更されます。再ペイント ハンドラは、Drawable の内容を更新する必要があるときに、その理由には関係なく呼び出されます。


drawable-changed? (フィールド)
public-get private-set DrawableGraphic.drawable-changed?:bool

最後に再ペイント ハンドラが呼び出された後に、基礎的な描画対象が変更されたかどうかを示します。

説明

この値は、基礎的な Drawable が変更されるたびに true に設定され、再ペイント ハンドラが呼び出された後に false に設定されます。

たとえば、アニメーションを前のフレームを元にして加算的に計算する場合、いつ Drawable が変更されるかについて知る必要があります。前のイメージは消去されるからです。


occlusion-performance-mode (アクセサ)
アクセサ public final DrawableGraphic.occlusion-performance-mode:OcclusionPerformanceMode
セッター public final DrawableGraphic.occlusion-performance-mode:OcclusionPerformanceMode

DrawableGraphic がウィンドウ処理の最適化を使用するかどうかを示します。

説明

このパラメータは、使用される Drawable のタイプを変更し、DrawableGraphic の速度に実質的な影響を与えます。既定値は OcclusionPerformanceMode.best-effort です。

詳細については、OcclusionPerformanceMode を参照してください。


visible? (ローカル オプション)
public DrawableGraphic.visible?:bool

描画や PointerEvent ディスパッチの目的でこのオブジェクトを透明にして不可視にするかどうかを示す bool

説明

visible? オプションが true (既定値) の場合、オブジェクトは表示されて正常に動作します。visible? オプションが false の場合、オブジェクトは同じ量のスペースを確保しますが、ピクセルを描画せずポインタ イベントに対して透過になります。
表示されていないオブジェクトも、キーボードフォーカスを取得できるので、visible? = false が設定された場合は、enabled? = false も設定することを推奨します。





メソッド詳細
draw (メソッド)
public {DrawableGraphic.draw gc:Renderer2d}:void

DrawableGraphic の表示領域の更新が必要な場合に、GUI Toolkit により呼び出されます。通常、DrawableGraphic を使用するときに、これを意識する必要はありません。その代わり、DrawableGraphic の repaint-handler (再ペイント ハンドラ) を設定する必要があります。

説明

GUI Toolkit の draw メソッドの詳細については、Graphic.draw を参照してください。

オーバーライド

DrawableGraphic の自身のサブクラス内で DrawableGraphic.draw をオーバーライドする場合、自身の DrawableGraphic.draw メソッドから DrawableGraphic.update-drawable を呼び出さないでください。


get-height-preference (メソッド)
public {DrawableGraphic.get-height-preference}:Dimension

この Graphic の高さ設定を返します。

lc: このレイアウト ネゴシエーションに対して有効な LayoutContext

戻り値

オブジェクトの高さ設定を表す Dimension。この Dimension は、後続のレイアウト処理中に OriginElastic に変換されます。

オーバーライド

このメソッドは、Graphic のサブクラス内で定義する必要があります。

このメソッドをオーバライドするクラスでは必ず Dimension を返すようにして、これで必要な垂直軸に沿ったスペースをそのオブジェクトの起点との関係を含めて表します。実際には、これはこのメソッドが適切な OriginElastic または Dimension を返すことを意味します。Dimension の場合は、「次元から OriginElastics への変換」で説明する変換規則に従って、適切な OriginElastic に変換されます。


get-width-preference (メソッド)
public {DrawableGraphic.get-width-preference}:Dimension

この Graphic の幅設定を返します。

lc: このレイアウト ネゴシエーションに対して有効な LayoutContext

戻り値

このオブジェクトの幅設定を表す Dimension。この Dimension は、後続のレイアウト処理中に OriginElastic に変換されます。

オーバーライド

このメソッドは、Graphic のサブクラスで定義する必要があります。

このメソッドをオーバライドするクラスでは必ず Dimension を返すようにして、これで必要な水平軸に沿ったスペースをそのオブジェクトの起点との関係を含めて表します。実際には、これはこのメソッドが適切な OriginElastic または Dimension を返すことを意味します。Dimension の場合は、「次元から OriginElastics への変換」で説明する変換規則に従って、適切な OriginElastic に変換されます。


set-size (メソッド)
public {DrawableGraphic.set-size lc:LayoutContext, bounds:GRect}:void

このオブジェクトにレイアウト幅と高さを代入します。

説明

このオブジェクトで set-size を呼び出すと、オブジェクトのレイアウト サイズを代入し、オブジェクトのレイアウト ネゴシエーションを完了します。グラフィック階層のすべてのオブジェクトにレイアウト サイズが代入された後で階層のレイアウト ネゴシエーションが完了します。
lc: このレイアウト ネゴシエーションに対して有効な LayoutContext
bounds: このオブジェクトの境界ボックスの左右および上下の範囲をオブジェクトの起点から相対的に示す GRect

プログラミング注意事項

このメソッドは、オブジェクトのグラフィカルな親によって呼び出されます。

オーバーライド

既定のメソッド Graphic.set-size は何も行ないません。Graphicのサブクラスはこのメソッドをオーバーライドして、ここで提供した情報をインターセプトできます。


update-drawable (メソッド)
public {DrawableGraphic.update-drawable area:#RectangleSet = null}:void

この DrawableGraphic に関連する、オフスクリーン Drawable の再ペイントを要求します。

area: 更新される領域。この領域は、開発者が用意した再ペイント ハンドラに渡され、可能であれば画面上のその領域だけが更新されます。値が null のときは、Drawable 全体が更新されることを示します。これが既定になります。

描画をより狭い領域に限定すれば、DrawableGraphic 全体を描画するよりも速く描画できます。したがって、Drawable の一部分のみを変更すれば良い場合、このパラメータを使用して更新を限定してください。

説明

Drawable の更新をトリガしたいときはいつでも、このメソッドを呼び出せます。このメソッドが呼び出されると、DrawableGraphic は開発者が用意した再ペイント ハンドラを呼び出します。 詳細については、Renderer3dGraphic.repaint-handler および Renderer2dGraphic.repaint-handler を参照してください。