/* AlphaComposite.java -- provides a context for performing alpha compositing
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
package java.awt;
+import gnu.java.awt.java2d.AlphaCompositeContext;
+
import java.awt.image.ColorModel;
import java.util.LinkedHashMap;
import java.util.Map;
/** Prune stale entries. */
protected boolean removeEldestEntry(Map.Entry eldest)
- { // XXX - FIXME Use Map.Entry, not just Entry as gcj 3.1 workaround.
+ {
return size() > MAX_CACHE_SIZE;
}
};
}
return a;
}
+
+ /**
+ * Creates a {@link CompositeContext} that can be used to perform
+ * compositing operations according to this AlphaComposite settings.
+ *
+ * @param srcColorModel the color model of the source raster
+ * @param dstColorModel the color model of the destination raster
+ * @param hints the rendering hints to use
+ *
+ * @return a {@link CompositeContext} that can be used to perform
+ * compositing operations according to this AlphaComposite settings
+ */
public CompositeContext createContext(ColorModel srcColorModel,
ColorModel dstColorModel,
RenderingHints hints)
{
- // XXX Implement. Sun uses undocumented implementation class
- // sun.java2d.SunCompositeContext.
- throw new Error("not implemented");
+ return new AlphaCompositeContext(this, srcColorModel, dstColorModel);
}
+
public float getAlpha()
{
return alpha;