org.jppf.ui.monitoring.charts.config
Class PreferencesStorage

java.lang.Object
  extended by org.jppf.ui.monitoring.charts.config.PreferencesStorage

public class PreferencesStorage
extends Object

This class provides an API to store and retrieve the chart configuration preferences, using the preferences mechanism.

Author:
Laurent Cohen

Constructor Summary
PreferencesStorage(JPPFChartBuilder chartBuilder)
          Initialize this preferences storage with a specified chart builder.
 
Method Summary
 ChartConfiguration loadChartConfiguration(Preferences child)
          Load a chart configuration from a preferences node.
 void loadChartConfigurations()
          Load all chart configurations from the preferences tree, and create the corresponding charts.
 ChartConfiguration[] loadTabCharts(Preferences tabNode)
          Load the chart configurations for a tab from a specified tab preferences node.
 void removeAllSaved()
          Remove all tabs and charts configurations from the user preferences.
 void saveAll()
          Save all tabs and charts configurations in the user preferences.
 void saveChartConfiguration(TabConfiguration tab, ChartConfiguration config)
          Save a specified chart configuration in the preferences tree.
 void saveTabConfiguration(TabConfiguration tab)
          Save a specified tab configuration in the preferences tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferencesStorage

public PreferencesStorage(JPPFChartBuilder chartBuilder)
Initialize this preferences storage with a specified chart builder.

Parameters:
chartBuilder - the chart builder from which to get the charts.
Method Detail

loadChartConfigurations

public void loadChartConfigurations()
Load all chart configurations from the preferences tree, and create the corresponding charts.


loadTabCharts

public ChartConfiguration[] loadTabCharts(Preferences tabNode)
Load the chart configurations for a tab from a specified tab preferences node.

Parameters:
tabNode - the tab preferences node that contains the chart configuration nodes.
Returns:
an array of ChartConfiguration instances.

loadChartConfiguration

public ChartConfiguration loadChartConfiguration(Preferences child)
Load a chart configuration from a preferences node.

Parameters:
child - the preferences node to laod the configuration from.
Returns:
a ChartConfiguration instance.

saveAll

public void saveAll()
Save all tabs and charts configurations in the user preferences.


saveTabConfiguration

public void saveTabConfiguration(TabConfiguration tab)
Save a specified tab configuration in the preferences tree.

Parameters:
tab - the tab to save.

saveChartConfiguration

public void saveChartConfiguration(TabConfiguration tab,
                                   ChartConfiguration config)
Save a specified chart configuration in the preferences tree.

Parameters:
tab - the tab into which to save the configuration.
config - the configuration to save.

removeAllSaved

public void removeAllSaved()
Remove all tabs and charts configurations from the user preferences.



Copyright © 2005-2010 JPPF Team.