org.gerhardb.lib.playlist
Class Scroller

java.lang.Object
  extended by org.gerhardb.lib.playlist.Scroller
All Implemented Interfaces:
javax.swing.BoundedRangeModel, javax.swing.ListModel

public class Scroller
extends java.lang.Object
implements javax.swing.ListModel, javax.swing.BoundedRangeModel

Commands to scroll among a group of pages. Used for making a slide show with sound. Class is a singleton.


Field Summary
static Scroller gblScroller
           
static int SORT_DATE
           
static int SORT_LENGTH
           
static int SORT_NAME_CASE_INSENSATIVE
           
static int SORT_NAME_CASE_SENSATIVE
           
static int SORT_OFF
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener x)
           
 void addListDataListener(javax.swing.event.ListDataListener l)
           
 void addScrollerListener(ScrollerListener x)
           
 void addSlideShowListener(SlideShowListener l)
           
 void doSort(boolean realSort)
           
 void down()
           
 void editedImage()
          Does not reset the slider.
 void end()
           
 void forceFocus()
           
 java.awt.image.BufferedImage getBeyondBounds()
           
 javax.swing.ImageIcon getBeyondBoundsIcon()
           
 java.io.File getCurrentFile()
           
 java.awt.image.BufferedImage getCurrentImage()
           
 IOImage getCurrentIOImage()
           
 java.lang.String getDescription()
           
 java.lang.Object getElementAt(int index)
           
 int getExtent()
           
 java.io.File getFile(int index)
           
 java.awt.Component getFocusComponent()
           
 ListMaker getListMaker()
           
 int getMaximum()
          Min and max are zero based which works well for the JSlider.
 int getMaximumZeroBased()
           
 int getMinimum()
           
 java.awt.event.MouseWheelListener getMouseWheelListener()
           
 java.io.File[] getPictureFiles()
           
 ScrollerKeyListener getScrollerKeyListener()
           
 java.awt.event.KeyListener getShowViewKeyListener()
           
 int getSize()
           
 int getSlideFlipDelay()
           
 java.io.File[] getSortedFiles()
           
 java.lang.String getStatusBarCount()
           
 java.lang.String getStatusBarFileName()
           
 int getValue()
           
 boolean getValueIsAdjusting()
           
 int getValueZeroBased()
           
 void home()
           
 boolean isBeyond()
           
 boolean isSlideShowRunning()
           
 void jumpTo(int index)
          Jump to a particular index.
 boolean jumpTo(java.lang.Object jumpTo)
          Jump to a particular object.
 void jumpToPercent(int jumpTo)
          Jumps to some percentage down the list.
 void pageDown()
           
 void pageUp()
           
 void refreshCurrentImage()
           
 void reloadScroller()
           
 void reloadScroller(int index)
           
 void removeChangeListener(javax.swing.event.ChangeListener x)
           
 void removeCurrentPage()
          Used for DnD.
 void removeListDataListener(javax.swing.event.ListDataListener l)
           
 void removeScrollerListener(ScrollerListener x)
           
 void removeSlideShowListener(SlideShowListener l)
           
 void requestFocus()
           
 void selectFile(java.io.File file)
           
 void setAutoFocus(java.awt.Component focus)
          Component to get focus when value is changed.
 void setEndMessages(boolean showEndMessages)
           
 void setExtent(int newExtent)
           
 void setFrame(javax.swing.JFrame frame)
           
 void setListMaker(ListMaker lm)
           
 void setListSelectionModel(FileListSelectionModel sm)
           
 void setMaximum(int newMaximum)
           
 void setMinimum(int newMinimum)
           
 void setPageSize(int pageSize)
          Set File size.
 void setRangeProperties(int value, int extent, int min, int max, boolean adjusting)
           
 void setShowViewKeyListener(java.awt.event.KeyListener k)
           
 void setSlideFlipDelay(int millisedonds)
           
 void setValue(int newValue)
           
 void setValueIsAdjusting(boolean b)
           
 void sort(int type)
           
 void startSlideShow(boolean continuous)
           
 void stopSlideShow()
           
 void up()
           
 void updateSelectionInterval()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gblScroller

public static final Scroller gblScroller

SORT_OFF

public static final int SORT_OFF
See Also:
Constant Field Values

SORT_NAME_CASE_INSENSATIVE

public static final int SORT_NAME_CASE_INSENSATIVE
See Also:
Constant Field Values

SORT_NAME_CASE_SENSATIVE

public static final int SORT_NAME_CASE_SENSATIVE
See Also:
Constant Field Values

SORT_DATE

public static final int SORT_DATE
See Also:
Constant Field Values

SORT_LENGTH

public static final int SORT_LENGTH
See Also:
Constant Field Values
Method Detail

setListMaker

public void setListMaker(ListMaker lm)

setListSelectionModel

public void setListSelectionModel(FileListSelectionModel sm)

updateSelectionInterval

public void updateSelectionInterval()

getListMaker

public ListMaker getListMaker()

getDescription

public java.lang.String getDescription()

getScrollerKeyListener

public ScrollerKeyListener getScrollerKeyListener()

getStatusBarCount

public java.lang.String getStatusBarCount()

getStatusBarFileName

public java.lang.String getStatusBarFileName()

setShowViewKeyListener

