com.moneydance.apps.md.model
Class MemorizedItemManager

java.lang.Object
  extended by com.moneydance.util.BasePropertyChangeReporter
      extended by com.moneydance.apps.md.model.MemorizedItemManager

public class MemorizedItemManager
extends BasePropertyChangeReporter

Manager for memorized reports and graphs, provides notifications when changes are made. This class also consolidates code that was scattered in several user interface classes. This class has a reference to the root account object and the root account also has a reference to this class to delegate tasks to it.


Field Summary
static java.lang.String GRAPH_MEMORIZED
          Property change event name for when a graph was memorized.
static java.lang.String GRAPH_NAME_CHANGED
          Property change event name for when the name of a graph was changed.
static java.lang.String GRAPH_REMOVED
          Property change event name for when a memorized graph was removed.
static java.lang.String REPORT_MEMORIZED
          Property change event name for when a report was memorized.
static java.lang.String REPORT_NAME_CHANGED
          Property change event name for when the name of a report was changed.
static java.lang.String REPORT_REMOVED
          Property change event name for when a memorized report was removed.
 
Fields inherited from class com.moneydance.util.BasePropertyChangeReporter
_eventNotify, ALL_PROPERTIES
 
Constructor Summary
MemorizedItemManager(RootAccount rootAccount)
          Constructor to allow the data file to be an immutable field.
 
Method Summary
 void changeMemorizedGraphName(java.lang.String oldName, java.lang.String newName)
          Modify a memorized graph's name.
 void changeMemorizedReportName(java.lang.String oldName, java.lang.String newName)
          Modify a memorized report's name.
 java.lang.String getGraphClassFromUri(java.lang.String graphUri)
          Given a graph URI, return the class name of the underlying graph object.
 java.lang.String getGraphURI(java.lang.String graphName)
          Given a memorized graph name, return the URI associated with that graph.
 java.lang.String getGraphURIFromSettings(StreamTable graphSettings)
          Given a memorized graph settings table, return the URI associated with that graph.
 java.util.Map<java.lang.String,StreamTable> getMemorizedGraphs()
          Read the user's memorized graphs settings from the current data file.
 java.util.Map<java.lang.String,StreamTable> getMemorizedReports()
          Read the user's memorized reports settings from the current data file.
 java.lang.String getReportClassFromUri(java.lang.String reportUri)
          Given a report URI, return the class name of the underlying graph object.
 java.lang.String getReportURI(java.lang.String reportName)
          Given a memorized report name, return the URI associated with that report.
 java.lang.String getReportURIFromSettings(StreamTable reportSettings)
          Given a memorized report settings table, return the URI associated with that report.
 void memorizeGraph(java.lang.String graphName, java.lang.String graphURI)
          Save a memorized graph.
 void memorizeReport(java.lang.String reportName, java.lang.String reportURI)
          Save a memorized report.
 void removeMemorizedGraph(java.lang.String graphName)
          Remove a memorized graph.
 void removeMemorizedReport(java.lang.String reportName)
          Remove a memorized report.
 
Methods inherited from class com.moneydance.util.BasePropertyChangeReporter
addPropertyChangeListener, notifyAllListeners, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPORT_NAME_CHANGED

public static final java.lang.String REPORT_NAME_CHANGED
Property change event name for when the name of a report was changed.

See Also:
Constant Field Values

REPORT_MEMORIZED

public static final java.lang.String REPORT_MEMORIZED
Property change event name for when a report was memorized.

See Also:
Constant Field Values

REPORT_REMOVED

public static final java.lang.String REPORT_REMOVED
Property change event name for when a memorized report was removed.

See Also:
Constant Field Values

GRAPH_NAME_CHANGED

public static final java.lang.String GRAPH_NAME_CHANGED
Property change event name for when the name of a graph was changed.

See Also:
Constant Field Values

GRAPH_MEMORIZED

public static final java.lang.String GRAPH_MEMORIZED
Property change event name for when a graph was memorized.

See Also:
Constant Field Values

GRAPH_REMOVED

