[4859] in java-interest

home help back first fref pref prev next nref lref last post

Re: java.awt.Polygon extends Rectangle??

daemon@ATHENA.MIT.EDU (Greg Ewing)
Wed Jan 17 00:43:19 1996

Date: Wed, 17 Jan 1996 12:34:44 +1100
From: grege@optimation.com.au (Greg Ewing)
To: java-interest@java.sun.com

> From NewsGroup_comp-lang-java Tue Jan 16 08:17 EST 1996
> From: NewsGroup_comp-lang-java
> >From: Maria Winslow <winslow@cs.unc.edu>
> Subject: java.awt.Polygon extends Rectangle??
> Date: Sat, 13 Jan 1996 17:22:22 -0500
> Nntp-Posting-Host: hopper.cs.unc.edu
> Mime-Version: 1.0
> Content-Transfer-Encoding: 7bit
> 
> In the API, java.awt.Polygon claims to extend Object, but 
> surely it must extend Rectangle. Does anyone happen to know
> for sure? Thanks.
> 
> mw

Unfortunately this is the case (Polygon inheriting from Object).
One would have hoped that all shape classes like this would 
descend from a common ancestor such as GeometricFigure or Shape.

The AWT is full of annoying things such as allowing one to pass a 
Polygon object as an argument to Graphics.drawPolygon(Polygon p) 
but not providing the means to pass a Rectangle/Arc to drawRect()/
drawArc(). Another one is giving Point and Rectangle translate/move 
functionality, but not providing this to Polygon.

GREG

greg@optimation.com.au
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post