01: /*
02: * $RCSfile: WrapperWRI.java,v $
03: *
04: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Use is subject to license terms.
07: *
08: * $Revision: 1.1 $
09: * $Date: 2005/02/11 04:55:44 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.iterator;
13:
14: import java.awt.Point;
15: import java.awt.image.Raster;
16: import java.awt.image.TileObserver;
17: import java.awt.image.WritableRaster;
18: import java.awt.image.WritableRenderedImage;
19:
20: /**
21: * @since EA2
22: */
23: public class WrapperWRI extends WrapperRI implements
24: WritableRenderedImage {
25:
26: WritableRaster wras;
27:
28: public WrapperWRI(WritableRaster wras) {
29: super (wras);
30: this .wras = wras;
31: }
32:
33: public void addTileObserver(TileObserver to) {
34: throw new RuntimeException(JaiI18N.getString("WrapperWRI0"));
35: }
36:
37: public void removeTileObserver(TileObserver to) {
38: throw new RuntimeException(JaiI18N.getString("WrapperWRI0"));
39: }
40:
41: public WritableRaster getWritableTile(int tileX, int tileY) {
42: if ((tileX != 0) || (tileY != 0)) {
43: throw new IllegalArgumentException();
44: }
45: return wras;
46: }
47:
48: public void releaseWritableTile(int tileX, int tileY) {
49: if ((tileX != 0) || (tileY != 0)) {
50: throw new IllegalArgumentException();
51: }
52: }
53:
54: public boolean isTileWritable(int tileX, int tileY) {
55: return true;
56: }
57:
58: public Point[] getWritableTileIndices() {
59: Point[] p = new Point[1];
60: p[0] = new Point(0, 0);
61: return p;
62: }
63:
64: public boolean hasTileWriters() {
65: return true;
66: }
67:
68: public void setData(Raster r) {
69: throw new RuntimeException(JaiI18N.getString("WrapperWRI0"));
70: }
71: }
|