Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

Code of the drawing of a Shape object (Arc2D)?

Hello

Since Java is open source, could someone get me the code that is used to fill and draw an Java Arc2D object?
Im coding on J2ME phones that have a sh*tty implementation of arc drawing and filling... so i want to replace them with efficient functions.
Thanks
0
oroussea
Asked:
oroussea
  • 4
  • 3
1 Solution
 
CEHJCommented:
You can't be *given* the source, but you can access it yourself in src.zip in your JDK
0
 
orousseaAuthor Commented:
Thanks for the lightning fast reply CEHJ!

I tried what you said... and the only thing i could is this:

public abstract void draw(Shape s);

I couldn't find the *real* implementation for the Arc2D... might look something like this:

void draw(Shape s)
{
   if s.type == ARC2D
   // do actual drawing of arc here -> Code im interested in
   else if (s.type == )
}
0
 
CEHJCommented:
Well actually Shape doesn't draw itself. Graphics draws it. Look at that class and also maybe Graphics2D
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
orousseaAuthor Commented:
Cant find it... i found drawArc and fillArc functions... but they are abstract... no implementation...

draw(Shape s) is also abstract...

do you have src.zip? could have a look? maybe you would find something...

Thanks again
0
 
CEHJCommented:
>>Since Java is open source

By no means. They simply let you see *some* of the source

>>i found drawArc and fillArc functions... but they are abstract...

Yes, you'd need to look at the source of the Graphics implementation. On my machine, that is

class sun.java2d.SunGraphics2D

which won't be in src.zip. *still* think it's open source? ;-)
0
 
orousseaAuthor Commented:
Ok thanks for the info!

Btw, i found the source code here:

http://www.cs.duke.edu/csed/java/src1.3/sun/java2d/

Since its an educational website, it must be legal...
Thanks
0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now