1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.dsol.gui.animation2D.actions;
11
12 import java.awt.event.ActionEvent;
13
14 import javax.swing.AbstractAction;
15 import javax.swing.Action;
16 import javax.swing.ImageIcon;
17
18 import nl.tudelft.simulation.dsol.gui.animation2D.GridPanel;
19 import nl.tudelft.simulation.language.io.URLResource;
20
21 /***
22 * The PanLeftAction.java (c) copyright 2003 <a
23 * href="http://www.simulation.tudelft.nl">Delft University of Technology </a>,
24 * the Netherlands. <br>
25 * See for project information <a
26 * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
27 * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
28 * License (GPL) </a>, no warranty <br>
29 *
30 * @version 1.0 18.10.2003 <br>
31 * @author <a href="mailto:nlang@fbk.eur.nl">Niels Lang </a>, <a
32 * href="http://www.simulation.tudelft.nl/people/jacobs.html">Peter
33 * Jacobs </a>
34 */
35 public class PanLeftAction extends AbstractAction
36 {
37 /*** target of the gridpanel */
38 private GridPanel target = null;
39
40 /***
41 * constructs a new ZoomIn
42 *
43 * @param target the target
44 */
45 public PanLeftAction(final GridPanel target)
46 {
47 super("PanLeft");
48 this.target = target;
49 this.putValue(Action.SMALL_ICON, new ImageIcon(URLResource
50 .getResource("/toolbarButtonGraphics/navigation/Back16.gif")));
51 this.setEnabled(true);
52 }
53
54 /***
55 * @see java.awt.event.ActionListener
56 * #actionPerformed(java.awt.event.ActionEvent)
57 */
58 public void actionPerformed(final ActionEvent actionEvent)
59 {
60 this.target.pan(GridPanel.LEFT, 0.1);
61 this.target.requestFocus();
62 }
63 }