Package net.sf.paperclips.internal
Class ResourcePool
java.lang.Object
net.sf.paperclips.internal.ResourcePool
Manages a pool of graphics resources for a graphics device (fonts, colors).
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcePoolforDevice(org.eclipse.swt.graphics.Device device) Returns a SharedGraphics which creates resources on the given device.org.eclipse.swt.graphics.ColorgetColor(org.eclipse.swt.graphics.RGB rgb) Returns a color for the passed in RGB.org.eclipse.swt.graphics.FontgetFont(org.eclipse.swt.graphics.FontData fontData) Returns a font for the passed in FontData.
-
Method Details
-
forDevice
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.
-