adams.core.option
Class LatexProducer

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionProducer<O,I>
          extended by adams.core.option.AbstractRecursiveOptionProducer<String,StringBuilder>
              extended by adams.core.option.LatexProducer
All Implemented Interfaces:
CleanUpHandler, Debuggable, FileBasedProducer, RecursiveOptionProducer, SizeOfHandler, Serializable

public class LatexProducer
extends AbstractRecursiveOptionProducer<String,StringBuilder>
implements FileBasedProducer

Generates the JSON format.

Version:
$Revision: 5846 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  StringBuilder m_Details
          for storing the content.
protected  int m_Index
          the index in the structure.
protected  boolean m_Landscape
          whether to print in landscape.
protected  StringBuilder m_Structure
          for storing the structure.
 
Fields inherited from class adams.core.option.AbstractRecursiveOptionProducer
m_Nesting
 
Fields inherited from class adams.core.option.AbstractOptionProducer
m_DebugLevel, m_Input, m_LastGenerated, m_Output, m_OutputVariableValues, m_SkippedProperties, m_UsePropertyNames
 
Constructor Summary
LatexProducer()
           
 
Method Summary
protected  void addActor(AbstractActor actor, boolean ref)
          Adds the actor to the structure.
protected  String addItem(String value)
          Encapsulates the string in an item command sequence.
protected  String addItem(String name, Object value)
          Encapsulates the string in an item command sequence.
protected  String endEnumerate()
          Returns the command sequence for the end of an enumerated list.
protected  String endItemize()
          Returns the command sequence for the end of an itemized list.
 String getDefaultFileExtension()
          Returns the default file extension (without the dot).
 String[] getFileExtensions()
          Returns the file extensions (without the dot).
 String getFileFormat()
          Returns the description of the file format.
protected  String getIndentation()
          Generates the indentation string based on the nesting level.
 boolean getLandscape()
          Returns whether to use portrait or landscape
 String globalInfo()
          Returns a string describing the object.
protected  void initialize()
          Initializes the members.
protected  String initOutput()
          Initializes the output data structure.
 String landscapeTipText()
          Returns the tip text for this property.
static void main(String[] args)
           
protected  void preProduce()
          Hook-method before starting visiting options.
 StringBuilder processOption(AbstractArgumentOption option)
          Visits an argument option.
 StringBuilder processOption(BooleanOption option)
          Visits a boolean option.
 StringBuilder processOption(ClassOption option)
          Visits a class option.
 void setLandscape(boolean value)
          Sets whether to use portrait or landscape.
protected  String startEnumerate()
          Returns the command sequence for the start of an enumerated list.
protected  String startItemize()
          Returns the command sequence for the start of an itemized list.
protected  String toLatex(String s)
          Makes the string LaTeX compliant.
 String toString()
          Returns the output generated from the visit.
 
Methods inherited from class adams.core.option.AbstractRecursiveOptionProducer
cleanUp, generateDebugString, getDebugIndentation, getDebugIndentation, getRecursionLevel, reset
 
Methods inherited from class adams.core.option.AbstractOptionProducer
checkInput, debug, debug, debugLevelTipText, doProduce, doProduce, getCurrentValue, getDebugLevel, getInput, getOptionIdentifier, getOutput, getOutputVariableValues, getSkippedProperties, getUsePropertyNames, isDebugOn, isDefaultValue, outputVariableValuesTipText, postProduce, postProduce, preProduce, produce, produce, setDebugLevel, setOutputVariableValues, setSkippedProperties, toString, write
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Landscape

protected boolean m_Landscape
whether to print in landscape.


m_Structure

protected StringBuilder m_Structure
for storing the structure.


m_Details

protected StringBuilder m_Details
for storing the content.


m_Index

protected int m_Index
the index in the structure.

Constructor Detail

LatexProducer

public LatexProducer()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionProducer<String,StringBuilder>
Returns:
a description suitable for displaying in the gui

initialize

protected void initialize()
Initializes the members.

Overrides:
initialize in class AbstractOptionProducer<String,StringBuilder>

setLandscape

public void setLandscape(boolean value)
Sets whether to use portrait or landscape.

Parameters:
value - true if to use landscape

getLandscape

public boolean getLandscape()
Returns whether to use portrait or landscape

Returns:
true if landscape in use

landscapeTipText

public String landscapeTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

initOutput

protected String initOutput()
Initializes the output data structure.

Specified by:
initOutput in class AbstractOptionProducer<String,StringBuilder>
Returns:
the created data structure

addActor

protected void addActor(AbstractActor actor,
                        boolean ref)
Adds the actor to the structure.

Parameters:
ref - reference or label
actor - the actor to add

startEnumerate

protected String startEnumerate()
Returns the command sequence for the start of an enumerated list.

Returns:
the command sequence

endEnumerate

protected String endEnumerate()
Returns the command sequence for the end of an enumerated list.

Returns:
the command sequence

startItemize

protected String startItemize()
Returns the command sequence for the start of an itemized list.

Returns:
the command sequence

endItemize

protected String endItemize()
Returns the command sequence for the end of an itemized list.

Returns:
the command sequence

toLatex

protected String toLatex(String s)
Makes the string LaTeX compliant.

Parameters:
s - the string to process
Returns:
the processed string

getIndentation

protected String getIndentation()
Generates the indentation string based on the nesting level.

Returns:
the indentation string

addItem

protected String addItem(String value)
Encapsulates the string in an item command sequence.

Parameters:
value - the list item
Returns:
the command sequence

addItem

protected String addItem(String name,
                         Object value)
Encapsulates the string in an item command sequence.

Parameters:
name - the list item
value - the value for the name surrounded in \texttt{...}
Returns:
the command sequence

processOption

public StringBuilder processOption(BooleanOption option)
Visits a boolean option.

Specified by:
processOption in class AbstractOptionProducer<String,StringBuilder>
Parameters:
option - the boolean option
Returns:
always null

processOption

public StringBuilder processOption(ClassOption option)
Visits a class option.

Specified by:
processOption in class AbstractOptionProducer<String,StringBuilder>
Parameters:
option - the class option
Returns:
always null

processOption

public StringBuilder processOption(AbstractArgumentOption option)
Visits an argument option.

Specified by:
processOption in class AbstractOptionProducer<String,StringBuilder>
Parameters:
option - the argument option
Returns:
always null

toString

public String toString()
Returns the output generated from the visit.

Specified by:
toString in class AbstractOptionProducer<String,StringBuilder>
Returns:
the output, null in case of an error

preProduce

protected void preProduce()
Hook-method before starting visiting options.

Overrides:
preProduce in class AbstractOptionProducer<String,StringBuilder>

getFileFormat

public String getFileFormat()
Returns the description of the file format.

Specified by:
getFileFormat in interface FileBasedProducer
Returns:
the description

getDefaultFileExtension

public String getDefaultFileExtension()
Returns the default file extension (without the dot).

Specified by:
getDefaultFileExtension in interface FileBasedProducer
Returns:
the default extension

getFileExtensions

public String[] getFileExtensions()
Returns the file extensions (without the dot).

Specified by:
getFileExtensions in interface FileBasedProducer
Returns:
the extensions

main

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


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.