Class JPICFormatter

  • All Implemented Interfaces:
    FormatterFactory, JPICConstants, PicObjectConstants

    public class JPICFormatter
    extends java.lang.Object
    implements FormatterFactory, PicObjectConstants, JPICConstants
    a FormatterFactory that produces formatters for the JPIC-XML native format

    Syntax for common attributes, that is, attributes not specific to a given subclass of Element, is strongly inspired from the XML-SVG markup language, although it is restricted to a subset of SVG attributes supported by jPicEdt, i.e. mainly by pstricks. Hence attributes names and values strongly mimic those of PsTricks, except for some keyword changes. So far, default values are hardcoded in DefaultAttributeSet. This may be changed in the near future, once the language has stabilized and the DtD is ready for use.

    Here is a list of supported attributes as of release 1.4-pre :

    • stroke-style=none|dashed|dotted|solid (default : solid)
    • stroke-color=#a_color_in_HEX_radix (default #000000)
    • stroke-width=length_in_mm
    • stroke-dasharray=a_dash_array (comma separated values)
    • stroke-dotsep=length_in_mm
    • fill-style=none|solid|any_PsTricks_valid_hatches_style (default : solid)
    • fill-color=#a_color_in_HEX_radix (default #000000)
    • shadow=true|false (default : false)
    • shadow-size=length_in_mm
    • shadow-angle=angle_in_degrees
    • shadow-color=#a_color_in_HEX_radix (default #000000)
    • hatch-width=length_in_mm
    • hatch-sep=length_in_mm
    • hatch-angle=angle_in_degrees
    • hatch-color=#a_color_in_HEX_radix (default #000000)
    • doubleline=true|false (default : false)
    • doubleline-sep=length_in_mm
    • doubleline-color=length_in_mm (default #000000)
    • left-arrow=arrow_name_as_in_Arrow_class (default Arrow.NONE)
    • right-arrow=arrow_name_as_in_Arrow_class (default Arrow.NONE)
    • arrow-global-scale-width=scale_factor_for_width
    • arrow-global-scale-length=scale_factor_for_length
    • arrow-width-minimum=minimum_width_in_mm
    • arrow-width-linewidth-scale=width_scale_factor_wrt_linewidth
    • arrow-length-scale=scale_factor_for_length
    • arrow-inset-scale=scale_factor_for_inset
    • tbar-width-minimum=minimum_width_for_tbars_in_mm
    • tbar-width-linewidth-scale=width_scale_factor_for_tbars_wrt_linewidth
    • bracket-length-scale=length_scale_factor_for_brackets
    • rbracket-length-scale=length_scale_factor_for_rounded_brackets
    • [todo] style=name_of_a_user_defined_style (see future <style> tag). Any attribute defined "in place" overrides the same attribute when defined in the corresponding <style> tag.
    These syntax rules are only briefly laid out here as a reminder to end-users. The corresponding DtD, once it is set up, will be the only valid specification for that matter.
    Since:
    jpicedt 1.4
    Version:
    $Id: JPICFormatter.java,v 1.18.2.1 2007/09/02 11:56:19 reynal Exp $
    Author:
    Sylvain Reynal
    • Field Detail

      • STROKE_DASHARRAY

        public static final java.lang.String STROKE_DASHARRAY
        See Also:
        Constant Field Values
    • Constructor Detail

      • JPICFormatter

        public JPICFormatter()
    • Method Detail

      • createFormatter

        public Formatter createFormatter​(Element e)
        Return a Formatter able to format the given Element in the JPIC-XML format
        Specified by:
        createFormatter in interface FormatterFactory
        Returns:
        a Formatter able to format the given Element according to the format of this factory
      • configure

        public static void configure​(java.util.Properties preferences)
        Configure static fields using the given Properties object This implementation does nothing so far.
        Parameters:
        properties - used to read shared parameters. If null, default values are used.
      • createFormatter

        public Formatter createFormatter​(Drawing d,
                                         java.lang.Object outputConstraint)
        Return a Formatter able to format the given Drawing in the JPIC-XML language ;
        Specified by:
        createFormatter in interface FormatterFactory
        Parameters:
        outputConstraint - constraint used by this factory to create a specific Formatter on-the-fly, with e.g. dynamic constraints on the output format. There are no constraints so far for this factory, and this parameter may safely be set to null.
        Returns:
        a Formatter able to format the given Drawing according to the format of this factory ; this may reliy on calls to createFormatter(Element e) on the elements of the drawing, plus creating auxiliary