jpicedt.format.output.pstricks
Class PstricksFormatter
java.lang.Object
jpicedt.format.output.pstricks.PstricksFormatter
- All Implemented Interfaces:
- PstricksConstants, FormatterFactory, PicObjectConstants
public class PstricksFormatter
- extends java.lang.Object
- implements FormatterFactory, PicObjectConstants, PstricksConstants
Produces formatters for the PsTricks macro package.
- Since:
- jpicedt 1.3.2
- Version:
- $Id: PstricksFormatter.java,v 1.21.2.1 2007/09/02 11:55:14 reynal 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. |
Fields inherited from interface jpicedt.graphic.model.PicObjectConstants |
ARROW_GLOBAL_SCALE_LENGTH, ARROW_GLOBAL_SCALE_WIDTH, ARROW_INSET_SCALE, ARROW_LENGTH_SCALE, ARROW_WIDTH_LINEWIDTH_SCALE, ARROW_WIDTH_MINIMUM_MM, BRACKET_LENGTH_SCALE, 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, MIDDLE, NONE, OUTER, OVER_STRIKE, OVER_STRIKE_COLOR, OVER_STRIKE_WIDTH, POLYDOTS_ANGLE, POLYDOTS_CIRCLE, POLYDOTS_DISK, POLYDOTS_PENTAGON, POLYDOTS_PENTAGON_FILLED, POLYDOTS_PLUS, POLYDOTS_SCALE_H, POLYDOTS_SCALE_V, POLYDOTS_SIZE_LINEWIDTH_SCALE, POLYDOTS_SIZE_MINIMUM_MM, POLYDOTS_SQUARE, POLYDOTS_SQUARE_FILLED, POLYDOTS_STYLE, POLYDOTS_SUPERIMPOSE, POLYDOTS_TRIANGLE, POLYDOTS_TRIANGLE_FILLED, PS_POINT, PST_CUSTOM, RBRACKET_LENGTH_SCALE, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, TBAR_WIDTH_LINEWIDTH_SCALE, TBAR_WIDTH_MINIMUM_MM, TEXT_BOX_CIRCLE, TEXT_BOX_NO_FRAME, TEXT_BOX_OVAL, TEXT_BOX_RECTANGLE, TEXT_FRAME, TEXT_HALIGN_CENTER, TEXT_HALIGN_LEFT, TEXT_HALIGN_RIGHT, TEXT_HOR_ALIGN, TEXT_ROTATION, TEXT_VALIGN_BASELINE, TEXT_VALIGN_BOTTOM, TEXT_VALIGN_CENTER, TEXT_VALIGN_TOP, TEXT_VERT_ALIGN, VLINES, VLINES_FILLED |
Fields inherited from interface jpicedt.format.output.pstricks.PstricksConstants |
CR_LF, DEFAULT_FILE_WRAPPER_EPILOG, DEFAULT_FILE_WRAPPER_PROLOG, KEY_FILE_WRAPPER_EPILOG, KEY_FILE_WRAPPER_PROLOG, PST_ARROWS, PST_ARROWS_LEFT, PST_ARROWS_RIGHT, PST_COLORNAMES, PST_COLORS, RESCALING_TEX_FUNCTION |
Method Summary |
static void |
configure(java.util.Properties preferences)
Configure static fields using the given Properties object |
java.lang.StringBuffer |
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,
java.lang.Object outputConstraint)
|
Formatter |
createFormatter(Element e)
|
PstricksFormatter.ParameterString |
createParameterString(Element obj)
Returns PsTricks's "standard" parameter string for the given Element:
linewidth=xxx, linecolor=xxxx, doubleline=true/false and rel. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fileWrapperEpilog
protected static java.lang.String fileWrapperEpilog
fileWrapperProlog
protected static java.lang.String fileWrapperProlog
PstricksFormatter
public PstricksFormatter()
createFormatter
public Formatter createFormatter(Element e)
- Specified by:
createFormatter
in interface FormatterFactory
- Returns:
- a Formatter able to format the given Element in the PsTricks format
configure
public static void configure(java.util.Properties preferences)
- Configure static fields using the given Properties object
- Parameters:
properties
- used to read shared parameters
If null, default values are used.
createFormatter
public Formatter createFormatter(Drawing d,
java.lang.Object outputConstraint)
- Specified by:
createFormatter
in interface FormatterFactory
- 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:
- linewidth=xxx, linecolor=xxxx, doubleline=true/false and rel.
- if dash non-nul : linestyle=dashed, dash=xx yy
- if object if filled : fillstyle=solid, fillcolor=xxxx + possibly shadow and hatch parameters.
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 java.lang.StringBuffer 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).
main
public static void main(java.lang.String[] args)
Submit a bug : syd@jpicedt.org