Class FactoryPrint

  • All Implemented Interfaces:
    Print

    public abstract class FactoryPrint
    extends java.lang.Object
    implements Print
    Deprecated.
    This class will be removed in a future release.
    An ill-conceived class I wish I could take back.
    • Constructor Summary

      Constructors 
      Constructor Description
      FactoryPrint()
      Deprecated.
      Default constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected java.lang.String convertToString​(java.lang.Object obj)
      Deprecated.
      Converts the argument to a String.
      protected abstract Print createPrint()
      Deprecated.
      Compose and return a Print appropriate for the concrete class.
      protected EmptyPrint empty()
      Deprecated.
      Constructs and returns an EmptyPrint of size (0, 0).
      protected EmptyPrint empty​(int width, int height)
      Deprecated.
      Constructs and returns an EmptyPrint with the given size.
      protected int getDefaultGridSpacing()
      Deprecated.
      Returns the default spacing, in points, for GridPrints.
      protected org.eclipse.swt.graphics.Point getDefaultImageDPI()
      Deprecated.
      Returns the default image DPI.
      protected org.eclipse.swt.graphics.FontData getDefaultLabelFont()
      Deprecated.
      Returns the default label font.
      protected org.eclipse.swt.graphics.FontData getDefaultTextFont()
      Deprecated.
      Returns the default text font.
      protected org.eclipse.swt.graphics.ImageData getImageData​(java.lang.String filename)
      Deprecated.
      Creates and returns an ImageData using the given filename.
      Print getPrint()
      Deprecated.
      Returns the Print created by this factory.
      protected GridPrint grid​(java.lang.String columns)
      Deprecated.
      Returns a GridPrint with columns using the given argument.
      protected GridPrint grid​(java.lang.String columns, int spacing)
      Deprecated.
      Returns a GridPrint with the given columns and spacing.
      protected ImagePrint image​(java.io.InputStream is)
      Deprecated.
      Returns an ImagePrint with the given image, and the default DPI.
      protected ImagePrint image​(java.io.InputStream is, org.eclipse.swt.graphics.Point dpi)
      Deprecated.
      Returns an ImagePrint with the given image and DPI.
      protected ImagePrint image​(java.lang.String filename)
      Deprecated.
      Returns an ImagePrint with the given image, and the default DPI.
      protected ImagePrint image​(java.lang.String filename, org.eclipse.swt.graphics.Point dpi)
      Deprecated.
      Returns an ImagePrint with the given image and DPI.
      protected ImagePrint image​(org.eclipse.swt.graphics.ImageData imageData)
      Deprecated.
      Returns an ImagePrint with the given image data, using the default DPI.
      protected ImagePrint image​(org.eclipse.swt.graphics.ImageData imageData, org.eclipse.swt.graphics.Point dpi)
      Deprecated.
      Returns an ImagePrint with the given image data and DPI.
      PrintIterator iterator​(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
      Deprecated.
      Returns a PrintIterator for the Print returned from a call to createPrint().
      protected TextPrint label​(java.lang.String text)
      Deprecated.
      Returns a TextPrint with the given text.
      protected TextPrint label​(java.lang.String text, int align)
      Deprecated.
      Returns a TextPrint with the given text and alignment.
      protected LayerPrint layer()
      Deprecated.
      Constructs and returns a new LayerPrint.
      protected TextPrint text​(java.lang.Object obj)
      Deprecated.
      Returns a TextPrint whose text represents the given parameter.
      protected TextPrint text​(java.lang.Object obj, int align)
      Deprecated.
      Returns a TextPrint whose text represents the given parameter.
      protected TextPrint text​(java.lang.String text)
      Deprecated.
      Returns a TextPrint with the given text.
      protected TextPrint text​(java.lang.String text, int align)
      Deprecated.
      Returns a TextPrint with the given text and alignment.
      • Methods inherited from class java.lang.Object

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

      • FactoryPrint

        public FactoryPrint()
        Deprecated.
        Default constructor.
    • Method Detail

      • getPrint

        public Print getPrint()
        Deprecated.
        Returns the Print created by this factory.
        Returns:
        the Print created by this factory.
      • iterator

        public PrintIterator iterator​(org.eclipse.swt.graphics.Device device,
                                      org.eclipse.swt.graphics.GC gc)
        Deprecated.
        Returns a PrintIterator for the Print returned from a call to createPrint().
        Specified by:
        iterator in interface Print
        Parameters:
        device - the graphics device this Print will be drawn onto.
        gc - the graphics context to be used for calculating layout and drawing the Print's contents.
        Returns:
        a PrintIterator for laying out the contents of this Print.
      • createPrint

        protected abstract Print createPrint()
        Deprecated.
        Compose and return a Print appropriate for the concrete class. Subclasses must override this method to create the Print.
        Returns:
        a Print appropriate for the concrete class.
      • convertToString

        protected java.lang.String convertToString​(java.lang.Object obj)
        Deprecated.
        Converts the argument to a String. This method is used by the TextPrint factory methods which accept an Object.
        Parameters:
        obj - the object to convert.
        Returns:
        This implementation returns the result of obj.toString(), or an empty string if the argument is null. Override this method to change this behavior.
      • getDefaultTextFont

        protected org.eclipse.swt.graphics.FontData getDefaultTextFont()
        Deprecated.
        Returns the default text font. All TextPrints returned from the text(...) methods are set to this font. This implementation uses TextPrint.DEFAULT_FONT_DATA as the default text font. Override this method to change the default text font.
        Returns:
        the default text font.
      • getDefaultLabelFont

        protected org.eclipse.swt.graphics.FontData getDefaultLabelFont()
        Deprecated.
        Returns the default label font. All TextPrints returned from the label(...) methods are set to this font. This implementation uses TextPrint.DEFAULT_FONT_DATA as the default label font. Override this method to change the default label font.
        Returns:
        the default label font.
      • getDefaultGridSpacing

        protected int getDefaultGridSpacing()
        Deprecated.
        Returns the default spacing, in points, for GridPrints. All GridPrints returned from the grid(String) method(s) have their vertical and horizontal spacing set to this value. This implementation returns 0 as the default spacing. Override this method to change the default grid spacing.
        Returns:
        the default spacing, in points, between GridPrint cells.
      • text

        protected TextPrint text​(java.lang.Object obj)
        Deprecated.
        Returns a TextPrint whose text represents the given parameter. The returned object will be set to the default text font.
        Parameters:
        obj - the object that the returned TextPrint will represent.
        Returns:
        a TextPrint whose text represents the given parameter.
        See Also:
        convertToString(Object), getDefaultTextFont()
      • text

        protected TextPrint text​(java.lang.Object obj,
                                 int align)
        Deprecated.
        Returns a TextPrint whose text represents the given parameter. The returned object will be set to the default text font.
        Parameters:
        obj - the object that the returned TextPrint will represent.
        align - the alignment property for the returned TextPrint.
        Returns:
        a TextPrint whose text represents the given parameter.
        See Also:
        convertToString(Object), getDefaultTextFont()
      • text

        protected TextPrint text​(java.lang.String text)
        Deprecated.
        Returns a TextPrint with the given text. The returned object will be set to the default text font.
        Parameters:
        text - the text property for the returned TextPrint
        Returns:
        a TextPrint with the given text.
        See Also:
        getDefaultTextFont()
      • text

        protected TextPrint text​(java.lang.String text,
                                 int align)
        Deprecated.
        Returns a TextPrint with the given text and alignment. The returned object will be set to the default text font.
        Parameters:
        text - the text property for the returned TextPrint
        align - the alignment property for the returned TextPrint.
        Returns:
        a TextPrint with the given text and alignment.
        See Also:
        convertToString(Object), getDefaultTextFont()
      • label

        protected TextPrint label​(java.lang.String text)
        Deprecated.
        Returns a TextPrint with the given text. The returned object will be set to the default label font.
        Parameters:
        text - the text property for the returned TextPrint
        Returns:
        a TextPrint with the given text.
        See Also:
        convertToString(Object), getDefaultLabelFont()
      • label

        protected TextPrint label​(java.lang.String text,
                                  int align)
        Deprecated.
        Returns a TextPrint with the given text and alignment. The returned object will be set to the default label font.
        Parameters:
        text - the text property for the returned TextPrint
        align - the alignment property for the returned TextPrint.
        Returns:
        a TextPrint with the given text and alignment.
        See Also:
        convertToString(Object), getDefaultLabelFont()
      • getDefaultImageDPI

        protected org.eclipse.swt.graphics.Point getDefaultImageDPI()
        Deprecated.
        Returns the default image DPI. All ImagePrints returned from the image(...) methods are set to this DPI. This implementation uses (300, 300) as the default DPI. Override this method to change the default image DPI.
        Returns:
        the default image DPI.
      • getImageData

        protected org.eclipse.swt.graphics.ImageData getImageData​(java.lang.String filename)
        Deprecated.
        Creates and returns an ImageData using the given filename. All ImagePrints returned from the image(...) methods are set to this DPI. This implementation uses the ImageData(String filename) constructor to generate the ImageData. Override this method to change this behavior.
        Parameters:
        filename - the filename of the image to load.
        Returns:
        an ImageData containing the image from the given filename.
      • image

        protected ImagePrint image​(java.lang.String filename)
        Deprecated.
        Returns an ImagePrint with the given image, and the default DPI.
        Parameters:
        filename - the filename of the image to load.
        Returns:
        an ImagePrint with the given image.
        See Also:
        getDefaultImageDPI()
      • image

        protected ImagePrint image​(java.lang.String filename,
                                   org.eclipse.swt.graphics.Point dpi)
        Deprecated.
        Returns an ImagePrint with the given image and DPI.
        Parameters:
        filename - the filename of the image to load.
        dpi - the DPI at which the image is to be printed.
        Returns:
        an ImagePrint with the given image and DPI.
      • image

        protected ImagePrint image​(java.io.InputStream is)
        Deprecated.
        Returns an ImagePrint with the given image, and the default DPI.
        Parameters:
        is - an input stream the image will be loaded from.
        Returns:
        an ImagePrint with the given image, and the default DPI.
      • image

        protected ImagePrint image​(java.io.InputStream is,
                                   org.eclipse.swt.graphics.Point dpi)
        Deprecated.
        Returns an ImagePrint with the given image and DPI.
        Parameters:
        is - an InputStream which the image will be loaded from.
        dpi - the DPI the image will be printed at.
        Returns:
        an ImagePrint with the given image and DPI.
      • image

        protected ImagePrint image​(org.eclipse.swt.graphics.ImageData imageData)
        Deprecated.
        Returns an ImagePrint with the given image data, using the default DPI.
        Parameters:
        imageData - the ImageData of the image to print.
        Returns:
        an ImagePrint with the given image data, using the default DPI.
      • image

        protected ImagePrint image​(org.eclipse.swt.graphics.ImageData imageData,
                                   org.eclipse.swt.graphics.Point dpi)
        Deprecated.
        Returns an ImagePrint with the given image data and DPI.
        Parameters:
        imageData - the ImageData of the image to print.
        dpi - the DPI the image will be printed at.
        Returns:
        an ImagePrint with the given image data and DPI.
      • grid

        protected GridPrint grid​(java.lang.String columns)
        Deprecated.
        Returns a GridPrint with columns using the given argument. The returned object will have the horizontal and vertical cell spacing set to the default spacing.
        Parameters:
        columns - comma-separated list of column specs.
        Returns:
        a GridPrint with columns using the given argument.
        See Also:
        GridColumn.parse(String), getDefaultGridSpacing()
      • grid

        protected GridPrint grid​(java.lang.String columns,
                                 int spacing)
        Deprecated.
        Returns a GridPrint with the given columns and spacing. The returned object will have the horizontal and vertical cell spacing set to the default spacing.
        Parameters:
        columns - comma-separated list of column specs.
        spacing - the spacing, in points, between cells in he GridPrint.
        Returns:
        a GridPrint with the specified column configuration and spacing.
        See Also:
        GridColumn.parse(String)
      • layer

        protected LayerPrint layer()
        Deprecated.
        Constructs and returns a new LayerPrint.
        Returns:
        a new LayerPrint.
      • empty

        protected EmptyPrint empty()
        Deprecated.
        Constructs and returns an EmptyPrint of size (0, 0).
        Returns:
        a new EmptyPrint of size (0, 0).
      • empty

        protected EmptyPrint empty​(int width,
                                   int height)
        Deprecated.
        Constructs and returns an EmptyPrint with the given size.
        Parameters:
        width - the width, in points.
        height - the height, in points.
        Returns:
        a new EmptyPrint with the given size.