de.muntjak.tinylookandfeel
Class TinyScrollBarUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ScrollBarUI
          extended by javax.swing.plaf.basic.BasicScrollBarUI
              extended by de.muntjak.tinylookandfeel.TinyScrollBarUI
All Implemented Interfaces:
java.awt.LayoutManager, javax.swing.SwingConstants

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

TinyScrollBarUI


Nested Class Summary
protected  class TinyScrollBarUI.MyTrackListener
          Basically does BasicScrollBarUI.TrackListener the right job, it just needs an additional repaint and rollover management
protected  class TinyScrollBarUI.OrientationChangeListener
           
 
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 isRollover
          true if thumb is in rollover state
protected  boolean wasRollover
          true if thumb was in rollover state
 
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
TinyScrollBarUI()
           
 
Method Summary
static void clearCache()
           
protected  javax.swing.JButton createDecreaseButton(int orientation)
          Creates the decrease button of the scrollbar.
protected  javax.swing.JButton createIncreaseButton(int orientation)
          Creates the increase button of the scrollbar.
protected  javax.swing.plaf.basic.BasicScrollBarUI.TrackListener createTrackListener()
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Creates the UI delegate for the given component.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
           
protected  void installDefaults()
          Installs some default values.
 boolean isThumbVisible()
          A return value of true signals that scrollbar buttons shall be painted enabled whereas a return value of false signals that scrollbar buttons shall be painted disabled.
protected  void layoutHScrollbar(javax.swing.JScrollBar sb)
           
protected  void layoutVScrollbar(javax.swing.JScrollBar sb)
           
 void paintThumb(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle thumbBounds)
           
 void paintTrack(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle trackBounds)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicScrollBarUI
addLayoutComponent, configureScrollBarColors, createArrowButtonListener, createModelListener, createPropertyChangeListener, createScrollListener, getMaximumSize, getMaximumThumbSize, getMinimumThumbSize, getSupportsAbsolutePositioning, getThumbBounds, getTrackBounds, installComponents, installKeyboardActions, installListeners, installUI, isThumbRollover, layoutContainer, minimumLayoutSize, paint, paintDecreaseHighlight, paintIncreaseHighlight, preferredLayoutSize, removeLayoutComponent, scrollByBlock, scrollByUnit, 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

isRollover

protected boolean isRollover
true if thumb is in rollover state


wasRollover

protected boolean wasRollover
true if thumb was in rollover state

Constructor Detail

TinyScrollBarUI

public TinyScrollBarUI()
Method Detail

clearCache

public static void clearCache()

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

installDefaults

protected void installDefaults()
Installs some default values.

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

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Creates the UI delegate for the given component.

Parameters:
mainColor - The component to create its UI delegate.
Returns:
The UI delegate for the given component.

createDecreaseButton

protected javax.swing.JButton createDecreaseButton(int orientation)
Creates the decrease button of the scrollbar.

Overrides:
createDecreaseButton in class javax.swing.plaf.basic.BasicScrollBarUI
Parameters:
orientation - The button's orientation.
Returns:
The created button.

createIncreaseButton

protected javax.swing.JButton createIncreaseButton(int orientation)
Creates the increase button of the scrollbar.

Overrides:
createIncreaseButton in class javax.swing.plaf.basic.BasicScrollBarUI
Parameters:
orientation - The button's orientation.
Returns:
The created button.

getPreferredSize

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

paintTrack

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

paintThumb

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

isThumbVisible

public boolean isThumbVisible()
A return value of true signals that scrollbar buttons shall be painted enabled whereas a return value of false signals that scrollbar buttons shall be painted disabled.

Returns:
true if thumb is visible, false otherwise.

createTrackListener

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