stravid/slotcars — pull request #111 by stravid (2012-03-22 09:00:05+00:00)
Title: Pull Request: feature/track list

Sorry for the big pull request!

This pull request adds the track list, to accomplish this a few things happened:

* The `Path` class parses input points to float in order to not break with input from the persistence layer.
* The `Path` class has a `asFixedLengthPointArray` method.
* The `RaphaelPath` class has the `setRaphaelPath` and `setRasterizedPath` methods which are used to update the track after loading from the persistence layer.
* Introduces the `ApiAdapter` class with a `findAll` method.
* The `ModelStore` uses the new adapter.
* The `Track` model has two persistent properties `raphael` and `rasterized` which are saved in the database. `raphael` is a normal Raphael path string. `rasterized` is a point array with fixed length saved as JSON string.
* The `Track.save` method updates the two persistent properties before calling `ModelStore.commit` in order to save the track.
* `Track.didLoad` is called when the data is loaded from the persistence layer. It parses the data and updates the `_raphaelPath` of the track model.
* The `TrackView` uses the property `scaleFactor` to draw the track. When the flag `drawTrackOnDidInsertElement` is set it will also try to draw the track when the `TrackView` is inserted.
* The `TrackView` can't have an `elementId` in order to allow the `TracksView` to work properly.
* Introduces `ThumbnailTrackView` with a small scale factor. This view has to have an uppercase namespace in order to work properly.
* Removes all deprecated Raphael methods and uses `transform` instead.