Class LayerPrint

java.lang.Object
net.sf.paperclips.LayerPrint
All Implemented Interfaces:
Print

public class LayerPrint extends Object implements Print
A Print which displays its child Prints on top each other.
Author:
Matthew Hall
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Constant for the default alignment of child Prints.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new LayerPrint.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Print print)
    Adds the given Print to this LayerPrint using the default alignment.
    void
    add(Print print, int align)
    Adds the given Print to this LayerPrint using the specified alignment.
    boolean
     
    Returns an array of entries in this LayerPrint.
    int
     
    iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
    Returns a PrintIterator for laying out the contents of this Print.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_ALIGN

      public static final int DEFAULT_ALIGN
      Constant for the default alignment of child Prints. Value is SWT.LEFT.
      See Also:
  • Constructor Details

    • LayerPrint

      public LayerPrint()
      Constructs a new LayerPrint.
  • Method Details

    • add

      public void add(Print print)
      Adds the given Print to this LayerPrint using the default alignment.
      Parameters:
      print - the Print to add.
      See Also:
    • add

      public void add(Print print, int align)
      Adds the given Print to this LayerPrint using the specified alignment.
      Parameters:
      print - the Print to add.
      align - the alignment for the Print. May be one of SWT.LEFT, SWT.CENTER, or SWT.RIGHT.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getEntries

      public LayerEntry[] getEntries()
      Returns an array of entries in this LayerPrint.
      Returns:
      an array of entries in this LayerPrint.
    • iterator

      public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
      Description copied from interface: Print
      Returns a PrintIterator for laying out the contents of this Print. The iterator uses a snapshot of the print at the time this method is invoked, so subsequent changes to the Print will not affect the output of the iterator.
      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.