org.gerhardb.lib.playlist
Class Scroller

java.lang.Object
  extended byorg.gerhardb.lib.playlist.Scroller
All Implemented Interfaces:
javax.swing.BoundedRangeModel, java.util.EventListener, java.awt.event.KeyListener, javax.swing.ListModel

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

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
           
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 down()
           
 boolean down(boolean showEndMessage)
           
 void end()
           
 javax.swing.ImageIcon getBeyondBounds()
           
 java.awt.image.BufferedImage getCurrentImage()
           
 java.io.File getCurrentImageFile()
           
 IOImage getCurrentIOImage()
           
 Page getCurrentPage()
           
 java.lang.Object getElementAt(int index)
           
 int getExtent()
           
 int getMaximum()
          Min and max are zero based which works well for the JSlider.
 int getMinimum()
           
 java.awt.event.MouseWheelListener getMouseWheelListener()
           
 javax.swing.Action getSavePictureAction()
           
 int getSize()
           
 int getSlideFlipDelay()
           
 int getValue()
           
 boolean getValueIsAdjusting()
           
 boolean grow()
           
 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 keyPressed(java.awt.event.KeyEvent event)
           
 void keyReleased(java.awt.event.KeyEvent event)
           
 void keyTyped(java.awt.event.KeyEvent event)
           
 void pageDown()
           
 void pageUp()
           
 void refreshCurrentImage()
           
 void reload()
           
 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()
           
 boolean rotateLeft()
           
 boolean rotateRight()
           
 void save()
           
 void setAutoFocus(java.awt.Component focus)
          Componet to get focus when value is changed.
 void setCanEnableSave(boolean b)
           
 void setExtent(int newExtent)
           
 void setListMaker(ListMaker lm)
           
 void setMaximum(int newMaximum)
           
 void setMinimum(int newMinimum)
           
 void setPageSize(int pageSize)
          Set page size.
 void setRangeProperties(int value, int extent, int min, int max, boolean adjusting)
           
 void setSlideFlipDelay(int millisedonds)
           
 void setValue(int newValue)
           
 void setValueIsAdjusting(boolean b)
           
 boolean shrink()
           
 void sort(int type)
           
 void startSlideShow(java.awt.Component parent, boolean continuous)
           
 void stopSlideShow()
           
 boolean up()
           
 boolean up(boolean showEndMessage)
           
 
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

public static final int SORT_NAME
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)

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

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

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

getMinimum

public int getMinimum()
Specified by:
getMinimum 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

keyPressed

public void keyPressed(java.awt.event.KeyEvent event)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent event)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent event)
Specified by:
keyTyped in interface java.awt.event.KeyListener

sort

public void sort(int type)

doSort

public void doSort()

getCurrentPage

public Page getCurrentPage()

reload

public void reload()

removeCurrentPage

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


setPageSize

public void setPageSize(int pageSize)
Set page size.

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

up

public boolean up()

down

public boolean down()

up

public boolean up(boolean showEndMessage)

down

public boolean down(boolean showEndMessage)

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
Returns:
true if jump worked

addSlideShowListener

public void addSlideShowListener(SlideShowListener l)

removeSlideShowListener

public void removeSlideShowListener(SlideShowListener l)

startSlideShow

public void startSlideShow(java.awt.Component parent,
                           boolean continuous)

stopSlideShow

public void stopSlideShow()

isSlideShowRunning

public boolean isSlideShowRunning()

setAutoFocus

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

Parameters:
focus - what get focus

requestFocus

public void requestFocus()

refreshCurrentImage

public void refreshCurrentImage()

getCurrentIOImage

public IOImage getCurrentIOImage()

getCurrentImage

public java.awt.image.BufferedImage getCurrentImage()

rotateRight

public boolean rotateRight()

rotateLeft

public boolean rotateLeft()

shrink

public boolean shrink()

grow

public boolean grow()

getCurrentImageFile

public java.io.File getCurrentImageFile()

setCanEnableSave

public void setCanEnableSave(boolean b)

getSavePictureAction

public javax.swing.Action getSavePictureAction()

save

public void save()

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 javax.swing.ImageIcon getBeyondBounds()


Copyright © 2002 Gerhard Beck. All rights reserved. Subject to GPL.