package org.helioviewer.gl3d.gui;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import org.helioviewer.gl3d.camera.GL3DCamera;
import org.helioviewer.gl3d.camera.GL3DSolarRotationTrackingTrackballCamera;

/**
 * Action that enables the Solar Rotation Tracking, which ultimately changes the
 * current {@link GL3DCamera} to the
 * {@link GL3DSolarRotationTrackingTrackballCamera}
 * 
 * @author Simon Spoerri (simon.spoerri@fhnw.ch)
 * 
 */
public class GL3DToggleSolarRotationAction extends AbstractAction {

    private static final long serialVersionUID = 1L;

    public GL3DToggleSolarRotationAction() {
        super("Track");
    }

    /**
     * {@inheritDoc}
     */
    public void actionPerformed(ActionEvent e) {
        if (GL3DCameraSelectorModel.getInstance().getCurrentCamera() instanceof GL3DSolarRotationTrackingTrackballCamera) {
            GL3DCameraSelectorModel.getInstance().setCurrentCamera(GL3DCameraSelectorModel.getInstance().getTrackballCamera());
        } else {
            GL3DCameraSelectorModel.getInstance().setCurrentCamera(GL3DCameraSelectorModel.getInstance().getSolarRotationCamera());
        }
    }

}

@@ -223,16 +223,72 @@
 lCamera;
+%0Aimport org.helioviewer.gl3d.camera.GL3DTrackballCamera;
 %0A%0A/**%0A *
@@ -457,17 +457,16 @@
 mera%7D%0A *
- 
 %0A * @aut
@@ -509,17 +509,16 @@
 w.ch)%0A *
- 
 %0A */%0Apub
@@ -750,16 +750,30 @@
      */%0A
+    @Override%0A
     publ
@@ -897,37 +897,16 @@
 eof GL3D
-SolarRotationTracking
 Trackbal
@@ -1024,25 +1024,29 @@
 ce().get
-Trackball
+SolarRotation
 Camera()
@@ -1169,37 +1169,33 @@
 stance().get
-SolarRotation
+Trackball
 Camera());%0A 

Change camera switch logic