|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.unizh.ini.jaer.projects.opticalflow.graphics.MotionViewer.Player
public class MotionViewer.Player
this class handles file input of AEs to control the number of events/sample or period of time in the sample, etc. It handles the file input stream, opening a dialog box, etc. It also handles synchronization of different viewers as follows:
If the viwer is not synchronized, then all calls from the GUI are passed directly to this instance of AEPlayer. Thus local control always happens.
If the viewer is sychronized, then all GUI calls pass instead to the CaviarViewer instance that contains (or started) this viewer. Then the CaviarViewer AEPlayer calls all the viewers to take the player action (e.g. rewind, go to next slice, change direction).
Thus whichever controls the user uses to control playback, the viewers are all sychronized properly without recursively. The "master" is indicated by the GUI action, which routes the request either to this instance's AEPlayer or to the CaviarViewer AEPlayer.
Nested Class Summary | |
---|---|
class |
MotionViewer.Player.FileDeleter
|
Constructor Summary | |
---|---|
MotionViewer.Player()
|
Method Summary | |
---|---|
float |
getFractionalPosition()
|
MotionInputStream |
getMotionInputStream()
|
MotionData |
getNextData()
|
int |
getTime()
|
boolean |
isChoosingFile()
|
boolean |
isPaused()
gets the MotionViewer paused flag |
boolean |
isPlayingForwards()
|
void |
mark()
mark the current position. |
void |
openInputFileDialog()
called when user asks to open data file file dialog |
void |
pause()
|
int |
position()
return position in events |
void |
position(int event)
set position in units of the file, e.g. |
void |
resume()
|
void |
rewind()
rewind to the start, or to the marked position, if it has been set |
void |
setFractionalPosition(float frac)
Sets fractional position in units of the file |
void |
setPaused(boolean yes)
sets the MotionViewer paused flag |
void |
setTime(int time)
|
long |
size()
|
void |
slowDown()
|
void |
speedUp()
|
void |
startPlayback(java.io.File file)
|
void |
stopPlayback()
stops playback. |
void |
toggleDirection()
|
void |
unmark()
clear any marked position |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MotionViewer.Player()
Method Detail |
---|
public boolean isChoosingFile()
public void openInputFileDialog()
public void startPlayback(java.io.File file) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public void stopPlayback()
public void rewind()
InputDataFileInterface
rewind
in interface InputDataFileInterface
public void pause()
public void resume()
public void setPaused(boolean yes)
public boolean isPaused()
public MotionData getNextData()
public void toggleDirection()
public void speedUp()
public void slowDown()
public boolean isPlayingForwards()
public float getFractionalPosition()
getFractionalPosition
in interface InputDataFileInterface
public void mark() throws java.io.IOException
InputDataFileInterface
mark
in interface InputDataFileInterface
java.io.IOException
- if there is some error in reading the datapublic int position()
InputDataFileInterface
position
in interface InputDataFileInterface
public void position(int event)
InputDataFileInterface
position
in interface InputDataFileInterface
event
- the number to position topublic long size()
size
in interface InputDataFileInterface
public void unmark()
InputDataFileInterface
unmark
in interface InputDataFileInterface
public void setFractionalPosition(float frac)
InputDataFileInterface
setFractionalPosition
in interface InputDataFileInterface
frac
- 0-1 float range, 0 at start, 1 at endpublic void setTime(int time)
public int getTime()
public MotionInputStream getMotionInputStream()
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |