Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua
Class QuaquaScrollBarUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ScrollBarUI
          extended by javax.swing.plaf.basic.BasicScrollBarUI
              extended by ch.randelshofer.quaqua.QuaquaScrollBarUI
All Implemented Interfaces:
java.awt.LayoutManager, javax.swing.SwingConstants

public class QuaquaScrollBarUI
extends javax.swing.plaf.basic.BasicScrollBarUI

QuaquaScrollBarUI.

Version:
$Id: QuaquaScrollBarUI.java 378 2011-02-15 10:08:36Z wrandelshofer $
Author:
Werner Randelshofer

Nested Class Summary
protected  class QuaquaScrollBarUI.QuaquaArrowButtonListener
          Listener for cursor keys.
 class QuaquaScrollBarUI.QuaquaPropertyChangeHandler
           
protected  class QuaquaScrollBarUI.QuaquaScrollListener
          Listener for scrolling events initiated in the ScrollPane.
protected  class QuaquaScrollBarUI.QuaquaTrackListener
           
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicScrollBarUI
javax.swing.plaf.basic.BasicScrollBarUI.ArrowButtonListener, javax.swing.plaf.basic.BasicScrollBarUI.ModelListener, javax.swing.plaf.basic.BasicScrollBarUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicScrollBarUI.ScrollListener, javax.swing.plaf.basic.BasicScrollBarUI.TrackListener
 
Field Summary
protected  boolean isPlaceButtonsTogether
           
protected  java.awt.Dimension smallMinimumThumbSize
           
 
Fields inherited from class javax.swing.plaf.basic.BasicScrollBarUI
buttonListener, decrButton, DECREASE_HIGHLIGHT, incrButton, INCREASE_HIGHLIGHT, isDragging, maximumThumbSize, minimumThumbSize, modelListener, NO_HIGHLIGHT, propertyChangeListener, scrollbar, scrollListener, scrollTimer, thumbColor, thumbDarkShadowColor, thumbHighlightColor, thumbLightShadowColor, thumbRect, trackColor, trackHighlight, trackHighlightColor, trackListener, trackRect
 
Fields inherited from interface 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
 
Constructor Summary
QuaquaScrollBarUI()
          Creates a new instance.
 
Method Summary
protected  javax.swing.plaf.basic.BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()
           
protected  javax.swing.JButton createDecreaseButton(int orientation)
           
protected  javax.swing.JButton createIncreaseButton(int orientation)
           
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
           
protected  javax.swing.plaf.basic.BasicScrollBarUI.ScrollListener createScrollListener()
           
protected  javax.swing.plaf.basic.BasicScrollBarUI.TrackListener createTrackListener()
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
 java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
           
protected  java.awt.Dimension getMaximumThumbSize()
          Return the largest acceptable size for the thumb.
