aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/image
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-01-14 21:21:35 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-01-14 21:21:35 +0000
commit7365ecf7896065901cd8689f62873acdeaf38a25 (patch)
tree666ba25bc24bce17d8c08205797a7aef5d4d6f24 /libjava/java/awt/image
parentb41621ee1493dc1bc14c763a72a689f5a9055417 (diff)
downloadgcc-7365ecf7896065901cd8689f62873acdeaf38a25.zip
gcc-7365ecf7896065901cd8689f62873acdeaf38a25.tar.gz
gcc-7365ecf7896065901cd8689f62873acdeaf38a25.tar.bz2
2003-01-14 Michael Koch <konqueror@gmx.de>
* java/awt/Label.java (Label): Implements javax.accessibility.Accessible; * java/awt/List.java (List): Implements javax.accessibility.Accessible; * java/awt/ScrollPane.java (ScrollPane): Implements javax.accessibility.Accessible; * java/awt/Scrollbar.java (Scrollbar): Implements javax.accessibility.Accessible; * java/awt/TextComponent.java (setCaretPosition): Throw exception, documentation added. * java/awt/Toolkit.java: Added some newlines in method documentations. (createButton): Exception documentation added. (createTextField): Exception documentation added. (createLabel): Exception documentation added. (createList): Exception documentation added. (createCheckbox): Exception documentation added. (createScrollbar): Exception documentation added. (createScrollPane): Exception documentation added. (createTextArea): Exception documentation added. (createChoice): Exception documentation added. (createFrame): Exception documentation added. (createWindow): Exception documentation added. (createDialog): Exception documentation added. (createMenuBar): Exception documentation added. (createMenu): Exception documentation added. (createMenuItem): Exception documentation added. (createFileDialog): Exception documentation added. (createCheckboxMenuItem): Exception documentation added. (loadSystemColors): Exception documentation added. (setDynamicLayout): Exception documentation added. (isDynamicLayoutSet): Exception documentation added. (isDynamicLayoutActive): Exception documentation added. (getScreenSize): Exception documentation added. (getScreenResolution): Exception documentation added. (getScreenInsets): Exception documentation added. (getColorModel): Exception documentation added. (getSystemClipboard): Exception documentation added. (getSystemSelection): Exception documentation added. (getMenuShortcutKeyMask): Exception documentation added. (getSystemEventQueue): Exception documentation added. * java/awt/Window.java: Reindented some code. (Window): Centralized implementation, documentation added. (finalize): Documentation added. (hide): Fixed typo in comment. (getWindowListeners): Documentation added. * java/awt/color/ColorSpace.java (toRGB): Documentation added. * java/awt/color/ICC_ColorSpace.java (ICC_ColorSpace): Documentation added. (toRGB): Throw exception, documentation added. (fromRGB): Throw exception, documentation added. (toCIEXYZ): Documentation added. (fromCIEXYZ): Documentation added. (getMinValue): Documentation added. (getMaxValue): Documentation added. * java/awt/geom/Dimension2D.java (clone): Documentation added. * java/awt/geom/GeneralPath.java (clone): Documentation added. * java/awt/geom/Line2D.java (clone): Documentation added. * java/awt/geom/QuadCurve2D.java (clone): Documentation added. * java/awt/image/ColorModel.java (ColorModel): Throw exception, documentation added. * java/awt/image/ImageFilter.java (clone): Doesnt throw CloneNotSupportedException. From-SVN: r61303
Diffstat (limited to 'libjava/java/awt/image')
-rw-r--r--libjava/java/awt/image/ColorModel.java22
-rw-r--r--libjava/java/awt/image/ImageFilter.java13
2 files changed, 33 insertions, 2 deletions
diff --git a/libjava/java/awt/image/ColorModel.java b/libjava/java/awt/image/ColorModel.java
index 14a1b2e..fab5166 100644
--- a/libjava/java/awt/image/ColorModel.java
+++ b/libjava/java/awt/image/ColorModel.java
@@ -120,10 +120,32 @@ public abstract class ColorModel implements Transparency
Buffers.smallestAppropriateTransferType(bits * 4));
}
+ /**
+ * Constructs a ColorModel that translates pixel values to
+ * color/alpha components.
+ *
+ * @exception IllegalArgumentException If the length of the bit array is less
+ * than the number of color or alpha components in this ColorModel, or if the
+ * transparency is not a valid value, or if the sum of the number of bits in
+ * bits is less than 1 or if any of the elements in bits is less than 0.
+ */
protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace,
boolean hasAlpha, boolean isAlphaPremultiplied,
int transparency, int transferType)
{
+ int bits_sum = 0;
+ for (int i = 0; i < bits.length; i++)
+ {
+ if (bits [i] < 0)
+ throw new IllegalArgumentException ();
+
+ bits_sum |= bits [i];
+ }
+
+ if ((bits.length < cspace.numComponents)
+ || (bits_sum < 1))
+ throw new IllegalArgumentException ();
+
this.pixel_bits = pixel_bits;
this.bits = bits;
this.cspace = cspace;
diff --git a/libjava/java/awt/image/ImageFilter.java b/libjava/java/awt/image/ImageFilter.java
index b34bb7d..86bc021 100644
--- a/libjava/java/awt/image/ImageFilter.java
+++ b/libjava/java/awt/image/ImageFilter.java
@@ -81,9 +81,18 @@ public class ImageFilter implements ImageConsumer, Cloneable
*
* @see java.lang.Object#clone ()
*/
- public Object clone() throws CloneNotSupportedException
+ public Object clone()
{
- return (super.clone());
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ // This should never happen as this class implements the
+ // Cloneable interface.
+ throw new InternalError ();
+ }
}
/**