0

I have been browsing the reference section on Android.com and couldn't quite find the java.awt.geom library. I'm aware it isn't included exactly as it is with Java.

Specifically I'm looking for java.awt.geom.Point2D and java.awt.Ellipse2D.

Is Point (http://developer.android.com/reference/android/graphics/Point.html) equivalent to Point2D in Java? Looking at the methods, they are slightly different, but is this the Android equivalent? Or is there Point2D elsewhere that I've missed?

As for java.awt.Ellipse2D I don't really see anything that replaces it. I see addCircle, addOval, and addRoundedRect. Is there Ellipse or an equivalent for Android?

1 Answer 1

2

You may want to look at http://developer.android.com/reference/android/graphics/drawable/shapes/package-summary.html: it has an OvalShape you can modify the height/width to get an ellipse.

3
  • thank you for pointing that out. I'll check into it. Any ideas on the Point2D question? Jul 8, 2011 at 0:51
  • Ah, not really: on Android, most point manipulation is done with native types and not classes. Point doesn't appear to have much similarity with Point2D: there are a number of measurement methods that are simply missing. What specifically are you trying to transfer from the AWT model to Android?
    – Femi
    Jul 8, 2011 at 1:08
  • I went ahead and took care of the Point2D by creating a slightly modified class of PointF. I still however can't figure out how to create the Ellipse2D.Double(). Can you elaborate before I create another question based on it? I'm wanting the ability to create the Ellipse based on my own height, width, and X and Y coordinates. Jul 26, 2011 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.