java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ScrollBarUI
javax.swing.plaf.basic.BasicScrollBarUI
- すべての実装されたインタフェース:
LayoutManager
,SwingConstants
- 直系の既知のサブクラス:
MetalScrollBarUI
,SynthScrollBarUI
public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, SwingConstants
基本Look & FeelのためのScrollBarUIの実装です。
-
ネストされたクラスのサマリー
修飾子と型クラス説明protected class
カーソル・キーのリスナーです。protected class
モデル変更を待機するリスナーです。class
プロパティ変更ハンドラprotected class
ScrollPane
で開始されるスクロール・イベントのリスナーです。protected class
マウス・ドラッグを追跡します。 -
フィールドのサマリー
修飾子と型フィールド説明protected BasicScrollBarUI.ArrowButtonListener
ボタン・リスナーprotected JButton
ボタンprotected static int
強調表示を減らすprotected int
減分ボタンとトラックの間の距離。protected JButton
インクリメント・ボタンprotected static int
ハイライトを上げるprotected int
増分ボタンとトラックの間の距離。protected boolean
ドラッグprotected Dimension
サムの最大サイズprotected Dimension
最小のサムのサイズprotected BasicScrollBarUI.ModelListener
モデル・リスナーprotected static int
ハイライトなしprotected PropertyChangeListener
プロパティ変更リスナーprotected JScrollBar
Scrollbarprotected int
幅(垂直の場合)または高さ(水平の場合)に関するヒント。protected BasicScrollBarUI.ScrollListener
スクロール・リスナーprotected Timer
スクロール・タイマーprotected Color
サムの色protected Color
サムの暗い影の色protected Color
サム・ハイライトの色protected Color
サムの光の影の色protected Rectangle
サムの矩形protected Color
トラックの色protected int
トラックのハイライトprotected Color
トラックのハイライト・カラーprotected BasicScrollBarUI.TrackListener
トラック・リスナーprotected Rectangle
トラック矩形インタフェース javax.swing.SwingConstantsで宣言されたフィールド
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
コンストラクタのサマリー
-
メソッドのサマリー
修飾子と型メソッド説明void
addLayoutComponent(String name, Component child)
レイアウト・マネージャがコンポーネントごとの文字列を使用する場合は、レイアウトにコンポーネントcomp
を追加し、それをname
によって指定された文字列に関連付けます。protected void
スクロール・バーの色を構成します。protected BasicScrollBarUI.ArrowButtonListener
矢印ボタン・リスナーを作成します。protected JButton
createDecreaseButton(int orientation)
減少ボタンを作成します。protected JButton
createIncreaseButton(int orientation)
増加ボタンを作成します。protected BasicScrollBarUI.ModelListener
モデル・リスナーを作成します。protected PropertyChangeListener
プロパティ変更リスナーを作成します。protected BasicScrollBarUI.ScrollListener
スクロール・リスナーを作成します。protected BasicScrollBarUI.TrackListener
トラック・リスナーを作成します。static ComponentUI
createUI(JComponent c)
UIを作成します。指定されたコンポーネントの、Look & Feelに適した最大サイズを返します。protected Dimension
つまみに許容される最大のサイズを返します。protected Dimension
つまみに許容される最小のサイズを返します。垂直スクロール・バーの推奨幅は、増分ボタンと減分ボタン(null
以外)の推奨幅の最大値、およびつまみの最小幅です。boolean
ユーザーがマウス・ジェスチャ(通常はマウスの中央ボタン)を使ってつまみを絶対位置指定できるかどうかを示します。protected Rectangle
つまみの現在のサイズ/位置を返します。protected Rectangle
トラックの現在の境界(増分ボタンと減分ボタンの間のスペース - イン・セット)を返します。protected void
コンポーネントをインストールします。protected void
デフォルトをインストールします。protected void
キーボード操作をインストールします。protected void
リスナーをインストールします。void
installUI(JComponent c)
UIをインストールします。boolean
マウスが現在つまみの上にある場合にtrueを返します。void
layoutContainer(Container scrollbarContainer)
指定されたコンテナを配置します。protected void
垂直スクロール・バーをレイアウトします。protected void
垂直スクロール・バーをレイアウトします。minimumLayoutSize(Container scrollbarContainer)
指定されたコンテナに含まれているコンポーネントを基に、コンテナの最小サイズを計算します。protected void
減少のハイライトをペイントします。protected void
増加のハイライトをペイントします。protected void
paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
サムをペイントします。protected void
paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
トラックをペイントします。preferredLayoutSize(Container scrollbarContainer)
指定されたコンテナに含まれているコンポーネントを基に、コンテナの推奨サイズを計算します。void
removeLayoutComponent(Component child)
指定されたコンポーネントをレイアウトから削除します。protected void
scrollByBlock(int direction)
ブロック単位でスクロールします。protected void
scrollByUnit(int direction)
ユニット単位でスクロールします。protected void
setThumbBounds(int x, int y, int width, int height)
つまみの境界を設定し、古いthumbBoundsと新しいthumbBoundsを含む再ペイントを強制します。protected void
setThumbRollover(boolean active)
マウスが現在つまみの上にあるかどうかを設定します。protected void
コンポーネントをアンインストールします。protected void
デフォルトをアンインストールします。protected void
キーボード操作をアンインストールします。protected void
リスナーをアンインストールします。void
UIをアンインストールします。クラス javax.swing.plaf.ComponentUIで宣言されたメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, paint, update
-
フィールド詳細
-
minimumThumbSize
protected Dimension minimumThumbSize最小のサムのサイズ -
maximumThumbSize
protected Dimension maximumThumbSizeサムの最大サイズ -
thumbHighlightColor
protected Color thumbHighlightColorサム・ハイライトの色 -
thumbLightShadowColor
protected Color thumbLightShadowColorサムの光の影の色 -
thumbDarkShadowColor
protected Color thumbDarkShadowColorサムの暗い影の色 -
thumbColor
protected Color thumbColorサムの色 -
trackColor
protected Color trackColorトラックの色 -
trackHighlightColor
protected Color trackHighlightColorトラックのハイライト・カラー -
scrollbar
protected JScrollBar scrollbarScrollbar -
incrButton
protected JButton incrButtonインクリメント・ボタン -
decrButton
protected JButton decrButtonボタン -
isDragging
protected boolean isDraggingドラッグ -
trackListener
protected BasicScrollBarUI.TrackListener trackListenerトラック・リスナー -
buttonListener
protected BasicScrollBarUI.ArrowButtonListener buttonListenerボタン・リスナー -
modelListener
protected BasicScrollBarUI.ModelListener modelListenerモデル・リスナー -
thumbRect
protected Rectangle thumbRectサムの矩形 -
trackRect
protected Rectangle trackRectトラック矩形 -
trackHighlight
protected int trackHighlightトラックのハイライト -
NO_HIGHLIGHT
protected static final int NO_HIGHLIGHTハイライトなし- 関連項目:
- 定数フィールド値
-
DECREASE_HIGHLIGHT
protected static final int DECREASE_HIGHLIGHT強調表示を減らす- 関連項目:
- 定数フィールド値
-
INCREASE_HIGHLIGHT
protected static final int INCREASE_HIGHLIGHTハイライトを上げる- 関連項目:
- 定数フィールド値
-
scrollListener
protected BasicScrollBarUI.ScrollListener scrollListenerスクロール・リスナー -
propertyChangeListener
protected PropertyChangeListener propertyChangeListenerプロパティ変更リスナー -
scrollTimer
protected Timer scrollTimerスクロール・タイマー -
scrollBarWidth
protected int scrollBarWidth幅(垂直の場合)または高さ(水平の場合)に関するヒント。- 導入されたバージョン:
- 1.7
-
incrGap
protected int incrGap増分ボタンとトラックの間の距離。 これは負の数値の場合があります。 負の場合はボタンとトラックの間でオーバーラップが発生し、形状付きボタンに役立ちます。- 導入されたバージョン:
- 1.7
-
decrGap
protected int decrGap減分ボタンとトラックの間の距離。 これは負の数値の場合があります。 負の場合はボタンとトラックの間でオーバーラップが発生し、形状付きボタンに役立ちます。- 導入されたバージョン:
- 1.7
-
-
コンストラクタの詳細
-
BasicScrollBarUI
public BasicScrollBarUI()BasicScrollBarUI
を構築します。
-
-
メソッドの詳細
-
createUI
public static ComponentUI createUI(JComponent c)UIを作成します。- パラメータ:
c
- コンポーネント- 戻り値:
- UI
-
configureScrollBarColors
protected void configureScrollBarColors()スクロール・バーの色を構成します。 -
installUI
public void installUI(JComponent c)UIをインストールします。- オーバーライド:
installUI
、クラス:ComponentUI
- パラメータ:
c
- コンポーネント- 関連項目:
ComponentUI.uninstallUI(javax.swing.JComponent)
,JComponent.setUI(javax.swing.plaf.ComponentUI)
,JComponent.updateUI()
-
uninstallUI
public void uninstallUI(JComponent c)UIをアンインストールします。- オーバーライド:
uninstallUI
、クラス:ComponentUI
- パラメータ:
c
- コンポーネント- 関連項目:
ComponentUI.installUI(javax.swing.JComponent)
,JComponent.updateUI()
-
installDefaults
protected void installDefaults()デフォルトをインストールします。 -
installComponents
protected void installComponents()コンポーネントをインストールします。 -
uninstallComponents
protected void uninstallComponents()コンポーネントをアンインストールします。 -
installListeners
protected void installListeners()リスナーをインストールします。 -
installKeyboardActions
protected void installKeyboardActions()キーボード操作をインストールします。 -
uninstallKeyboardActions
protected void uninstallKeyboardActions()キーボード操作をアンインストールします。 -
uninstallListeners
protected void uninstallListeners()リスナーをアンインストールします。 -
uninstallDefaults
protected void uninstallDefaults()デフォルトをアンインストールします。 -
createTrackListener
protected BasicScrollBarUI.TrackListener createTrackListener()トラック・リスナーを作成します。- 戻り値:
- トラック・リスナー
-
createArrowButtonListener
protected BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()矢印ボタン・リスナーを作成します。- 戻り値:
- 矢印ボタン・リスナー
-
createModelListener
protected BasicScrollBarUI.ModelListener createModelListener()モデル・リスナーを作成します。- 戻り値:
- モデル・リスナー
-
createScrollListener
protected BasicScrollBarUI.ScrollListener createScrollListener()スクロール・リスナーを作成します。- 戻り値:
- スクロール・リスナー
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()プロパティ変更リスナーを作成します。- 戻り値:
- プロパティ変更リスナー
-
setThumbRollover
protected void setThumbRollover(boolean active)マウスが現在つまみの上にあるかどうかを設定します。- パラメータ:
active
- trueは、つまみが現在アクティブであることを示します。- 導入されたバージョン:
- 1.5
-
isThumbRollover
public boolean isThumbRollover()マウスが現在つまみの上にある場合にtrueを返します。- 戻り値:
- つまみが現在アクティブな場合はtrue
- 導入されたバージョン:
- 1.5
-
getPreferredSize
public Dimension getPreferredSize(JComponent c)垂直スクロール・バーの推奨幅は、増分ボタンと減分ボタン(null
以外)の推奨幅の最大値、およびつまみの最小幅です。 推奨される高さは、同じ部分の推奨される高さの総計です。 水平スクロール・バーの推奨されるサイズの原理も同様です。preferredSize
は1回だけ計算されます。以後、このメソッドを呼び出すと、キャッシュに格納されたサイズ値が返されます。- オーバーライド:
getPreferredSize
、クラス:ComponentUI
- パラメータ:
c
- このメソッドを委譲しているJScrollBar
- 戻り値:
- Basic JScrollBarの適切なサイズ
- 関連項目:
getMaximumSize(javax.swing.JComponent)
,ComponentUI.getMinimumSize(javax.swing.JComponent)
-
getMaximumSize
public Dimension getMaximumSize(JComponent c)クラスからコピーされた説明:ComponentUI
指定されたコンポーネントの、Look & Feelに適した最大サイズを返します。null
が返された場合、最大サイズは代わりにコンポーネントのレイアウト・マネージャによって計算されます(これは、特定のレイアウト・マネージャをインストールしてあるコンポーネントの場合に推奨する方法です)。 このメソッドのデフォルト実装はgetPreferredSize
を呼び出して、その値を返します。- オーバーライド:
getMaximumSize
、クラス:ComponentUI
- パラメータ:
c
- このメソッドを委譲しているJScrollBar。- 戻り値:
- new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
- 関連項目:
ComponentUI.getMinimumSize(javax.swing.JComponent)
,getPreferredSize(javax.swing.JComponent)
-
createDecreaseButton
protected JButton createDecreaseButton(int orientation)減少ボタンを作成します。- パラメータ:
orientation
- オリエンテーション- 戻り値:
- 減少ボタン
-
createIncreaseButton
protected JButton createIncreaseButton(int orientation)増加ボタンを作成します。- パラメータ:
orientation
- オリエンテーション- 戻り値:
- 増加ボタン
-
paintDecreaseHighlight
protected void paintDecreaseHighlight(Graphics g)減少のハイライトをペイントします。- パラメータ:
g
- グラフィックス
-
paintIncreaseHighlight
protected void paintIncreaseHighlight(Graphics g)増加のハイライトをペイントします。- パラメータ:
g
- グラフィックス
-
paintTrack
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)トラックをペイントします。- パラメータ:
g
- グラフィックスc
- コンポーネントtrackBounds
- トラックの境界
-
paintThumb
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)サムをペイントします。- パラメータ:
g
- グラフィックスc
- コンポーネントthumbBounds
- サムの境界
-
getMinimumThumbSize
protected Dimension getMinimumThumbSize()つまみに許容される最小のサイズを返します。 スクロール・バーが小さくなりすぎてこのサイズでは利用できない場合、つまみは隠されます。警告: このメソッドが返す値は変更しないでください。これは共有されるstatic定数です。
- 戻り値:
- つまみに許容される最小サイズ。
- 関連項目:
getMaximumThumbSize()
-
getMaximumThumbSize
protected Dimension getMaximumThumbSize()つまみに許容される最大のサイズを返します。 固定サイズのつまみを作成するには、このメソッドとgetMinimumThumbSize
が同じ値を返すようにしてください。警告: このメソッドが返す値は変更しないでください。これは共有されるstatic定数です。
- 戻り値:
- つまみに許容される最大サイズ。
- 関連項目:
getMinimumThumbSize()
-
addLayoutComponent
インタフェースからコピーされた説明:LayoutManager
レイアウト・マネージャがコンポーネントごとの文字列を使用する場合は、レイアウトにコンポーネントcomp
を追加し、それをname
によって指定された文字列に関連付けます。- 定義:
addLayoutComponent
、インタフェース:LayoutManager
- パラメータ:
name
- コンポーネントに関連付けられる文字列child
- 追加されるコンポーネント
-
removeLayoutComponent
public void removeLayoutComponent(Component child)インタフェースからコピーされた説明:LayoutManager
指定されたコンポーネントをレイアウトから削除します。- 定義:
removeLayoutComponent
、インタフェース:LayoutManager
- パラメータ:
child
- 削除されるコンポーネント
-
preferredLayoutSize
インタフェースからコピーされた説明:LayoutManager
指定されたコンテナに含まれているコンポーネントを基に、コンテナの推奨サイズを計算します。- 定義:
preferredLayoutSize
、インタフェース:LayoutManager
- パラメータ:
scrollbarContainer
- レイアウトされるコンテナ- 戻り値:
- コンテナの優先ディメンション
- 関連項目:
LayoutManager.minimumLayoutSize(java.awt.Container)
-
minimumLayoutSize
インタフェースからコピーされた説明:LayoutManager
指定されたコンテナに含まれているコンポーネントを基に、コンテナの最小サイズを計算します。- 定義:
minimumLayoutSize
、インタフェース:LayoutManager
- パラメータ:
scrollbarContainer
- レイアウトされるコンポーネント- 戻り値:
- コンテナの最小ディメンション
- 関連項目:
LayoutManager.preferredLayoutSize(java.awt.Container)
-
layoutVScrollbar
protected void layoutVScrollbar(JScrollBar sb)垂直スクロール・バーをレイアウトします。- パラメータ:
sb
- スクロール・バー
-
layoutHScrollbar
protected void layoutHScrollbar(JScrollBar sb)垂直スクロール・バーをレイアウトします。- パラメータ:
sb
- スクロール・バー
-
layoutContainer
public void layoutContainer(Container scrollbarContainer)インタフェースからコピーされた説明:LayoutManager
指定されたコンテナを配置します。- 定義:
layoutContainer
、インタフェース:LayoutManager
- パラメータ:
scrollbarContainer
- レイアウトされるコンテナ
-
setThumbBounds
protected void setThumbBounds(int x, int y, int width, int height)つまみの境界を設定し、古いthumbBoundsと新しいthumbBoundsを含む再ペイントを強制します。- パラメータ:
x
- サムのxロケーションを設定y
- サムのyのロケーションを設定width
- サムの幅を設定height
- サムの高さを設定- 関連項目:
getThumbBounds()
-
getThumbBounds
protected Rectangle getThumbBounds()つまみの現在のサイズ/位置を返します。警告: このメソッドが返す値は変更しないでください。これは実際の矩形への参照です。コピーではありません。
- 戻り値:
- つまみの現在のサイズ/位置。
- 関連項目:
setThumbBounds(int, int, int, int)
-
getTrackBounds
protected Rectangle getTrackBounds()トラックの現在の境界(増分ボタンと減分ボタンの間のスペース - イン・セット)を返します。 このメソッドが返す値は、スクロール・バーが配置される(検証される)たびに更新されます。警告: このメソッドが返す値は変更しないでください。これは実際の矩形への参照です。コピーではありません。
- 戻り値:
- スクロールバー・トラックの現在の境界
- 関連項目:
layoutContainer(java.awt.Container)
-
scrollByBlock
protected void scrollByBlock(int direction)ブロック単位でスクロールします。- パラメータ:
direction
- スクロールする方向
-
scrollByUnit
protected void scrollByUnit(int direction)ユニット単位でスクロールします。- パラメータ:
direction
- スクロールする方向
-
getSupportsAbsolutePositioning
public boolean getSupportsAbsolutePositioning()ユーザーがマウス・ジェスチャ(通常はマウスの中央ボタン)を使ってつまみを絶対位置指定できるかどうかを示します。- 戻り値:
- マウス・ジェスチャがつまみを絶対位置指定できる場合はtrue
- 導入されたバージョン:
- 1.5
-