/[classpath]/classpath/java/awt/image/ColorModel.java
ViewVC logotype

Diff of /classpath/java/awt/image/ColorModel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19.2.1 by gnu_andrew, Fri Jan 14 10:24:15 2005 UTC revision 1.19.2.2 by gnu_andrew, Sat Jan 15 17:01:49 2005 UTC
# Line 43  import gnu.java.awt.Buffers; Line 43  import gnu.java.awt.Buffers;
43  import java.awt.Point;  import java.awt.Point;
44  import java.awt.Transparency;  import java.awt.Transparency;
45  import java.awt.color.ColorSpace;  import java.awt.color.ColorSpace;
46    import java.lang.reflect.Constructor;
47  import java.util.Arrays;  import java.util.Arrays;
48    
49  /**  /**
# Line 158  public abstract class ColorModel impleme Line 159  public abstract class ColorModel impleme
159      this.transferType = transferType;      this.transferType = transferType;
160    }    }
161    
162      // This is a hook for ColorConvertOp to create a colormodel with
163      // a new colorspace
164      ColorModel cloneColorModel(ColorSpace cspace)
165      {
166        Class cls = this.getClass();
167        ColorModel cm;
168        try {
169          // This constructor will exist.
170          Constructor ctor =
171            cls.getConstructor(new Class[]{int.class, int[].class,
172                                           ColorSpace.class, boolean.class,
173                                           boolean.class, int.class, int.class});
174          cm = (ColorModel)ctor.
175            newInstance(new Object[]{new Integer(pixel_bits),
176                                     bits, cspace, Boolean.valueOf(hasAlpha),
177                                     Boolean.valueOf(isAlphaPremultiplied),
178                                     new Integer(transparency),
179                                     new Integer(transferType)});
180        }
181        catch (Exception e)
182        {
183          throw new IllegalArgumentException();
184        }
185        return cm;
186      }
187      
188    public void finalize()    public void finalize()
189    {    {
190      // Do nothing here.      // Do nothing here.

Legend:
Removed from v.1.19.2.1  
changed lines
  Added in v.1.19.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26