Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpicedt.graphic.io.parser.pstricks
Class PsUnitLengthExpression  view PsUnitLengthExpression download PsUnitLengthExpression.java

java.lang.Object
  extended byjpicedt.graphic.io.parser.AbstractRegularExpression
      extended byjpicedt.graphic.io.parser.SequenceExpression
          extended byjpicedt.graphic.io.parser.pstricks.PsUnitLengthExpression
All Implemented Interfaces:
jpicedt.graphic.io.parser.ExpressionConstants

public class PsUnitLengthExpression
extends jpicedt.graphic.io.parser.SequenceExpression
implements jpicedt.graphic.io.parser.ExpressionConstants

To be used by PSTParamExpression.

"unit=1mm,xunit=1mm,yunit=1mm,runit=1mm" (or pt or cm), where setting unit sets xunit, yunit and runit simult. Default PsTricks's unit is 1cm ! (whereas jPicEdt default unit is 1mm) hence no unit leads to pstXunit = 0.1, etc...

Allowed syntaxs are : "0.11" (i.e. cm), "0.11mm", "0.11cm", "0.11pt"

According to PsTricks's doc, whitespaces are allowed ONLY after the comma (see PsTricks doc. page 6), though here we use a StatementExpression which swallows them, which makes it less stringent.

Once parsed, we set "psXunit", "psRunit" and "psYunit" in the pool


Field Summary
private  jpicedt.graphic.io.parser.LaTeXParser.Pool pool
           
static java.lang.String RUNIT
           
private  java.lang.String type
           
static java.lang.String UNIT
           
static java.lang.String XUNIT
           
static java.lang.String YUNIT
           
 
Fields inherited from class jpicedt.graphic.io.parser.SequenceExpression
 
Fields inherited from interface jpicedt.graphic.io.parser.ExpressionConstants
ANY_CHAR, ANY_CHAR_EOL, ANY_SIGN, AT_LEAST, AT_MOST, DEBUG, DOUBLE, EOL, EXACTLY, INTEGER, NEGATIVE, NON_NULL, POSITIVE, STRICTLY_NEGATIVE, STRICTLY_POSITIVE, WHITE_SPACES, WHITE_SPACES_OR_EOL
 
Constructor Summary
PsUnitLengthExpression(jpicedt.graphic.io.parser.LaTeXParser.Pool pl, java.lang.String type)
          unit actually sets the following three parameters : xunit, yunit, and runit.
 
Method Summary
private  void scaleUnit(double scale)
           
private  void setUnit(double value)
           
 
Methods inherited from class jpicedt.graphic.io.parser.SequenceExpression
add, interpret, toString
 
Methods inherited from class jpicedt.graphic.io.parser.AbstractRegularExpression
action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pool

private jpicedt.graphic.io.parser.LaTeXParser.Pool pool

XUNIT

public static final java.lang.String XUNIT
See Also:
Constant Field Values

YUNIT

public static final java.lang.String YUNIT
See Also:
Constant Field Values

RUNIT

public static final java.lang.String RUNIT
See Also:
Constant Field Values

UNIT

public static final java.lang.String UNIT
See Also:
Constant Field Values

type

private java.lang.String type
Constructor Detail

PsUnitLengthExpression

public PsUnitLengthExpression(jpicedt.graphic.io.parser.LaTeXParser.Pool pl,
                              java.lang.String type)
unit actually sets the following three parameters : xunit, yunit, and runit.

Method Detail

setUnit

private void setUnit(double value)

scaleUnit

private void scaleUnit(double scale)