10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.java2d.pipe; 27 28 import java.awt.Rectangle; 29 30 import javax.tools.annotation.GenerateNativeHeader; 31 32 /** 33 * This class defines the API for iterating through the bands 34 * of a region object. 35 */ 36 /* No native methods here, but the constants are needed in the supporting JNI code */ 37 @GenerateNativeHeader 38 public class RegionIterator { 39 Region region; 40 int curIndex; 41 int numXbands; 42 43 RegionIterator(Region r) { 44 region = r; 45 } 46 47 /** 48 * Returns a new RegionIterator object representing the same 49 * iteration state as this object to allow multiple iteration 50 * branches from the current position. 51 */ 52 public RegionIterator createCopy() { 53 RegionIterator r = new RegionIterator(region); 54 r.curIndex = this.curIndex; 55 r.numXbands = this.numXbands; 56 return r; 57 } | 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.java2d.pipe; 27 28 import java.awt.Rectangle; 29 30 /** 31 * This class defines the API for iterating through the bands 32 * of a region object. 33 */ 34 public class RegionIterator { 35 Region region; 36 int curIndex; 37 int numXbands; 38 39 RegionIterator(Region r) { 40 region = r; 41 } 42 43 /** 44 * Returns a new RegionIterator object representing the same 45 * iteration state as this object to allow multiple iteration 46 * branches from the current position. 47 */ 48 public RegionIterator createCopy() { 49 RegionIterator r = new RegionIterator(region); 50 r.curIndex = this.curIndex; 51 r.numXbands = this.numXbands; 52 return r; 53 } |