View Javadoc

1   /*
2    * @(#) PanRightAction.java Oct 29, 2003
3    * 
4    * Copyright (c) 2003 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
5    * the Netherlands All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the General Public License
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 PanRightAction 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 PanRightAction(final GridPanel target)
46  	{
47  		super("PanRight");
48  		this.target = target;
49  		this
50  				.putValue(
51  						Action.SMALL_ICON,
52  						new ImageIcon(
53  								URLResource
54  										.getResource("/toolbarButtonGraphics/navigation/Forward16.gif")));
55  		this.setEnabled(true);
56  	}
57  
58  	/***
59  	 * @see java.awt.event.ActionListener
60  	 *      #actionPerformed(java.awt.event.ActionEvent)
61  	 */
62  	public void actionPerformed(final ActionEvent actionEvent)
63  	{
64  		this.target.pan(GridPanel.RIGHT, 0.1);
65  		this.target.requestFocus();
66  	}
67  }