jfig.utils
Class PresentationParser

java.lang.Object
  extended byjfig.utils.PresentationParser

public class PresentationParser
extends java.lang.Object

parse and manage jfig presentations.

PresentationParser: a class to read, parse, and manage jfig presentation files. The idea behind a jfig presentation is to collect individual drawings into a simple multi-page presentation. The corresponding viewer runs as both an applet or application and allows the usual navigation, e.g. first page, next page, next chapter, etc.

In order to avoid a new complex file format, the presentation file does not contain the individual pages. Instead, it simply lists the filenames/URLs for the pages. While it is possible to use absolute pathnames, you are encouraged to use relative pathnames. The PresentationParser will complete a relative pathname with the pathname to the presentation file.

Currently, the only structuring commands are pages (called slides), chapters consisting of an arbitrary number of slides, and books, consisting of chapters.

For example, a simple presentation might look like this:

    #jfig presentation
    chapter title="Introduction"
      slide title="jfig presentations" href="intro/presentation.fig"
      slide title="A demo" href="intro/demo.fig"
      slide href="intro/notitle.fig"
     ... 
    chapter title="File format"
      slide title="The file format" href="spec/fileformat.fig"
      slide title="Syntax (BNF)" href="spec/bnf.fig"
      slide title="Example" href="spec/example.fig"
     ...
    ...
    # comment line
   


Field Summary
static boolean debug
           
static java.lang.String DUMMY_TITLE
           
static java.lang.String DUMMY_URL
           
static int N_CHAPTERS
           
static int N_SLIDES
           
 
Constructor Summary
PresentationParser()
           
 
Method Summary
static void dbg(java.lang.String msg)
           
 void decodeTokens(java.util.Vector vector, int line)
           
 void dumpData()
           
 java.lang.String[] getChapterTitles()
           
 int getCurrentChapterIndex()
           
 java.lang.String[] getCurrentChapterSlideTitles()
           
 java.lang.String getCurrentChapterTitle()
           
 int getCurrentSlideIndex()
           
 java.lang.String getCurrentSlideTitle()
           
 java.lang.String getFirstSlide()
          return the pathname (URL) of the first slide in this presentation.
 java.lang.String getLastSlide()
          return the pathname (URL) of the last slide in this presentation.
 java.lang.String getNextChapter()
           
 java.lang.String getNextSlide()
           
 int getNumberOfSlides()
           
 java.lang.String getPreviousChapter()
           
 java.lang.String getPreviousSlide()
           
 java.lang.String getSlide(int pageNumber)
           
 java.lang.String getSlide(int chapterIndex, int slideIndex)
           
 boolean hasNextChapter()
           
 boolean hasNextSlide()
           
 boolean hasPreviousChapter()
           
 boolean hasPreviousSlide()
           
(package private)  void initData()
           
static void main(java.lang.String[] args)
           
static void msg(java.lang.String msg)
           
 void parse(java.io.InputStream IS)
           
 void setBasename(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
See Also:
Constant Field Values

N_SLIDES

public static final int N_SLIDES
See Also:
Constant Field Values

N_CHAPTERS

public static final int N_CHAPTERS
See Also:
Constant Field Values

DUMMY_TITLE

public static java.lang.String DUMMY_TITLE

DUMMY_URL

public static java.lang.String DUMMY_URL
Constructor Detail

PresentationParser

public PresentationParser()
Method Detail

initData

void initData()

setBasename

public void setBasename(java.lang.String s)

getFirstSlide

public java.lang.String getFirstSlide()
return the pathname (URL) of the first slide in this presentation.


getLastSlide

public java.lang.String getLastSlide()
return the pathname (URL) of the last slide in this presentation.


getSlide

public java.lang.String getSlide(int pageNumber)

getSlide

public java.lang.String getSlide(int chapterIndex,
                                 int slideIndex)

hasNextSlide

public boolean hasNextSlide()

hasPreviousSlide

public boolean hasPreviousSlide()

getNextSlide

public java.lang.String getNextSlide()

getPreviousSlide

public java.lang.String getPreviousSlide()

hasNextChapter

public boolean hasNextChapter()

hasPreviousChapter

public boolean hasPreviousChapter()

getNextChapter

public java.lang.String getNextChapter()

getPreviousChapter

public java.lang.String getPreviousChapter()

getCurrentChapterIndex

public int getCurrentChapterIndex()

getCurrentChapterTitle

public java.lang.String getCurrentChapterTitle()

getChapterTitles

public java.lang.String[] getChapterTitles()

getCurrentSlideTitle

public java.lang.String getCurrentSlideTitle()

getCurrentSlideIndex

public int getCurrentSlideIndex()

getNumberOfSlides

public int getNumberOfSlides()

getCurrentChapterSlideTitles

public java.lang.String[] getCurrentChapterSlideTitles()

parse

public void parse(java.io.InputStream IS)
           throws java.lang.Exception
Throws:
java.lang.Exception

decodeTokens

public void decodeTokens(java.util.Vector vector,
                         int line)

dumpData

public void dumpData()

dbg

public static void dbg(java.lang.String msg)

msg

public static void msg(java.lang.String msg)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception