Class JaxoAxodraw
java.lang.Object
net.sf.jaxodraw.io.imports.JaxoAxodraw
- Direct Known Subclasses:
JaxoAxodraw4J
Defines a number of axodraw LaTeX commands and all the methods to convert
them into JaxoObjects. This is responsible for the import option.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
ConstructorsConstructorDescriptionConstructor: Initializes the list of Latex packages (axodraw and color). -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddPackage(String pack) Adds a latex package if it is not already contained in the package list.final voidcheckRequired(String newString) Checks whether the given string starts with one of "\documentclass", "\begin{document}" or "\begin{picture}".protected String[]getArcBrackets(String str) Returns the five strings s1 - s5 contained in a string of the form " # (s1, s2) (s3, s4, s5) * " where * can be anything and # doesn't contain any parenthesis.protected Point2D[]getArcPoints(String[] st, boolean clock) protected floatReturn the current bounding box height.protected ColorgetColor()Return the current color.final StringReturns the comment (description) of this axodraw object.protected int[]getFourInts(String str) Returns the four integers xi,yi,xf,yf contained in a string of the form " # (xi,yi) (xf,yf) * " where * can be anything and # doesn't contain any parenthesis.protected int[]getFourInts(String str, int fromIndex) Returns the four integers xi,yi,xf,yf contained in a string of the form " # (xi,yi) (xf,yf) * " where * can be anything and # doesn't contain any parenthesis.getJaxoObject(String newString) Returns a JaxoObject corresponding to a axodraw command.protected int[]getLineParams(int[] in, String st) protected int[]getLoopPars(String[] st, String st1, boolean cntrclk) protected StringgetOneBrace(String str) Returns the four integers xi,yi,xf,yf contained in a string of the form " # [String] * " where * can be anything and # doesn't contain any braces.protected String[]getOneBracket(String str) Returns the two integers xi,yi contained in a string of the form " # (xi,yi) * " where * can be anything and # doesn't contain any parenthesis.protected StringgetOneCurl(String str) Returns the string "String" contained in a string of the form " # {String} * " where * can be anything and # doesn't contain any curly brackets.Returns the current list of LaTeX packages included in the graph.final floatReturns the scale factor of this axodraw object.protected int[]getSixInts(String str) Returns the six integers x1, y1,x2,y2,x3,y3 contained in a string of the form " # (x1, y1) (x2,y2) (x3,y3) * " where * can be anything and # doesn't contain any parenthesis.protected floatReturn the current stroke (line width).protected int[]getT4Params(int[] firstl, int[] secondl) protected String[]getThreeCurls(String str) Returns the three strings s1, s2, s3 contained in a string of the form " # {s1}{s2}{s3} * " where * can be anything and # doesn't contain any curly brackets.protected String[]getTwoCurls(String str) Returns the two strings s1, s2 contained in a string of the form " # {s1}{s2} * " where * can be anything and # doesn't contain any curly brackets.protected int[]getTwoInts(String str) Returns the two integers xi,yi contained in a string of the form " # (xi,yi) * " where * can be anything and # doesn't contain any parenthesis.final boolean[]getValid()Returns an array that indicates which required LaTeX commands were found.protected JaxoObjectnewPLine()final booleanremovePackage(String pack) Removes a latex package if it is contained in the package list.
-
Field Details
-
LINE
- See Also:
-
COLOR
- See Also:
-
REL_WIDTH
- See Also:
-
REL_HEIGHT
- See Also:
-
PAINT_ARROW
- See Also:
-
STROKE_WIDTH
- See Also:
-
FREQ_FROM_WIGGLES
- See Also:
-
DOUBLE_LINE
- See Also:
-
DL_SEP
- See Also:
-
AMP
- See Also:
-
DASH
- See Also:
-
-
Constructor Details
-
JaxoAxodraw
public JaxoAxodraw()Constructor: Initializes the list of Latex packages (axodraw and color).
-
-
Method Details
-
getJaxoObject
Returns a JaxoObject corresponding to a axodraw command.- Parameters:
newString- One line of a latex file- Returns:
- A JaxoObject the corresponds to the axodraw command of the input line, or null, if nothing corresponds
-
checkRequired
Checks whether the given string starts with one of "\documentclass", "\begin{document}" or "\begin{picture}".- Parameters:
newString- The input string.
-
getValid
public final boolean[] getValid()Returns an array that indicates which required LaTeX commands were found.- Returns:
- An array of three boolean variables, the first is true if "\documentclass" was found, the second is true if "\begin{document}" was found, the third is true if "\begin{picture}" was found
-
getPackages
-
addPackage
Adds a latex package if it is not already contained in the package list.- Parameters:
pack- the package to add.
-
removePackage
Removes a latex package if it is contained in the package list.- Parameters:
pack- the package to remove.- Returns:
- true if the list contained the package, ie the list was modified.
-
getComment
Returns the comment (description) of this axodraw object.- Returns:
- The axodraw comment
-
getScaleFactor
public final float getScaleFactor()Returns the scale factor of this axodraw object.- Returns:
- The axodraw scale factor.
-
getLineParams
-
getT4Params
protected int[] getT4Params(int[] firstl, int[] secondl) -
getArcPoints
-
getLoopPars
-
getFourInts
Returns the four integers xi,yi,xf,yf contained in a string of the form " # (xi,yi) (xf,yf) * " where * can be anything and # doesn't contain any parenthesis.- Parameters:
str- the string.- Returns:
- the four ints.
-
getTwoInts
Returns the two integers xi,yi contained in a string of the form " # (xi,yi) * " where * can be anything and # doesn't contain any parenthesis.- Parameters:
str- the string.- Returns:
- the two ints.
-
getFourInts
Returns the four integers xi,yi,xf,yf contained in a string of the form " # (xi,yi) (xf,yf) * " where * can be anything and # doesn't contain any parenthesis.- Parameters:
str- the string.fromIndex- the starting index.- Returns:
- the four ints.
-
getSixInts
Returns the six integers x1, y1,x2,y2,x3,y3 contained in a string of the form " # (x1, y1) (x2,y2) (x3,y3) * " where * can be anything and # doesn't contain any parenthesis.- Parameters:
str- the string.- Returns:
- the six ints.
-
getOneBracket
-
getOneBrace
-
getOneCurl
-
getTwoCurls
-
getThreeCurls
-
getArcBrackets
-
newPLine
-
getColor
-
getStroke
protected float getStroke()Return the current stroke (line width).- Returns:
- The current stroke.
-
getBBoxHeight
protected float getBBoxHeight()Return the current bounding box height.- Returns:
- The current bounding box height.
-