org.norvelle.textcite.gui.action
Class ExportTranslationsAction

java.lang.Object
  extended by org.norvelle.textcite.gui.action.ExportRTFAction
      extended by org.norvelle.textcite.gui.action.ExportTranslationsAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, CancelListener

public class ExportTranslationsAction
extends ExportRTFAction

ExportPDFAction: Handles the exporting of citations in PDF format. Produces a dialog box, allowing the user to indicate preferences, then collects the citations required and uses the iText framework to produce a PDF document with the name the user chooses.

Author:
Erik Norvelle

Nested Class Summary
(package private)  class ExportTranslationsAction.GreekCitationsFilter
          GreekCitationsFilter Filters for citations with Greek text
(package private)  class ExportTranslationsAction.TranslationsOnlyCitationExporter
          TranslationsOnlyCitationExporter: An CitationExporter that outputs citations to RTF, including only citations and excluding commentaries.
 
Field Summary
protected  boolean cancelButtonPressed
           
protected  CitationSet citationSet
           
static int CODE_BIBTEX
           
static int CODE_CITATION
           
static int CODE_ENDNOTE
           
protected  int codeStyle
           
static int COMMENTARIES_IN_FOOTNOTES
           
static int COMMENTARIES_INTERWOVEN
           
static int COMMENTARIES_MAIN_TEXT
           
protected  double currentIndent
           
protected  int currOutlineLevel
           
protected  ExportRTFDialog dialog
           
static int EXPORT_ALL
           
static int EXPORT_SELECTED
           
static int EXPORT_VIEW
           
protected  CitationExporter exporter
           
protected  java.io.File exportFile
           
protected  int exportSet
           
protected  java.lang.String footer
           
protected  java.lang.String header
           
protected  boolean includeCommentaries
           
protected  boolean includeOnlyRefs
           
protected  int inclusionType
           
static float INDENT_WIDTH
          Indentation equivalent to half an inch.
protected  boolean insertBibCodes
           
protected  MainFrame mainFrame
           
protected  ExportTranslationsAction me
           
protected  boolean numberPages
           
protected  int organization
           
static int ORGANIZE_AUTHOR_PUB
           
static int ORGANIZE_CURRENT_VIEW
           
static int ORGANIZE_OUTLINE
           
protected  java.io.FileWriter outputWriter
           
protected  ProgressDialog progressDialog
          Objects for handling PDF output via iText
 
Fields inherited from class org.norvelle.textcite.gui.action.ExportRTFAction
authorFont, bookFont, document, outlineFont, titleFont
 
Constructor Summary
ExportTranslationsAction(MainFrame mainFrame)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent arg0)
          Called by the menu or toolbar when the user chooses the action.
protected  void addCitationsToDocument()
          For each Citation in the CitationSet, add it to the PDF document to be output, following the parameters selected by the user.
 void cancelPressed()
           
protected  void collectCitationSet()
          The routine that adds the chosen content to the document.
 void doExport(ExportRTFDialog dialog)
          This method is called once the dialog box has collected the necessary information from the user in order to perform the export.
protected  void newAuthor(Citation c)
          Respond to a change in Author by outputting a new section header
protected  void newBook(Citation c)
          Respond to a change in Book by outputting a new section header
 void process()
          The controller routine for the export process.
protected  void setExporter()
          Set up the CitationExporter according to the user's choice
protected  void setSortColumns()
          Figures out what the sorting columns should be and configures the CitationSet appropriately
 
Methods inherited from class org.norvelle.textcite.gui.action.ExportRTFAction
getCurrentIndent, getExportFile, getFooter, getHeader, isIncludeCommentaries, isNumberPages, newOutlineNumber, setCodeStyle, setCommentaryInclusionType, setExportFile, setExportSet, setFooter, setHeader, setIncludeCommentaries, setIncludeOnlyReferences, setInsertBibCodes, setOrganization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPORT_ALL

public static final int EXPORT_ALL
See Also:
Constant Field Values

EXPORT_SELECTED

public static final int EXPORT_SELECTED
See Also:
Constant Field Values

EXPORT_VIEW

public static final int EXPORT_VIEW
See Also:
Constant Field Values

ORGANIZE_CURRENT_VIEW

public static final int ORGANIZE_CURRENT_VIEW
See Also:
Constant Field Values

ORGANIZE_AUTHOR_PUB

public static final int ORGANIZE_AUTHOR_PUB
See Also:
Constant Field Values

ORGANIZE_OUTLINE

public static final int ORGANIZE_OUTLINE
See Also:
Constant Field Values

COMMENTARIES_IN_FOOTNOTES

public static final int COMMENTARIES_IN_FOOTNOTES
See Also:
Constant Field Values

COMMENTARIES_INTERWOVEN

public static final int COMMENTARIES_INTERWOVEN
See Also:
Constant Field Values

COMMENTARIES_MAIN_TEXT

public static final int COMMENTARIES_MAIN_TEXT
See Also:
Constant Field Values

CODE_BIBTEX

public static final int CODE_BIBTEX
See Also:
Constant Field Values

CODE_ENDNOTE

public static final int CODE_ENDNOTE
See Also:
Constant Field Values

CODE_CITATION

public static final int CODE_CITATION
See Also:
Constant Field Values

INDENT_WIDTH

public static final float INDENT_WIDTH
Indentation equivalent to half an inch.

See Also:
Constant Field Values

exportFile

protected java.io.File exportFile

header

protected java.lang.String header

footer

protected java.lang.String footer

numberPages

protected boolean numberPages

includeCommentaries

protected boolean includeCommentaries

exportSet

protected int exportSet

organization

protected int organization

dialog

protected ExportRTFDialog dialog

mainFrame

protected MainFrame mainFrame

outputWriter

protected java.io.FileWriter outputWriter

citationSet

protected CitationSet citationSet

cancelButtonPressed

protected boolean cancelButtonPressed

inclusionType

protected int inclusionType

includeOnlyRefs

protected boolean includeOnlyRefs

insertBibCodes

protected boolean insertBibCodes

codeStyle

protected int codeStyle

exporter

protected CitationExporter exporter

currentIndent

protected double currentIndent

currOutlineLevel

protected int currOutlineLevel

me

protected ExportTranslationsAction me

progressDialog

protected ProgressDialog progressDialog
Objects for handling PDF output via iText

Constructor Detail

ExportTranslationsAction

public ExportTranslationsAction(MainFrame mainFrame)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent arg0)
Called by the menu or toolbar when the user chooses the action. Pops up the dialog box. When the user closes the dialog box,

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class ExportRTFAction

doExport

public void doExport(ExportRTFDialog dialog)
This method is called once the dialog box has collected the necessary information from the user in order to perform the export. It creates a SwingWorker object, which gives us the ability to do work without blocking the GUI (which means that we can produce a meaningful progress dialog).

Overrides:
doExport in class ExportRTFAction

process

public void process()
The controller routine for the export process. It collects the chosen citation set, creates an iText object, and inserts the citations into the iText object, writing the destination file when finished.

Overrides:
process in class ExportRTFAction

setSortColumns

protected void setSortColumns()
Figures out what the sorting columns should be and configures the CitationSet appropriately

Overrides:
setSortColumns in class ExportRTFAction

setExporter

protected void setExporter()
                    throws RTFExportException
Set up the CitationExporter according to the user's choice

Overrides:
setExporter in class ExportRTFAction
Throws:
RTFExportException

collectCitationSet

protected void collectCitationSet()
The routine that adds the chosen content to the document.

Overrides:
collectCitationSet in class ExportRTFAction

addCitationsToDocument

protected void addCitationsToDocument()
                               throws DocumentException
For each Citation in the CitationSet, add it to the PDF document to be output, following the parameters selected by the user.

Overrides:
addCitationsToDocument in class ExportRTFAction
Throws:
DocumentException

cancelPressed

public void cancelPressed()
Specified by:
cancelPressed in interface CancelListener
Overrides:
cancelPressed in class ExportRTFAction

newAuthor

protected void newAuthor(Citation c)
Respond to a change in Author by outputting a new section header

Overrides:
newAuthor in class ExportRTFAction

newBook

protected void newBook(Citation c)
Respond to a change in Book by outputting a new section header

Overrides:
newBook in class ExportRTFAction
Parameters:
changedCitation - The citation that contains the new Book