cafe.gui
Interface ViewEventInterface

All Known Implementing Classes:
GuiMain

public interface ViewEventInterface


Method Summary
 void addAlert()
          Confirms that selected alert is ok to add.
 void addingFingerprint(int finger)
          Sets the GUI to fingerprint insert mode, so that it waits for a fingerprint to the finger that is given as a parameter.
 void alertProduct(ImportProduct product)
          Adds alert to specified product
 void authenticateUser(java.lang.String username, java.lang.String password)
          Used to tell the GUI's main class that user has entered this username-password-pair and should be authenticated.
 void buyProduct(ExportProduct product)
          Debits the product given as parameter from user's account
 void cancelFingerprintAdd()
          Cancels fingerprint insert mode and returns to normal mode.
 void cancelLastAction()
          Cancels the previous product export transaction from the currently logged on user.
 void changeAlertView()
          Changes the current view to add product alert view
 void changeConfigView()
          Changes the current view to "my settings" view
 void changeImportView()
          Changes the current view to product import view
 void changeLanguage()
          Changes the current language and resets/redraws the current view
 void changeRegisterView()
          Changes the current view to register a new user view
 void changeShopView()
          Changes the current view to product export view
 void changeStartView()
          Changes the current view to start view (title screen)
 void confirmImport(ImportProduct product, double amount)
          This method is used when the user confirms the importing of the product he has previously selected.
 double getBalance(java.lang.String[] productGroup)
          Returns logged on user's balance in given product group.
 LanguageEnum getCurrentLanguage()
          Gets the current language used in the GUI
 int getErrorTimeout()
          Gets the time to show "finger not recognized" error message.
 java.lang.String getFirstAndLastName()
          Gets current user's first and last name.
 GuiMain getGuiMain()
           
 java.lang.String getGuiText(java.lang.String id)
          Gets the text/string corresponding to the id in the current language
 int getIdleTimeout()
          Gets the time to wait until automatic logout, if user doesn't do anything.
 javax.swing.ImageIcon getLanguageImage()
          Gets the icon (country flag) used as a symbol for the current language.
 int getPayTimeout()
          Gets the time to wait until automatic debit of export product, if user doesn't make any other choices.
 void groupSelected()
          Stops the countdown timer in import view when a product group is selected.
 void importProduct(ImportProduct product, double amount)
          Sets the currently selected product in import view.
 boolean isCancelAllowed()
          Gets the info about if the user is allowed to cancel previous export transaction.
 void logoutTimerExpired()
          A view in the user interface can use this to logout the current user after a certain time of inactivity has expired.
 void productSelected(ExportProduct product)
          Sets the currently selected export product
 void removeAlert(ImportProduct product)
          Removes product alert from the product given as parameter
 void setFavoriteProduct(ExportProduct product)
          Sets the current user's favorite product.
 void setUserName(java.lang.String firstname, java.lang.String familyname)
          Sets current user's first and family name
 

Method Detail

changeStartView

void changeStartView()
Changes the current view to start view (title screen)


changeShopView

void changeShopView()
Changes the current view to product export view


changeImportView

void changeImportView()
Changes the current view to product import view


changeConfigView

void changeConfigView()
Changes the current view to "my settings" view


changeAlertView

void changeAlertView()
Changes the current view to add product alert view


changeRegisterView

void changeRegisterView()
Changes the current view to register a new user view


changeLanguage

void changeLanguage()
Changes the current language and resets/redraws the current view


getGuiText

java.lang.String getGuiText(java.lang.String id)
Gets the text/string corresponding to the id in the current language

Parameters:
id - name of the string to get
Returns:
the GUI string in current language

importProduct

void importProduct(ImportProduct product,
                   double amount)
Sets the currently selected product in import view.

Parameters:
product - the selected import product
amount - the selected amount of the product

confirmImport

void confirmImport(ImportProduct product,
                   double amount)
This method is used when the user confirms the importing of the product he has previously selected.

Parameters:
product - the product user wants to import
amount - the selected import amount

setFavoriteProduct

void setFavoriteProduct(ExportProduct product)
Sets the current user's favorite product.

Parameters:
product - the export product to set as the favorite

addAlert

void addAlert()
Confirms that selected alert is ok to add.


authenticateUser

void authenticateUser(java.lang.String username,
                      java.lang.String password)
Used to tell the GUI's main class that user has entered this username-password-pair and should be authenticated.

Parameters:
username - user inputted username
password - user inputted password

setUserName

void setUserName(java.lang.String firstname,
                 java.lang.String familyname)
Sets current user's first and family name

Parameters:
firstname - first name
familyname - family name

buyProduct

void buyProduct(ExportProduct product)
Debits the product given as parameter from user's account

Parameters:
product - the product to export/debit

productSelected

void productSelected(ExportProduct product)
Sets the currently selected export product

Parameters:
product - the selected product

groupSelected

void groupSelected()
Stops the countdown timer in import view when a product group is selected.


removeAlert

void removeAlert(ImportProduct product)
Removes product alert from the product given as parameter

Parameters:
product - the product to remove the alert from

getCurrentLanguage

LanguageEnum getCurrentLanguage()
Gets the current language used in the GUI

Returns:
the current language

getLanguageImage

javax.swing.ImageIcon getLanguageImage()
Gets the icon (country flag) used as a symbol for the current language.

Returns:
icon for the current language

addingFingerprint

void addingFingerprint(int finger)
Sets the GUI to fingerprint insert mode, so that it waits for a fingerprint to the finger that is given as a parameter.

Parameters:
finger - the finger to wait the fingerprint for, from 0-4, where 0 means thumb and 4 means little finger.

cancelFingerprintAdd

void cancelFingerprintAdd()
Cancels fingerprint insert mode and returns to normal mode.


cancelLastAction

void cancelLastAction()
Cancels the previous product export transaction from the currently logged on user.


alertProduct

void alertProduct(ImportProduct product)
Adds alert to specified product

Parameters:
product - product that alert is added

getBalance

double getBalance(java.lang.String[] productGroup)
Returns logged on user's balance in given product group.

Parameters:
productGroup - the product group
Returns:
user's balance in the given product group

isCancelAllowed

boolean isCancelAllowed()
Gets the info about if the user is allowed to cancel previous export transaction.

Returns:
true if cancelling is allowed, false if not

logoutTimerExpired

void logoutTimerExpired()
A view in the user interface can use this to logout the current user after a certain time of inactivity has expired.


getIdleTimeout

int getIdleTimeout()
Gets the time to wait until automatic logout, if user doesn't do anything.

Returns:
the time to wait

getPayTimeout

int getPayTimeout()
Gets the time to wait until automatic debit of export product, if user doesn't make any other choices.

Returns:
the time to wait

getErrorTimeout

int getErrorTimeout()
Gets the time to show "finger not recognized" error message.

Returns:
the time to show the message

getFirstAndLastName

java.lang.String getFirstAndLastName()
Gets current user's first and last name.

Returns:
first and last name in the form "firstname lastname"

getGuiMain

GuiMain getGuiMain()