Documentation of 'org.jhotdraw.samples.svg.io.SVGOutputFormat' Java class
SVGOutputFormat
org.jhotdraw.samples.svg.io

Class SVGOutputFormat

  • All Implemented Interfaces:
    OutputFormat
    Direct Known Subclasses:
    SVGZOutputFormat


    public class SVGOutputFormat
    extends java.lang.Object
    implements OutputFormat
    An output format for storing drawings as Scalable Vector Graphics SVG Tiny 1.2.
    • Constructor Summary

      Constructors 
      Constructor and Description
      SVGOutputFormat()
      Creates a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.awt.datatransfer.Transferable createTransferable(Drawing drawing, java.util.List<Figure> figures, double scaleFactor)
      Creates a Transferable for the specified list of Figures.
      java.lang.String getFileExtension()
      Returns the file extension for the output format.
      javax.swing.filechooser.FileFilter getFileFilter()
      Return a FileFilter that can be used to identify files which can be stored with this output format.
      java.lang.String getId(IXMLElement element)
      Gets a unique ID for the specified element.
      javax.swing.JComponent getOutputFormatAccessory()
      Return a JFileChooser accessory that can be used to customize the output format.
      boolean isPrettyPrint() 
      void setPrettyPrint(boolean newValue) 
      static java.lang.String toColor(java.awt.Color color) 
      static java.lang.String toNumber(double number)
      Returns a double array as a number attribute value.
      static java.lang.String toPath(BezierPath[] paths)
      Returns a value as a SVG Path attribute.
      static java.lang.String toPoints(java.awt.geom.Point2D.Double[] points)
      Returns a Point2D.Double array as a Points attribute value.
      static java.lang.String toTransform(java.awt.geom.AffineTransform t) 
      void write(java.io.File file, Drawing drawing) 
      void write(java.io.OutputStream out, Drawing drawing)
      Writes a Drawing into an output stream.
      void write(java.io.OutputStream out, Drawing drawing, java.util.List<Figure> figures)
      All other write methods delegate their work to here.
      void write(java.net.URI uri, Drawing drawing)
      Writes a Drawing into an URI.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SVGOutputFormat

        public SVGOutputFormat()
        Creates a new instance.
    • Method Detail

      • getFileFilter

        public javax.swing.filechooser.FileFilter getFileFilter()
        Description copied from interface: OutputFormat
        Return a FileFilter that can be used to identify files which can be stored with this output format. Typically, each output format has its own recognizable file extension.
        Specified by:
        getFileFilter in interface OutputFormat
        Returns:
        FileFilter to be used with a javax.swing.JFileChooser
      • getOutputFormatAccessory

        public javax.swing.JComponent getOutputFormatAccessory()
        Description copied from interface: OutputFormat
        Return a JFileChooser accessory that can be used to customize the output format.
        Specified by:
        getOutputFormatAccessory in interface OutputFormat
        Returns:
        A JFileChooser accessory to be used with a javax.swing.JFileChooser Returns null, if no accessory is provided for this format.
      • setPrettyPrint

        public void setPrettyPrint(boolean newValue)
      • isPrettyPrint

        public boolean isPrettyPrint()
      • toPath

        public static java.lang.String toPath(BezierPath[] paths)
        Returns a value as a SVG Path attribute. as specified in http://www.w3.org/TR/SVGMobile12/paths.html#PathDataBNF
      • toNumber

        public static java.lang.String toNumber(double number)
        Returns a double array as a number attribute value.
      • toPoints

        public static java.lang.String toPoints(java.awt.geom.Point2D.Double[] points)
                                         throws java.io.IOException
        Returns a Point2D.Double array as a Points attribute value. as specified in http://www.w3.org/TR/SVGMobile12/shapes.html#PointsBNF
        Throws:
        java.io.IOException
      • toTransform

        public static java.lang.String toTransform(java.awt.geom.AffineTransform t)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • toColor

        public static java.lang.String toColor(java.awt.Color color)
      • getFileExtension

        public java.lang.String getFileExtension()
        Description copied from interface: OutputFormat
        Returns the file extension for the output format. The file extension should be appended to a file name when storing a Drawing with the specified file format.
        Specified by:
        getFileExtension in interface OutputFormat
      • write

        public void write(java.net.URI uri,
                          Drawing drawing)
                   throws java.io.IOException
        Description copied from interface: OutputFormat
        Writes a Drawing into an URI.
        Specified by:
        write in interface OutputFormat
        Parameters:
        uri - The uri.
        drawing - The drawing.
        Throws:
        java.io.IOException
      • write

        public void write(java.io.File file,
                          Drawing drawing)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write(java.io.OutputStream out,
                          Drawing drawing)
                   throws java.io.IOException
        Description copied from interface: OutputFormat
        Writes a Drawing into an output stream.
        Specified by:
        write in interface OutputFormat
        Parameters:
        out - The output stream.
        drawing - The drawing.
        Throws:
        java.io.IOException
      • write

        public void write(java.io.OutputStream out,
                          Drawing drawing,
                          java.util.List<Figure> figures)
                   throws java.io.IOException
        All other write methods delegate their work to here.
        Throws:
        java.io.IOException
      • getId

        public java.lang.String getId(IXMLElement element)
        Gets a unique ID for the specified element.
      • createTransferable

        public java.awt.datatransfer.Transferable createTransferable(Drawing drawing,
                                                                     java.util.List<Figure> figures,
                                                                     double scaleFactor)
                                                              throws java.io.IOException
        Description copied from interface: OutputFormat
        Creates a Transferable for the specified list of Figures.
        Specified by:
        createTransferable in interface OutputFormat
        Parameters:
        drawing - The drawing.
        figures - A list of figures of the drawing.
        scaleFactor - The factor to be used, when the Transferable creates an image with a fixed size from the figures.
        Returns:
        The Transferable.
        Throws:
        java.io.IOException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.