2362N/A * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class can iterate individual span elements generated by scan 0N/A * converting a Shape. 0N/A * This particular implementation flattens the incoming path and then 0N/A * performs simple polygon tracing to calculate the spans. 0N/A * Note that this class holds pointers to native data which must be 0N/A * disposed. It is not marked as finalizable since it is intended 0N/A * to be very lightweight and finalization is a comparitively expensive 0N/A * procedure. The caller must specifically use try{} finally{} to 0N/A * manually ensure that the object is disposed after use, otherwise 0N/A * native data structures might be leaked. 0N/A * Here is a code sample for using this class: 0N/A * public void fillShape(Shape s, Rectangle clipRect) { 0N/A * ShapeSpanIterator ssi = new ShapeSpanIterator(false); 0N/A * ssi.setOutputArea(clipRect); 0N/A * ssi.appendPath(s.getPathIterator(null)); 0N/A * int spanbox[] = new int[4]; 0N/A * while (ssi.nextSpan(spanbox)) { 0N/A * int x = spanbox[0]; 0N/A * int y = spanbox[1]; 0N/A * int w = spanbox[2] - x; 0N/A * int h = spanbox[3] - y; 0N/A * fillRect(x, y, w, h); 0N/A * Appends the geometry and winding rule from the indicated 0N/A * Appends the geometry from the indicated set of polygon points. 0N/A * Sets the normalization flag so that incoming data is 0N/A * adjusted to nearest (0.25, 0.25) subpixel position. 0N/A * Sets the rectangle of interest for storing and returning 0N/A * Sets the rectangle of interest for storing and returning 0N/A * Sets the rectangle of interest for storing and returning 0N/A * span segments to the specified Rectangle. 0N/A * Sets the rectangle of interest for storing and returning 0N/A * span segments to the bounds of the specified Region. 0N/A * Sets the winding rule in the native data structures. 0N/A * Adds a single PathIterator segment to the internal list of 0N/A * path element structures. 0N/A * Gets the bbox of the available path segments, clipped to the 0N/A * Intersects the path box with the given bbox. 0N/A * Returned spans are clipped to this region, or discarded 0N/A * altogether if they lie outside it. 0N/A * Fetches the next span that needs to be operated on. 0N/A * If the return value is false then there are no more spans. 0N/A * This method tells the iterator that it may skip all spans 0N/A * whose Y range is completely above the indicated Y coordinate. 0N/A * This method returns a native pointer to a function block that 0N/A * can be used by a native method to perform the same iteration 0N/A * cycle that the above methods provide while avoiding upcalls to 0N/A * The definition of the structure whose pointer is returned by 0N/A * this method is defined in: 0N/A * Cleans out all internal data structures.