JavaTM 2 Platform
Std. Ed. v1.3

javax.swing.plaf.basic
クラス BasicScrollBarUI

java.lang.Object
  |
  +--javax.swing.plaf.ComponentUI
        |
        +--javax.swing.plaf.ScrollBarUI
              |
              +--javax.swing.plaf.basic.BasicScrollBarUI
すべての実装インタフェース:
LayoutManager, SwingConstants
直系の既知のサブクラス:
MetalScrollBarUI

public class BasicScrollBarUI
extends ScrollBarUI
implements LayoutManager, SwingConstants

基本 Look & Feel のための、ScrollBarUI の実装です。


内部クラスの概要
protected  class BasicScrollBarUI.ArrowButtonListener
          カーソルキーのリスナーです。
protected  class BasicScrollBarUI.ModelListener
          モデルの変更を待機するリスナーです。
 class BasicScrollBarUI.PropertyChangeHandler
           
protected  class BasicScrollBarUI.ScrollListener
          ScrollPane で発生したイベントをスクロールするためのリスナーです。
protected  class BasicScrollBarUI.TrackListener
          マウスのドラッグを追跡します。
 
フィールドの概要
protected  BasicScrollBarUI.ArrowButtonListener buttonListener
           
protected  JButton decrButton
           
protected static int DECREASE_HIGHLIGHT
           
protected  JButton incrButton
           
protected static int INCREASE_HIGHLIGHT
           
protected  boolean isDragging
           
protected  Dimension maximumThumbSize
           
protected  Dimension minimumThumbSize
           
protected  BasicScrollBarUI.ModelListener modelListener
           
protected static int NO_HIGHLIGHT
           
protected  PropertyChangeListener propertyChangeListener
           
protected  JScrollBar scrollbar
           
protected  BasicScrollBarUI.ScrollListener scrollListener
           
protected  Timer scrollTimer
           
protected  Color thumbColor
           
protected  Color thumbDarkShadowColor
           
protected  Color thumbHighlightColor
           
protected  Color thumbLightShadowColor
           
protected  Rectangle thumbRect
           
protected  Color trackColor
           
protected  int trackHighlight
           
protected  Color trackHighlightColor
           
protected  BasicScrollBarUI.TrackListener trackListener
           
protected  Rectangle trackRect
           
 
インタフェース javax.swing.SwingConstants から継承したフィールド
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
コンストラクタの概要
BasicScrollBarUI()
           
 
メソッドの概要
 void addLayoutComponent(String name, Component child)
          指定された名前で、指定されたコンポーネントをレイアウトに追加します。
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)
           
protected  Dimension getMaximumThumbSize()
          サムに許容される最大のサイズを返します。
 Dimension getMinimumSize(JComponent c)
          垂直スクロールバーの最小幅は、増分ボタンおよび減分ボタンの最小幅 (null 以外) の最大値、およびサムの最小幅です。
protected  Dimension getMinimumThumbSize()
          サムに許容される最小のサイズを返します。
 Dimension getPreferredSize(JComponent c)
          垂直スクロールバーの適切な幅は、増分ボタンおよび減分ボタンの適切な幅 (null 以外) の最大値、およびサムの最小幅です。
protected  Rectangle getThumbBounds()
          サムの現在のサイズおよび位置を返します。
protected  Rectangle getTrackBounds()
          トラックの現在の境界を返します。
protected  void installComponents()
           
protected  void installDefaults()
           
protected  void installKeyboardActions()
           
protected  void installListeners()
           
 void installUI(JComponent c)
           
 void layoutContainer(Container scrollbarContainer)
          指定されたパネルにコンテナを配置します。
protected  void layoutHScrollbar(JScrollBar sb)
           
protected  void layoutVScrollbar(JScrollBar sb)
           
 Dimension minimumLayoutSize(Container scrollbarContainer)
          指定された親コンテナにコンポーネントを配置した時のパネルの最小サイズを計算します。
 void paint(Graphics g, JComponent c)
           
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)
          サムの境界を設定し、古いサムの境界と新しいサムの境界を含む、再ペイントを強制します。
protected  void uninstallComponents()
           
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
           
protected  void uninstallListeners()
           
 void uninstallUI(JComponent c)
           
 
クラス javax.swing.plaf.ComponentUI から継承したメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

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

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
コンストラクタの詳細

BasicScrollBarUI

public BasicScrollBarUI()
メソッドの詳細

createUI

public static ComponentUI createUI(JComponent c)

configureScrollBarColors

protected void configureScrollBarColors()

installUI

public void installUI(JComponent c)
オーバーライド:
クラス ComponentUI 内の installUI

uninstallUI

public void uninstallUI(JComponent c)
オーバーライド:
クラス ComponentUI 内の uninstallUI

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()

paint

public void paint(Graphics g,
                  JComponent c)
オーバーライド:
クラス ComponentUI 内の paint

getPreferredSize

public Dimension getPreferredSize(JComponent c)
垂直スクロールバーの適切な幅は、増分ボタンおよび減分ボタンの適切な幅 (null 以外) の最大値、およびサムの最小幅です。適切な高さは、これらのコンポーネントの適切な高さの総計です。水平スクロールバーの適切なサイズも、これらのコンポーネントに基づいて決まります。

適切なサイズは 1 回だけ計算されます。以後、このメソッドを呼び出すと、キャッシュに格納されたサイズ値が返されます。

