public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, SwingConstants
| 修飾子と型 | クラス | 説明 | 
|---|---|---|
| protected class  | BasicScrollBarUI.ArrowButtonListener | カーソル・キーのリスナーです。 | 
| protected class  | BasicScrollBarUI.ModelListener | モデル変更を待機するリスナーです。 | 
| class  | BasicScrollBarUI.PropertyChangeHandler | |
| protected class  | BasicScrollBarUI.ScrollListener | ScrollPaneで開始されるスクロール・イベントのリスナーです。 | 
| protected class  | BasicScrollBarUI.TrackListener | マウス・ドラッグを追跡します。 | 
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| コンストラクタ | 説明 | 
|---|---|
| BasicScrollBarUI() | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| void | addLayoutComponent(String name, Component child) | レイアウト・マネージャがコンポーネントごとの文字列を使用する場合は、レイアウトにコンポーネント compを追加し、それをnameによって指定された文字列に関連付けます。 | 
| protected void | configureScrollBarColors() | |
| protected BasicScrollBarUI.ArrowButtonListener | createArrowButtonListener() | |
| protected JButton | createDecreaseButton(int orientation) | |
| protected JButton | createIncreaseButton(int orientation) | |
| protected BasicScrollBarUI.ModelListener | createModelListener() | |
| protected PropertyChangeListener | createPropertyChangeListener() | |
| protected BasicScrollBarUI.ScrollListener | createScrollListener() | |
| protected BasicScrollBarUI.TrackListener | createTrackListener() | |
| static ComponentUI | createUI(JComponent c) | |
| Dimension | getMaximumSize(JComponent c) | 指定されたコンポーネントの、Look & Feelに適した最大サイズを返します。 | 
| protected Dimension | getMaximumThumbSize() | つまみに許容される最大のサイズを返します。 | 
| protected Dimension | getMinimumThumbSize() | つまみに許容される最小のサイズを返します。 | 
| Dimension | getPreferredSize(JComponent c) | 垂直スクロール・バーの推奨幅は、増分ボタンと減分ボタン( null以外)の推奨幅の最大値、およびつまみの最小幅です。 | 
| boolean | getSupportsAbsolutePositioning() | ユーザーがマウス・ジェスチャ(通常はマウスの中央ボタン)を使ってつまみを絶対位置指定できるかどうかを示します。 | 
| protected Rectangle | getThumbBounds() | つまみの現在のサイズ/位置を返します。 | 
| protected Rectangle | getTrackBounds() | トラックの現在の境界を返します。 | 
| protected void | installComponents() | |
| protected void | installDefaults() | |
| protected void | installKeyboardActions() | |
| protected void | installListeners() | |
| void | installUI(JComponent c) | 指定されたコンポーネントをLook & Feelに応じて適切に構成します。 | 
| boolean | isThumbRollover() | マウスが現在つまみの上にある場合にtrueを返します。 | 
| void | layoutContainer(Container scrollbarContainer) | 指定されたコンテナを配置します。 | 
| protected void | layoutHScrollbar(JScrollBar sb) | |
| protected void | layoutVScrollbar(JScrollBar sb) | |
| Dimension | minimumLayoutSize(Container scrollbarContainer) | 指定されたコンテナに含まれているコンポーネントを基に、コンテナの最小サイズを計算します。 | 
| void | paint(Graphics g, JComponent c) | 指定されたコンポーネントをLook & Feelに合わせてペイントします。 | 
| protected void | paintDecreaseHighlight(Graphics g) | |
| protected void | paintIncreaseHighlight(Graphics g) | |
| protected void | paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) | |
| protected void | paintTrack(Graphics g, JComponent c, Rectangle trackBounds) | |
| Dimension | 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 | uninstallComponents() | |
| protected void | uninstallDefaults() | |
| protected void | uninstallKeyboardActions() | |
| protected void | uninstallListeners() | |
| void | uninstallUI(JComponent c) | installUI時に、指定されたコンポーネントに対して行われた構成を取り消します。 | 
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, updateprotected Dimension minimumThumbSize
protected Dimension maximumThumbSize
protected Color thumbHighlightColor
protected Color thumbLightShadowColor
protected Color thumbDarkShadowColor
protected Color thumbColor
protected Color trackColor
protected Color trackHighlightColor
protected JScrollBar scrollbar
protected JButton incrButton
protected JButton decrButton
protected boolean isDragging
protected BasicScrollBarUI.TrackListener trackListener
protected BasicScrollBarUI.ArrowButtonListener buttonListener
protected BasicScrollBarUI.ModelListener modelListener
protected Rectangle thumbRect
protected Rectangle trackRect
protected int trackHighlight
protected static final int NO_HIGHLIGHT
protected static final int DECREASE_HIGHLIGHT
protected static final int INCREASE_HIGHLIGHT
protected BasicScrollBarUI.ScrollListener scrollListener
protected PropertyChangeListener propertyChangeListener
protected Timer scrollTimer
protected int scrollBarWidth
protected int incrGap
protected int decrGap
public static ComponentUI createUI(JComponent c)
protected void configureScrollBarColors()
public void installUI(JComponent c)
ComponentUIComponentUIインスタンスが、指定されたコンポーネントのUI委譲としてインストールされているときに呼び出されます。 このメソッドは、次を含むLook & Feel用のコンポーネントを完全に構成するべきです。 
 LayoutManagerをインストールする。
 PropertyChangeListenerを作成してコンポーネントにインストールする。
 installUI、クラスComponentUIc - UI委譲がインストールされるコンポーネントComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()public void uninstallUI(JComponent c)
