|
StocksMonitor 1.5.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectAbstractAction
FetchQuotesAction
public final class FetchQuotesAction
Fetch current quote data for the CurrentPortfolio from a data
source on the web.
This action is performed at many different times :
This class performs most of its work in a background daemon thread, and uses EventQueue.invokeLater to update the user interface with the result. The user interface remains responsive, regardless of the time taken for its work to complete.
A daemon thread is used since daemon threads do not prevent an application from terminating.
| Field Summary |
|---|
| Fields inherited from class AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
FetchQuotesAction(CurrentPortfolio aCurrentPortfolio,
QuoteTablePreferencesEditor aQuoteTablePrefEditor,
QuoteTable aQuoteTable,
SummaryView aSummaryView)
Constructor. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Fetch quotes from the web for the CurrentPortfolio. |
void |
update(Observable aPublisher,
Object aData)
Listens for changes to the CurrentPortfolio or the user preference for update frequency, and calls actionPerformed(java.awt.event.ActionEvent). |
| Methods inherited from class AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FetchQuotesAction(CurrentPortfolio aCurrentPortfolio,
QuoteTablePreferencesEditor aQuoteTablePrefEditor,
QuoteTable aQuoteTable,
SummaryView aSummaryView)
aCurrentPortfolio - an Observable which notifies this
object when the CurrentPortfolio is changedaQuoteTablePrefEditor - allows this class to read the user preference
for the frequency of periodic fetchesaQuoteTable - a GUI element which is updated when a fetch is performedaSummaryView - a GUI element which is updated when a fetch is performed| Method Detail |
|---|
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListener
public void update(Observable aPublisher,
Object aData)
actionPerformed(java.awt.event.ActionEvent).
In the case of changes to the update frequency, actionPerformed is called only if the udate frequency has been assigned a new value.
update in interface Observer
|
StocksMonitor 1.5.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||