オーバーライド:
クラス ComponentUI 内の getPreferredSize
パラメータ:
c - このメソッドを委譲している JScrollBar
戻り値:
Basic JScrollBar の適切なサイズ
関連項目:
getMaximumSize(javax.swing.JComponent), getMinimumSize(javax.swing.JComponent)

getMinimumSize

public Dimension getMinimumSize(JComponent c)
垂直スクロールバーの最小幅は、増分ボタンおよび減分ボタンの最小幅 (null 以外) の最大値、およびサムの最小幅です。最小の高さは、これらのコンポーンネントの最小の高さの総計です。水平スクロールバーの適切なサイズも、これらのコンポーネントに基づいて決まります。

minimumSize は 1 回だけ計算されます。以後、このメソッドを呼び出しても、キャッシュに格納されたサイズ値が返されます。

オーバーライド:
クラス ComponentUI 内の getMinimumSize
パラメータ:
c - このメソッドを委譲している JScrollBar
戻り値:
基本 JScrollBar の最小サイズ
関連項目:
getMaximumSize(javax.swing.JComponent), getPreferredSize(javax.swing.JComponent)

getMaximumSize

public Dimension getMaximumSize(JComponent c)
オーバーライド:
クラス ComponentUI 内の getMaximumSize
パラメータ:
c - このメソッドを委譲している JScrollBar
戻り値:
new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
関連項目:
getMinimumSize(javax.swing.JComponent), getPreferredSize(javax.swing.JComponent)

createDecreaseButton

protected JButton createDecreaseButton(int orientation)

createIncreaseButton

protected JButton createIncreaseButton(int orientation)

paintDecreaseHighlight

protected void paintDecreaseHighlight(Graphics g)

paintIncreaseHighlight

protected void paintIncreaseHighlight(Graphics g)

paintTrack

protected void paintTrack(Graphics g,
                          JComponent c,
                          Rectangle trackBounds)

paintThumb

protected void paintThumb(Graphics g,
                          JComponent c,
                          Rectangle thumbBounds)

getMinimumThumbSize

protected Dimension getMinimumThumbSize()
サムに許容される最小のサイズを返します。スクロールバーが小さすぎてこのサイズでは利用できない場合、サムは隠されます。

警告: このメソッドが返す値は変更しないでください。これは共有される静的定数です。

戻り値:
サムに許容できる最小のサイズ
関連項目:
getMaximumThumbSize()

getMaximumThumbSize

protected Dimension getMaximumThumbSize()
サムに許容される最大のサイズを返します。固定サイズのサムを作成するには、このメソッドを作成すると getMinimumThumbSize が同じ値を返します。

警告: このメソッドが返す値は変更しないでください。これは共有される静的定数です。

戻り値:
サムに許容できる最大のサイズ
関連項目:
getMinimumThumbSize()

addLayoutComponent

public void addLayoutComponent(String name,
                               Component child)
インタフェース LayoutManager の記述:
指定された名前で、指定されたコンポーネントをレイアウトに追加します。
定義:
インタフェース LayoutManager 内の addLayoutComponent
インタフェース java.awt.LayoutManager からコピーされたタグ:
パラメータ:
name - コンポーネントの名前
comp - 追加されるコンポーネント

removeLayoutComponent

public void removeLayoutComponent(Component child)
インタフェース LayoutManager の記述:
指定されたコンポーネントをレイアウトから削除します。
定義:
インタフェース LayoutManager 内の removeLayoutComponent
インタフェース java.awt.LayoutManager からコピーされたタグ:
パラメータ:
comp - 削除されるコンポーネント

preferredLayoutSize

public Dimension preferredLayoutSize(Container scrollbarContainer)
インタフェース LayoutManager の記述:
指定された親コンテナにコンポーネントを配置した時のパネルの推奨サイズを計算します。
定義:
インタフェース LayoutManager 内の preferredLayoutSize
インタフェース java.awt.LayoutManager からコピーされたタグ:
パラメータ:
parent - 配置されるコンポーネント
関連項目:
LayoutManager.minimumLayoutSize(java.awt.Container)

minimumLayoutSize

public Dimension minimumLayoutSize(Container scrollbarContainer)
インタフェース LayoutManager の記述:
指定された親コンテナにコンポーネントを配置した時のパネルの最小サイズを計算します。
定義:
インタフェース LayoutManager 内の minimumLayoutSize
インタフェース java.awt.LayoutManager からコピーされたタグ:
パラメータ:
parent - 配置されるコンポーネント
関連項目:
LayoutManager.preferredLayoutSize(java.awt.Container)

layoutVScrollbar

protected void layoutVScrollbar(JScrollBar sb)

layoutHScrollbar

protected void layoutHScrollbar(JScrollBar sb)

layoutContainer

public void layoutContainer(Container scrollbarContainer)
インタフェース LayoutManager の記述:
指定されたパネルにコンテナを配置します。
定義:
インタフェース LayoutManager 内の layoutContainer
インタフェース java.awt.LayoutManager からコピーされたタグ:
パラメータ:
parent - レイアウトする必要があるコンポーネント

setThumbBounds

protected void setThumbBounds(int x,
                              int y,
                              int width,
                              int 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)

scrollByUnit

protected void scrollByUnit(int direction)

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.