I've been away from Java for several years, so forgive my rust. I inherited some code targeting Java SE 1.5. When building under Java 1.7.0, there are several build warnings with the text:
Crossings is internal proprietary API and may be removed in a future release.
I would like to remedy this build warning, probably by replacing this code with my own. On examining the code, I see that the full class in question is sun.awt.geom.Crossings
. The OpenJDK code is available, of course, but I do not understand the overall purpose of the class or its concrete implementations. What is the purpose of sun.awt.geom.Crossings
? Where can I find more documentation?
Crossings
class is used here; for example: Area.contains()
to check the crossings of a rectangular area inside an area. in http://kickjava.com/src/java/awt/geom/Area.java.htm. Since its application is mostly used inside other commonly used classes, you don't have to worry so much. But, if you use it directly, then you may have a problem in the future - ee. 2012-04-05 06:54
Crossings
directly, which is what I am trying to fix. You might consider posting your comments as an answer - Andrew 2012-04-05 12:48
Since @ee. has not come back to rewrite his or her comments as an answer, I will do so here. @ee., if you do stop by, I'd be happy to put the checkmark by your answer instead.
Check this http://docstore.mik.ua/orelly/java/awt/ch02_01.htm#JAWT-CH-2-FIG-9:
Filling polygons is a complex topic. It is not as easy as filling rectangles or ovals because a polygon may not be closed and its edges may cross. AWT uses an even-odd rule to fill polygons. This algorithm works by counting the number of times each scan line crosses an edge of the polygon. If the total number of crossings to the left of the current point is odd, the point is colored. If it is even, the point is left alone.
You can see Crossings class is used here; for example: Area.contains() to check the crossings of a rectangular area inside an area. in http://kickjava.com/src/java/awt/geom/Area.java.htm. Since its application is mostly used inside other commonly used classes, you don't have to worry so much. But, if you use it directly, then you may have a problem in the future!
Filling polygons is a complex topic. It is not as easy as filling rectangles or ovals because a polygon may not be closed and its edges may cross. AWT uses an even-odd rule to fill polygons. This algorithm works by counting the number of times each scan line crosses an edge of the polygon. If the total number of crossings to the left of the current point is odd, the point is colored. If it is even, the point is left alone.
ee. 2012-04-05 06:40