From 6c8a62bbfea9ae40fa27ffe8b1756cec414d6db3 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 26 Jul 2005 23:22:38 +0000 Subject: package.html, [...]: Removed. * gnu/java/net/protocol/ftp/package.html, gnu/javax/swing/text/html/package.html, gnu/javax/swing/text/html/parser/package.html, gnu/javax/swing/text/html/parser/models/package.html, gnu/javax/swing/text/html/parser/support/package.html, gnu/javax/swing/text/html/parser/support/low/package.html, gnu/xml/aelfred2/package.html, gnu/xml/dom/package.html, gnu/xml/pipeline/package.html, gnu/xml/transform/package.html, gnu/xml/util/package.html, java/awt/geom/doc-files/Area-1.png, java/awt/geom/doc-files/CubicCurve2D-1.png, java/awt/geom/doc-files/CubicCurve2D-2.png, java/awt/geom/doc-files/CubicCurve2D-3.png, java/awt/geom/doc-files/CubicCurve2D-4.png, java/awt/geom/doc-files/CubicCurve2D-5.png, java/awt/geom/doc-files/Ellipse-1.png, java/awt/geom/doc-files/FlatteningPathIterator-1.html, java/awt/geom/doc-files/GeneralPath-1.png, java/awt/geom/doc-files/QuadCurve2D-1.png, java/awt/geom/doc-files/QuadCurve2D-2.png, java/awt/geom/doc-files/QuadCurve2D-3.png, java/awt/geom/doc-files/QuadCurve2D-4.png, java/awt/geom/doc-files/QuadCurve2D-5.png, javax/imageio/package.html, javax/imageio/event/package.html, javax/imageio/metadata/package.html, javax/imageio/spi/package.html, javax/imageio/stream/package.html, javax/swing/border/doc-files/BevelBorder-1.png, javax/swing/border/doc-files/BevelBorder-2.png, javax/swing/border/doc-files/BevelBorder-3.png, javax/swing/border/doc-files/EmptyBorder-1.png, javax/swing/border/doc-files/EtchedBorder-1.png, javax/swing/border/doc-files/EtchedBorder-2.png, javax/swing/border/doc-files/LineBorder-1.png, javax/swing/border/doc-files/MatteBorder-1.png, javax/swing/border/doc-files/MatteBorder-2.png, javax/swing/border/doc-files/MatteBorder-3.png, javax/swing/border/doc-files/MatteBorder-4.png, javax/swing/border/doc-files/MatteBorder-5.png, javax/swing/border/doc-files/MatteBorder-6.png, javax/swing/border/doc-files/SoftBevelBorder-1.png, javax/swing/border/doc-files/SoftBevelBorder-2.png, javax/swing/border/doc-files/SoftBevelBorder-3.png, javax/swing/plaf/basic/doc-files/BasicBorders-1.png, javax/swing/plaf/basic/doc-files/BasicBorders-2.png, javax/swing/plaf/basic/doc-files/BasicBorders.ButtonBorder-1.png, javax/swing/plaf/basic/doc-files/BasicBorders.FieldBorder-1.png, javax/swing/plaf/basic/doc-files/BasicBorders.MarginBorder-1.png, javax/swing/plaf/basic/doc-files/BasicBorders.MenuBarBorder-1.png, javax/swing/plaf/basic/doc-files/BasicBorders.RadioButtonBorder-1.png, javax/swing/plaf/basic/doc-files/BasicBorders.SplitPaneBorder-1.png, javax/swing/plaf/basic/doc-files/BasicBorders.SplitPaneBorder-2.png, javax/swing/plaf/basic/doc-files/BasicBorders.SplitPaneDividerBorder-1.png, javax/swing/plaf/basic/doc-files/BasicBorders.ToggleButtonBorder-1.png, javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-1.png, javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-2.png, javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-3.png, javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-4.png, javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-5.png, javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-6.png, javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-7.png, javax/swing/plaf/doc-files/ComponentUI-1.dia, javax/swing/plaf/doc-files/ComponentUI-1.png, javax/swing/plaf/doc-files/TreeUI-1.png, javax/xml/datatype/package.html, javax/xml/namespace/package.html, javax/xml/parsers/package.html, javax/xml/transform/package.html, javax/xml/transform/dom/package.html, javax/xml/transform/sax/package.html, javax/xml/transform/stream/package.html, javax/xml/validation/package.html, javax/xml/xpath/package.html: Removed. From-SVN: r102404 --- libjava/java/awt/geom/doc-files/Area-1.png | Bin 21447 -> 0 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-1.png | Bin 6280 -> 0 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-2.png | Bin 5791 -> 0 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-3.png | Bin 13168 -> 0 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-4.png | Bin 7839 -> 0 bytes libjava/java/awt/geom/doc-files/CubicCurve2D-5.png | Bin 5112 -> 0 bytes libjava/java/awt/geom/doc-files/Ellipse-1.png | Bin 19426 -> 0 bytes .../geom/doc-files/FlatteningPathIterator-1.html | 481 --------------------- libjava/java/awt/geom/doc-files/GeneralPath-1.png | Bin 13111 -> 0 bytes libjava/java/awt/geom/doc-files/QuadCurve2D-1.png | Bin 6363 -> 0 bytes libjava/java/awt/geom/doc-files/QuadCurve2D-2.png | Bin 5872 -> 0 bytes libjava/java/awt/geom/doc-files/QuadCurve2D-3.png | Bin 12334 -> 0 bytes libjava/java/awt/geom/doc-files/QuadCurve2D-4.png | Bin 7797 -> 0 bytes libjava/java/awt/geom/doc-files/QuadCurve2D-5.png | Bin 4757 -> 0 bytes 14 files changed, 481 deletions(-) delete mode 100644 libjava/java/awt/geom/doc-files/Area-1.png delete mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-1.png delete mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-2.png delete mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-3.png delete mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-4.png delete mode 100644 libjava/java/awt/geom/doc-files/CubicCurve2D-5.png delete mode 100644 libjava/java/awt/geom/doc-files/Ellipse-1.png delete mode 100644 libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html delete mode 100644 libjava/java/awt/geom/doc-files/GeneralPath-1.png delete mode 100644 libjava/java/awt/geom/doc-files/QuadCurve2D-1.png delete mode 100644 libjava/java/awt/geom/doc-files/QuadCurve2D-2.png delete mode 100644 libjava/java/awt/geom/doc-files/QuadCurve2D-3.png delete mode 100644 libjava/java/awt/geom/doc-files/QuadCurve2D-4.png delete mode 100644 libjava/java/awt/geom/doc-files/QuadCurve2D-5.png (limited to 'libjava/java/awt/geom') diff --git a/libjava/java/awt/geom/doc-files/Area-1.png b/libjava/java/awt/geom/doc-files/Area-1.png deleted file mode 100644 index 44650f2..0000000 Binary files a/libjava/java/awt/geom/doc-files/Area-1.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-1.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-1.png deleted file mode 100644 index 1784509..0000000 Binary files a/libjava/java/awt/geom/doc-files/CubicCurve2D-1.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-2.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-2.png deleted file mode 100644 index 1ddae9f..0000000 Binary files a/libjava/java/awt/geom/doc-files/CubicCurve2D-2.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-3.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-3.png deleted file mode 100644 index b200dad..0000000 Binary files a/libjava/java/awt/geom/doc-files/CubicCurve2D-3.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-4.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-4.png deleted file mode 100644 index e57ffdc..0000000 Binary files a/libjava/java/awt/geom/doc-files/CubicCurve2D-4.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-5.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-5.png deleted file mode 100644 index 701ab13..0000000 Binary files a/libjava/java/awt/geom/doc-files/CubicCurve2D-5.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/Ellipse-1.png b/libjava/java/awt/geom/doc-files/Ellipse-1.png deleted file mode 100644 index 8317db6..0000000 Binary files a/libjava/java/awt/geom/doc-files/Ellipse-1.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html b/libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html deleted file mode 100644 index 5a52d69..0000000 --- a/libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html +++ /dev/null @@ -1,481 +0,0 @@ - - - - - The GNU Implementation of java.awt.geom.FlatteningPathIterator - - - - - -

