View Javadoc

1   /*
2    * @(#) PanRightAction.java Oct 29, 2003
3    * 
4    * Copyright (c) 2002-2005 Delft University of Technology Jaffalaan 5, 2628 BX
5    * Delft, the Netherlands. All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the Lesser 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 2002-2005 <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/lesser.html">Lesser
28   * General Public License (LGPL) </a>, no warranty.
29   * 
30   * @version $Revision$ $Date$
31   * @author <a href="mailto:nlang@fbk.eur.nl">Niels Lang </a>, <a
32   *         href="http://www.tbm.tudelft.nl/webstaf/peterja">Peter Jacobs </a>
33   */
34  public class PanRightAction extends AbstractAction
35  {
36  	/*** target of the gridpanel */
37  	private GridPanel target = null;
38  
39  	/***
40  	 * constructs a new ZoomIn
41  	 * 
42  	 * @param target the target
43  	 */
44  	public PanRightAction(final GridPanel target)
45  	{
46  		super("PanRight");
47  		this.target = target;
48  		this
49  				.putValue(
50  						Action.SMALL_ICON,
51  						new ImageIcon(
52  								URLResource
53  										.getResource("/toolbarButtonGraphics/navigation/Forward16.gif")));
54  		this.setEnabled(true);
55  	}
56  
57  	/***
58  	 * @see java.awt.event.ActionListener
59  	 *      #actionPerformed(java.awt.event.ActionEvent)
60  	 */
61  	public void actionPerformed(final ActionEvent actionEvent)
62  	{
63  		this.target.pan(GridPanel.RIGHT, 0.1);
64  		this.target.requestFocus();
65  	}
66  }