package programming101.calculator;

import java.awt.event.ActionEvent;


/**
	* Applies last operation to current data in entry area and displays
	* result.
	*
	* @author © 1998 Peter T. Sander
	* @version 1.0  (15/03/98)
	* @since 15/03/98
	*/
	
public class EqButton extends CalculatorButton {

	/**
		* Constructor.
		*/
	public EqButton(Calculator calculator) {
		super("=", calculator);
	}
	
	/**
		* Invoked by the appropriate button adapter.  Gets the current state 
		* of the calculator and applies last operation to data in the
		* entry region.
		*
		* @param ae action event fired by the windowing system
		*/
	public void actionPerformed(ActionEvent ae) {
		getCalculatorData();
		lastButton.actionPerformed((ActionEvent)null);
		System.out.println("EqButton putsched: " + cumulator);
	}
}
