javaswinglanguage-history

Historic reasons for Left-Handed Coordinate System


I find it a bit non-intuitive that the (0,0) maps to the left-top of the screen. Is there a historic reason for using a left-handed coordinate system in Java Swing?

While mapping this to a right-handed system is not too difficult, I'm curious to know if there is any hidden benefit in having a left-handed system.


Solution

  • According to “Why is the origin at the upper left corner?” by Raymond Chen that's simply because that's the way it always was with television sets (which hasn't changed, BTW). So it seems that this early design decision still has an impact today.

    Early home computers often were connected to the TV, so naturally they used this coordinate system. I guess a lot of monitors worked the same way simply because the manufacturers could partly recycle electronics/logic. And since this was then the "natural" coordinate system which programmers used (remember, we had to access the video system on a much lower level back then) it simply stuck as most people were used to it.

    The exception to this model is PostScript and it successor, PDF. They model a paper and therefor weren't tied to use the screen's coordinate system for efficiency. They use (0,0) in the lower left, like mathematicians usually do. The NeXT used a video system called Display PostScript which is an extension to PostScript for drawing on-screen and thus used PostScripts system with (0,0) in the lower left. Todays Mac OS X derived from NeXT and thus also uses this system. On iOS, the Apple engineers decided to flip the system to the more common model with (0,0) in the upper left to make it easier for developers migrating from others systems.