public class LabelView extends GlyphView implements TabableView
LabelViewは、テキスト・モデルの要素上にマッピングされたビューを表す、テキストの書式付きチャンクです。 描画に使われる文字レベルの属性をキャッシュに書き込みます。 GlyphView.GlyphPainterBadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| void | changedUpdate(DocumentEvent e, Shape a, ViewFactory f) | このビューが扱う位置で属性が変更されたことをドキュメントから通知します。 | 
| Color | getBackground() | グリフの描画に使用するバックグラウンド・カラーを取得します。 | 
| Font | getFont() | グリフのベースとなるフォントを取得します。 | 
| protected FontMetrics | getFontMetrics() | 非推奨。 
 FontMetricsは、JDKで実行する場合はグリフ・レンダリングには使用されません。 | 
| Color | getForeground() | グリフの描画に使用するフォアグラウンド・カラーを取得します。 | 
| boolean | isStrikeThrough() | グリフが取消し線を持つかかどうかを判定します。 | 
| boolean | isSubscript() | グリフを上付き文字として描画するかどうかを決定します。 | 
| boolean | isSuperscript() | グリフを下付き文字として描画するかどうかを決定します。 | 
| boolean | isUnderline() | グリフに下線を付けるかどうかを判定します。 | 
| protected void | setBackground(Color bg) | ビューのバックグラウンド・カラーを設定します。 | 
| protected void | setPropertiesFromAttributes() | キャッシュに書き込まれたプロパティを属性から設定します。 | 
| protected void | setStrikeThrough(boolean s) | ビューに取消し線を付けるかどうかを設定します。 | 
| protected void | setSubscript(boolean s) | ビューが下付き文字を表すかどうかを設定します。 | 
| protected void | setSuperscript(boolean s) | ビューが上付き文字を表すかどうかを設定します。 | 
| protected void | setUnderline(boolean u) | ビューに下線を付けるかどうかを設定します。 | 
breakView, checkPainter, clone, createFragment, getAlignment, getBreakWeight, getEndOffset, getGlyphPainter, getMinimumSpan, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, insertUpdate, modelToView, paint, removeUpdate, setGlyphPainter, viewToModelappend, forwardUpdate, forwardUpdateToView, getAttributes, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getParent, getResizeWeight, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModelequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPartialSpan, getTabbedSpanpublic LabelView(Element elem)
elem - 要素protected void setUnderline(boolean u)
u - ビューに下線が付いている場合はtrue、そうでない場合はfalseisUnderline()protected void setStrikeThrough(boolean s)
s - ビューに取消し線がある場合はtrue、そうでない場合はfalseisStrikeThrough()protected void setSuperscript(boolean s)
s - ビューが上付き文字を表す場合はtrue、そうでない場合はfalseisSuperscript()protected void setSubscript(boolean s)
s - ビューが下付き文字を表す場合はtrue、そうでない場合はfalseisSubscript()protected void setBackground(Color bg)
Viewの構成の一環として呼び出されます。 バックグラウンド・カラーをカスタマイズする必要がある場合は、setPropertiesFromAttributesをオーバーライドして、このメソッドを呼び出します。 値nullは、バックグラウンドが描画されないことを示すため、親Viewのバックグラウンドが透けて見えるようになります。 bg - バックグラウンド・カラー、またはnullsetPropertiesFromAttributes()protected void setPropertiesFromAttributes()
@Deprecated protected FontMetrics getFontMetrics()
FontMetricsを取得します。public Color getBackground()
nullになります。 getBackground、クラスGlyphViewpublic Color getForeground()
nullになります。 getForeground、クラスGlyphViewpublic Font getFont()
public boolean isUnderline()
このプロパティを要求するとき、ElementのAttributeSetというプロパティで、LabelViewの状態が同期し直されます。 ElementのAttributeSetにこのプロパティ・セットがない場合、falseに戻されます。 
isUnderline、クラスGlyphViewunderlineプロパティの値public boolean isStrikeThrough()
strikeThroughプロパティを返すために実装されます。 
 このプロパティを要求するとき、ElementのAttributeSetというプロパティで、LabelViewの状態が同期し直されます。 ElementのAttributeSetにこのプロパティ・セットがない場合、falseに戻されます。 
isStrikeThrough、クラスGlyphViewstrikeThroughプロパティの値public boolean isSubscript()
isSubscript、クラスGlyphViewこのプロパティを要求するとき、ElementのAttributeSetというプロパティで、LabelViewの状態が同期し直されます。 ElementのAttributeSetにこのプロパティ・セットがない場合、falseに戻されます。 
public boolean isSuperscript()
このプロパティを要求するとき、ElementのAttributeSetというプロパティで、LabelViewの状態が同期し直されます。 ElementのAttributeSetにこのプロパティ・セットがない場合、falseに戻されます。 
isSuperscript、クラスGlyphViewsuperscriptプロパティの値public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate、クラスGlyphViewe - 関連するドキュメントからの変更情報a - ビューの現在の割当てf - ビューが子を持つ場合に再構築に使用するファクトリView.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory) バグまたは機能を送信 
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。 
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved.  Use is subject to license terms.  Documentation Redistribution Policyも参照してください。