Großmarkt

market
Class SPCustomer

java.lang.Object
  |
  +--sale.SalesPoint
        |
        +--market.SPListenable
              |
              +--market.SPCustomer
All Implemented Interfaces:
EventListener, FormSheetListener, MarketEventListener, OfferEventListener, ProcessContext, Serializable, SerializableListener

public class SPCustomer
extends SPListenable
implements OfferEventListener

SalesPoint used by the UCustomer.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class sale.SalesPoint
m_pCurProcess
 
Constructor Summary
SPCustomer(User user)
           
 
Method Summary
static void addEventListener(OfferEventListener e)
          Adds an OfferEventListener to the array of listeners.
 void countArticles(String articleKey, SProcessWorker spw)
          Reaction on event: a SProcessWorker needs the count of all existing articles.
static void fireCountArticles(String articleKey, SProcessWorker spw)
          Fires an event to all listeners: count this article.
static void fireOfferIsEmpty(String articleKey)
          Fires an event to all listeners: this article is empty.
protected  FormSheet getDefaultFormSheet()
           
protected  MenuSheet getDefaultMenuSheet()
           
 void offerEmpty(String articleKey)
          Reaction on event: An article is unavailable.
protected  boolean onCanQuit()
           
 void quit()
          Removes this SPSustomer from the array of OfferEventListeners.
static void removeEventListener(OfferEventListener e)
          Removes an OfferEventListener from the array of listeners.
 void wakeUpOrders()
          Empty implementation of the OfferEventListener Interface.
 
Methods inherited from class market.SPListenable
formSheetSet, marketClosed, marketOpened, notifyOnMarketClosing, notifyOnMarketNotClosing, resume, timeAdvanced, workerInformationChanged
 
Methods inherited from class sale.SalesPoint
attach, attach, attach, attach, attachLoadedDisplay, attachStatusDisplay, canQuit, createNewID, detachBasket, detachDisplay, detachStatusDisplay, detachUser, formSheetRemoved, getBasket, getCatalog, getCurrentProcess, getCurrentUser, getDefaultStatusFormSheet, getDefaultStatusMenuSheet, getDisplay, getID, getName, getProcessLock, getSalesPointFrameBounds, getStock, getUser, hasUseableDisplay, log, logSalesPointClosed, logSalesPointOpened, popUpFormSheet, processFinished, processStarted, runProcess, runProcess, setFormSheet, setMenuSheet, setSalesPointFrameBounds, setStatusFormSheet, setStatusMenuSheet, suspend, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPCustomer

public SPCustomer(User user)
Parameters:
user - the User of this SPCustomer
Method Detail

onCanQuit

protected boolean onCanQuit()
Overrides:
onCanQuit in class SPListenable
Returns:
true if no SaleProcess is running, otherwise false. This forces the user to quit the SaleProcess before he closes the SalesPoint.

quit

public void quit()
Removes this SPSustomer from the array of OfferEventListeners.

Overrides:
quit in class SalesPoint

getDefaultFormSheet

protected FormSheet getDefaultFormSheet()
Overrides:
getDefaultFormSheet in class SPListenable
Returns:
the default FormSheet

getDefaultMenuSheet

protected MenuSheet getDefaultMenuSheet()
Overrides:
getDefaultMenuSheet in class SalesPoint
Returns:
the default MenuSheet

addEventListener

public static void addEventListener(OfferEventListener e)
Adds an OfferEventListener to the array of listeners.

Parameters:
e - the OfferEventListener that will be added.

removeEventListener

public static void removeEventListener(OfferEventListener e)
Removes an OfferEventListener from the array of listeners.

Parameters:
e - the OfferEventListener that will be removed.

fireOfferIsEmpty

public static void fireOfferIsEmpty(String articleKey)
Fires an event to all listeners: this article is empty.

Parameters:
articleKey - the key of the unavailable article.

fireCountArticles

public static void fireCountArticles(String articleKey,
                                     SProcessWorker spw)
Fires an event to all listeners: count this article.

Parameters:
articleKey - the key of the article to count.
spw - the SProcessWorker which has sended the request.

offerEmpty

public void offerEmpty(String articleKey)
Reaction on event: An article is unavailable.

Specified by:
offerEmpty in interface OfferEventListener
Parameters:
articleKey - the unavailable article.

wakeUpOrders

public void wakeUpOrders()
Empty implementation of the OfferEventListener Interface.

Specified by:
wakeUpOrders in interface OfferEventListener

countArticles

public void countArticles(String articleKey,
                          SProcessWorker spw)
Reaction on event: a SProcessWorker needs the count of all existing articles.

Specified by:
countArticles in interface OfferEventListener
Parameters:
articleKey - the name of the article.
spw - the SProcessWorker that sends the request.

Großmarkt