openpiano.control
Class PositionSliderUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.SliderUI
          extended by javax.swing.plaf.basic.BasicSliderUI
              extended by javax.swing.plaf.metal.MetalSliderUI
                  extended by openpiano.control.PositionSliderUI

public class PositionSliderUI
extends MetalSliderUI

A modified version of the MetalSliderUI

Version:
1.0, 07/30/08
Author:
Sascha Westermann

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicSliderUI
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicSliderUI
MAX_SCROLL, MIN_SCROLL, NEGATIVE_SCROLL, POSITIVE_SCROLL
 
Constructor Summary
PositionSliderUI()
          Creates a new UI for a slider
 
Method Summary
 int getMiddleOfThumb()
          Calculates the middle of a slider thumb
 void paintTrack(Graphics g)
          Paints the track on the slider
 void setEndMarker(int value, JSlider slider)
          Sets an end marker according to a value
 void setEndMarker(JSlider slider)
          Sets an end marker according to a slider's value
 void setStartMarker(int value, JSlider slider)
          Sets a start marker according to a value
 void setStartMarker(JSlider slider)
          Sets a start marker according to a slider's value
 
Methods inherited from class javax.swing.plaf.metal.MetalSliderUI
createUI, getTickLength, installUI, paintFocus, paintThumb
 
Methods inherited from class javax.swing.plaf.basic.BasicSliderUI
getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredSize, getPreferredVerticalSize, paint, paintLabels, paintTicks, scrollByBlock, scrollByUnit, setThumbLocation, uninstallUI, valueForXPosition, valueForYPosition
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionSliderUI

public PositionSliderUI()
Creates a new UI for a slider

Method Detail

paintTrack

public void paintTrack(Graphics g)
Paints the track on the slider

Overrides:
paintTrack in class MetalSliderUI

setStartMarker

public void setStartMarker(JSlider slider)
Sets a start marker according to a slider's value

Parameters:
slider - the slider which value is used

setStartMarker

public void setStartMarker(int value,
                           JSlider slider)
Sets a start marker according to a value

Parameters:
value - the value to set the marker to
slider - the relevant slider

getMiddleOfThumb

public int getMiddleOfThumb()
Calculates the middle of a slider thumb

Returns:
the middle of a slider thumb

setEndMarker

public void setEndMarker(JSlider slider)
Sets an end marker according to a slider's value

Parameters:
slider - the slider which value is used

setEndMarker

public void setEndMarker(int value,
                         JSlider slider)
Sets an end marker according to a value

Parameters:
value - the value to set the marker to
slider - the relevant slider