Class ResourcePool

java.lang.Object
net.sf.paperclips.internal.ResourcePool

public class ResourcePool extends Object
Manages a pool of graphics resources for a graphics device (fonts, colors).
  • Method Summary

    Modifier and Type
    Method
    Description
    forDevice(org.eclipse.swt.graphics.Device device)
    Returns a SharedGraphics which creates resources on the given device.
    org.eclipse.swt.graphics.Color
    getColor(org.eclipse.swt.graphics.RGB rgb)
    Returns a color for the passed in RGB.
    org.eclipse.swt.graphics.Font
    getFont(org.eclipse.swt.graphics.FontData fontData)
    Returns a font for the passed in FontData.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • forDevice

      public static ResourcePool forDevice(org.eclipse.swt.graphics.Device device)
      Returns a SharedGraphics which creates resources on the given device.
      Parameters:
      device - the device which resources will be created on.
      Returns:
      a SharedGraphics which creates resources on the given device.
    • getFont

      public org.eclipse.swt.graphics.Font getFont(org.eclipse.swt.graphics.FontData fontData)
      Returns a font for the passed in FontData.
      Parameters:
      fontData - FontData describing the required font.
      Returns:
      a font for the passed in FontData.
    • getColor

      public org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
      Returns a color for the passed in RGB.
      Parameters:
      rgb - RGB describing the required color.
      Returns:
      a color for the passed in RGB.