View Javadoc

1   /*
2    * UpdateStockAction.java Created @ Sep 23, 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  package org.gscg.gameleader.dialogs.actor.actions;
15  
16  import java.awt.event.ActionEvent;
17  
18  import javax.swing.AbstractAction;
19  
20  import nl.tudelft.simulation.supplychain.product.Product;
21  
22  import org.gscg.gameleader.dialogs.actor.components.StockPanel;
23  
24  /***
25   * The UpdateStockAction is invoked whenever a game administrator would like to
26   * update the stock of a product of a supplychain actor.
27   * <p>
28   * 
29   * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
30   * Delft, the Netherlands. All rights reserved.
31   * 
32   * See for project information <a href="http://www.simulation.tudelft.nl/">
33   * www.simulation.tudelft.nl </a>.
34   * 
35   * The source code and binary code of this software is proprietary information
36   * of Delft University of Technology. 
37   * 
38   * @author <a
39   *         href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
40   *         van Houten </a>
41   * @version $Revision: 1.1 $ $Date: 2005/06/16 12:34:10 $
42   * @since 1.0.0
43   */
44  public class UpdateStockAction extends AbstractAction
45  {
46  	/*** the serial version uid */
47  	private static final long serialVersionUID = 11L;
48  
49  	/*** the stock panel panel */
50  	private StockPanel stockPanel = null;
51  
52  	/*** the product to change the amount for */
53  	private Product product = null;
54  
55  	/***
56  	 * constructs a new SendAction
57  	 * 
58  	 * @param stockPanel the stock panel
59  	 * @param name the name of the action
60  	 * @param product the product
61  	 */
62  	public UpdateStockAction(final StockPanel stockPanel, final String name,
63  			final Product product)
64  	{
65  		super(name);
66  		this.stockPanel = stockPanel;
67  		this.product = product;
68  	}
69  
70  	/***
71  	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
72  	 */
73  	public void actionPerformed(final ActionEvent actionEvent)
74  	{
75  		this.stockPanel.updateStock(this.product);
76  	}
77  }