com.limegroup.gnutella.gui.statistics.panes
Class PaneItemImpl

java.lang.Object
  extended bycom.limegroup.gnutella.gui.statistics.panes.PaneItemImpl
All Implemented Interfaces:
PaneItem, RefreshListener

public class PaneItemImpl
extends java.lang.Object
implements PaneItem, RefreshListener

This class provides a skeletal implementation of the PaneItem interface.

It provides the basic implementation for displaying one statistic within a larger window of statistics. Each PaneItemImpl has a titled border and a label describing the statistic. The label is followed by standardized spacing.


Constructor Summary
PaneItemImpl(java.lang.String key)
          Creates a new PaneItemImpl with the default settings for the displayed graph.
PaneItemImpl(java.lang.String key, GraphAxisData data)
          This sole constructor overrides the the public accessibility of the default constructor and is usually called implicitly.
 
Method Summary
protected  void add(java.awt.Component comp)
          Adds the specified Component to the enclosed Container instance.
 void componentResized(java.awt.event.ComponentEvent e, java.awt.Component comp)
          Notifies the StatisticsPane that the component has been resized.
 java.awt.Container getContainer()
          Returns the Container for this set of statistics.
protected  java.awt.Component getHorizontalSeparator()
          Returns a Component standardly sized for horizontal separators.
 javax.swing.JComponent getStatsComponent()
          Accessor for the component that displays the statistic -- without the label or associated components.
protected  java.awt.Component getVerticalSeparator()
          Returns a Component standardly sized for vertical separators.
 void refresh()
          Refreshes the statistics for this PaneItem.
 void registerStatistic(com.limegroup.gnutella.statistics.Statistic stat, java.lang.String displayName)
          Registers the specified Statistic for display.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PaneItemImpl

public PaneItemImpl(java.lang.String key)
Creates a new PaneItemImpl with the default settings for the displayed graph.

Parameters:
key - the key for obtaining the locale-specific values for displayed strings

PaneItemImpl

public PaneItemImpl(java.lang.String key,
                    GraphAxisData data)
This sole constructor overrides the the public accessibility of the default constructor and is usually called implicitly.

Parameters:
key - the key for obtaining the locale-specific values for displayed strings
data - the GraphAxisData instance specifying the customized display values to use for the graph
Method Detail

getStatsComponent

public javax.swing.JComponent getStatsComponent()
Description copied from interface: PaneItem
Accessor for the component that displays the statistic -- without the label or associated components.

Specified by:
getStatsComponent in interface PaneItem
Returns:
the JComponent instance that contains the stat display

getContainer

public java.awt.Container getContainer()
Description copied from interface: PaneItem
Returns the Container for this set of statistics.

Specified by:
getContainer in interface PaneItem
Returns:
the Container for this set of statistics

add

protected final void add(java.awt.Component comp)
Adds the specified Component to the enclosed Container instance.

Parameters:
comp - the Component to add

getHorizontalSeparator

protected final java.awt.Component getHorizontalSeparator()
Returns a Component standardly sized for horizontal separators.

Returns:
the constant Component used as a standard horizontal separator

getVerticalSeparator

protected final java.awt.Component getVerticalSeparator()
Returns a Component standardly sized for vertical separators.

Returns:
the constant Component used as a standard vertical separator

registerStatistic

public void registerStatistic(com.limegroup.gnutella.statistics.Statistic stat,
                              java.lang.String displayName)
Registers the specified Statistic for display.

Parameters:
stat - the Statistic instance to register

refresh

public void refresh()
Refreshes the statistics for this PaneItem.

Specified by:
refresh in interface RefreshListener

toString

public java.lang.String toString()

componentResized

public void componentResized(java.awt.event.ComponentEvent e,
                             java.awt.Component comp)
Description copied from interface: PaneItem
Notifies the StatisticsPane that the component has been resized.

Specified by:
componentResized in interface PaneItem
Parameters:
e - the ComponentEvent that generated the resize
comp - the pane Component