- 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 classBasicScrollBarUI.ArrowButtonListenerカーソル・キーのリスナーです。protected classBasicScrollBarUI.ModelListenerモデル変更を待機するリスナーです。classBasicScrollBarUI.PropertyChangeHandlerプロパティ変更ハンドラprotected classBasicScrollBarUI.ScrollListenerScrollPaneで開始されるスクロール・イベントのリスナーです。protected classBasicScrollBarUI.TrackListenerマウス・ドラッグを追跡します。
-
フィールドのサマリー
フィールド 修飾子と型 フィールド 説明 protected BasicScrollBarUI.ArrowButtonListenerbuttonListenerボタン・リスナーprotected JButtondecrButtonボタンprotected static intDECREASE_HIGHLIGHT強調表示を減らすprotected intdecrGap減分ボタンとトラックの間の距離。protected JButtonincrButtonインクリメント・ボタンprotected static intINCREASE_HIGHLIGHTハイライトを上げるprotected intincrGap増分ボタンとトラックの間の距離。protected booleanisDraggingドラッグprotected DimensionmaximumThumbSizeサムの最大サイズprotected DimensionminimumThumbSize最小のサムのサイズprotected BasicScrollBarUI.ModelListenermodelListenerモデル・リスナーprotected static intNO_HIGHLIGHTハイライトなしprotected PropertyChangeListenerpropertyChangeListenerプロパティ変更リスナーprotected JScrollBarscrollbarScrollbarprotected intscrollBarWidth幅(垂直の場合)または高さ(水平の場合)に関するヒント。protected BasicScrollBarUI.ScrollListenerscrollListenerスクロール・リスナーprotected TimerscrollTimerスクロール・タイマーprotected ColorthumbColorサムの色protected ColorthumbDarkShadowColorサムの暗い影の色protected ColorthumbHighlightColorサム・ハイライトの色protected ColorthumbLightShadowColorサムの光の影の色protected RectanglethumbRectサムの矩形protected ColortrackColorトラックの色protected inttrackHighlightトラックのハイライトprotected ColortrackHighlightColorトラックのハイライト・カラーprotected BasicScrollBarUI.TrackListenertrackListenerトラック・リスナーprotected RectangletrackRectトラック矩形-
インタフェース 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
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 BasicScrollBarUI()
-
メソッドのサマリー
すべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 voidaddLayoutComponent(String name, Component child)レイアウト・マネージャがコンポーネントごとの文字列を使用する場合は、レイアウトにコンポーネントcompを追加し、それをnameによって指定された文字列に関連付けます。protected voidconfigureScrollBarColors()ス・クロール・バーの色を構成します。protected BasicScrollBarUI.ArrowButtonListenercreateArrowButtonListener()矢印ボタン・リスナーを作成します。protected JButtoncreateDecreaseButton(int orientation)減少ボタンを作成します。protected JButtoncreateIncreaseButton(int orientation)増加ボタンを作成します。protected BasicScrollBarUI.ModelListenercreateModelListener()モデル・リスナーを作成します。protected PropertyChangeListenercreatePropertyChangeListener()プロパティ変更リスナーを作成します。protected BasicScrollBarUI.ScrollListenercreateScrollListener()スクロール・リスナーを作成します。protected BasicScrollBarUI.TrackListenercreateTrackListener()トラック・リスナーを作成します。static ComponentUIcreateUI(JComponent c)UIを作成します。DimensiongetMaximumSize(JComponent c)指定されたコンポーネントの、Look & Feelに適した最大サイズを返します。protected DimensiongetMaximumThumbSize()つまみに許容される最大のサイズを返します。protected DimensiongetMinimumThumbSize()つまみに許容される最小のサイズを返します。DimensiongetPreferredSize(JComponent c)垂直スクロール・バーの推奨幅は、増分ボタンと減分ボタン(null以外)の推奨幅の最大値、およびつまみの最小幅です。booleangetSupportsAbsolutePositioning()ユーザーがマウス・ジェスチャ(通常はマウスの中央ボタン)を使ってつまみを絶対位置指定できるかどうかを示します。protected RectanglegetThumbBounds()つまみの現在のサイズ/位置を返します。protected RectanglegetTrackBounds()トラックの現在の境界(増分ボタンと減分ボタンの間のスペース - イン・セット)を返します。protected voidinstallComponents()コンポーネントをインストールします。protected voidinstallDefaults()デフォルトをインストールします。protected voidinstallKeyboardActions()キーボード操作をインストールします。protected voidinstallListeners()リスナーをインストールします。voidinstallUI(JComponent c)UIをインストールします。booleanisThumbRollover()マウスが現在つまみの上にある場合にtrueを返します。voidlayoutContainer(Container scrollbarContainer)指定されたコンテナを配置します。protected voidlayoutHScrollbar(JScrollBar sb)垂直ス・クロール・バーをレイアウトします。protected voidlayoutVScrollbar(JScrollBar sb)垂直ス・クロール・バーをレイアウトします。DimensionminimumLayoutSize(Container scrollbarContainer)指定されたコンテナに含まれているコンポーネントを基に、コンテナの最小サイズを計算します。voidpaint(Graphics g, JComponent c)指定されたコンポーネントをLook & Feelに合わせてペイントします。protected voidpaintDecreaseHighlight(Graphics g)減少のハイライトをペイントします。protected voidpaintIncreaseHighlight(Graphics g)増加のハイライトをペイントします。protected voidpaintThumb(Graphics g, JComponent c, Rectangle thumbBounds)サムをペイントします。protected voidpaintTrack(Graphics g, JComponent c, Rectangle trackBounds)トラックをペイントします。DimensionpreferredLayoutSize(Container scrollbarContainer)指定されたコンテナに含まれているコンポーネントを基に、コンテナの推奨サイズを計算します。voidremoveLayoutComponent(Component child)指定されたコンポーネントをレイアウトから削除します。protected voidscrollByBlock(int direction)ブロック単位でスクロールします。protected voidscrollByUnit(int direction)ユニット単位でスクロールします。protected voidsetThumbBounds(int x, int y, int width, int height)つまみの境界を設定し、古いthumbBoundsと新しいthumbBoundsを含む再ペイントを強制します。protected voidsetThumbRollover(boolean active)マウスが現在つまみの上にあるかどうかを設定します。protected voiduninstallComponents()コンポーネントをアンインストールします。protected voiduninstallDefaults()デフォルトをアンインストールします。protected voiduninstallKeyboardActions()キーボード操作をアンインストールします。protected voiduninstallListeners()リスナーをアンインストールします。voiduninstallUI(JComponent c)UIをアンインストールします。-
クラス javax.swing.plaf.ComponentUIから継承されたメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, 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 scrollbar
Scrollbar
-
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
-
-
メソッドの詳細
-
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
-
paint
public void paint(Graphics g, JComponent c)
クラスからコピーされた説明:ComponentUI指定されたコンポーネントをLook & Feelに合わせてペイントします。 このメソッドは、指定されたコンポーネントがペイントされるときにComponentUI.updateメソッドから呼び出されます。 サブクラスは、このメソッドをオーバーライドして、指定されたGraphicsオブジェクトを使ってコンポーネントの内容を描画するべきです。- オーバーライド:
paint、クラス:ComponentUI- パラメータ:
g- ペイント対象のGraphicsコンテキストc- ペイントされるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある- 関連項目:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
-
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
public void addLayoutComponent(String name, Component child)
インタフェースからコピーされた説明:LayoutManagerレイアウト・マネージャがコンポーネントごとの文字列を使用する場合は、レイアウトにコンポーネントcompを追加し、それをnameによって指定された文字列に関連付けます。- 定義:
addLayoutComponent、インタフェース:LayoutManager- パラメータ:
name- コンポーネントに関連付けられる文字列child- 追加されるコンポーネント
-
removeLayoutComponent
public void removeLayoutComponent(Component child)
インタフェースからコピーされた説明:LayoutManager指定されたコンポーネントをレイアウトから削除します。- 定義:
removeLayoutComponent、インタフェース:LayoutManager- パラメータ:
child- 削除されるコンポーネント
-
preferredLayoutSize
public Dimension preferredLayoutSize(Container scrollbarContainer)
インタフェースからコピーされた説明:LayoutManager指定されたコンテナに含まれているコンポーネントを基に、コンテナの推奨サイズを計算します。- 定義:
preferredLayoutSize、インタフェース:LayoutManager- パラメータ:
scrollbarContainer- レイアウトされるコンテナ- 戻り値:
- コンテナの優先ディメンション
- 関連項目:
LayoutManager.minimumLayoutSize(java.awt.Container)
-
minimumLayoutSize
public Dimension minimumLayoutSize(Container scrollbarContainer)
インタフェースからコピーされた説明: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
-
-