com.limegroup.gnutella.gui
Class GUIMediator

java.lang.Object
  extended bycom.limegroup.gnutella.gui.GUIMediator

public final class GUIMediator
extends java.lang.Object

This class acts as a central point of access for all gui components, a sort of "hub" for the frontend. This should be the only common class that all frontend components have access to, reducing the overall dependencies and therefore increasing the modularity of the code.

Any functions or services that should be accessible to multiple classes should be added to this class. These currently include such functions as easily displaying standardly-formatted messages to the user, obtaining locale-specific strings, and obtaining image resources, among others.

All of the methods in this class should be called from the event- dispatch (Swing) thread.


Field Summary
static int CONNECTIONS_INDEX
          Constant for the index of the connections tab in the main application window.
static int LIBRARY_INDEX
          Constant for the index of the library tab in the main application window.
static int MONITOR_INDEX
          Constant for the index of the monitor tab in the main application window.
static int NO_OPTION
          Constant for when the user selects the no button in a message giving the user a yes and a no option.
static int SEARCH_INDEX
          Constant for the index of the search tab in the main application window.
static int SHOPPING_INDEX
          Constant for the index of the shopping tab in the main application window.
static int YES_OPTION
          Constant for when the user selects the yes button in a message giving the user a yes and a no option.
 
Method Summary
static void addFinalizeListener(FinalizeListener fin)
          Adds the FinalizeListener class to the list of classes that should be notified of finalize events.
 void addNewLibraryFolder()
          Tells the library to add a new folder to the currently selected folder.
static void addNotify()
          Shows the user notification area.
static void addRefreshListener(RefreshListener listener)
          Adds the specified RefreshListener instance to the list of listeners to be notified when a UI refresh event occurs.
 void addSharedLibraryFolder()
          Tells the library to add a new top-level (shared) folder.
static void addThemeObserver(ThemeObserver observer)
          Adds the specified ThemeObserver instance to the list of ThemeObservers that should be notified whenever the theme changes.
 void audioFileDoubleClicked()
          Notification that an audio file has been double-clicked.
 void clearConnections()
          Clear the connections in the connection view.
 void clearLibrary()
          Tells the library to update the shared directories that it displays.
static void close()
          Determines the appropriate shutdown behavior based on user settings.
 void connect()
          Disconnects the user from the network.
 void deleteLibraryFile()
          Tells the library to delete the selected file(s).
 void disconnect()
          Connects the user to the network.
static javax.swing.JFrame getAppFrame()
          Returns the main application JFrame instance.
static java.awt.Point getAppLocation()
          Returns a Point instance containing the x, y position of the wrapped on the screen.
static java.awt.Dimension getAppSize()
          Returns a Dimension instance containing the dimensions of the wrapped JFrame.
 int getCurrentDownloads()
          Returns the total number of currently active downloads.
 int getCurrentUploads()
          Returns the total number of currently active uploads.
static java.awt.Component getHorizontalSeparator()
          Returns a Component standardly sized for horizontal separators.
static javax.swing.LookAndFeel getInitialLookAndFeel()
          Returns the look and feel for when the application first loaded.
 com.limegroup.gnutella.gui.MainFrame getMainFrame()
          Returns the MainFrame instance.
static java.awt.Component getMainOptionsComponent()
          Gets a handle to the options window main JComponent instance.
 com.limegroup.gnutella.RouterService getRouter()
          Returns the router service variable for other classes to access.
static java.awt.Point getScreenCenterPoint(java.awt.Component comp)
          Returns the point for the placing the specified component on the center of the screen.
static java.lang.String getStringResource(java.lang.String resourceKey)
          Returns the locale-specific String from the resource manager.
static javax.swing.ImageIcon getThemeImage(java.lang.String name)
          Serves as a single point of access for any icons used in the program.
 int getTotalDownloads()
          Returns the total number of downloads for this session.
 int getTotalUploads()
          Returns the total number of uploads for this session.
