Java プラットフォーム 1.2

javax.swing.plaf.basic
クラス BasicScrollBarUI

java.lang.Object
  |
  +--javax.swing.plaf.ComponentUI
        |
        +--javax.swing.plaf.ScrollBarUI
              |
              +--javax.swing.plaf.basic.BasicScrollBarUI
直接の既知のサブクラス:
MetalScrollBarUI

public class BasicScrollBarUI
extends ScrollBarUI
implements LayoutManager, SwingConstants

Basic 仕様 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
           
 
コンストラクタの概要
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 回だけ計算されます。以後、このメソッドを呼び出すと、キャッシュに格納されたサイズ値が返されます。

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

getMinimumSize

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

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

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

getMaximumSize

public Dimension getMaximumSize(JComponent c)
パラメータ:
c - このメソッドを委譲している JScrollBar
戻り値:
新しい Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
オーバーライド:
クラス ComponentUI 内の getMaximumSize
関連項目:
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 内の addLayoutComponent

removeLayoutComponent

public void removeLayoutComponent(Component child)
定義:
インタフェース LayoutManager 内の removeLayoutComponent

preferredLayoutSize

public Dimension preferredLayoutSize(Container scrollbarContainer)
定義:
インタフェース LayoutManager 内の preferredLayoutSize

minimumLayoutSize

public Dimension minimumLayoutSize(Container scrollbarContainer)
定義:
インタフェース LayoutManager 内の minimumLayoutSize

layoutVScrollbar

protected void layoutVScrollbar(JScrollBar sb)

layoutHScrollbar

protected void layoutHScrollbar(JScrollBar sb)

layoutContainer

public void layoutContainer(Container scrollbarContainer)
定義:
インタフェース LayoutManager 内の layoutContainer

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)

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.