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

Polygon object should expose methods for updating bounds after modifications

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.1, 1.1.8, 1.2.0, 1.3.0
    • client-libs
    • None
    • 2d
    • beta
    • generic, x86
    • generic, windows_98

      From java-awt:

      I'm trying to subclass java.awt.Polygon in order to add scale(), rotate(), and
      set(). After I finish manipulating the Polygon, I need to update the bounds.
      The easiest way to do this would be to call calculateBounds(), but because it's
      friendly instead of protected the only way I can do this is to

      1) set my class' package as java.awt and use super.calculateBounds().
         If I understand packages correctly, this is bad because my class _isn't_ part
         of AWT. (On the other hand, if scale(), rotate(), and set() were part of
         java.awt.Polygon I wouldn't need to subclass. :)

      or

      2) cut-and-paste the code from java.awt.Polygon, which is what I did. As OO
         design goes, this is terrible.

      It seems like calculateBounds() should be protected.

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: