[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orekit Developers] New snapshot with favorites management



Hi,

I know the time between the snapshots is being longer, but as I've
finished the big parts of the feature list (except if I misunderstood
some parts), I'm currently just polishing the UI and doing things I was
pushing away for later before considering 2D orbit visualization.

The URL for the release is here :
http://dl.dropbox.com/u/6734910/orekit/orekit-20110829.apk

The release is not on the forge, because the forge has a 5MB limit for
files, and this file's size is 5.4MB.

Changelog :
* The dataset is embedded in this .apk, you can notice this in the
  greater file size
* Add favorites management for stations and orbits (this feature works
  by serializing OrbitProxy instances in a SQLite database)
* The "next" button in the virtual keyboard now works for Vector3D
  input.

  This issue wasn't as easy as it first sounds. The reason is that when
  you press the "Next" button, Android will try to find the next widget
  to edit with a "DOWN" direction, and not a "RIGHT" direction like we
  would like for Vector3D.

  I've managed to fix this once, but the fix was flawed when there were
  two Vector3D widgets in the same panel. But I figured that you can
  catch keyboard actions (like reply to the "Next"/"Done"/"Search"
  button in the virtual keyboard) by using
  TextView.setOnEditorActionListener(), and override Android's way.

* Fix DashboardLayout

  The DashboardLayout used in Orekit's front page was taken from Google
  I/O 2011 app (under Apache2 license), but I had some troubles with
  it.
  
  In fact when you add an icon, you can see that it doesn't avoid
  buttons overlapping (you can see this behavior here :
  http://img231.imageshack.us/img231/3061/dashboardlandscape.png ).

  I fixed the problem by adding a penalty in the positionment algorithm
  when the unwanted behavior is met. I've submitted the patch on their
  bug tracker here :
  http://code.google.com/p/iosched/issues/detail?id=19. I wanted to fix
  this before releasing this snapshot, and I fixed it this morning.

* Add home-made icons in DashboardLayout
* Add back/home icon in the toolbar
* Radians input fields are now in degrees (and conversion is done at
  compute time, as Luc wanted)
* You can now convert the resulting orbit after a maneuver, by clicking
  on the "Convert" button in the toolbar on the result page.
* Use real names for frames
* In the Maneuver part, LOF and non-LOF frames are now merged in the
  same form field.
* It now uses the official way of getting default sdcard path (instead
  of hard-wiring "/sdcard/", it uses
  Environment.getExternalStorageDirectory() )

Known issues and drawbacks :
* I don't know if you like the way we display output data, especially
  orbit data and position/vector data. Would you like it to be written
  in a tabular form (with no borders), or are you fine with the current
  way ?

* In order to embed the dataset in the apk, I've used Orekit's
  ClasspathCrawler, but it didn't work (and raised a
  NullPointerException) if I didn't change all the
  ClasspathCrawler.class.getClassLoader().getResourceAsStream(name) to
  getClass().getResourceAsStream(name) in Orekit.

  I don't understand why (and I haven't searched much, but I can search
  if you want). The "git diff" is attached.

* The home layout doesn't seem to render well on big screens like
  tablets, and I may make a specific layout for tablets.

Apart from the known issues and drawbacks part, I'm not
currently thinking of any changes to do at UI level, so tell me if
that's suiting you.

If that suits you, I'll now try to dig dipper in the optimization part
and then try to begin 2D orbit visualization.

Have a nice day,

Alexis
diff --git a/src/main/java/org/orekit/data/ClasspathCrawler.java b/src/main/java/org/orekit/data/ClasspathCrawler.java
index 7697a46..f506e0f 100644
--- a/src/main/java/org/orekit/data/ClasspathCrawler.java
+++ b/src/main/java/org/orekit/data/ClasspathCrawler.java
@@ -82,8 +82,7 @@ public class ClasspathCrawler implements DataProvider {
             if (!"".equals(name)) {
 
                 final String convertedName = name.replace('\\', '/');
-                final ClassLoader classLoader = ClasspathCrawler.class.getClassLoader();
-                final InputStream stream = classLoader.getResourceAsStream(convertedName);
+                final InputStream stream = getClass().getResourceAsStream(convertedName);
                 if (stream == null) {
                     throw new OrekitException(OrekitMessages.UNABLE_TO_FIND_RESOURCE, name);
                 }
@@ -124,9 +123,8 @@ public class ClasspathCrawler implements DataProvider {
 
                             if (supported.matcher(baseName).matches()) {
 
-                                final ClassLoader classLoader = ClasspathCrawler.class.getClassLoader();
-                                final InputStream stream      = classLoader.getResourceAsStream(name);
-                                final URI uri                 = classLoader.getResource(name).toURI();
+                                final InputStream stream      = getClass().getResourceAsStream(name);
+                                final URI uri                 = getClass().getResource(name).toURI();
 
                                 // visit the current file
                                 if (gzipMatcher.matches()) {
 
diff --git a/src/main/java/org/orekit/data/ZipJarCrawler.java b/src/main/java/org/orekit/data/ZipJarCrawler.java
index 62a7a23..5c0c603 100644
--- a/src/main/java/org/orekit/data/ZipJarCrawler.java
+++ b/src/main/java/org/orekit/data/ZipJarCrawler.java
@@ -94,7 +94,7 @@ public class ZipJarCrawler implements DataProvider {
             this.file     = null;
             this.resource = resource;
             this.url      = null;
-            this.name     = ZipJarCrawler.class.getClassLoader().getResource(resource).toURI().toString();
+            this.name     = getClass().getResource(resource).toURI().toString();
         } catch (URISyntaxException use) {
             throw new OrekitException(use, LocalizedFormats.SIMPLE_MESSAGE, use.getMessage());
         }
@@ -126,7 +126,7 @@ public class ZipJarCrawler implements DataProvider {
             if (file != null) {
                 rawStream = new FileInputStream(file);
             } else if (resource != null) {
-                rawStream = ZipJarCrawler.class.getClassLoader().getResourceAsStream(resource);
+                rawStream = getClass().getResourceAsStream(resource);
             } else {
                 rawStream = url.openConnection().getInputStream();
             }