-
Bug
-
Resolution: Fixed
-
P3
-
1.1, 1.1.8, 1.2.0, 1.3.0
-
None
-
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.
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.
- duplicates
-
JDK-4269933 java.awt.Polygon.getBounds() does not update the bounds
-
- Closed
-
-
JDK-4427852 Polygon.contains() doesn't work after changing xpoints[] or ypoints[]
-
- Closed
-