Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6521970

Java2D tutorial: improve explanation of clipping and shape bounding boxes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0
    • docs
    • x86
    • windows_xp

      A DESCRIPTION OF THE PROBLEM :
      The new Graphics2 class needs far more tutorial material before it is seriously useable. In particular, explanation of how the new draw(Shape) works is lacking. The single example of drawing a Line2D by creating a new one on the spot is simplistic in the extreme.

      - How does one create a Shape which can be drawn in various positions in a Container?

      - How is the clipping rectangle determined?

      - When using getBounds on a arbitrary Shape, how does this Rectangle relate to the co-ordinate system used to construct the Shape?

        Comments in the Forum indicate that this is not thought of as material for the Javadoc. So it should be in the tutorial.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Answers to the above. I am not in a position at the moment to contribute, as I do not know the answers. Maybe, when I've sorted myself out I might be able to suggest suitable text - this is not a promise, though.

      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/docs/books/tutorial/2d/geometry/primitives.html

            Unassigned Unassigned
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: