All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Calculator.ClearButtonObj

java.lang.Object
   |
   +----Calculator.ButtonObj
           |
           +----Calculator.ClearButtonObj

public class ClearButtonObj
extends ButtonObj
This class is a smart button object that clears the Calculator. Every ButtonHandler should have one.

See Also:
Calculator

Constructor Index

 o ClearButtonObj(CalcTextGUI, CalculatorState)
How to make one: Make a ButtonObj (i.e., my superclass).

Method Index

 o handleButton()
This method is called by the ButtonHandler whenever the decimal point button is pressed.

Constructors

 o ClearButtonObj
 public ClearButtonObj(CalcTextGUI gui,
                       CalculatorState stateObj)
How to make one: Make a ButtonObj (i.e., my superclass). This constructor exists only to call super w/the appropriate arguments.

Parameters:
gui - The CalcTextGUI to keep track of.
stateObj - The CalculatorState to keep track of.

Methods

 o handleButton
 public void handleButton()
This method is called by the ButtonHandler whenever the decimal point button is pressed.

How to handle (my button) being pressed? Clear the calculator by asking its state to reset.

This should really call this.gui.clearScreen(), now, shouldn't it?

Overrides:
handleButton in class ButtonObj

All Packages  Class Hierarchy  This Package  Previous  Next  Index