Solved

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

Posted on 2006-06-23
7
265 Views
Last Modified: 2010-03-31
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
Comment
Question by:oroussea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 16971035
You can't be *given* the source, but you can access it yourself in src.zip in your JDK
0
 

Author Comment

by:oroussea
ID: 16971133
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 16971172
Well actually Shape doesn't draw itself. Graphics draws it. Look at that class and also maybe Graphics2D
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:oroussea
ID: 16971224
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
 
LVL 86

Accepted Solution

by:
CEHJ earned 125 total points
ID: 16971418
>>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
 

Author Comment

by:oroussea
ID: 16971656
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 16971678
:-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 58
String array comparison 4 45
Java Restore security prompts not working 10 123
What is the use of Forwarding Class in java 1 34
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question