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 ZoomIn.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 ZoomInAction extends AbstractAction
35 {
36 /*** target of the gridpanel */
37 private GridPanel target = null;
38
39 /***
40 * constructs a new AddRowAction
41 *
42 * @param target the target
43 */
44 public ZoomInAction(final GridPanel target)
45 {
46 super("ZoomIn");
47 this.target = target;
48 this.putValue(Action.SMALL_ICON, new ImageIcon(URLResource
49 .getResource("/toolbarButtonGraphics/general/ZoomIn16.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.zoom(GridPanel.IN, 0.6);
60 this.target.requestFocus();
61 }
62 }