Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.pbm
Class PBMPlayer

java.lang.Object
  extended by ch.randelshofer.media.AbstractPlayer
      extended by ch.randelshofer.media.pbm.PBMPlayer
All Implemented Interfaces:
ColorCyclePlayer, Player, StateModel, java.lang.Runnable

public class PBMPlayer
extends AbstractPlayer
implements ColorCyclePlayer

A Player for PBM images with color cycling.

Version:
1.0 2010-08-04 Created.
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class ch.randelshofer.media.AbstractPlayer
dispatcher, listenerList, propertyChangeSupport
 
Fields inherited from interface ch.randelshofer.media.Player
CLOSED, PREFETCHED, PREFETCHING, REALIZED, REALIZING, STARTED, UNREALIZED
 
Constructor Summary
PBMPlayer(java.io.InputStream in)
           
PBMPlayer(java.io.InputStream in, int inputFileSize)
          Creates a new instance.
 
Method Summary
protected  void doClosed()
          Does the work for the closed state.
protected  void doPrefetched()
          Does the work for the prefetched state.
protected  void doPrefetching()
          Does the work for the prefetching state.
protected  void doRealized()
          Does the work for the realized state.
protected  void doRealizing()
          Does the work for the realizing state.
protected  void doStarted()
          Does the work for the started state.
protected  void doUnrealized()
          Does the work for the unrealized state.
 javax.swing.BoundedRangeModel getCachingModel()
          Gets the model representing the realizing progress of the player.
 java.awt.Component getControlPanelComponent()
           
protected  java.awt.image.ImageProducer getImageProducer()
          Returns the image producer that produces the animation frames.
 javax.swing.BoundedRangeModel getTimeModel()
          Gets the model representing the time line of the player.
 long getTotalDuration()
           
 java.awt.Component getVisualComponent()
           
 boolean isAudioAvailable()
          Returns true if audio is available.
 boolean isAudioEnabled()
          Returns true if audio is enabled.
 boolean isBlendedColorCycling()
          Returns true if colors are blended during color cycling.
 boolean isCached()
          Returns true when the player has completely cached all movie data.
 boolean isColorCyclingAvailable()
          Returns true if color cycling is available.
 boolean isColorCyclingStarted()
          Returns true if color cycling is started.
 void setAudioEnabled(boolean b)
          Sets the audio enabled state.
 void setBlendedColorCycling(boolean newValue)
          Sets whether colors are blended during color cycling.
 void setColorCyclingStarted(boolean newValue)
          Starts/Stops color cycling.
 
Methods inherited from class ch.randelshofer.media.AbstractPlayer
addChangeListener, addPropertyChangeListener, addStateListener, close, deallocate, fireStateChanged, getState, getTargetState, isActive, prefetch, realize, removeChangeListener, removePropertyChangeListener, removeStateListener, run, setTargetState, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.randelshofer.media.Player
addChangeListener, addPropertyChangeListener, addStateListener, close, deallocate, getState, getTargetState, isActive, prefetch, realize, removeChangeListener, removePropertyChangeListener, removeStateListener, setTargetState, start, stop
 

Constructor Detail

PBMPlayer

public PBMPlayer(java.io.InputStream in)

PBMPlayer

public PBMPlayer(java.io.InputStream in,
                 int inputFileSize)
Creates a new instance.

Parameters:
in - InputStream containing an IFF ANIM file.
inputFileSize - The size of the input file. Provide the value -1 if this is not known.
Method Detail

doClosed

protected void doClosed()
Description copied from class: AbstractPlayer
Does the work for the closed state.

Specified by:
doClosed in class AbstractPlayer

doUnrealized

protected void doUnrealized()
Description copied from class: AbstractPlayer
Does the work for the unrealized state.

Specified by:
doUnrealized in class AbstractPlayer

doRealizing

protected void doRealizing()
Description copied from class: AbstractPlayer
Does the work for the realizing state.

Specified by:
doRealizing in class AbstractPlayer

doRealized

protected void doRealized()
Description copied from class: AbstractPlayer
Does the work for the realized state.

Specified by:
doRealized in class AbstractPlayer

doPrefetching

protected void doPrefetching()
Description copied from class: AbstractPlayer
Does the work for the prefetching state.

Specified by:
doPrefetching in class AbstractPlayer

doPrefetched

protected void doPrefetched()
Description copied from class: AbstractPlayer
Does the work for the prefetched state.

Specified by:
doPrefetched in class AbstractPlayer

doStarted

protected void doStarted()
Description copied from class: AbstractPlayer
Does the work for the started state.

Specified by:
doStarted in class AbstractPlayer

setAudioEnabled

public void setAudioEnabled(boolean b)
Description copied from interface: Player
Sets the audio enabled state.

Specified by:
setAudioEnabled in interface Player

isAudioEnabled

public boolean isAudioEnabled()
Description copied from interface: Player
Returns true if audio is enabled.

Specified by:
isAudioEnabled in interface Player

isAudioAvailable

public boolean isAudioAvailable()
Description copied from interface: Player
Returns true if audio is available.

Specified by:
isAudioAvailable in interface Player

getTimeModel

public javax.swing.BoundedRangeModel getTimeModel()
Description copied from interface: Player
Gets the model representing the time line of the player.

Specified by:
getTimeModel in interface Player

getCachingModel

public javax.swing.BoundedRangeModel getCachingModel()
Description copied from interface: Player
Gets the model representing the realizing progress of the player.

Specified by:
getCachingModel in interface Player

getVisualComponent

public java.awt.Component getVisualComponent()
Specified by:
getVisualComponent in interface Player

getControlPanelComponent

public java.awt.Component getControlPanelComponent()
Specified by:
getControlPanelComponent in interface Player

getTotalDuration

public long getTotalDuration()
Specified by:
getTotalDuration in interface Player

getImageProducer

protected java.awt.image.ImageProducer getImageProducer()
Returns the image producer that produces the animation frames.


setColorCyclingStarted

public void setColorCyclingStarted(boolean newValue)
Description copied from interface: ColorCyclePlayer
Starts/Stops color cycling.

Specified by:
setColorCyclingStarted in interface ColorCyclePlayer

isColorCyclingAvailable

public boolean isColorCyclingAvailable()
Description copied from interface: ColorCyclePlayer
Returns true if color cycling is available.

Specified by:
isColorCyclingAvailable in interface ColorCyclePlayer

isColorCyclingStarted

public boolean isColorCyclingStarted()
Description copied from interface: ColorCyclePlayer
Returns true if color cycling is started.

Specified by:
isColorCyclingStarted in interface ColorCyclePlayer

isCached

public boolean isCached()
Returns true when the player has completely cached all movie data. This player informs all property change listeners, when the value of this property changes. The name of the property is 'cached'.

Specified by:
isCached in interface Player

setBlendedColorCycling

public void setBlendedColorCycling(boolean newValue)
Sets whether colors are blended during color cycling.

Specified by:
setBlendedColorCycling in interface ColorCyclePlayer

isBlendedColorCycling

public boolean isBlendedColorCycling()
Returns true if colors are blended during color cycling.

Specified by:
isBlendedColorCycling in interface ColorCyclePlayer

Copyright 2011-01-06 Werner Randelshofer