static java.net.URL getURLResource(java.lang.String FILE_NAME)
          Returns a new URL instance for the specified file name.
static java.awt.Component getVerticalSeparator()
          Returns a Component standardly sized for vertical separators.
 void handleTabSelection(int SELECTED_TAB)
          Notifies any necessary components that the specified tab has been selected.
static boolean hasDonated()
          Returns a boolean specifying whether or not the user has donated to the LimeWire project.
static void hideNotify()
          Hides the user notification area.
static void hideView()
          Hides the GUI by either sending it to the System Tray or minimizing the window.
static GUIMediator instance()
          Singleton accessor for this class.
static boolean isAppVisible()
          Returns a boolean specifying whether or not the wrapped JFrame is visible or not.
static boolean isBrowserPageLoaded()
          Returns whether or not the browser page has been successfully loaded.
 boolean isConnected()
          Returns whether or not the client is currently connected to the Gnutella network.
static boolean isConstructed()
          Accessor for whether or not the GUIMediator has been constructed yet.
static boolean isOptionsVisible()
          Returns whether or not the options window is visible
 void launchAudio(java.io.File file)
          Launches the specified audio file in the player.
static int launchFile(java.io.File file)
          Acts as a proxy for the Launcher class so that other classes only need to know about this mediator class.
 void launchLibraryFile()
          Tells the library to launch the currently selected file(s).
static int openURL(java.lang.String url)
          Acts as a proxy for the Launcher class so that other classes only need to know about this mediator class.
 void refreshGUI()
          Refreshes the various gui components that require refreshing.
 void refreshLibrary()
          Tells the library to refresh its components.
static void removeThemeObserver(ThemeObserver observer)
          Removes the specified ThemeObserver instance from the list of ThemeObservers.
 void renameLibraryFolder()
          Tells the library to rename the currently selected folder.
static void restoreView()
          Makes the GUI visible by either restoring it from the System Tray or the task bar.
static void setAppVisible(boolean visible)
          Specifies whether or not the main application window should be visible or not.
 void setCurrentTheme()
          Sets the current theme pack in use by LimeWire.
 void setKeepAliveText(java.lang.String keepAlive)
          Sets the "keep alive" value displayed to the user in the Connections tab.
 void setOptionsVisible(boolean visible)
          Sets the visibility state of the options window.
 void setRouterService(com.limegroup.gnutella.RouterService routerService)
          Sets the router service variable for other classes to access.
 void setSearching(boolean searching)
          Sets the searching or not searching status of the application.
static void setSplashScreenString(java.lang.String text)
          Modifies the text displayed to the user in the splash screen to provide application loading information.
 void setStatisticsVisible(boolean visible)
          Sets the visibility of the statistics window.
 void setTabVisible(int TAB_INDEX, boolean VISIBLE)
          Sets the visible/invisible state of the tab associated with the specified index.
 void setWindow(int index)
          Sets the tab pane to display the given tab.
static void showAboutWindow()
          Shows the "About" menu with more information about the program.
static void showConfirmMessage(java.lang.String messageKey)
          Acts as a proxy for the MessageService class.
static void showConfirmMessage(java.lang.String messageKey, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showConfirmMessage(java.lang.String messageKey, java.lang.String message)
          Acts as a proxy for the MessageService class.
static void showConfirmMessage(java.lang.String messageKey, java.lang.String message, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showConfirmMessage(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey)
          Acts as a proxy for the MessageService class.
static void showConfirmMessage(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showError(java.lang.String messageKey)
          Acts as a proxy for the MessageService class.
static void showError(java.lang.String messageKey, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showError(java.lang.String messageKey, java.lang.String message)
          Acts as a proxy for the MessageService class.
static void showError(java.lang.String messageKey, java.lang.String message, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showError(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey)
          Acts as a proxy for the MessageService class.
static void showError(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showInternalError(java.lang.Throwable t)
          Stub for calling showInternalError(t, null, Thread.currentThread())
static void showInternalError(java.lang.Throwable t, java.lang.String detail)
          Stub for calling showInternalError(t, detail, Thread.currentThread())
static void showInternalError(java.lang.Throwable t, java.lang.String detail, java.lang.Thread curThread)
          Acts as a proxy for the MessageService class.
static void showInternalError(java.lang.Throwable t, java.lang.Thread curThread)
          Stub for calling showInternalError(t, null, curThread)
static void showMessage(java.lang.String messageKey)
          Acts as a proxy for the MessageService class.
static void showMessage(java.lang.String messageKey, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showMessage(java.lang.String messageKey, java.lang.String message)
          Acts as a proxy for the MessageService class.
static void showMessage(java.lang.String messageKey, java.lang.String message, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
static void showMessage(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey)
          Acts as a proxy for the MessageService class.
static void showMessage(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey, com.limegroup.gnutella.settings.BooleanSetting ignore)
          Acts as a proxy for the MessageService class.
 int showPasswordDialog(PasswordDialog dialog)
          Displays the passed password dialog
static int showYesNoMessage(java.lang.String messageKey)
          Acts as a proxy for the MessageService class.
static int showYesNoMessage(java.lang.String messageKey, com.limegroup.gnutella.settings.IntSetting defaultValue)
          Acts as a proxy for the MessageService class.
static int showYesNoMessage(java.lang.String messageKey, java.lang.String message)
          Acts as a proxy for the MessageService class.
static int showYesNoMessage(java.lang.String messageKey, java.lang.String message, com.limegroup.gnutella.settings.IntSetting defaultValue)
          Acts as a proxy for the MessageService class.
static int showYesNoMessage(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey)
          Acts as a proxy for the MessageService class.
static int showYesNoMessage(java.lang.String messageStartKey, java.lang.String message, java.lang.String messageEndKey, com.limegroup.gnutella.settings.IntSetting defaultValue)
          Acts as a proxy for the MessageService class.
static void shutdown()
          Shutdown the program cleanly.
static void shutdownAfterTransfers()
          Shutdown the program cleanly after all transfers in progress are complete.
 void startTimer()
          The host catcher and the statistics view need the backend to be initialized for these methods to be called.
 byte[] triggerSearch(java.lang.String query)
          Trigger a search based on a string.
 void unshareLibraryFolder()
          Tells the library to unshare the currently selected folder.
static void updateNotify(java.lang.String imageFileName, java.lang.String text)
          Updates the icon and the text associated with the user notification area, such as the system tray on Windows.
static void updateNotifyImage(java.lang.String imageFileName)
          Updates the icon associated with the user notification area, such as the system tray on Windows.
static void updateNotifyText(java.lang.String text)
          Updates the text associated with the user notification area, such as the system tray on Windows.
 void updateTabIcon(int index)
          Updates the icon at the specified tab index.
 void wakeupShoppingView()
          Call the ShoppingView component to relayout itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_INDEX

public static final int SEARCH_INDEX
Constant for the index of the search tab in the main application window.

See Also:
Constant Field Values

MONITOR_INDEX

public static final int MONITOR_INDEX
Constant for the index of the monitor tab in the main application window.

See Also:
Constant Field Values

CONNECTIONS_INDEX

public static final int CONNECTIONS_INDEX
Constant for the index of the connections tab in the main application window.

See Also:
Constant Field Values

LIBRARY_INDEX

public static final int LIBRARY_INDEX
Constant for the index of the library tab in the main application window.

See Also:
Constant Field Values

SHOPPING_INDEX

public static final int SHOPPING_INDEX
Constant for the index of the shopping tab in the main application window.

See Also:
Constant Field Values

YES_OPTION

public static final int YES_OPTION
Constant for when the user selects the yes button in a message giving the user a yes and a no option.

See Also:
Constant Field Values

NO_OPTION

public static final int NO_OPTION
Constant for when the user selects the no button in a message giving the user a yes and a no option.

See Also:
Constant Field Values
Method Detail

instance

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

Returns:
the GUIMediator instance

isConstructed

public static boolean isConstructed()
Accessor for whether or not the GUIMediator has been constructed yet.


startTimer

public final void startTimer()
The host catcher and the statistics view need the backend to be initialized for these methods to be called.


isAppVisible

public static final boolean isAppVisible()
Returns a boolean specifying whether or not the wrapped JFrame is visible or not.

Returns:
true if the JFrame is visible, false otherwise

setAppVisible

public static final void setAppVisible(boolean visible)
Specifies whether or not the main application window should be visible or not.

Parameters:
visible - specifies whether or not the application should be made visible or not

getAppSize

public static final java.awt.Dimension getAppSize()
Returns a Dimension instance containing the dimensions of the wrapped JFrame.

Returns:
a Dimension instance containing the width and height of the wrapped JFrame

getAppLocation

public static final java.awt.Point getAppLocation()
Returns a Point instance containing the x, y position of the wrapped on the screen.

Returns:
a Point instance containting the x, y position of the wrapped JFrame

getMainFrame

public final com.limegroup.gnutella.gui.MainFrame getMainFrame()
Returns the MainFrame instance. MainFrame maintains handles to all of the major gui classes.

Returns:
the MainFrame instance

wakeupShoppingView

public void wakeupShoppingView()
Call the ShoppingView component to relayout itself.


getAppFrame

public static final javax.swing.JFrame getAppFrame()
Returns the main application JFrame instance.

Returns:
the main application JFrame instance

getRouter

public final com.limegroup.gnutella.RouterService getRouter()
Returns the router service variable for other classes to access.

Returns:
the RouterService instance

setRouterService

public final void setRouterService(com.limegroup.gnutella.RouterService routerService)
Sets the router service variable for other classes to access.

Parameters:
routerService - the RouterService instance for other classes to access

refreshGUI

public final void refreshGUI()
Refreshes the various gui components that require refreshing.


setOptionsVisible

public void setOptionsVisible(boolean visible)
Sets the visibility state of the options window.

Parameters:
visible - the visibility state to set the window to

isOptionsVisible

public static boolean isOptionsVisible()
Returns whether or not the options window is visible

Returns:
true if the options window is visible, false otherwise

getMainOptionsComponent

public static java.awt.Component getMainOptionsComponent()
Gets a handle to the options window main JComponent instance.

Returns:
the options window main JComponent, or null if the options window has not yet been constructed (the window is guaranteed to be constructed if it is visible)

setStatisticsVisible

public final void setStatisticsVisible(boolean visible)
Sets the visibility of the statistics window.

Parameters:
visible - the visibility state to set the window to

showPasswordDialog

public final int showPasswordDialog(PasswordDialog dialog)
Displays the passed password dialog

Parameters:
dialog - The dialog box to be displayed

handleTabSelection

public final void handleTabSelection(int SELECTED_TAB)
Notifies any necessary components that the specified tab has been selected.

Parameters:
SELECTED_TAB - the index of the tab that has been selected

setWindow

public void setWindow(int index)
Sets the tab pane to display the given tab.

Parameters:
index - the index of the tab to display

updateTabIcon

public void updateTabIcon(int index)
Updates the icon at the specified tab index.

Parameters:
index - the fixed index of the tab to update

clearConnections

public void clearConnections()
Clear the connections in the connection view.


setKeepAliveText

public void setKeepAliveText(java.lang.String keepAlive)
Sets the "keep alive" value displayed to the user in the Connections tab.

Parameters:
keepAlive - a String representing the keep alive to display

triggerSearch

public byte[] triggerSearch(java.lang.String query)
Trigger a search based on a string.

Parameters:
query - the query String
Returns:
the GUID of the query sent to the network. Used mainly for testing

getTotalUploads

public int getTotalUploads()
Returns the total number of uploads for this session.

Returns:
the total number of uploads for this session

getCurrentUploads

public int getCurrentUploads()
Returns the total number of currently active uploads.

Returns:
the total number of currently active uploads

getTotalDownloads

public final int getTotalDownloads()
Returns the total number of downloads for this session.

Returns:
the total number of downloads for this session

getCurrentDownloads

public final int getCurrentDownloads()
Returns the total number of currently active downloads.

Returns:
the total number of currently active downloads

addSharedLibraryFolder

public final void addSharedLibraryFolder()
Tells the library to add a new top-level (shared) folder.


addNewLibraryFolder

public final void addNewLibraryFolder()
Tells the library to add a new folder to the currently selected folder.


unshareLibraryFolder

public final void unshareLibraryFolder()
Tells the library to unshare the currently selected folder.


renameLibraryFolder

public final void renameLibraryFolder()
Tells the library to rename the currently selected folder.


launchLibraryFile

public final void launchLibraryFile()
Tells the library to launch the currently selected file(s).


deleteLibraryFile

public final void deleteLibraryFile()
Tells the library to delete the selected file(s).


refreshLibrary

public final void refreshLibrary()
Tells the library to refresh its components.


clearLibrary

public final void clearLibrary()
Tells the library to update the shared directories that it displays.


hideView

public static void hideView()
Hides the GUI by either sending it to the System Tray or minimizing the window. Mimimize behavior occurs on platforms which do not support the System Tray.

See Also:
restoreView

restoreView

public static void restoreView()
Makes the GUI visible by either restoring it from the System Tray or the task bar.

See Also:
hideView

close

public static void close()
Determines the appropriate shutdown behavior based on user settings. This implementation decides between exiting the application immediately, or exiting after all file transfers in progress are complete.


shutdown

public static void shutdown()
Shutdown the program cleanly.


shutdownAfterTransfers

public static void shutdownAfterTransfers()
Shutdown the program cleanly after all transfers in progress are complete. Calling this method causes the GUI to be hidden while the application waits to shutdown.

See Also:
hideView

showAboutWindow

public static final void showAboutWindow()
Shows the "About" menu with more information about the program.


updateNotifyImage

public static void updateNotifyImage(java.lang.String imageFileName)
Updates the icon associated with the user notification area, such as the system tray on Windows.

Parameters:
imageFileName - the name of the new image file to use, preferably a file in and relative to the current directory, as in "LimeWire.ico"

updateNotifyText

public static void updateNotifyText(java.lang.String text)
Updates the text associated with the user notification area, such as the system tray on Windows.

Parameters:
text - the new text to use for the user notification area for such things as the system tray tooltip on Windows

updateNotify

public static void updateNotify(java.lang.String imageFileName,
                                java.lang.String text)
Updates the icon and the text associated with the user notification area, such as the system tray on Windows.

Parameters:
imageFileName - the name of the new image file to use, preferably a file in and relative to the current directory, as in "LimeWire.ico"
text - the new text to use for the user notification area for such things as the system tray tooltip on Windows

hideNotify

public static void hideNotify()
Hides the user notification area. If this method is called, the caller must ensure that the user always has a way to exit the application even though the notification area is hidden, or to make the notification area visible again.


addNotify

public static void addNotify()
Shows the user notification area. The user notification icon and tooltip created by the NotifyUser object are not modified.


getThemeImage

public static final javax.swing.ImageIcon getThemeImage(java.lang.String name)
Serves as a single point of access for any icons used in the program.

Returns:
the ImageIcon object specified in the param string

getURLResource

public static java.net.URL getURLResource(java.lang.String FILE_NAME)
Returns a new URL instance for the specified file name. The file must be located in the com/limegroup/gnutella/gui/resources directory, or this will return null.

Parameters:
FILE_NAME - the name of the file to return a url for without path information, as in "about.html"
Returns:
the URL instance for the specified file, or null if the URL could not be loaded

getStringResource

public static final java.lang.String getStringResource(java.lang.String resourceKey)
Returns the locale-specific String from the resource manager.

Returns:
an internationalized String instance corresponding with the resourceKey

showYesNoMessage

public static final int showYesNoMessage(java.lang.String messageKey)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user in the form of a yes or no question.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
Returns:
an integer indicating a yes or a no response from the user

showYesNoMessage

public static final int showYesNoMessage(java.lang.String messageKey,
                                         com.limegroup.gnutella.settings.IntSetting defaultValue)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user in the form of a yes or no question.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
defaultValue - the IntSetting to store/retrieve the default value
Returns:
an integer indicating a yes or a no response from the user

showYesNoMessage

public static final int showYesNoMessage(java.lang.String messageKey,
                                         java.lang.String message)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user with a hard-coded String appended to it. This is in the form of a yes or no question.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename
Returns:
an integer indicating a yes or a no response from the user

showYesNoMessage

public static final int showYesNoMessage(java.lang.String messageKey,
                                         java.lang.String message,
                                         com.limegroup.gnutella.settings.IntSetting defaultValue)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user with a hard-coded String appended to it. This is in the form of a yes or no question.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename
defaultValue - the IntSetting to store/retrieve the defaultValue
Returns:
an integer indicating a yes or a no response from the user

showYesNoMessage

public static final int showYesNoMessage(java.lang.String messageStartKey,
                                         java.lang.String message,
                                         java.lang.String messageEndKey)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user with a hard-coded String in the middle of the message between two locale-specific String values. This is in the form of a yes or no question.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message
Returns:
an integer indicating a yes or a no response from the user.

showYesNoMessage

public static final int showYesNoMessage(java.lang.String messageStartKey,
                                         java.lang.String message,
                                         java.lang.String messageEndKey,
                                         com.limegroup.gnutella.settings.IntSetting defaultValue)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user with a hard-coded String in the middle of the message between two locale-specific String values. This is in the form of a yes or no question.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message
defaultValue - the IntSetting that stores/retrieves the defaultValue
Returns:
an integer indicating a yes or a no response from the user.

showMessage

public static final void showMessage(java.lang.String messageKey)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display

showMessage

public static final void showMessage(java.lang.String messageKey,
                                     com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
ignore - the BooleanSetting that stores/retrieves whether or not to display this message.

showMessage

public static final void showMessage(java.lang.String messageKey,
                                     java.lang.String message)
Acts as a proxy for the MessageService class. Displays a message to the user with a locale-specific message with a hard-coded message appended to it.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename

showMessage

public static final void showMessage(java.lang.String messageKey,
                                     java.lang.String message,
                                     com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a message to the user with a locale-specific message with a hard-coded message appended to it.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename
ignore - the BooleanSetting that stores/retrieves whether or not to display this message.

showMessage

public static final void showMessage(java.lang.String messageStartKey,
                                     java.lang.String message,
                                     java.lang.String messageEndKey)
Acts as a proxy for the MessageService class. Displays a message to the user with a locale-specific message with a hard-coded message appended to it.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message

showMessage

public static final void showMessage(java.lang.String messageStartKey,
                                     java.lang.String message,
                                     java.lang.String messageEndKey,
                                     com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a message to the user with a locale-specific message with a hard-coded message appended to it.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message
ignore - the BooleanSetting for that stores/retrieves whether or not to display this message.

showConfirmMessage

public static final void showConfirmMessage(java.lang.String messageKey)
Acts as a proxy for the MessageService class. Displays a confirmation message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display

showConfirmMessage

public static final void showConfirmMessage(java.lang.String messageKey,
                                            com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a confirmation message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
ignore - the BooleanSetting for that stores/retrieves whether or not to display this message.

showConfirmMessage

public static final void showConfirmMessage(java.lang.String messageKey,
                                            java.lang.String message)
Acts as a proxy for the MessageService class. Displays a confirmation message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename

showConfirmMessage

public static final void showConfirmMessage(java.lang.String messageKey,
                                            java.lang.String message,
                                            com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a confirmation message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename
ignore - the BooleanSetting for that stores/retrieves whether or not to display this message.

showConfirmMessage

public static final void showConfirmMessage(java.lang.String messageStartKey,
                                            java.lang.String message,
                                            java.lang.String messageEndKey)
Acts as a proxy for the MessageService class. Displays a confirmation message to the user.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message

showConfirmMessage

public static final void showConfirmMessage(java.lang.String messageStartKey,
                                            java.lang.String message,
                                            java.lang.String messageEndKey,
                                            com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a confirmation message to the user.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message
ignore - the BooleanSetting for that stores/retrieves whether or not to display this message.

showError

public static final void showError(java.lang.String messageKey)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display.

showError

public static final void showError(java.lang.String messageKey,
                                   com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display.
ignore - the BooleanSetting for that stores/retrieves whether or not to display this message.

showError

public static final void showError(java.lang.String messageKey,
                                   java.lang.String message)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user with a hard-coded message appended to it at the end.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename

showError

public static final void showError(java.lang.String messageKey,
                                   java.lang.String message,
                                   com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a locale-specific message to the user with a hard-coded message appended to it at the end.

The messageKey parameter must be the key for a locale- specific message String and not a hard-coded value.

Parameters:
messageKey - the key for the locale-specific message to display
message - a second, non-locale-specific message to display, such as a filename
ignore - the BooleanSetting for that stores/retrieves whether or not to display this message.

showError

public static final void showError(java.lang.String messageStartKey,
                                   java.lang.String message,
                                   java.lang.String messageEndKey)
Acts as a proxy for the MessageService class. Displays a message to the user with a locale-specific message with a hard-coded message appended to it.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message

showError

public static final void showError(java.lang.String messageStartKey,
                                   java.lang.String message,
                                   java.lang.String messageEndKey,
                                   com.limegroup.gnutella.settings.BooleanSetting ignore)
Acts as a proxy for the MessageService class. Displays a message to the user with a locale-specific message with a hard-coded message appended to it.

The messageStartKey and the messageEndKey parameters must be keys for locale-specific message Strings and not a hard-coded values.

Parameters:
messageStartKey - the key for the locale-specific message to display at the beginning of the message
message - a second, non-locale-specific message to display, such as a filename
messageEndKey - the key for the locale-specific message to display at the end of the message
ignore - the BooleanSetting for that stores/retrieves whether or not to display this message.

showInternalError

public static final void showInternalError(java.lang.Throwable t,
                                           java.lang.String detail,
                                           java.lang.Thread curThread)
Acts as a proxy for the MessageService class.

Parameters:
t - a Throwable object for displaying more information to the user
detail - A detailed message to display with the error
curThread - the thread the error occured in.

showInternalError

public static final void showInternalError(java.lang.Throwable t)
Stub for calling showInternalError(t, null, Thread.currentThread())

Parameters:
t - a Throwable object for displaying more information to the user

showInternalError

public static final void showInternalError(java.lang.Throwable t,
                                           java.lang.String detail)
Stub for calling showInternalError(t, detail, Thread.currentThread())

Parameters:
t - a Throwable object for displaying more information to the user
detail - A detailed error message to display to the user.

showInternalError

public static final void showInternalError(java.lang.Throwable t,
                                           java.lang.Thread curThread)
Stub for calling showInternalError(t, null, curThread)

Parameters:
t - a Throwable object for displaying more information to the user
curThread - the thread the error occured in

openURL

public static final int openURL(java.lang.String url)
                         throws java.io.IOException
Acts as a proxy for the Launcher class so that other classes only need to know about this mediator class.

Opens the specified url in a browser.

Parameters:
url - the url to open
Returns:
an int indicating the success of the browser launch
Throws:
java.io.IOException - if the url cannot be loaded do to an IO problem

launchFile

public static final int launchFile(java.io.File file)
                            throws java.io.IOException
Acts as a proxy for the Launcher class so that other classes only need to know about this mediator class.

Launches the file specified in its associated application.

Parameters:
file - a File instance denoting the abstract pathname of the file to launch
Returns:
an int indicating the success of the file launch
Throws:
java.io.IOException - if the file cannot be launched do to an IO problem

getHorizontalSeparator

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

Returns:
the constant Component used as a standard horizontal separator

getVerticalSeparator

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

Returns:
the constant Component used as a standard vertical separator

connect

public void connect()
Disconnects the user from the network.


disconnect

public void disconnect()
Connects the user to the network.


hasDonated

public static boolean hasDonated()
Returns a boolean specifying whether or not the user has donated to the LimeWire project.

Returns:
true if the user has donated, false otherwise

setTabVisible

public void setTabVisible(int TAB_INDEX,
                          boolean VISIBLE)
Sets the visible/invisible state of the tab associated with the specified index. The indeces correspond to the order of the tabs whether or not they are visible, as specified by the tab indices in this class.

Parameters:
TAB_INDEX - the index of the tab to make visible or invisible
VISIBLE - the visible/invisible state to set the tab to

setSplashScreenString

public static void setSplashScreenString(java.lang.String text)
Modifies the text displayed to the user in the splash screen to provide application loading information.

Parameters:
text - the text to display

getScreenCenterPoint

public static java.awt.Point getScreenCenterPoint(java.awt.Component comp)
Returns the point for the placing the specified component on the center of the screen.

Parameters:
comp - the Component to use for getting the relative center point
Returns:
the Point for centering the specified Component on the screen

addFinalizeListener

public static void addFinalizeListener(FinalizeListener fin)
Adds the FinalizeListener class to the list of classes that should be notified of finalize events.

Parameters:
fin - the FinalizeListener class that should be notified

setSearching

public void setSearching(boolean searching)
Sets the searching or not searching status of the application.

Parameters:
searching - the searching status of the application

addRefreshListener

public static void addRefreshListener(RefreshListener listener)
Adds the specified RefreshListener instance to the list of listeners to be notified when a UI refresh event occurs.


isConnected

public boolean isConnected()
Returns whether or not the client is currently connected to the Gnutella network.

Returns:
true if the client is connected to Gnutella, false otherwise

getInitialLookAndFeel

public static javax.swing.LookAndFeel getInitialLookAndFeel()
Returns the look and feel for when the application first loaded.

Returns:
the look and feel for when the application first loaded

launchAudio

public void launchAudio(java.io.File file)
Launches the specified audio file in the player.

Parameters:
file - the File instance to launch

audioFileDoubleClicked

public void audioFileDoubleClicked()
Notification that an audio file has been double-clicked.


isBrowserPageLoaded

public static boolean isBrowserPageLoaded()
Returns whether or not the browser page has been successfully loaded.

Returns:
true if the browser page is successfully loaded, otherwise false

addThemeObserver

public static void addThemeObserver(ThemeObserver observer)
Adds the specified ThemeObserver instance to the list of ThemeObservers that should be notified whenever the theme changes.

Parameters:
observer - the ThemeObserver to add to the notification list

removeThemeObserver

public static void removeThemeObserver(ThemeObserver observer)
Removes the specified ThemeObserver instance from the list of ThemeObservers. This is necessary to allow the removed component to be garbage-collected.

Parameters:
observer - the ThemeObserver to remove from the notification list

setCurrentTheme

public void setCurrentTheme()
Sets the current theme pack in use by LimeWire.