protected  java.awt.Dimension getMinimumThumbSize()
          Return the smallest acceptable size for the thumb.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
           
 boolean getSupportsAbsolutePositioning()
          Indicates whether the user can absolutely position the offset with a mouse click (depending on the settings in "Appearance" panel of " the "System Preferences" application).
protected  javax.swing.border.Border getTrackAndButtonsBorder()
          We use a border to fill the background of the scroll bar.
protected  void installDefaults()
           
protected  void layoutHScrollbar(javax.swing.JScrollBar sb)
           
protected  void layoutVScrollbar(javax.swing.JScrollBar sb)
           
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
           
protected  void paintThumb(java.awt.Graphics gr, javax.swing.JComponent c, java.awt.Rectangle thumbBounds)
           
protected  void paintTrack(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle trackBounds)
          This method actually paints the track plus the button artwork.
protected  void scrollByBlock(int direction)
           
protected  void scrollByUnit(int direction)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicScrollBarUI
addLayoutComponent, configureScrollBarColors, createModelListener, getThumbBounds, getTrackBounds, installComponents, installKeyboardActions, installListeners, installUI, isThumbRollover, layoutContainer, minimumLayoutSize, paintDecreaseHighlight, paintIncreaseHighlight, preferredLayoutSize, removeLayoutComponent, setThumbBounds, setThumbRollover, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

smallMinimumThumbSize

protected java.awt.Dimension smallMinimumThumbSize

isPlaceButtonsTogether

protected boolean isPlaceButtonsTogether
Constructor Detail

QuaquaScrollBarUI

public QuaquaScrollBarUI()
Creates a new instance.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicScrollBarUI

createTrackListener

protected javax.swing.plaf.basic.BasicScrollBarUI.TrackListener createTrackListener()
Overrides:
createTrackListener in class javax.swing.plaf.basic.BasicScrollBarUI

createArrowButtonListener

protected javax.swing.plaf.basic.BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()
Overrides:
createArrowButtonListener in class javax.swing.plaf.basic.BasicScrollBarUI

createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()
Overrides:
createPropertyChangeListener in class javax.swing.plaf.basic.BasicScrollBarUI

createDecreaseButton

protected javax.swing.JButton createDecreaseButton(int orientation)
Overrides:
createDecreaseButton in class javax.swing.plaf.basic.BasicScrollBarUI

createIncreaseButton

protected javax.swing.JButton createIncreaseButton(int orientation)
Overrides:
createIncreaseButton in class javax.swing.plaf.basic.BasicScrollBarUI

createScrollListener

protected javax.swing.plaf.basic.BasicScrollBarUI.ScrollListener createScrollListener()
Overrides:
createScrollListener in class javax.swing.plaf.basic.BasicScrollBarUI

getMinimumThumbSize

protected java.awt.Dimension getMinimumThumbSize()
Return the smallest acceptable size for the thumb. If the scrollbar becomes so small that this size isn't available, the thumb will be hidden.

Warning : the value returned by this method should not be be modified, it's a shared static constant.

Overrides:
getMinimumThumbSize in class javax.swing.plaf.basic.BasicScrollBarUI
Returns:
The smallest acceptable size for the thumb.
See Also:
getMaximumThumbSize()

getMaximumSize

public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
Overrides:
getMaximumSize in class javax.swing.plaf.basic.BasicScrollBarUI

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Overrides:
getPreferredSize in class javax.swing.plaf.basic.BasicScrollBarUI

getMaximumThumbSize

protected java.awt.Dimension getMaximumThumbSize()
Return the largest acceptable size for the thumb. To create a fixed size thumb one make this method and getMinimumThumbSize return the same value.

Warning : the value returned by this method should not be be modified, it's a shared static constant.

Overrides:
getMaximumThumbSize in class javax.swing.plaf.basic.BasicScrollBarUI
Returns:
The largest acceptable size for the thumb.
See Also:
getMinimumThumbSize()

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Overrides:
paint in class javax.swing.plaf.basic.BasicScrollBarUI

paintThumb

protected void paintThumb(java.awt.Graphics gr,
                          javax.swing.JComponent c,
                          java.awt.Rectangle thumbBounds)
Overrides:
paintThumb in class javax.swing.plaf.basic.BasicScrollBarUI

paintTrack

protected void paintTrack(java.awt.Graphics g,
                          javax.swing.JComponent c,
                          java.awt.Rectangle trackBounds)
This method actually paints the track plus the button artwork.

Overrides:
paintTrack in class javax.swing.plaf.basic.BasicScrollBarUI

getTrackAndButtonsBorder

protected javax.swing.border.Border getTrackAndButtonsBorder()
We use a border to fill the background of the scroll bar. The border contains the track and the buttons in their current visual representation depending on the various states of the scroll bar ('enabled','pressed','inactive').


getSupportsAbsolutePositioning

public boolean getSupportsAbsolutePositioning()
Indicates whether the user can absolutely position the offset with a mouse click (depending on the settings in "Appearance" panel of " the "System Preferences" application).

The return value is determined from the UIManager property ScrollBar.allowsAbsolutePositioning.

Overrides:
getSupportsAbsolutePositioning in class javax.swing.plaf.basic.BasicScrollBarUI

layoutVScrollbar

protected void layoutVScrollbar(javax.swing.JScrollBar sb)
Overrides:
layoutVScrollbar in class javax.swing.plaf.basic.BasicScrollBarUI

layoutHScrollbar

protected void layoutHScrollbar(javax.swing.JScrollBar sb)
Overrides:
layoutHScrollbar in class javax.swing.plaf.basic.BasicScrollBarUI

scrollByUnit

protected void scrollByUnit(int direction)
Overrides:
scrollByUnit in class javax.swing.plaf.basic.BasicScrollBarUI

scrollByBlock

protected void scrollByBlock(int direction)
Overrides:
scrollByBlock in class javax.swing.plaf.basic.BasicScrollBarUI

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.