View Javadoc

    1   /*
    2    * @(#) PanUpAction.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 PanUpAction 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 PanUpAction(final GridPanel target)
    45  	{
    46  		super("PanUp");
    47  		this.target = target;
    48  		this.putValue(Action.SMALL_ICON, new ImageIcon(URLResource
    49  				.getResource("/toolbarButtonGraphics/navigation/Up16.gif")));
    50  		this.setEnabled(true);
    51  	}
    52
    53  	/***
    54  	 * @see java.awt.event.ActionListener
    55  	 *      #actionPerformed(java.awt.event.ActionEvent)
    56  	 */
    57  	public void actionPerformed(final ActionEvent actionEvent)
    58  	{
    59  		this.target.pan(GridPanel.UP, 0.1);
    60  		this.target.requestFocus();
    61  	}
    62  }