The GNU Implementation of FlatteningPathIterator

- -

Sascha -Brawer, November 2003

- -

This document describes the GNU implementation of the class -java.awt.geom.FlatteningPathIterator. It does -not describe how a programmer should use this class; please -refer to the generated API documentation for this purpose. Instead, it -is intended for maintenance programmers who want to understand the -implementation, for example because they want to extend the class or -fix a bug.

- - -

Data Structures

- -

The algorithm uses a stack. Its allocation is delayed to the time -when the source path iterator actually returns the first curved -segment (either SEG_QUADTO or SEG_CUBICTO). -If the input path does not contain any curved segments, the value of -the stack variable stays null. In this quite -common case, the memory consumption is minimal.

- -
stack
The variable stack is -a double array that holds the start, control and end -points of individual sub-segments.
- -
recLevel
The variable recLevel -holds how many recursive sub-divisions were needed to calculate a -segment. The original curve has recursion level 0. For each -sub-division, the corresponding recursion level is increased by -one.
- -
stackSize
Finally, the variable -stackSize indicates how many sub-segments are stored on -the stack.
- -

Algorithm

- -

The implementation separately processes each segment that the -base iterator returns.

- -

In the case of SEG_CLOSE, -SEG_MOVETO and SEG_LINETO segments, the -implementation simply hands the segment to the consumer, without actually -doing anything.

- -

Any SEG_QUADTO and SEG_CUBICTO segments -need to be flattened. Flattening is performed with a fixed-sized -stack, holding the coordinates of subdivided segments. When the base -iterator returns a SEG_QUADTO and -SEG_CUBICTO segments, it is recursively flattened as -follows:

- -
  1. Intialization: Allocate memory for the stack (unless a -sufficiently large stack has been allocated previously). Push the -original quadratic or cubic curve onto the stack. Mark that segment as -having a recLevel of zero.
  2. - -
  3. If the stack is empty, flattening the segment is complete, -and the next segment is fetched from the base iterator.
  4. - -
  5. If the stack is not empty, pop a curve segment from the -stack. - -
    • If its recLevel exceeds the recursion limit, - hand the current segment to the consumer.
    • - -
    • Calculate the squared flatness of the segment. If it smaller - than flatnessSq, hand the current segment to the - consumer.
    • - -
    • Otherwise, split the segment in two halves. Push the right - half onto the stack. Then, push the left half onto the stack. - Continue with step two.
  6. -
- -

The implementation is slightly complicated by the fact that -consumers pull the flattened segments from the -FlatteningPathIterator. This means that we actually -cannot “hand the curent segment over to the consumer.” -But the algorithm is easier to understand if one assumes a -push paradigm.

- - -

Example

- -

The following example shows how a -FlatteningPathIterator processes a -SEG_QUADTO segment. It is (arbitrarily) assumed that the -recursion limit was set to 2.

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABCDEFGH
stack[0]Sll.x
stack[1]Sll.y
stack[2]Cll.x
stack[3]Cll.y
stack[4]Sl.xEll.x - = Slr.xSlr.xSrl.x
stack[5]Sl.yEll.x - = Slr.ySlr.ySrl.y
stack[6]Cl.xClr.xClr.xCrl.x
stack[7]Cl.yClr.yClr.yCrl.y
stack[8]S.xEl.x - = Sr.xElr.x - = Sr.xElr.x - = Sr.xSr.xErl.x - = Srr.xSrr.x
stack[9]S.yEl.y - = Sr.yElr.y - = Sr.yElr.y - = Sr.ySr.yErl.y - = Srr.ySrr.y
stack[10]C.xCr.xCr.xCr.xCr.xCrr.xCrr.x
stack[11]C.yCr.yCr.yCr.yCr.yCrr.yCrr.y
stack[12]E.xEr.xEr.xEr.xEr.xErr.xErr.x
stack[13]E.yEr.yEr.yEr.yEr.yErr.yErr.x
stackSize12321210
recLevel[2]2
recLevel[1]1222
recLevel[0]0111122
-
- -
    - -
  1. The data structures are initialized as follows. - -
    • The segment’s end point E, control point -C, and start point S are pushed onto the stack.
    • - -
    • Currently, the curve in the stack would be approximated by one - single straight line segment (SE). - Therefore, stackSize is set to 1.
    • - -
    • This single straight line segment is approximating the original - curve, which can be seen as the result of zero recursive - splits. Therefore, recLevel[0] is set to - zero.
    - -Column A shows the state after the initialization step.
  2. - -
  3. The algorithm proceeds by taking the topmost curve segment -(SCE) from the stack. - -
    • The recursion level of this segment (stored in - recLevel[0]) is zero, which is smaller than - the limit 2.
    • - -
    • The method java.awt.geom.QuadCurve2D.getFlatnessSq - is called to calculate the squared flatness.
    • - -
    • For the sake of argument, we assume that the squared flatness is - exceeding the threshold stored in flatnessSq. Thus, the - curve segment SCE gets - subdivided into a left and a right half, namely - SlCl – - El and Sr – - CrEr. Both halves are - pushed onto the stack, so the left half is now on top. - -
       
      The left half starts at the same point - as the original curve, so Sl has the same - coordinates as S. Similarly, the end point of the right - half and of the original curve are identical - (Er = E). More interestingly, the left - half ends where the right half starts. Because - El = Sr, their coordinates need - to be stored only once, which amounts to saving 16 bytes (two - double values) for each iteration.
    - -Column B shows the state after the first iteration.
  4. - -
  5. Again, the topmost curve segment (Sl -– ClEl) is -taken from the stack. - -
    • The recursion level of this segment (stored in - recLevel[1]) is 1, which is smaller than - the limit 2.
    • - -
    • The method java.awt.geom.QuadCurve2D.getFlatnessSq - is called to calculate the squared flatness.
    • - -
    • Assuming that the segment is still not considered - flat enough, it gets subdivided into a left - (SllCll – - Ell) and a right (Slr - – ClrElr) - half.
    - -Column C shows the state after the second iteration.
  6. - -
  7. The topmost curve segment (Sll – -CllEll) is popped from -the stack. - -
    • The recursion level of this segment (stored in - recLevel[2]) is 2, which is not smaller than - the limit 2. Therefore, a SEG_LINETO (from - Sll to Ell) is passed to the - consumer.
    - - The new state is shown in column D.
  8. - - -
  9. The topmost curve segment (Slr – -ClrElr) is popped from -the stack. - -
    • The recursion level of this segment (stored in - recLevel[1]) is 2, which is not smaller than - the limit 2. Therefore, a SEG_LINETO (from - Slr to Elr) is passed to the - consumer.
    - - The new state is shown in column E.
  10. - -
  11. The algorithm proceeds by taking the topmost curve segment -(SrCr – -Er) from the stack. - -
    • The recursion level of this segment (stored in - recLevel[0]) is 1, which is smaller than - the limit 2.
    • - -
    • The method java.awt.geom.QuadCurve2D.getFlatnessSq - is called to calculate the squared flatness.
    • - -
    • For the sake of argument, we again assume that the squared - flatness is exceeding the threshold stored in - flatnessSq. Thus, the curve segment - (SrCr – - Er) is subdivided into a left and a right half, - namely - SrlCrl – - Erl and Srr – - CrrErr. Both halves - are pushed onto the stack.
    - - The new state is shown in column F.
  12. - -
  13. The topmost curve segment (Srl – -CrlErl) is popped from -the stack. - -
    • The recursion level of this segment (stored in - recLevel[2]) is 2, which is not smaller than - the limit 2. Therefore, a SEG_LINETO (from - Srl to Erl) is passed to the - consumer.
    - - The new state is shown in column G.
  14. - -
  15. The topmost curve segment (Srr – -CrrErr) is popped from -the stack. - -
    • The recursion level of this segment (stored in - recLevel[2]) is 2, which is not smaller than - the limit 2. Therefore, a SEG_LINETO (from - Srr to Err) is passed to the - consumer.
    - - The new state is shown in column H.
  16. - -
  17. The stack is now empty. The FlatteningPathIterator will fetch the -next segment from the base iterator, and process it.
  18. - -
