com.limegroup.gnutella.gui.connection
Class ConnectionMediator

java.lang.Object
  extended bycom.limegroup.gnutella.gui.tables.AbstractTableMediator
      extended bycom.limegroup.gnutella.gui.connection.ConnectionMediator
All Implemented Interfaces:
ComponentMediator, HeaderMouseObserver, RefreshListener, ThemeObserver

public final class ConnectionMediator
extends AbstractTableMediator

This class acts as a mediator between all of the components of the connection window.


Nested Class Summary
 
Nested classes inherited from class com.limegroup.gnutella.gui.tables.AbstractTableMediator
AbstractTableMediator.Resorter
 
Field Summary
 
Fields inherited from class com.limegroup.gnutella.gui.tables.AbstractTableMediator
BUTTON_ROW, CHAT_RENDERER, COLOR_RENDERER, DATA_MODEL, DEFAULT_LISTENER, HEADER_LISTENER, ID, MAIN_PANEL, PROGRESS_BAR_RENDERER, REMOVE_LISTENER, RESORTER, SCROLL_PANE, SELECTION_LISTENER, SETTINGS, TABLE, TABLE_PANE, ZERO_DIMENSION
 
Method Summary
protected  void addListeners()
          Add the listeners
protected  void buildListeners()
          Build the listeners
protected  void buildSettings()
          Overriden to have different default values for tooltips.
 void clearConnections()
          Clear the connections visually
protected  javax.swing.JPopupMenu createPopupMenu()
          Abstract method for creating a right-click popup menu for the table.
 void doRefresh()
          Override the default doRefresh so we can update the servent status label (Uses doRefresh instead of refresh so this will only get called when the table is showing.
protected  java.awt.Component getScrolledTablePane()
          Overridden to set the size.
 void handleMouseDoubleClick(java.awt.Point p)
          Do nothing on double-click
 void handleNoSelection()
          Handles the deselection of all rows in the download table, disabling all necessary buttons and menu items.
 void handleSelection(int row)
          Handles the selection of the specified row in the connection window, enabling or disabling buttons
static ConnectionMediator instance()
           
 void processKeepAliveChange(javax.swing.JTextField source)
          Called when the user changes their keep alive settings
 void removeSelection()
          Removes all selected rows from Router, which will in turn remove it from the list.
 void setKeepAliveText(java.lang.String val)
           
protected  void setupConstants()
          Set up the necessary constants.
protected  void setupMainPanel()
          Override the default main panel setup so we can add two text boxes, for the host & port.
protected  void updateSplashScreen()
          Update the splash screen
 
Methods inherited from class com.limegroup.gnutella.gui.tables.AbstractTableMediator
add, addUnsorted, clearSelection, clearTable, createColumnSelectionMenu, createDefaultColumnPreferencesHandler, forceResort, getComponent, getSize, handleHeaderColumnLeftClick, handleHeaderColumnPressed, handleHeaderColumnReleased, handleHeaderPopupMenu, handlePopupMenu, handleRightMouseClick, refresh, remove, removeRow, resort, setButtonEnabled, setDefaultEditors, setDefaultRenderers, setupTable, setupTableHeaders, sortAndMaintainSelection, update, updateTheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static ConnectionMediator instance()

buildListeners

protected void buildListeners()
Build the listeners

Overrides:
buildListeners in class AbstractTableMediator

buildSettings

protected void buildSettings()
Overriden to have different default values for tooltips.

Overrides:
buildSettings in class AbstractTableMediator

addListeners

protected void addListeners()
Add the listeners

Overrides:
addListeners in class AbstractTableMediator

setupConstants

protected void setupConstants()
Set up the necessary constants.

Specified by:
setupConstants in class AbstractTableMediator

getScrolledTablePane

protected java.awt.Component getScrolledTablePane()
Overridden to set the size.

Overrides:
getScrolledTablePane in class AbstractTableMediator

updateSplashScreen

protected void updateSplashScreen()
Update the splash screen

Specified by:
updateSplashScreen in class AbstractTableMediator

setupMainPanel

protected void setupMainPanel()
Override the default main panel setup so we can add two text boxes, for the host & port.

Overrides:
setupMainPanel in class AbstractTableMediator

removeSelection

public void removeSelection()
Removes all selected rows from Router, which will in turn remove it from the list. Overrides default removeSelection

Specified by:
removeSelection in interface ComponentMediator
Overrides:
removeSelection in class AbstractTableMediator

createPopupMenu

protected javax.swing.JPopupMenu createPopupMenu()
Description copied from class: AbstractTableMediator
Abstract method for creating a right-click popup menu for the table. If an implemention does not support a right-click popup menu, it should return null.

Specified by:
createPopupMenu in class AbstractTableMediator
Returns:
a new JPopupMenu to display on right-click

handleSelection

public void handleSelection(int row)
Handles the selection of the specified row in the connection window, enabling or disabling buttons

Parameters:
row - the selected row

handleNoSelection

public void handleNoSelection()
Handles the deselection of all rows in the download table, disabling all necessary buttons and menu items.


handleMouseDoubleClick

public void handleMouseDoubleClick(java.awt.Point p)
Do nothing on double-click


doRefresh

public void doRefresh()
Override the default doRefresh so we can update the servent status label (Uses doRefresh instead of refresh so this will only get called when the table is showing. Small optimization.)

Overrides:
doRefresh in class AbstractTableMediator

processKeepAliveChange

public void processKeepAliveChange(javax.swing.JTextField source)
Called when the user changes their keep alive settings


setKeepAliveText

public void setKeepAliveText(java.lang.String val)

clearConnections

public void clearConnections()
Clear the connections visually