Class BackgroundPrint

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

public class BackgroundPrint extends Object implements Print
A decorator that paints a background color behind it's target.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BackgroundPrint(Print target, org.eclipse.swt.graphics.RGB background)
    Constructs a BackgroundPrint with the given target and background color.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    org.eclipse.swt.graphics.RGB
    Returns the background color.
    Returns the wrapped print to which the background color is being applied.
    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.
    void
    setBackground(org.eclipse.swt.graphics.RGB background)
    Sets the background color.

    Methods inherited from class java.lang.Object

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

    • BackgroundPrint

      public BackgroundPrint(Print target, org.eclipse.swt.graphics.RGB background)
      Constructs a BackgroundPrint with the given target and background color.
      Parameters:
      target - the
      background -
  • Method Details

    • hashCode

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

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

      public Print getTarget()
      Returns the wrapped print to which the background color is being applied.
      Returns:
      the wrapped print to which the background color is being applied.
    • getBackground

      public org.eclipse.swt.graphics.RGB getBackground()
      Returns the background color.
      Returns:
      the background color.
    • setBackground

      public void setBackground(org.eclipse.swt.graphics.RGB background)
      Sets the background color.
      Parameters:
      background - the new background color.
    • 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.