/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class implements the ShapeIterator interface for a Region.
* This is useful as the source iterator of a device clip region
* (in its native guise), and also as the result of clipping a
* Region to a rectangle.
*/
// The RegionIterator that we use to do the work
// Clipping bounds
// Current Y band limits
// Are we done?
boolean done = false;
// Is the associated Region rectangular?
boolean isrect;
/*
REMIND: For native implementation
long pData; // Private storage of rect info
static {
initIDs();
}
public static native void initIDs();
*/
/**
* Constructs an instance based on the given Region
*/
int[] bounds = new int[4];
isrect = r.isRectangular();
ri = r.getIterator();
}
/**
* Gets the bbox of the available region spans.
*/
}
/**
* Intersect the box used for clipping the output spans with the
* given box.
*/
}
}
}
}
}
/**
* Fetches the next span that needs to be operated on.
* If the return value is false then there are no more spans.
*/
// Quick test for end conditions
if (done) {
return false;
}
// If the Region is rectangular, we store our bounds (possibly
// clipped via intersectClipBox()) in spanbox and return true
// so that the caller will process the single span. We set done
// to true to ensure that this will be the last span processed.
if (isrect) {
done = true;
return true;
}
// Local cache of current span's bounds
while (true) {
done = true;
return false;
}
// Update the current y band and clip it
}
}
// Check for moving below the clip rect
done = true;
return false;
}
continue;
}
// Clip the x box
}
}
// If it's non- box, we're done
break;
}
}
// Update the result and the store y range
return true;
}
/**
* This method tells the iterator that it may skip all spans
* whose Y range is completely above the indicated Y coordinate.
*/
public void skipDownTo(int y) {
loy = y;
}
/**
* This method returns a native pointer to a function block that
* can be used by a native method to perform the same iteration
* cycle that the above methods provide while avoiding upcalls to
* the Java object.
* The definition of the structure whose pointer is returned by
* this method is defined in:
* <pre>
* </pre>
*/
public long getNativeIterator() {
return 0;
}
/*
* Cleans out all internal data structures.
* REMIND: Native implementation
public native void dispose();
protected void finalize() {
dispose();
}
*/
}