|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.glib.views.latex.LaTeXGenerator
public abstract class LaTeXGenerator
Defines an abstract LaTeX generator.
This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
05/23/2010
Nested Class Summary | |
---|---|
static class |
LaTeXGenerator.VerticalPosition
The different vertical positions. |
Field Summary | |
---|---|
protected java.lang.String |
caption
The caption of the drawing. |
protected java.lang.String |
comment
The comment of the drawing. |
protected java.lang.String |
label
The label of the drawing. |
static int |
LGTH_START_LINE_COMMENT
Defines the number of characters added at the beginning of each lines of the comment (these characters are "% "). |
protected boolean |
modified
Defined if the instrument has been modified. |
protected static IUnary<java.lang.String> |
PACKAGES
The latex packages used when exporting using latex. |
protected boolean |
positionHoriCentre
The horizontal position of the drawing |
protected LaTeXGenerator.VerticalPosition |
positionVertToken
The token of the position of the drawing |
Constructor Summary | |
---|---|
LaTeXGenerator()
Initialises the abstract generator. |
Method Summary | |
---|---|
static java.io.File |
createLatexFile(IDrawing drawing,
java.lang.String pathExportTex,
ViewsSynchroniserHandler synchronizer)
Creates a latex file that contains the pstricks code of the given canvas. |
static java.io.File |
createPDFFile(IDrawing drawing,
java.lang.String pathExportPdf,
ViewsSynchroniserHandler synchronizer,
boolean crop)
Create a .pdf file that corresponds to the compiled latex document containing the pstricks drawing. |
static java.io.File |
createPSFile(IDrawing drawing,
java.lang.String pathExportPs,
ViewsSynchroniserHandler synchronizer)
Create a .ps file that corresponds to the compiled latex document containing the pstricks drawing. |
static java.io.File |
createPSFile(IDrawing drawing,
java.lang.String pathExportPs,
ViewsSynchroniserHandler synchronizer,
java.io.File tmpDir)
Create a .ps file that corresponds to the compiled latex document containing the pstricks drawing. |
private static java.lang.String |
execute(java.lang.String[] cmd,
java.io.File tmpdir)
|
java.lang.String |
getCaption()
|
java.lang.String |
getComment()
|
java.lang.String |
getCommentsWithoutTag()
|
java.lang.String |
getLabel()
|
static java.lang.String |
getLatexDocument(IDrawing drawing,
ViewsSynchroniserHandler synchronizer)
Generates a latex document that contains the pstricks code of the given canvas. |
static java.lang.String |
getPackages()
|
static IUnary<java.lang.String> |
getPackagesUnary()
|
LaTeXGenerator.VerticalPosition |
getPositionVertToken()
|
boolean |
isModified()
|
boolean |
isPositionHoriCentre()
|
void |
setCaption(java.lang.String caption)
|
void |
setComment(java.lang.String newComments)
|
void |
setLabel(java.lang.String label)
|
void |
setModified(boolean modified)
Sets the Modifiable object as modified. |
static void |
setPackages(java.lang.String packages)
|
void |
setPositionHoriCentre(boolean positionHoriCentre)
|
void |
setPositionVertToken(LaTeXGenerator.VerticalPosition positionVertToken)
|
abstract void |
update()
Updates the code cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LGTH_START_LINE_COMMENT
protected static final IUnary<java.lang.String> PACKAGES
protected java.lang.String comment
protected java.lang.String label
protected java.lang.String caption
protected LaTeXGenerator.VerticalPosition positionVertToken
protected boolean positionHoriCentre
protected boolean modified
Constructor Detail |
---|
public LaTeXGenerator()
Method Detail |
---|
public static void setPackages(java.lang.String packages)
packages
- the packages to set.public static java.lang.String getPackages()
public static IUnary<java.lang.String> getPackagesUnary()
public java.lang.String getComment()
public java.lang.String getCommentsWithoutTag()
public boolean isModified()
isModified
in interface Modifiable
public void setModified(boolean modified)
Modifiable
setModified
in interface Modifiable
modified
- True: the element is will tagged as modified.public void setComment(java.lang.String newComments)
newComments
- the comment to set.public LaTeXGenerator.VerticalPosition getPositionVertToken()
public void setPositionVertToken(LaTeXGenerator.VerticalPosition positionVertToken)
positionVertToken
- The new vertical position token. Must not be null.public boolean isPositionHoriCentre()
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- the new label of the drawing. Must not be null.public java.lang.String getCaption()
public void setCaption(java.lang.String caption)
caption
- the new caption of the drawing. Must not be null.public void setPositionHoriCentre(boolean positionHoriCentre)
positionHoriCentre
- True: the latex drawing will be horizontally centred.public abstract void update()
public static java.lang.String getLatexDocument(IDrawing drawing, ViewsSynchroniserHandler synchronizer)
drawing
- The shapes to export.synchronizer
- The object that synchronises the view and the model.
public static java.io.File createLatexFile(IDrawing drawing, java.lang.String pathExportTex, ViewsSynchroniserHandler synchronizer)
drawing
- The shapes to export.pathExportTex
- The location where the file must be created.synchronizer
- The object that synchronises the view and the model.
public static java.io.File createPSFile(IDrawing drawing, java.lang.String pathExportPs, ViewsSynchroniserHandler synchronizer)
drawing
- The shapes to export.pathExportPs
- The path of the .ps file to create (MUST ends with .ps).synchronizer
- The object that synchronises the view and the model.
public static java.io.File createPSFile(IDrawing drawing, java.lang.String pathExportPs, ViewsSynchroniserHandler synchronizer, java.io.File tmpDir)
drawing
- The shapes to export.pathExportPs
- The path of the .ps file to create (MUST ends with .ps).synchronizer
- The object that synchronises the view and the model.tmpDir
- The temporary directory used for the compilation.
public static java.io.File createPDFFile(IDrawing drawing, java.lang.String pathExportPdf, ViewsSynchroniserHandler synchronizer, boolean crop)
drawing
- The shapes to export.pathExportPdf
- The path of the .pdf file to create (MUST ends with .pdf).synchronizer
- The object that synchronises the view and the model.crop
- if true, the output document will be cropped.
private static java.lang.String execute(java.lang.String[] cmd, java.io.File tmpdir)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |