iRex DR1000 Merger v0.4.1

it.andynaz.irex.dr1000.document
Class Document

java.lang.Object
  extended by it.andynaz.irex.dr1000.document.Document
Direct Known Subclasses:
Note, PdfDocument

public abstract class Document
extends Object

Document on a iRex DR1000. This class ia a model for both a PDF document or a note: it has an associated SQLite database file, in which the scribbles are stored.

Version:
2013-08-01
Author:
andynaz

Field Summary
protected  File db
          Database file.
 
Constructor Summary
protected Document(File db)
          Creates a new Document with an associated database file.
 
Method Summary
 void format(String outputFile)
          Deprecated. only for debug purpuse; will be deleted in future release
protected abstract  String getDefaultFileName()
          Return the default filename used to create the output PDF file.
protected abstract  String getFileName()
          Return the file name as it is present in the database file.
protected  ScribbleMgr getScribbleMgr()
          Returns an initialized ScribbleMgr.
 void merge(String outFilePath)
          Creates the output PDF file, using the default color for the strokes (as specified in the ColorMgr class).
abstract  void merge(String outFilePath, Color c)
          Creates the output PDF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

db

protected File db
Database file.

Constructor Detail

Document

protected Document(File db)
Creates a new Document with an associated database file.

Parameters:
db - database file
Throws:
IllegalArgumentException - il the db file does not exists or is not a file
Method Detail

getScribbleMgr

protected ScribbleMgr getScribbleMgr()
Returns an initialized ScribbleMgr.

Returns:
a ScribbleMgr that is already connected to the database file

getFileName

protected abstract String getFileName()
Return the file name as it is present in the database file. Subclasses implement the correct format of the file_metadata.filename column.

Returns:
the name of the file as written in the database
See Also:
ScribbleMgr

getDefaultFileName

protected abstract String getDefaultFileName()
Return the default filename used to create the output PDF file. The filemane returned should be without the file extensions (it will be added in the calling methods).

Returns:
the filename used to create the output PDF file, when no one is specified

merge

public void merge(String outFilePath)
Creates the output PDF file, using the default color for the strokes (as specified in the ColorMgr class).

Parameters:
outFilePath - the path to the output PDF file; if it is null or empty, the default one returned by getDefaultFileName() is used

merge

public abstract void merge(String outFilePath,
                           Color c)
Creates the output PDF file.

Parameters:
outFilePath - the path to the output PDF file; if it is null or empty, the default one returned by getDefaultFileName() is used
c - strokes color

format

public void format(String outputFile)
Deprecated. only for debug purpuse; will be deleted in future release

Create a file with all the scribbles in a text format.

Parameters:
outputFile - path to the output text file; if it is null or empty, the default one returned by getDefaultFileName() is used

iRex DR1000 Merger v0.4.1

© 2013 andynaz - http://andynaz.altervista.org