- -

In order to split the most recently pushed segment, the -subdivideQuadratic() method passes stack -directly to -QuadCurve2D.subdivide(double[],int,double[],int,double[],int). -Because the stack grows towards the beginning of the array, no data -needs to be copied around: subdivide will directly store -the result into the stack, which will have the contents shown to the -right.

- - - diff --git a/libjava/java/awt/geom/doc-files/GeneralPath-1.png b/libjava/java/awt/geom/doc-files/GeneralPath-1.png deleted file mode 100644 index d1d75d5..0000000 Binary files a/libjava/java/awt/geom/doc-files/GeneralPath-1.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/QuadCurve2D-1.png b/libjava/java/awt/geom/doc-files/QuadCurve2D-1.png deleted file mode 100644 index 7c2ec0e..0000000 Binary files a/libjava/java/awt/geom/doc-files/QuadCurve2D-1.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/QuadCurve2D-2.png b/libjava/java/awt/geom/doc-files/QuadCurve2D-2.png deleted file mode 100644 index 496180c..0000000 Binary files a/libjava/java/awt/geom/doc-files/QuadCurve2D-2.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/QuadCurve2D-3.png b/libjava/java/awt/geom/doc-files/QuadCurve2D-3.png deleted file mode 100644 index a7557ba..0000000 Binary files a/libjava/java/awt/geom/doc-files/QuadCurve2D-3.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/QuadCurve2D-4.png b/libjava/java/awt/geom/doc-files/QuadCurve2D-4.png deleted file mode 100644 index 835c064..0000000 Binary files a/libjava/java/awt/geom/doc-files/QuadCurve2D-4.png and /dev/null differ diff --git a/libjava/java/awt/geom/doc-files/QuadCurve2D-5.png b/libjava/java/awt/geom/doc-files/QuadCurve2D-5.png deleted file mode 100644 index 72110cd..0000000 Binary files a/libjava/java/awt/geom/doc-files/QuadCurve2D-5.png and /dev/null differ -- cgit v1.1