com.limegroup.gnutella.gui.statistics
Class StatisticsMediator

java.lang.Object
  extended bycom.limegroup.gnutella.gui.statistics.StatisticsMediator
All Implemented Interfaces:
RefreshListener

public final class StatisticsMediator
extends java.lang.Object
implements RefreshListener

This class acts as a mediator for the different components of the statistics window. This class maintains references to the StatisticsTreeManager and StatisticsPaneManager, the two primary classes that it delegates to.


Field Summary
static java.lang.String ROOT_NODE_KEY
          Constant for the key for the root node in the tree.
 
Method Summary
 javax.swing.JComponent getComponent()
           
 java.awt.Component getMainStatisticsComponent()
          Returns the main JComponent instance for the statistics window, allowing other components to position themselves accordingly.
static javax.swing.JComponent getStatDisplayComponent()
          Accessor for the component that contains the displayed statistics, as opposed to the navigational component.
 void handleSelection(java.lang.String key)
          Handles the selection of a new panel as the currently visible panel.
static StatisticsMediator instance()
          Singleton accessor for this class.
 boolean isStatisticsVisible()
          Returns whether or not the statistics window is visible.
 void refresh()
          Implements RefreshListener.
 void setAdvancedStatsVisible(boolean visible)
          Sets the visibility state of the advanced statistics.
 void setStatisticsVisible(boolean visible)
          Makes the statistics window either visible or not visible depending on the boolean argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_NODE_KEY

public static final java.lang.String ROOT_NODE_KEY
Constant for the key for the root node in the tree.

See Also:
Constant Field Values
Method Detail

instance

public static StatisticsMediator instance()
Singleton accessor for this class.

Returns:
the StatisticsMediator instance

setStatisticsVisible

public final void setStatisticsVisible(boolean visible)
Makes the statistics window either visible or not visible depending on the boolean argument.

Parameters:
visible - boolean value specifying whether the statistics window should be made visible or not visible

isStatisticsVisible

public final boolean isStatisticsVisible()
Returns whether or not the statistics window is visible.

Returns:
true is the statistics window is visible, false otherwise

handleSelection

public final void handleSelection(java.lang.String key)
Handles the selection of a new panel as the currently visible panel.

Parameters:
key - the unique identifying key of the panel to show

getMainStatisticsComponent

public java.awt.Component getMainStatisticsComponent()
Returns the main JComponent instance for the statistics window, allowing other components to position themselves accordingly.

Returns:
the main statistics JComponent window

getComponent

public javax.swing.JComponent getComponent()

getStatDisplayComponent

public static javax.swing.JComponent getStatDisplayComponent()
Accessor for the component that contains the displayed statistics, as opposed to the navigational component.

Returns:
the component that contains the displayed statistics, as opposed to the navigational component

refresh

public void refresh()
Implements RefreshListener.

Refreshes all statistics.

Specified by:
refresh in interface RefreshListener

setAdvancedStatsVisible

public void setAdvancedStatsVisible(boolean visible)
Sets the visibility state of the advanced statistics.

Parameters:
visible - the visibility state to apply