Class JaxoAxodraw

java.lang.Object
net.sf.jaxodraw.io.imports.JaxoAxodraw
Direct Known Subclasses:
JaxoAxodraw4J

public class JaxoAxodraw extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor: Initializes the list of Latex packages (axodraw and color).
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Adds a latex package if it is not already contained in the package list.
    final void
    checkRequired(String newString)
    Checks whether the given string starts with one of "\documentclass", "\begin{document}" or "\begin{picture}".
    protected String[]
    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 float
    Return the current bounding box height.
    protected Color
    Return the current color.
    final String
    Returns the comment (description) of this axodraw object.
    protected int[]
    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 String
    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[]
    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 String
    Returns the string "String" contained in a string of the form " # {String} * " where * can be anything and # doesn't contain any curly brackets.
    final List<String>
    Returns the current list of LaTeX packages included in the graph.
    final float
    Returns the scale factor of this axodraw object.
    protected int[]
    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 float
    Return the current stroke (line width).
    protected int[]
    getT4Params(int[] firstl, int[] secondl)
     
    protected String[]
    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[]
    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[]
    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[]
    Returns an array that indicates which required LaTeX commands were found.
    protected JaxoObject
     
    final boolean
    Removes a latex package if it is contained in the package list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • JaxoAxodraw

      public JaxoAxodraw()
      Constructor: Initializes the list of Latex packages (axodraw and color).
  • Method Details

    • getJaxoObject

      public JaxoObject getJaxoObject(String newString)
      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

      public final void checkRequired(String newString)
      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

      public final List<String> getPackages()
      Returns the current list of LaTeX packages included in the graph.
      Returns:
      A List that contains strings of latex packages.
    • addPackage

      public final void addPackage(String pack)
      Adds a latex package if it is not already contained in the package list.
      Parameters:
      pack - the package to add.
    • removePackage

      public final boolean removePackage(String pack)
      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

      public final String 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

      protected int[] getLineParams(int[] in, String st)
    • getT4Params

      protected int[] getT4Params(int[] firstl, int[] secondl)
    • getArcPoints

      protected Point2D[] getArcPoints(String[] st, boolean clock)
    • getLoopPars

      protected int[] getLoopPars(String[] st, String st1, boolean cntrclk)
    • getFourInts

      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.
      Parameters:
      str - the string.
      Returns:
      the four ints.
    • getTwoInts

      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.
      Parameters:
      str - the string.
      Returns:
      the two ints.
    • getFourInts

      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.
      Parameters:
      str - the string.
      fromIndex - the starting index.
      Returns:
      the four ints.
    • getSixInts

      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.
      Parameters:
      str - the string.
      Returns:
      the six ints.
    • getOneBracket

      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.
      Parameters:
      str - the String.
      Returns:
      the two ints.
    • getOneBrace

      protected String getOneBrace(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.
      Parameters:
      str - the String.
      Returns:
      the four ints.
    • getOneCurl

      protected String getOneCurl(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.
      Parameters:
      str - the String.
      Returns:
      the String.
    • getTwoCurls

      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.
      Parameters:
      str - the String.
      Returns:
      the Strings.
    • getThreeCurls

      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.
      Parameters:
      str - the String.
      Returns:
      the Strings.
    • getArcBrackets

      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.
      Parameters:
      str - the String.
      Returns:
      the Strings.
    • newPLine

      protected JaxoObject newPLine()
    • getColor

      protected Color getColor()
      Return the current color.
      Returns:
      The current color.
    • 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.