Android Open Source - clusterkraf Animated Transition






From Project

Back to project page clusterkraf.

License

The source code is released under:

Apache License

If you think the Android project clusterkraf listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.twotoasters.clusterkraf;
/*w w w .ja  v  a 2 s .c  o m*/
import com.google.android.gms.maps.Projection;

/**
 * Models the animated transition of a cluster
 */
class AnimatedTransition {

  private final ClusterPoint originClusterPoint;
  private final ClusterPoint originClusterRelevantInputPoints;
  private final ClusterPoint destinationClusterPoint;
  private final boolean spans180Meridian;

  AnimatedTransition(Projection projection, ClusterPoint originClusterPoint, InputPoint firstRelevantInputPointFromOriginClusterPoint,
      ClusterPoint destinationClusterPoint) {
    originClusterPoint.clearScreenPosition();
    originClusterPoint.buildScreenPosition(projection);
    this.originClusterPoint = originClusterPoint;

    this.originClusterRelevantInputPoints = new ClusterPoint(firstRelevantInputPointFromOriginClusterPoint, projection, true,
        originClusterPoint.getMapPosition());
    this.originClusterRelevantInputPoints.setScreenPosition(originClusterPoint.getScreenPosition());

    this.destinationClusterPoint = destinationClusterPoint;

    this.spans180Meridian = Math.abs((originClusterPoint.getMapPosition().longitude) - (destinationClusterPoint.getMapPosition().longitude)) > 180;
  }

  boolean originContains(InputPoint point) {
    return originClusterPoint != null && originClusterPoint.containsInputPoint(point);
  }

  boolean destinationContains(InputPoint point) {
    return destinationClusterPoint != null && destinationClusterPoint.containsInputPoint(point);
  }

  ClusterPoint getOriginClusterRelevantInputPoints() {
    return originClusterRelevantInputPoints;
  }

  ClusterPoint getDestinationClusterPoint() {
    return destinationClusterPoint;
  }

  void addOriginClusterRelevantInputPoint(InputPoint previousInputPoint) {
    originClusterRelevantInputPoints.add(previousInputPoint);
  }

  /**
   * @return whether (true) or not (false) the origin and destination
   *         longitudes are on opposite sides of the 180 meridian
   */
  boolean spans180Meridian() {
    return spans180Meridian;
  }
}




Java Source Code List

android.UnusedStub.java
com.twotoasters.clusterkraf.AnimatedTransition.java
com.twotoasters.clusterkraf.BasePoint.java
com.twotoasters.clusterkraf.ClusterPoint.java
com.twotoasters.clusterkraf.ClusterTransitionsAnimation.java
com.twotoasters.clusterkraf.ClusterTransitionsBuildingTask.java
com.twotoasters.clusterkraf.ClusterTransitions.java
com.twotoasters.clusterkraf.ClusteringOnCameraChangeListener.java
com.twotoasters.clusterkraf.ClusteringTask.java
com.twotoasters.clusterkraf.Clusterkraf.java
com.twotoasters.clusterkraf.ClustersBuilder.java
com.twotoasters.clusterkraf.InfoWindowDownstreamAdapter.java
com.twotoasters.clusterkraf.InputPoint.java
com.twotoasters.clusterkraf.MarkerOptionsChooser.java
com.twotoasters.clusterkraf.OnInfoWindowClickDownstreamListener.java
com.twotoasters.clusterkraf.OnMarkerClickDownstreamListener.java
com.twotoasters.clusterkraf.Options.java
com.twotoasters.clusterkraf.sample.AdvancedModeFragment.java
com.twotoasters.clusterkraf.sample.DelayedIndeterminateProgressBarRunnable.java
com.twotoasters.clusterkraf.sample.MainActivity.java
com.twotoasters.clusterkraf.sample.MarkerData.java
com.twotoasters.clusterkraf.sample.NormalModeFragment.java
com.twotoasters.clusterkraf.sample.RandomPointsProvider.java
com.twotoasters.clusterkraf.sample.SampleActivity.java
com.twotoasters.clusterkraf.sample.SingleChoiceDialogFragment.java
com.twotoasters.clusterkraf.sample.ToastedMarkerOptionsChooser.java
com.twotoasters.clusterkraf.sample.ToastedOnMarkerClickDownstreamListener.java
com.twotoasters.clusterkraf.sample.TwoToastersActivity.java
com.twotoasters.clusterkraf.util.Distance.java