View Javadoc

1   /*
2    * @(#) ContentDialogAction.java Oct 27, 2004
3    * 
4    * 
5    * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
6    * Delft, the Netherlands. All rights reserved.
7    * 
8    * See for project information <a href="http://www.simulation.tudelft.nl/">
9    * www.simulation.tudelft.nl </a>.
10   * 
11   * The source code and binary code of this software is proprietary information
12   * of Delft University of Technology.
13   */
14  
15  package org.gscg.gameleader.dialogs.content.actions;
16  
17  import java.awt.event.ActionEvent;
18  
19  import javax.swing.AbstractAction;
20  
21  import nl.tudelft.simulation.supplychain.content.Content;
22  
23  import org.gscg.gameleader.dialogs.content.components.ContentDialog;
24  
25  /***
26   * The ContentDialogAction is used when a game administrator clicks on a content
27   * animation on the animation panel.
28   * <p>
29   * 
30   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
31   * Delft, the Netherlands. All rights reserved.
32   * 
33   * See for project information <a href="http://www.simulation.tudelft.nl/">
34   * www.simulation.tudelft.nl </a>.
35   * 
36   * The source code and binary code of this software is proprietary information
37   * of Delft University of Technology.
38   * 
39   * @author <a
40   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
41   *         van Houten </a>
42   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:34:10 $
43   * @since 1.0.3
44   */
45  public class ContentDialogAction extends AbstractAction
46  {
47  	/*** the serial version uid */
48  	private static final long serialVersionUID = 11L;
49  
50  	/*** the content to create a dialog for */
51  	private Content content = null;
52  
53  	/***
54  	 * constructs a new ContentDialogAction
55  	 * 
56  	 * @param content the content to create a dialog for
57  	 */
58  	public ContentDialogAction(final Content content)
59  	{
60  		super(content.getClass().getName().substring(
61  				content.getClass().getName().lastIndexOf(".") + 1));
62  		this.content = content;
63  	}
64  
65  	/***
66  	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
67  	 */
68  	public void actionPerformed(final ActionEvent actionEvent)
69  	{
70  		new ContentDialog(this.content);
71  	}
72  }