ComponentUIinstallUI時に、指定されたコンポーネントに対して行われた構成を取り消します。 このメソッドは、このUIComponentインスタンスが、指定されたコンポーネントのUI委譲として削除されているときに呼び出されます。 このメソッドは、installUIによって実行された構成を元に戻すべきです。この場合、JComponentインスタンスをクリーンな状態(余分なリスナーや、Look & Feel固有のプロパティ・オブジェクトが残らないように)にするよう十分注意してください。 手順には次のものが含まれるべきです。 
 uninstallUI、クラスComponentUIc - このUI委譲が削除されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()protected void installDefaults()
protected void installComponents()
protected void uninstallComponents()
protected void installListeners()
protected void installKeyboardActions()
protected void uninstallKeyboardActions()
protected void uninstallListeners()
protected void uninstallDefaults()
protected BasicScrollBarUI.TrackListener createTrackListener()
protected BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()
protected BasicScrollBarUI.ModelListener createModelListener()
protected BasicScrollBarUI.ScrollListener createScrollListener()
protected PropertyChangeListener createPropertyChangeListener()
protected void setThumbRollover(boolean active)
active - trueは、つまみが現在アクティブであることを示します。public boolean isThumbRollover()
public void paint(Graphics g, JComponent c)
ComponentUIComponentUI.updateメソッドから呼び出されます。 サブクラスは、このメソッドをオーバーライドして、指定されたGraphicsオブジェクトを使ってコンポーネントの内容を描画するべきです。 paint、クラスComponentUIg - ペイント対象のGraphicsコンテキストc - ペイントされるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるComponentUI.update(java.awt.Graphics, javax.swing.JComponent)public Dimension getPreferredSize(JComponent c)
null以外)の推奨幅の最大値、およびつまみの最小幅です。 推奨される高さは、同じ部分の推奨される高さの総計です。 水平スクロール・バーの推奨されるサイズの原理も同様です。 
 
 preferredSizeは1回だけ計算されます。以後、このメソッドを呼び出すと、キャッシュに格納されたサイズ値が返されます。
getPreferredSize、クラスComponentUIc - このメソッドを委譲しているJScrollBargetMaximumSize(javax.swing.JComponent), ComponentUI.getMinimumSize(javax.swing.JComponent)public Dimension getMaximumSize(JComponent c)
ComponentUInullが返された場合、最大サイズは代わりにコンポーネントのレイアウト・マネージャによって計算されます(これは、特定のレイアウト・マネージャをインストールしてあるコンポーネントの場合に推奨する方法です)。 このメソッドのデフォルト実装はgetPreferredSizeを呼び出して、その値を返します。 getMaximumSize、クラスComponentUIc - このメソッドを委譲しているJScrollBar。ComponentUI.getMinimumSize(javax.swing.JComponent), getPreferredSize(javax.swing.JComponent)protected JButton createDecreaseButton(int orientation)
protected JButton createIncreaseButton(int orientation)
protected void paintDecreaseHighlight(Graphics g)
protected void paintIncreaseHighlight(Graphics g)
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
protected Dimension getMinimumThumbSize()
警告: このメソッドが返す値は変更しないでください。これは共有されるstatic定数です。
getMaximumThumbSize()protected Dimension getMaximumThumbSize()
getMinimumThumbSizeが同じ値を返すようにしてください。 
 警告: このメソッドが返す値は変更しないでください。これは共有されるstatic定数です。
getMinimumThumbSize()public void addLayoutComponent(String name, Component child)
LayoutManagercompを追加し、それをnameによって指定された文字列に関連付けます。addLayoutComponent、インタフェースLayoutManagername - コンポーネントに関連付けられる文字列child - 追加されるコンポーネントpublic void removeLayoutComponent(Component child)
LayoutManagerremoveLayoutComponent、インタフェースLayoutManagerchild - 削除されるコンポーネントpublic Dimension preferredLayoutSize(Container scrollbarContainer)
LayoutManagerpreferredLayoutSize、インタフェースLayoutManagerscrollbarContainer - レイアウトされるコンテナLayoutManager.minimumLayoutSize(java.awt.Container)public Dimension minimumLayoutSize(Container scrollbarContainer)
LayoutManagerminimumLayoutSize、インタフェースLayoutManagerscrollbarContainer - レイアウトされるコンポーネントLayoutManager.preferredLayoutSize(java.awt.Container)protected void layoutVScrollbar(JScrollBar sb)
protected void layoutHScrollbar(JScrollBar sb)
public void layoutContainer(Container scrollbarContainer)
LayoutManagerlayoutContainer、インタフェースLayoutManagerscrollbarContainer - レイアウトされるコンテナprotected void setThumbBounds(int x,
                              int y,
                              int width,
                              int height)
getThumbBounds()protected Rectangle getThumbBounds()
警告: このメソッドが返す値は変更しないでください。これは実際の矩形への参照です。コピーではありません。
setThumbBounds(int, int, int, int)protected Rectangle getTrackBounds()
警告: このメソッドが返す値は変更しないでください。これは実際の矩形への参照です。コピーではありません。
layoutContainer(java.awt.Container)protected void scrollByBlock(int direction)
protected void scrollByUnit(int direction)
public boolean getSupportsAbsolutePositioning()
 バグまたは機能を送信 
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。 
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved.  Use is subject to license terms.  Documentation Redistribution Policyも参照してください。