http://www.jpicedt.org

jpicedt.format.output.pstricks
Class PstricksFormatter

java.lang.Object
  extended by jpicedt.graphic.io.formatter.AbstractFormatterFactory
      extended by jpicedt.format.output.pstricks.PstricksFormatter
All Implemented Interfaces:
FormatterFactory

public class PstricksFormatter
extends AbstractFormatterFactory

Produces formatters for the PsTricks macro package.

Since:
jpicedt 1.3.2
Version:
$Id: PstricksFormatter.java,v 1.38 2013/03/27 07:23:04 vincentb1 Exp $
Author:
Sylvain Reynal

Nested Class Summary
 class PstricksFormatter.DrawingFormatter
          "begin{pspicture}(x0,y0)(x1,y1)" (PsTricks) where (x0,y0)=lower-left corner and (x1,y1)=upper-right corner
 class PstricksFormatter.ParameterString
          an inner class that represents a PsTricks parameter string (useful especially to handle User Defined Colours) the basic problem is that, if a new colour has to be defined, this has to be done through e.g. a \\newrgbcolor command BEFORE the Element command appears in the file.
 
Field Summary
protected static String fileWrapperEpilog
           
protected static String fileWrapperProlog
           
 
Fields inherited from class jpicedt.graphic.io.formatter.AbstractFormatterFactory
commentFormatter, factoryMap, lineSeparator
 
Fields inherited from interface jpicedt.graphic.io.formatter.FormatterFactory
MAKE_STANDALONE_FILE
 
Constructor Summary
PstricksFormatter()
          Creates a FormatterFactory able to format Element's in the PsTricks format
 
Method Summary
static void configure(Properties preferences)
          Configure static fields using the given Properties object
 PstricksFormatter.ParameterString createDefaultParameterString()
          Returns a "\\psset{...}" buffer containing default parameters (useful if these differ from PsTricks's ones) This is very similar to createParameterString() except that a default attribute set is used, and dimensional parameters are taken into account, for which jPicEdt's default values slightly differ from PsTricks's default (mostly due to the use of mm instead of postscript points as the basic unit).
 Formatter createFormatter(Drawing d, Object outputConstraint)
           
 PstricksFormatter.ParameterString createParameterString(Element obj)
          Returns PsTricks's "standard" parameter string for the given Element: linewidth=xxx, linecolor=xxxx, doubleline=true/false and rel.
 PicGroup getContainerPsCustom()
          Renvoie le dernier PicGroup ayant un compoundMode égal à JOINT, s'il y en a un, null sinon, de sorte à détecter l'exception NestedPsCustomException.
 PstricksCustomProperties getCustomProperties()
           
static void main(String[] args)
           
 void popDefaultAttributes()
          Remplace les defaultAttributes courante par ceux du sommet de pile defaultAttributesStack, et dépile.
 void pushDefaultAttributes(PicAttributeSet defaultAttributes)
          Sauvegarde les defaultAttribute courant dans la pile defaultAttributesStack, et remplace les par ceux passés en argument.
 void setContainerPsCustom(PicGroup group)
          Mémorise le dernier PicGroup ayant un compoundMode égal à JOINT, de sorte à détecter l'exception NestedPsCustomException.
 
Methods inherited from class jpicedt.graphic.io.formatter.AbstractFormatterFactory
createFormatter, getCommentFormatter, getFileWrapperEpilog, getFileWrapperProlog, getFormatterFactory, getLineSeparator, getMappedClass, map, revertedArrowsAttribute, setCommentFormatter, setLineSeparator, stringWriteMultiLine, textWriteMultiLine, toString, unmap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileWrapperEpilog

protected static String fileWrapperEpilog

fileWrapperProlog

protected static String fileWrapperProlog
Constructor Detail

PstricksFormatter

public PstricksFormatter()
Creates a FormatterFactory able to format Element's in the PsTricks format

Method Detail

getCustomProperties

public PstricksCustomProperties getCustomProperties()

setContainerPsCustom

public void setContainerPsCustom(PicGroup group)
Mémorise le dernier PicGroup ayant un compoundMode égal à JOINT, de sorte à détecter l'exception NestedPsCustomException.

Since:
jPicEdt 1.6

getContainerPsCustom

public PicGroup getContainerPsCustom()
Renvoie le dernier PicGroup ayant un compoundMode égal à JOINT, s'il y en a un, null sinon, de sorte à détecter l'exception NestedPsCustomException.

Since:
jPicEdt 1.6

configure

public static void configure(Properties preferences)
Configure static fields using the given Properties object

Parameters:
preferences - used to read shared parameters If null, default values are used.

createFormatter

public Formatter createFormatter(Drawing d,
                                 Object outputConstraint)
Parameters:
outputConstraint - constraint used by the factory to create a specific Formatter on-the-fly
Returns:
a Formatter able to format the given Drawing in the PsTricks format ; this may reliy on calls to createFormatter(Element e) on the elements of the drawing, plus creating auxiliary

createParameterString

public PstricksFormatter.ParameterString createParameterString(Element obj)
Returns PsTricks's "standard" parameter string for the given Element: Note that leading and trailing brackets must be added by the caller ! (this allows the caller to add its own set of parameters)

Since jpicedt 1.3.3: border is supported (not bordercolor), custom parameters are included verbatim

Returns:
an object encapsulating the parameter string as well as one or more \\newrgbcolor commands whenever deemed necessary.

createDefaultParameterString

public PstricksFormatter.ParameterString createDefaultParameterString()
Returns a "\\psset{...}" buffer containing default parameters (useful if these differ from PsTricks's ones) This is very similar to createParameterString() except that a default attribute set is used, and dimensional parameters are taken into account, for which jPicEdt's default values slightly differ from PsTricks's default (mostly due to the use of mm instead of postscript points as the basic unit).


pushDefaultAttributes

public void pushDefaultAttributes(PicAttributeSet defaultAttributes)
Sauvegarde les defaultAttribute courant dans la pile defaultAttributesStack, et remplace les par ceux passés en argument.

Parameters:
defaultAttributes - nouveaux defaultAttributes
Since:
jPicEdt 1.5.1

popDefaultAttributes

public void popDefaultAttributes()
Remplace les defaultAttributes courante par ceux du sommet de pile defaultAttributesStack, et dépile.

Since:
jPicEdt 1.5.1

main

public static void main(String[] args)

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org