public void setShowViewKeyListener(java.awt.event.KeyListener k)

getShowViewKeyListener

public java.awt.event.KeyListener getShowViewKeyListener()

setEndMessages

public void setEndMessages(boolean showEndMessages)

getSortedFiles

public java.io.File[] getSortedFiles()

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener l)
Specified by:
addListDataListener in interface javax.swing.ListModel

getElementAt

public java.lang.Object getElementAt(int index)
Specified by:
getElementAt in interface javax.swing.ListModel

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener l)
Specified by:
removeListDataListener in interface javax.swing.ListModel

getValueZeroBased

public int getValueZeroBased()

getMaximumZeroBased

public int getMaximumZeroBased()

getValue

public int getValue()
Specified by:
getValue in interface javax.swing.BoundedRangeModel

getMaximum

public int getMaximum()
Min and max are zero based which works well for the JSlider.

Specified by:
getMaximum in interface javax.swing.BoundedRangeModel
Returns:
-1 if no items

getMinimum

public int getMinimum()
Specified by:
getMinimum in interface javax.swing.BoundedRangeModel

setValue

public void setValue(int newValue)
Specified by:
setValue in interface javax.swing.BoundedRangeModel
Parameters:
newValue - Invalid values are silently ignored.

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener x)
Specified by:
addChangeListener in interface javax.swing.BoundedRangeModel

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener x)
Specified by:
removeChangeListener in interface javax.swing.BoundedRangeModel

getExtent

public int getExtent()
Specified by:
getExtent in interface javax.swing.BoundedRangeModel

getValueIsAdjusting

public boolean getValueIsAdjusting()
Specified by:
getValueIsAdjusting in interface javax.swing.BoundedRangeModel

setValueIsAdjusting

public void setValueIsAdjusting(boolean b)
Specified by:
setValueIsAdjusting in interface javax.swing.BoundedRangeModel

setRangeProperties

public void setRangeProperties(int value,
                               int extent,
                               int min,
                               int max,
                               boolean adjusting)
Specified by:
setRangeProperties in interface javax.swing.BoundedRangeModel

setExtent

public void setExtent(int newExtent)
Specified by:
setExtent in interface javax.swing.BoundedRangeModel

setMaximum

public void setMaximum(int newMaximum)
Specified by:
setMaximum in interface javax.swing.BoundedRangeModel

setMinimum

public void setMinimum(int newMinimum)
Specified by:
setMinimum in interface javax.swing.BoundedRangeModel

sort

public void sort(int type)

doSort

public void doSort(boolean realSort)

getCurrentFile

public java.io.File getCurrentFile()

getFile

public java.io.File getFile(int index)

reloadScroller

public void reloadScroller()

selectFile

public void selectFile(java.io.File file)

reloadScroller

public void reloadScroller(int index)

removeCurrentPage

public void removeCurrentPage()
Used for DnD. Note that it only removes from scroll list, not the physical File.


getPictureFiles

public java.io.File[] getPictureFiles()

setPageSize

public void setPageSize(int pageSize)
Set File size.

Parameters:
pageSize - How many items File up and File down should Scroller.

up

public void up()

down

public void down()

pageUp

public void pageUp()

pageDown

public void pageDown()

home

public void home()

end

public void end()

jumpToPercent

public void jumpToPercent(int jumpTo)
Jumps to some percentage down the list.

Parameters:
jumpTo - between 0 and 100

jumpTo

public boolean jumpTo(java.lang.Object jumpTo)
Jump to a particular object.

Parameters:
jumpTo - where to jump
Returns:
true if jump worked

jumpTo

public void jumpTo(int index)
Jump to a particular index.

Parameters:
index - where to jump

addSlideShowListener

public void addSlideShowListener(SlideShowListener l)

removeSlideShowListener

public void removeSlideShowListener(SlideShowListener l)

startSlideShow

public void startSlideShow(boolean continuous)

stopSlideShow

public void stopSlideShow()

isSlideShowRunning

public boolean isSlideShowRunning()

setFrame

public void setFrame(javax.swing.JFrame frame)

setAutoFocus

public void setAutoFocus(java.awt.Component focus)
Component to get focus when value is changed.

Parameters:
focus - what get focus

requestFocus

public void requestFocus()

forceFocus

public void forceFocus()

getFocusComponent

public java.awt.Component getFocusComponent()

refreshCurrentImage

public void refreshCurrentImage()

getCurrentIOImage

public IOImage getCurrentIOImage()

getCurrentImage

public java.awt.image.BufferedImage getCurrentImage()

addScrollerListener

public void addScrollerListener(ScrollerListener x)

removeScrollerListener

public void removeScrollerListener(ScrollerListener x)

setSlideFlipDelay

public void setSlideFlipDelay(int millisedonds)

getSlideFlipDelay

public int getSlideFlipDelay()

getMouseWheelListener

public java.awt.event.MouseWheelListener getMouseWheelListener()

isBeyond

public boolean isBeyond()

getBeyondBounds

public java.awt.image.BufferedImage getBeyondBounds()

getBeyondBoundsIcon

public javax.swing.ImageIcon getBeyondBoundsIcon()

editedImage

public void editedImage()
Does not reset the slider.



Copyright ? 2007 Gerhard Beck. All rights reserved. Subject to GPL.