• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.awt.Graphics and java.awt.Graphics2D

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Out of simple curiosity who implements the actual methods that draw? Since the draw(Shape S) from the java.awt.Graphics2D is an abstract method and I heven't been able to find something that implements logic to it.
I got curious!
 
Saloon Keeper
Posts: 15488
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, one thing you could do is try and track down the point where the actual Graphics instance is created. A point you can start is the source code of one of the JFrame.repaint() methods.
 
Victor M. Pereira
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks I'll try that and post the result of the experiment. I only hope It doesn't end in the Java ByteCode.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All the interesting methods of concrete implementations of Graphics/2D are in native code, and the concrete classes themselves are (possibly platform-dependent) proprietary com.sun... classes. Do a sysout of getClass() in a painting method override and you can get the class name. No, you won't find the source of that class in src.zip.

If you're interested in the sequence of painting activities, look at RepaintManager.

The repaint() method merely queues a paint event in the EventQueue.
reply
    Bookmark Topic Watch Topic
  • New Topic