public static final java.lang.String GRAPH_REMOVED
Property change event name for when a memorized graph was removed.

See Also:
Constant Field Values
Constructor Detail

MemorizedItemManager

public MemorizedItemManager(RootAccount rootAccount)
Constructor to allow the data file to be an immutable field.

Parameters:
rootAccount - The associated data file.
Method Detail

removeMemorizedGraph

public void removeMemorizedGraph(java.lang.String graphName)
Remove a memorized graph.

Parameters:
graphName - The name of the memorized graph to remove.

changeMemorizedGraphName

public void changeMemorizedGraphName(java.lang.String oldName,
                                     java.lang.String newName)
Modify a memorized graph's name. This method assumes the new name is different from the old and is valid.

Parameters:
oldName - The previous name of the memorized graph.
newName - The new, valid name for the same graph.

memorizeGraph

public void memorizeGraph(java.lang.String graphName,
                          java.lang.String graphURI)
Save a memorized graph. This method assumes the new name is valid. If the name matches an existing name, the graph will be replaced. If the name is new, a new graph is added.

Parameters:
graphName - The name of the graph to memorize.
graphURI - The graph parameters to save.

getGraphURI

public java.lang.String getGraphURI(java.lang.String graphName)
Given a memorized graph name, return the URI associated with that graph.

Parameters:
graphName - The unique name of the memorized graph.
Returns:
The URI of the graph, or null if the graph cannot be found.

getGraphURIFromSettings

public java.lang.String getGraphURIFromSettings(StreamTable graphSettings)
Given a memorized graph settings table, return the URI associated with that graph.

Parameters:
graphSettings - The settings for the memorized graph.
Returns:
The URI of the graph.

getMemorizedGraphs

public java.util.Map<java.lang.String,StreamTable> getMemorizedGraphs()
Read the user's memorized graphs settings from the current data file. The returned map is sorted by the user-selected names.

Returns:
A map where the key is the user-selected name of the memorized graph, and the value is the stream table of settings for that memorized graph.

getGraphClassFromUri

public java.lang.String getGraphClassFromUri(java.lang.String graphUri)
Given a graph URI, return the class name of the underlying graph object.

Parameters:
graphUri - The URI for the graph.
Returns:
The class name of the graph generator, or null if not found.

removeMemorizedReport

public void removeMemorizedReport(java.lang.String reportName)
Remove a memorized report.

Parameters:
reportName - The name of the memorized report to remove.

changeMemorizedReportName

public void changeMemorizedReportName(java.lang.String oldName,
                                      java.lang.String newName)
Modify a memorized report's name. This method assumes the new name is different from the old and is valid.

Parameters:
oldName - The previous name of the memorized report.
newName - The new, valid name for the same report.

memorizeReport

public void memorizeReport(java.lang.String reportName,
                           java.lang.String reportURI)
Save a memorized report. This method assumes the new name is valid. If the name matches an existing name, the report will be replaced. If the name is new, a new report is added.

Parameters:
reportName - The name of the report to memorize.
reportURI - The report parameters to save.

getReportURI

public java.lang.String getReportURI(java.lang.String reportName)
Given a memorized report name, return the URI associated with that report.

Parameters:
reportName - The unique name of the memorized report.
Returns:
The URI of the report, or null if the report cannot be found.

getReportURIFromSettings

public java.lang.String getReportURIFromSettings(StreamTable reportSettings)
Given a memorized report settings table, return the URI associated with that report.

Parameters:
reportSettings - The settings for the memorized report.
Returns:
The URI of the report.

getMemorizedReports

public java.util.Map<java.lang.String,StreamTable> getMemorizedReports()
Read the user's memorized reports settings from the current data file. The returned map is sorted by the user-selected names.

Returns:
A map where the key is the user-selected name of the memorized report, and the value is the stream table of settings for that memorized report.

getReportClassFromUri

public java.lang.String getReportClassFromUri(java.lang.String reportUri)
Given a report URI, return the class name of the underlying graph object.

Parameters:
reportUri - The URI for the report.
Returns:
The class name of the report generator, or null if not found.