(クラス)
public StandardPieSet
{inherits
PieSet}
PieSet の標準実装。
説明
このクラスは、レイアウトおよび計算ロジックを実装します。PieSet のサブクラス化に関心がある場合は、StandardPieSet をサブクラス化することができます。それ以外では、このクラスの存在を考慮する必要はありません。
| コンストラクタ public | {StandardPieSet.default} |
非ローカル オプション public StandardPieSet.font-family:
String
非ローカル オプション public StandardPieSet.font-size:
any
| font-style: | オブジェクト内のテキストを斜体や斜投影法などのフォントにするかどうかを指定します。 |
非ローカル オプション public StandardPieSet.font-style:
FontStyle
非ローカル オプション public StandardPieSet.font-weight:
FontWeight
非ローカル オプション public StandardPieSet.pie-set-inner-margin:
any
非ローカル オプション public StandardPieSet.pie-wedge-border-line-style:
LineStyle
非ローカル オプション public StandardPieSet.pie-wedge-border-width:
any
非ローカル オプション public StandardPieSet.text-line-through?:
bool
非ローカル オプション public StandardPieSet.text-underline?:
bool プロパティ 継承 PieSet:
chart, color-associations, label-data, label-factory, label-group, label-set?, label-value?, labels, legend-enabled?, legend-entry-factory, pie-label-radius, pie-set-shape-quality, pie-set-starting-angle, set-data, shape-factory, style-element, wedge-group, wedge-labels?, wedges プロパティ 継承 Shape:
as-Shape, border-color, color, draw-operation, option-parent, selection-context, shape-parent, shape-selectable, stroke-thickness, transformation, visible? プロパティ 継承 Visual:
_style-element, clonable-class?, completely-clonable-children?, cursor, data-source, dragee, input-method-enabled?, input-method-keyboard-mode, name, options, options-present-here, style-class, style-manager, style-options, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data
| public | {StandardPieSet.compute-data-abs-sum}:any |
| public | {StandardPieSet.estimate-bounds}:GRect |
| public | {StandardPieSet.get-outside-margin}:Distance |
| public | {StandardPieSet.get-wedge-size value:any}:Fraction |
| protected | {StandardPieSet.handle-observer-message}:void |
| public | {StandardPieSet.note-set-data-array-changed}:void |
| public | {StandardPieSet.transformation-changed}:void |
| public | {StandardPieSet.update-layout}:void |
メソッド 継承 PieSet:
append-color-association, append-data-series, create-legend-entries, detach, draw, get-fill-pattern-for-record, get-label-position, get-own-bounds, non-keyword-init-arg, note-color-associations-changed, remove-color-association, remove-data-series, self-contains-point?, self-intersects-polygon? メソッド 継承 Shape:
apply-rotation, apply-scale, apply-transformation, apply-translation, apply-translation-in-parent, constrain-own-layout-bounds, constrain-shape-layout-bounds, contains-point?, find-graphical-ancestor, fire-crossing-event, fire-in-child, get-display-context, get-down-orientation-in-shape-parent, get-graphical-root, get-local-device-pixel-size, get-origin-in-graphical-ancestor, get-origin-in-root, get-origin-in-shape-parent, get-origin-in-shape-root, get-own-bounds-in-shape-root, get-own-layout-bounds, get-right-orientation-in-shape-parent, get-shape-bounds, get-shape-bounds-in-shape-root, get-shape-layout-bounds, get-top-left-in-ancestor, get-transformation-to-shape-root, keyword-init-arg, option-change-notify, overdraw-for-selection, quantize-line-thickness, request-draw, request-draw-self, reset-transformation, set-rotation, set-scale, set-transformation, set-translation-in-parent, to-Graphic, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-point-from-shape-root, transform-point-to-shape-root, transform-to-display-coordinates, transform-to-graphical-root-coordinates, transform-vector-from-shape-root, transform-vector-to-shape-root, transformation-changing メソッド 継承 ShapeContainerBase:
add, clear, draw-shape-child, draw-shape-children, get-all-children-at-point, get-child-at-point, get-leaf-at-point, get-shape-root, note-attached, note-detaching, notify-option-children, on-drag-enter, on-pointer-enter, on-pointer-envelope-event, register-options, remove, set-shape-index, set-shape-index-after, set-shape-index-before, shape-container-fire-inferior-crossing-event, shape-container-handle-crossing, shape-container-pick-child, shape-container-pointer-enter-occurred, shape-container-pointer-leave-occurred メソッド 継承 Visual:
add-from-init-args, add-option, add-style-option, animate, change-cursor, clonable-appearance?, clone-appearance, clone-appearance-helper, find-test-children, get-focus-manager, get-layout-context, get-test-parent, get-test-property, get-text, get-view, maybe-fire-attach-event, maybe-fire-detach-event, note-caret-position, on-drag-leave, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, release-key-focus, remove-option, remove-style-option, request-key-focus, scroll-to-include, test-record, test-run, xy-offset-to メソッド 継承 GuiEventTarget:
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-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 メソッド 継承 OptionListInterface:
change-option-parent-notify, clone-options, get-option, get-option-by-name, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, option-changed, option-lookup, option-lookup-here, option-propagate-notify, option-set?, propagate-option-change, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
(コンストラクタ)
| public | {StandardPieSet.default} |
新しい StandardPieSet を作成します。
説明
通常、StandardPieSet を直接作成する必要はありません。
(非ローカル オプション)
このオブジェクトに関連付けられている 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 オプションでの変更をモニタリングするコードは、この可能性を考慮に入れ、この状況における望ましくない動作の実行を回避しなくてはなりません。
(非ローカル オプション)
public StandardPieSet.font-family:
String テキストのフォント書体を設定します。
説明
テキストをレンダリングするフォントの検索に使用するフォント ファミリー名 (または名前のリスト) を指定します。
フォントの指定方法の詳細については、
Font を参照してください。
| 例 |
 |
{VBox
{text font-family = "serif", serif},
{text font-family = "sans-serif", sans-serif},
{text font-family = "monospace", monospace},
{text
font-family = "Arial, Nimbus Sans L, sans-serif",
prefer a particular sans-serif
},
{text
font-family =
"Times New Roman, Nimbus Roman No9 L, serif",
prefer a particular serif
}
}
| |
(非ローカル オプション)
public StandardPieSet.font-size:
any オブジェクト内のテキストの既定サイズを指定します。
説明
このサイズは、数量の尺度単位である
Distance で表されます。数量は他に、重量、温度、および他のカテゴリの測定単位をサポートします。
Distance 単位の例としては、
pt (ポイント)、
in (インチ)、
cm (センチメートル) などがあります。サポートされる
Distance 単位の詳細なリストについては、「
数量と単位」の章を参照してください。
数量を指定するときは、数と単位の間にスペースを入れないでください。
8pt と
4mm は、2 つの正しい
font-size 値の例です。
例
font-size オプションを使用したテキスト サイズの指定方法の例をいくつか示します。"Medium" という語を持つテキスト オブジェクトが、それを含むテキスト オブジェクトから、どのようにフォント サイズを取得するかに注意してください。
| 例 |
 |
{text font-size=12pt,
{text font-size=8pt, Little}
{text font-size=1cm, Pretty big}
{text Medium}
{text font-size=1in, Huge!}
}
{text And this is the default}
| |
参照:
(非ローカル オプション)
オブジェクト内のテキストを斜体や斜投影法などのフォントにするかどうかを指定します。
説明
例
| 例 |
 |
{paragraph font-style="italic", Everything in this paragraph
should be in an italic font,
{text font-style="normal", except for this text fragment.}
}
| |
参照:
(非ローカル オプション)
オブジェクト内のテキストを、太字として強調表示するかどうかを指定します。
説明
例
| 例 |
 |
{paragraph Everything in this paragraph
should be normally weighted,
{text font-weight="bold", except for this text fragment.}
}
| |
参照:
(非ローカル オプション)
public StandardPieSet.pie-set-inner-margin:
any
(非ローカル オプション)
public StandardPieSet.pie-wedge-border-line-style:
LineStyle
(非ローカル オプション)
public StandardPieSet.pie-wedge-border-width:
any
(非ローカル オプション)
public StandardPieSet.text-line-through?:
bool オブジェクト内のテキストに、取り消し線を適用するかどうかを指定します。
説明
true または
false に設定します。
line-through も参照してください。このオプション用の定義済み文字書式です。
例
| 例 |
 |
{paragraph
Modified Shopping List: onions, carrots, french bread,
{text text-line-through?=true, pot roast},
London Broil, Camembert, eggs, {text
text-line-through?=true, orange juice}, butter, jam.}
| |
参照:
(非ローカル オプション)
public StandardPieSet.text-underline?:
bool このオブジェクト内のテキストに、下線を引かれるかどうかを指定します。
説明
true または false に設定します。
例
| 例 |
 |
{paragraph
This is the result of
{text text-underline?=true, setting text-underline? to true}
for a text fragment.
}
{paragraph
{underline But notice what I am doing here{em-dash}I
am using the underline character format and
{text text-underline?=false, setting text-underline? to false.}}
}
| |
参照:
(メソッド)
| public | {StandardPieSet.compute-data-abs-sum}:any |
この PieSet 内のデータの絶対値の合計を計算します。
戻り値
説明
この値は、各データ ポイントが表す全体の割合を決定するために使用されます。
(メソッド)
| public | {StandardPieSet.estimate-bounds}:GRect |
この PieSet に必要な境界を見積もります。
inner-radius: この PieSet の内径。
outer-radius: この PieSet の外径。
total-radius: すべての PieSet の合計半径。
dest: データを返すために使用されるオプションの GRect オブジェクト。
戻り値
境界を含む
GRect オブジェクト。これは、常に
dest と同じオブジェクトになります。この
GRect は正しい形式である必要があります。つまり、次の条件が true でなければなりません。
-dest.lextent <= dest.rextent and -dest.ascent <= dest.descent
説明
返された GRect は必ずしも正しい必要はありません。ただし、これは円セットとラベルに割り当てられるスペース量の決定に使用されるため、プロット エリアとラベルへのスペースの割り当て量が多すぎたり少なすぎたりすると、エラーが発生する可能性があります。
注意事項
(メソッド)
Shape に関連した ChartDataSeries を決定します (ある場合)。
shape: 検索する Shape。
説明
PieSet.set-data の要素を表すために、
Shape がこの
PieSet によって生成された場合は、このメソッドでその要素が判別され、該当するデータ系列が返されます。その他の場合は、null を返します。
PieSet をサブクラス化しようとする場合は、このメソッドを実装する必要があります。これは通常、生成された Shape のセットを追跡し、渡される Shape が既知の Shape のメンバであるかどうかを決定することにより実行されます。
(メソッド)
| public | {StandardPieSet.get-outside-margin}:Distance |
このグラフでその一番外側からグラフの境界または凡例までの必要スペースを決定します。
説明
このメソッドの標準実装では、くさび形の境界に合わせるために十分なスペースが必要です。さらにスペースが必要な場合、このメソッドをオーバーライドできます。
(メソッド)
指定の位置に Record、ChartDataSeries、および Shape があれば、それらを確認してください。
x: この PieSet の相対 X 座標。
y: この PieSet の相対 Y 座標。
戻り値
ポイントでの Record、ChartDataSeries、および Shape。この位置に Shape が配置されたデータ系列がない場合、すべての値は null になります。そうでない場合は、すべて非 null になります。
説明
渡されるポイントは、この
PieSet の座標系に対して相対的である必要があります。この
PieSet の
Shape.transformation を変更していない限り、
PieSet の原点はプロット エリアの中央になります。
Chart 相対座標のプロット エリア相対座標への変換を含む例については、次を参照してください。
注意事項
これに関するその他の手法については、以下を参照してください。
例
マウス ポインタをこの円グラフ内の各くさび形上で移動し、それぞれに関する情報を表示します。この情報は、PieSet.get-record-at-point を使用して実行時に検出されます。
| 例:
次の使用: PieSet.get-record-at-point |
 |
{import * from CURL.GUI.CHARTS}
{import * from CHARTS-DOC,
location = "../docstring-support/gui/charts-doc.scurl"
}
{let display:TextDisplay = {TextDisplay}}
{VBox
hstretch? = true,
display,
{PieChart
width = 12cm,
height = 8cm,
{PieSet
sample-records,
"Age"
},
{on e:PointerMotion at chart:PieChart do
|| Transform coordinates from chart into one of its
|| children -- the plot area:
let constant point-in-plot-area:Distance2d =
{chart.plot-area.transformation.inverse-transform-point
{Distance2d e.x, e.y}
}
let constant pie-set:PieSet = chart.sets[0]
let (record:#Record, data:#ChartDataSeries, shape:#Shape) =
{pie-set.get-record-at-point
point-in-plot-area.x,
point-in-plot-area.y
}
set display.value =
{if-non-null record then
{format
"Name: %s, points: %s, wins: %s, age: %s " &
"(from series %s)",
record["Name"],
record["Points"],
record["Wins"],
record["Age"],
data.field.caption
}
else
""
}
}
}
}
| |
(メソッド)
| public | {StandardPieSet.get-wedge-size value:any}:Fraction |
この PieSet 内のすべての値の合計に対する 1 つの値の割合を決定します。
戻り値
(メソッド)
| protected | {StandardPieSet.handle-observer-message}:void |
監視対象のオブジェクトがメッセージを送信するときにこのメソッドを呼び出します。Observer はこのメソッドを実装して、変更が発生したときに処理を実行する必要があります。
sender: 変更があった Observable オブジェクトです。
message: これは、Observer からの変更に関する詳細情報が含まれています。詳細情報がない場合は NULL になります。
(メソッド)
| public | {StandardPieSet.note-set-data-array-changed}:void |
この PieSet に PieSet.set-data の順序が変更されたことを通知します。
説明
PieSet.set-data は、既存の要素の順序を変更する場合にのみ直接操作できます。これを行う場合、このメソッドを呼び出して、PieSet がその要素を再生成できるようにする必要があります。
(メソッド)
| public | {StandardPieSet.transformation-changed}:void |
Shape.transformation が変更されたことの通知。
オーバーライド
重要:このメソッドのオーバーライド実装にスーパークラス実装の呼び出しを含めて、オブジェクトの新しい領域を無効にする必要があります。
(メソッド)
| public | {StandardPieSet.update-layout}:void |
この PieSet の内部レイアウトを更新します。
inner-radius: この PieSet の内径。
outer-radius: この PieSet の外径。
total-radius: すべての PieSet の合計半径。
説明