java.lang.Object
jpicedt.format.latex.LatexFormatter
- All Implemented Interfaces:
- jpicedt.graphic.io.formatter.FormatterFactory, LatexConstants, jpicedt.graphic.model.PicObjectConstants
- public class LatexFormatter
- extends java.lang.Object
- implements jpicedt.graphic.io.formatter.FormatterFactory, jpicedt.graphic.model.PicObjectConstants, LatexConstants
LaTeX formater
- Since:
- jpicedt 1.0 (code refactoring 1.3.2)
Fields inherited from interface jpicedt.graphic.model.PicObjectConstants |
CROSSHATCH, CROSSHATCH_FILLED, DASH_OPAQUE, DASH_TRANSPARENT, DASH1, DASH2, DASH3, DASHED, DIMEN, DOT_SEP, DOT_SEP1, DOT_SEP2, DOT_SEP3, DOTTED, DOUBLE_COLOR, DOUBLE_LINE, DOUBLE_SEP, FILL_COLOR, FILL_STYLE, HATCH_ANGLE, HATCH_COLOR, HATCH_SEP, HATCH_WIDTH, HLINES, HLINES_FILLED, INNER, LEFT_ARROW, LINE_COLOR, LINE_STYLE, LINE_WIDTH, MaxAttributeNameIndex, MIDDLE, NONE, OUTER, POLYGON_DOTS, POLYGON_SOLID, POLYGON_STYLE, PS_POINT, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, VLINES, VLINES_FILLED |
Fields inherited from interface jpicedt.format.latex.LatexConstants |
CR_LF, DEFAULT_EM_LINE_LENGTH, DEFAULT_FILE_WRAPPER_EPILOG, DEFAULT_FILE_WRAPPER_PROLOG, DEFAULT_LINE_THICKNESS, DEFAULT_MAX_CIRCLE_DIAMETER, DEFAULT_MAX_DISK_DIAMETER, DEFAULT_MAX_EM_CIRCLE_SEGMENT_LENGTH, DEFAULT_MAX_EM_LINE_SLOPE, KEY_EM_LINE_LENGTH, KEY_FILE_WRAPPER_EPILOG, KEY_FILE_WRAPPER_PROLOG, KEY_LINE_THICKNESS, KEY_MAX_CIRCLE_DIAMETER, KEY_MAX_DISK_DIAMETER, KEY_MAX_EM_CIRCLE_SEGMENT_LENGTH, KEY_MAX_EM_LINE_SLOPE |
Constructor Summary |
LatexFormatter()
Constructor using default properties values |
Method Summary |
void |
appendPicedtParameterString(java.lang.StringBuffer buf,
jpicedt.graphic.model.Element obj)
Create a string representation of the attributes of the given object using PicEdt syntax (i.e. |
void |
appendThicknessString(java.lang.StringBuffer buf,
jpicedt.graphic.model.Element obj)
Create a string representation of the thickness command for the given PicObjet in the LaTeX format,
and append it to the given StringBuffer. |
java.lang.StringBuffer |
arrowToLatexString(jpicedt.graphic.PicPoint loc,
jpicedt.graphic.PicPoint dir)
Create a string representation of an arrow in the LaTeX format using \\vector's. |
static void |
configure(java.util.Properties preferences)
Configure static fields using the given Properties object |
jpicedt.graphic.io.formatter.Formatter |
createFormatter(jpicedt.graphic.model.Drawing d,
java.lang.Object outputConstraint)
|
jpicedt.graphic.io.formatter.Formatter |
createFormatter(jpicedt.graphic.model.Element e)
|
java.awt.Point |
getXYNearestSlope(double slope,
boolean isVector)
|
java.lang.String |
lineToLatexString(double x0,
double y0,
double x1,
double y1,
jpicedt.graphic.model.Arrow leftArrow,
jpicedt.graphic.model.Arrow rightArrow,
double dash)
Computes a LaTeX string for a line segment (PicLine object), given its two points and
decoration parameters. |
java.lang.String |
toPicedtString(jpicedt.graphic.model.Arrow arrow)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lineThickness
static double lineThickness
emLineLength
static double emLineLength
maxLatexCircleDiameter
static double maxLatexCircleDiameter
maxLatexDiskDiameter
static double maxLatexDiskDiameter
maxEmCircleSegmentLength
static double maxEmCircleSegmentLength
maxEmLineSlope
static double maxEmLineSlope
minEmLineSlope
static double minEmLineSlope
fileWrapperProlog
protected static java.lang.String fileWrapperProlog
fileWrapperEpilog
protected static java.lang.String fileWrapperEpilog
NEG_GREATER_THAN_1
private static final int NEG_GREATER_THAN_1
- See Also:
- Constant Field Values
NEG_LOWER_THAN_1
private static final int NEG_LOWER_THAN_1
- See Also:
- Constant Field Values
HORIZONTAL
private static final int HORIZONTAL
- See Also:
- Constant Field Values
POS_LOWER_THAN_1
private static final int POS_LOWER_THAN_1
- See Also:
- Constant Field Values
POS_GREATER_THAN_1
private static final int POS_GREATER_THAN_1
- See Also:
- Constant Field Values
VERTICAL
private static final int VERTICAL
- See Also:
- Constant Field Values
LatexFormatter
public LatexFormatter()
- Constructor using default properties values
configure
public static void configure(java.util.Properties preferences)
- Configure static fields using the given Properties object
createFormatter
public jpicedt.graphic.io.formatter.Formatter createFormatter(jpicedt.graphic.model.Element e)
- Specified by:
createFormatter
in interface jpicedt.graphic.io.formatter.FormatterFactory
createFormatter
public jpicedt.graphic.io.formatter.Formatter createFormatter(jpicedt.graphic.model.Drawing d,
java.lang.Object outputConstraint)
- Specified by:
createFormatter
in interface jpicedt.graphic.io.formatter.FormatterFactory
appendPicedtParameterString
public void appendPicedtParameterString(java.lang.StringBuffer buf,
jpicedt.graphic.model.Element obj)
- Create a string representation of the attributes of the given object using PicEdt syntax (i.e. %Rectangle...), and
append it to the given buffer. This string is NOT CR-terminated, but has a leading whitespace.
- Since:
- jpicedt 1.3.2
appendThicknessString
public void appendThicknessString(java.lang.StringBuffer buf,
jpicedt.graphic.model.Element obj)
Create a string representation of the thickness command for the given PicObjet in the LaTeX format,
and append it to the given StringBuffer.
Such a command should preceed every object command. This string is CR-terminated.
- Since:
- jpicedt 1.3.2
toPicedtString
public java.lang.String toPicedtString(jpicedt.graphic.model.Arrow arrow)
lineToLatexString
public java.lang.String lineToLatexString(double x0,
double y0,
double x1,
double y1,
jpicedt.graphic.model.Arrow leftArrow,
jpicedt.graphic.model.Arrow rightArrow,
double dash)
- Computes a LaTeX string for a line segment (PicLine object), given its two points and
decoration parameters.
- Since:
- picedt 1.0
arrowToLatexString
public java.lang.StringBuffer arrowToLatexString(jpicedt.graphic.PicPoint loc,
jpicedt.graphic.PicPoint dir)
- Create a string representation of an arrow in the LaTeX format using \\vector's.
The slope of the vector is as near as possible of the given slope.
- Since:
- jpicedt 1.3.2
getXYNearestSlope
public java.awt.Point getXYNearestSlope(double slope,
boolean isVector)