invoking one method by a series of key events ?
Hi ;
im developing a currency conversion program at the moment for a java subject at uni,
it has 2 classes named (converter)which contains declaration of buttons and menu and key listeners, and (manager) class contains methods called by (converter) class to prefrom currency conversion or refund operation, im not allowed to modify the (converter ) in any way.
i wana change the currency conversion rate after pressing a series of buttons and menu options, i was thinking about adding a method to track if those events come in order .i.e. clearbtn , 1poundbtn , clearbtn then menu.
can anybody help me plz ?
[640 byte] By [
mejairana] at [2007-10-3 8:31:14]

sorry but i think i havent explained my problem clearly ,,
i wana build method which to change the currency rate after the user do a series of actions,, not random actions or one single action,,
the user will press 4 btns, and they already have listeners implmented to invoke other methods , all 4 btns must be pressed in order to invoke this single method.
i have been looking at listenerList. thought about adding the events in the list and if all the events occur in order,,,the user can change the currency rate.
help , plz
> the user will press 4 btns,
What a terrible design. How on earth to you document something like that?
If there is flow control then you should be building a wizzard that steps you throught the process.
Or, start by having 4 buttons, 3 of which are disabled. When the first is clicked you disable it and enable the 2nd, and so on.
i know its a very bad design, but thank god i didnt design it my self, its a course work for uni , let me copy the requirement exactelly:
**********************************************************************
A desirable extra feature would be to allow the operator to set the exchange rate selecting the Status menu option then immediately pressing the code: clear-?-clear then the coin buttons to the desired value with the sequence ended with a final press of the clear button.
***********************************************************************
the problem is that im allowed only to work in (manager class) which only methods invoked by actions in (converter class) converter class has declarations of the btns and the action events.
disabling btns is a good idea but it adds complexity which i dont need at the moment !!
thanks anyway