~josejuan-sanchez/+junk/original-jhv-experimental-version

« back to all changes in this revision

Viewing changes to src/jhv/src/org/helioviewer/jhv/gui/actions/SetPanSelectionAction.java

  • Committer: José Juan Sánchez Hernández
  • Date: 2013-02-05 13:32:08 UTC
  • Revision ID: josejuan.sanchez@gmail.com-20130205133208-dfz1sh1uge5pjkny
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.helioviewer.jhv.gui.actions;
 
2
 
 
3
import java.awt.event.ActionEvent;
 
4
 
 
5
import javax.swing.AbstractAction;
 
6
 
 
7
import org.helioviewer.jhv.gui.ImageViewerGui;
 
8
import org.helioviewer.jhv.gui.controller.MainImagePanelMousePanController;
 
9
 
 
10
/**
 
11
 * Action to switch to pan selection mode.
 
12
 * 
 
13
 * <p>
 
14
 * In pan selection mode, the image can be dragged around.
 
15
 * 
 
16
 * <p>
 
17
 * For further information, see
 
18
 * {@link org.helioviewer.jhv.gui.controller.MainImagePanelMousePanController}.
 
19
 * 
 
20
 * @author Markus Langenberg
 
21
 */
 
22
public class SetPanSelectionAction extends AbstractAction {
 
23
 
 
24
    private static final long serialVersionUID = 1L;
 
25
 
 
26
    /**
 
27
     * Default constructor.
 
28
     */
 
29
    public SetPanSelectionAction() {
 
30
        super("Pan");
 
31
    }
 
32
 
 
33
    /**
 
34
     * {@inheritDoc}
 
35
     */
 
36
    public void actionPerformed(ActionEvent e) {
 
37
        ImageViewerGui ivg = ImageViewerGui.getSingletonInstance();
 
38
        ivg.getMainImagePanel().getInputController().detach();
 
39
        ivg.getMainImagePanel().setInputController(new MainImagePanelMousePanController());
 
40
    }
 
41
 
 
42
}