Preferences.java
| Index Score | ||
|---|---|---|
![]() |
![]() |
org.xnap.util |
![]() |
![]() |
XNap 3 |
View: Reasons, Metrics, Source Code
These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.
/*
* XNap - A P2P framework and client.
*
* See the file AUTHORS for copyright information.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.xnap.util;
import javax.swing.KeyStroke;
import javax.swing.UIManager;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import org.xnap.util.prefs.IntValidator;
import org.xnap.util.prefs.StringValidator;
/**
* Provides access to the global settings.
*
* <p>This class makes use of the singleton pattern.
*
* <p>If you hack around, make sure all pathes are returned with a trailing
* file separator and all values are initialized to something other than
* null.
*
* <p>Most important, keep all preferences sorted alphabetically everywhere.
*/
public class Preferences extends AbstractPreferences
implements PreferencesProvider, TablePreferencesProvider {
//--- Constant(s) ---
/**
* The name of the references file that was used by XNap 1.x.
*/
public static final String XNAP1_FILENAME = "xnap.properties";
/**
* The name of the references file that was used by XNap 2.x.
*/
public static final String XNAP2_FILENAME = "xnap2.properties";
/**
* The name of the current preferences file.
*/
public static final String XNAP3_FILENAME = "xnap3.properties";
/**
* The current version of the preferences file. Increase this, if keys
* are renamed or removed.
*/
public static final int PREFS_VERSION = 17;
public static final String DEFAULT_THEME
= "org.xnap.gui.theme.DefaultTheme";
//--- Data field(s) ---
private static Preferences singleton = null;
//--- Constructor(s) ---
private Preferences(String filename)
{
super(filename, PREFS_VERSION, "xnap");
}
//--- Method(s) ---
/**
* Returns the preferences. This should be called at an early stage.
*/
public static Preferences getInstance()
{
if (singleton == null) {
synchronized (Preferences.class) {
if (singleton == null) {
String f = FileHelper.getHomeDir() + XNAP3_FILENAME;
singleton = new Preferences(f);
}
}
}
return singleton;
}
/**
* Sets the preferences from the default preferences file.
*/
public void read()
{
if (prefsFile.exists()) {
super.read();
}
else {
File f = new File(FileHelper.getHomeDir() + XNAP2_FILENAME);
if (f.exists()) {
super.read(f);
}
else {
f = new File(FileHelper.getHomeDir() + XNAP1_FILENAME);
if (f.exists()) {
super.read(f);
}
}
}
defaults();
}
/**
* Converts preferences from <code>oldVersion</code>.
*/
public void convert(int oldVersion)
{
if (oldVersion <= 1) {
set("lastLaunchVersion", "1.0");
}
if (oldVersion <= 2) {
renameProperty("xnap.autofetchnaptigator",
"xnap.plugin.nap.autoFetchNaptigator");
renameProperty("xnap.autoversioncheck", "xnap.autoVersionCheck");
renameProperty("xnap.clientinfo", "xnap.plugin.nap.clientInfo");
renameProperty("xnap.delincompletefiles",
"xnap.delIncompleteFiles");
renameProperty("xnap.downloaddir", "xnap.downloadDir");
renameProperty("xnap.filterresults", "xnap.filterResults");
renameProperty("xnap.http.proxy.host", "xnap.httpProxyHost");
renameProperty("xnap.http.proxy.port", "xnap.httpProxyPort");
renameProperty("xnap.incompletedir", "xnap.incompleteDir");
renameProperty("xnap.lastupdatecheck", "xnap.lastUpdateCheck");
renameProperty("xnap.linktype", "xnap.linkType");
renameProperty("xnap.localport", "xnap.plugin.nap.localPort");
renameProperty("xnap.lookandfeel", "xnap.lookAndFeel");
renameProperty("xnap.maxautoconnectservers",
"xnap.plugin.nap.maxAutoconnectServers");
renameProperty("xnap.maxconsolelines", "xnap.maxConsoleLines");
renameProperty("xnap.maxdownloads", "xnap.maxDownloads");
renameProperty("xnap.maxsearchresults", "xnap.maxSearchResults");
renameProperty("xnap.maxsearchservers",
"xnap.plugin.nap.maxSearchServers");
renameProperty("xnap.maxuploads", "xnap.maxUploads");
renameProperty("xnap.mp3playercmd", "xnap.mp3PlayerCmd");
renameProperty("xnap.mp3playertype", "xnap.mp3PlayerType");
renameProperty("xnap.gift.daemon", "xnap.plugin.gift.daemon");
renameProperty("xnap.gift.host", "xnap.plugin.gift.host");
renameProperty("xnap.gift.port", "xnap.plugin.gift.port");
renameProperty("xnap.removeduplicateresults",
"xnap.removeDuplicateResults");
renameProperty("xnap.search.bitrate", "xnap.searchBitrate");
renameProperty("xnap.search.compare", "xnap.searchCompare");
renameProperty("xnap.search.mediatype", "xnap.searchMediaType");
renameProperty("xnap.showclosedialog", "xnap.showCloseDialog");
renameProperty("xnap.showicons", "xnap.showIcons");
renameProperty("xnap.showsplash", "xnap.showSplash");
renameProperty("xnap.socksproxyhost", "xnap.socksProxyHost");
renameProperty("xnap.socksproxyport", "xnap.socksProxyPort");
renameProperty("xnap.uploaddirs", "xnap.uploadDirs");
renameProperty("xnap.useautoconnector",
"xnap.plugin.nap.useAutoconnector");
renameProperty("xnap.usehttpproxy", "xnap.useHttpProxy");
removeProperty("xnap.uselimewire");
renameProperty("xnap.useopenfileaction", "xnap.useOpenFileAction");
renameProperty("xnap.usesingleport",
"xnap.plugin.nap.useSinglePort");
renameProperty("xnap.useSocksProxy", "xnap.useSocksProxy");
renameProperty("xnap.window.height", "xnap.windowHeight");
renameProperty("xnap.window.width", "xnap.windowWidth");
renameProperty("xnap.window.x", "xnap.windowX");
renameProperty("xnap.window.y", "xnap.windowY");
// setProperty("plugin.nap.useSinglePort", "true");
// if (getInt("plugin.nap.localPort") == 0) {
// setProperty("firewalled", "true");
// }
}
if (oldVersion <= 3) {
if (getDownloadThrottle() > 0) {
setThrottleDownloads(true);
}
if (getUploadThrottle() > 0) {
setThrottleUploads(true);
}
}
if (oldVersion <= 4) {
renameProperty("xnap.useOpenFileAction", "xnap.fileLauncherType");
if (!SystemHelper.isWindowsOS && getBoolean("fileLauncherType")) {
setFileLauncherCmd("kfmclient");
setFileLauncherType("kfmclient");
}
else {
setFileLauncherCmd("");
setFileLauncherType(SystemHelper.getNativeLauncherType());
}
}
if (oldVersion <= 5) {
removeProperty("maintainSortOrder");
set("channelTableColumns", "0;1;2");
set("downloadTableColumns", "0;1;2;4;5;6");
set("libraryTableColumns", "0;3;4;6");
set("searchTableColumns", "0;2;3;5;6;10");
set("uploadTableColumns", "0;1;2;4;5;6");
}
if (oldVersion <= 6) {
set("progressRunningColor", 11513855);
set("progressFinishedColor", 65280);
}
if (oldVersion <= 7) {
setLimitDownloads(getMaxDownloads() > 0);
setLimitUploads(getMaxUploads() > 0);
}
if (oldVersion <= 8) {
// this is acctually a useful thing and used by the XNap class
// but it hast been renamed to lastLaunchVersion
removeProperty("lastLaunchVer");
}
if (oldVersion <= 9) {
setDownloadRetryInterval(120);
}
if (oldVersion <= 10) {
set("updaterInterval", "3600");
}
if (oldVersion <= 11) {
set("browseTableColumns", "icon;filesize;availability");
set("channelTableColumns", "channel;userCount;topic");
set("downloadTableColumns",
"icon;queuePos;filesize;peer;status;segments;progress;timeLeft");
set("hotlistTableColumns", "name;status");
set("libraryTableColumns", "filename;type;size;modified");
set("searchTableColumns",
"icon;filesize;peer;availability");
set("uploadTableColumns",
"icon;queuePos;filesize;peer;status;progress;timeLeft");
set("userTableColumns", "name;fileCount;linkSpeed");
}
if (oldVersion <= 12) {
renameProperty("xnap.mp3PlayerCmd", "xnap.playerCommand");
renameProperty("xnap.mp3PlayerType", "xnap.playerType");
}
if (oldVersion <= 13) {
removeProperty("xnap.autoJoinChannels");
removeProperty("xnap.maxSearchResults");
set("enabledPlugins", "");
set("libraryTreeNodes",
"downloads;incompletes;home;root;library;shares");
set("useTabbedPane", "true");
}
if (oldVersion <= 14) {
removeProperty("lastLaunchReleaseNr");
}
if (oldVersion <= 15) {
set("theme", DEFAULT_THEME);
}
if (oldVersion <= 16) {
// reset default look and feel
set("lookAndFeel", getDefaultLookAndFeel());
}
if (oldVersion <= 17) {
set("enabledPlugins", getEnabledPlugins() + ";News");
}
}
/**
* Sets the defaults. Preferences that are already set are not overwritten.
*/
public void defaults()
{
setDefault("AudioDownloadDir", "");
setDefault("alwaysAutoDownload", "true");
setDefault("appendServerNameToChatUser", "false");
setDefault("autoClearTransfers", "false");
setDefault("autoClearTransfersInterval", "300");
setDefault("autoComplete", "false");
setDefault("autoVersionCheck", "true");
setDefault("autoDownlodMaxSearches", "12");
setDefault("autoDownlodSearchInterval", "900",
new IntValidator(600));
setDefault("autoSourcesListManagement", "true");
setDefault("beepOnChatMessage", "false");
setDefault("blinkOnChannelJoin", "true");
setDefault("browseTableColumns", "icon;filesize;availability");
setDefault("buildSearchTreeOnStartup", "false");
setDefault("captureLauncherOutput", "false");
setDefault("channelTableColumns", "channel;userCount;topic");
setDefault("chatBackgroundColor", "16777215");
setDefault("chatErrorColor", "255");
setDefault("chatFont", "Monospaced;0;12");
setDefault("chatAwayMessage", "I'm away, please try again later.");
setDefault("chatIgnoreMessage", "I'm ignoring you, please stop sending"
+ " messages.");
setDefault("chatInfoColor", "51455");
setDefault("chatMessageColor", "0");
setDefault("chatUserColor", "16711680");
setDefault("chatVerticalDividerLocation", "400");
setDefault("chatGlobalVerticalDividerLocation", "200");
setDefault("consoleFont", "Monospaced;1;12");
setDefault("consoleForegroundColor", "51455");
setDefault("consoleBackgroundColor", "0");
setDefault("consoleBackgroundColor", "0");
setDefault("correctivePixels", "0");
setDefault("debugLogFile", FileHelper.getHomeDir() + "debug.log");
setDefault("defaultCompletionMode", "Dropdown List");
setDefault("defaultThemeFont", "Dialog;0;12");
setDefault("delIncompleteFiles", "true");
setDefault("DocumentsDownloadDir", "");
setDefault("downloadDir",
FileHelper.directory(System.getProperty("user.home")));
setDefault("downloadMaxTries", "60");
setDefault("downloadRetryInterval", "300",
new IntValidator(60));
setDefault("downloadTableColumns",
"icon;queuePos;filesize;peer;status;segments;progress;timeLeft");
setDefault("downloadThrottle", "0", new IntValidator(0));
setDefault("doubleFilterMediaType", "true");
setDefault("emacsCycleBackwardShortcut",
toString(KeyStroke.getKeyStroke(KeyEvent.VK_R,
InputEvent.CTRL_MASK)));
setDefault("emacsCycleForwardShortcut",
toString(KeyStroke.getKeyStroke(KeyEvent.VK_T,
InputEvent.CTRL_MASK)));
setDefault("email", "anonymous@universe", StringValidator.EMAIL);
setDefault("enabledPlugins", "News");
setDefault("errorDialogDetailsVisible", "false");
setDefault("errorDialogHeight", "275");
setDefault("errorDialogWidth", "475");
setDefault("faqURL", "http://xnap.sourceforge.net/faq.php");
setDefault("feedbackEmail", "");
setDefault("feedbackName", "");
setDefault("feedbackURL", "http://xnap.sourceforge.net/feedback.php");
setDefault("fileLauncherCmd", "");
setDefault("fileLauncherType", SystemHelper.getNativeLauncherType());
setDefault("filteredDownloadTableColumns",
"icon;queuePos;filesize;peer;status;progress;timeLeft");
setDefault("filteredUploadTableColumns",
"icon;queuePos;filesize;peer;status;progress;timeLeft");
setDefault("filterResults", "false");
setDefault("focusOnAllEvents", "true");
setDefault("helpDialogHeight", "480");
setDefault("helpDialogWidth", "640");
setDefault("hotlistDividerLocation", "540");
setDefault("hotlistTableColumns", "name;status");
setDefault("httpProxyHost", "");
setDefault("httpProxyPort", "0");
setDefault("iconTheme", "org.xnap.gui.theme.DefaultIconTheme");
setDefault("ImagesDownloadDir", "");
setDefault("incompleteDir", "");
setDefault("jarIncludePath", "/usr/share/java");
setDefault("language", "");
setDefault("lastLaunchVersion", "-1");
setDefault("lastUpdateCheck", "0");
setDefault("libraryDirs", "");
setDefault("libraryFileDeleteShortcut",
toString(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)));
setDefault("libraryFileRenameShortcut",
toString(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0)));
setDefault("libraryHorizontalDividerLocation", "220");
setDefault("libraryRefreshShortcut",
toString(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)));
setDefault("libraryTableColumns", "filename;type;size;modified");
setDefault("libraryVerticalDividerLocation", "200");
setDefault("libraryTreeNodes",
"downloads;incompletes;home;root;library;shares");
setDefault("limitDownloads", "false");
setDefault("limitDownloadAttempts", "false");
setDefault("limitUploads", "true");
setDefault("limitDownloadsPerUser", "true");
setDefault("limitUploadsPerUser", "true");
setDefault("linkType", "0");
setDefault("logTransfersToFile", "false");
setDefault("lookAndFeel", getDefaultLookAndFeel());
setDefault("manuallyCompleteShortcut",
toString(KeyStroke.getKeyStroke(KeyEvent.VK_T,
InputEvent.CTRL_MASK)));
setDefault("maxDownloads", "20", new IntValidator(0));
setDefault("maxDownloadsPerUser", "3", new IntValidator(0));
setDefault("maxConsoleLines", "100", new IntValidator(1));
setDefault("maxOpenWithCommands", "5");
setDefault("maxSwarmedConnects", "1");
setDefault("maxUploads", "5", new IntValidator(0));
setDefault("maxUploadsPerUser", "1", new IntValidator(0));
setDefault("mediaDownloadDirsTableColumns", "mediatype;downloaddir");
setDefault("minimumShares", "0");
setDefault("minimumSharesMessage", "Sorry, you are not allowed to"
+ " download since you do not share enough.");
setDefault("openWithCommands", "");
setDefault("password", StringHelper.randomString(8),
StringValidator.REGULAR_STRING);
setDefault("playerCommand", "");
setDefault("playerType", "other");
setDefault("preferencesDialogShortcut",
toString(SystemHelper.getMenuShortcut(KeyEvent.VK_P)));
setDefault("prefsWindowHeight", "550");
setDefault("prefsWindowWidth", "700");
setDefault("problemReportURL",
"http://xnap.sourceforge.net/problem_report.php");
setDefault("progressRunningColor", "11513855");
setDefault("progressFinishedColor", "65280");
setDefault("rememberFeedback", "true");
setDefault("removeDuplicateResults", "true");
setDefault("requerySearchShortcut",
toString(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)));
setDefault("searchBitrate", "0");
setDefault("searchCompare", "0");
setDefault("searchDividerLocation", "200");
setDefault("searchHorizontalDividerLocation", "150");
setDefault("searchHistorySize", "30");
setDefault("searchMediaType", "0");
setDefault("searchTableColumns",
"icon;filesize;peer;availability");
setDefault("searchTableSortedColumn", "-11");
setDefault("seenStartupWizard", "false");
setDefault("sendChatAwayMessage", "false");
setDefault("sendChatIgnoreMessage", "true");
setDefault("sendMinimumSharesMessage", "false");
setDefault("PrintServerNotificationsInChatWindow", "false");
setDefault("SoftwareDownloadDir", "");
setDefault("shareFullPath", "true");
setDefault("shortcutTableColumns", "Action;Shortcut");
setDefault("showAdvancedSearchOptions", "false");
setDefault("showChatMsgTime", "true");
setDefault("showChatPanel", "true");
setDefault("showCloseDialog", "true");
setDefault("showCmdlToolbar", "false");
setDefault("showCopyDialog", "true");
setDefault("showDeleteDownloadsDialog", "true");
setDefault("showDeleteFilesDialog", "true");
setDefault("showErrorDialog", "true");
setDefault("showIcons", "true");
setDefault("showLibraryPanel", "true");
setDefault("showMainToolbar", "true");
setDefault("showMoveDialog", "true");
setDefault("showSearchLibraryOnDownloadDialog", "true");
setDefault("showSearchOptions", "true");
setDefault("showSplash", "true");
setDefault("showToolTips", !SystemHelper.hasMacOSXToolTipsBug() + "");
setDefault("socksProxyHost", "");
setDefault("socksProxyPort", "0");
setDefault("theme", DEFAULT_THEME);
setDefault("transferDividerLocation", "220");
setDefault("transferLogFile", FileHelper.getHomeDir() + "transfer.log");
setDefault("throttleDownloads", "false");
setDefault("throttleUploads", "false");
setDefault("updatePluginsOnStartup", "false");
setDefault("updaterInterval", "600", new IntValidator(60));
setDefault("updateURL",
"http://xnap.sourceforge.net/updates/LATEST_VERSION.txt");
setDefault("uploadDirs", "");
setDefault("uploadTableColumns",
"icon;queuePos;filesize;peer;status;progress;timeLeft");
setDefault("uploadThrottle", "0", new IntValidator(0));
setDefault("useEmacsKeyBindings", "false");
setDefault("username", StringHelper.randomString(8),
StringValidator.REGULAR_STRING);
setDefault("useHttpProxy", "false");
setDefault("userTableColumns", "name;fileCount;linkSpeed");
setDefault("useMinimumShares", "false");
setDefault("useSmallTransferIcons", "false");
setDefault("useSocksProxy", "false");
setDefault("useTabbedPane", "true");
setDefault("useTabbedTransferPane", "false");
setDefault("useSubMenuForPluginMenus", "true");
setDefault("VideoDownloadDir", "");
setDefault("windowHeight", "540");
setDefault("windowWidth", "720");
setDefault("windowX", "0");
setDefault("windowY", "0");
setDefault("xnapJarURL", "http://xnap.sourceforge.net/redirect.php");
}
/**
* Add a listener for a table preferences.
*/
public void addTableListener(String table, PropertyChangeListener l)
{
addPropertyChangeListener(table + "TableColumns", l);
addPropertyChangeListener(table + "TableMaintainSortOrder", l);
}
public boolean getAlwaysAutoDownload() {
return getBoolean("alwaysAutoDownload");
}
public void setAlwaysAutoDownload(boolean newValue) {
set("alwaysAutoDownload", newValue);
}
public boolean getAppendServerNameToChatUser(){
return getBoolean("appendServerNameToChatUser");
}
public void setAppendServerNameToChatUser(boolean newValue) {
set("appendServerNameToChatUser", newValue);
}
public boolean getAutoClearTransfers() {
return getBoolean("autoClearTransfers");
}
public void setAutoClearTransfers(boolean newValue) {
set("autoClearTransfers", newValue);
}
public int getAutoClearTransfersInterval() {
return getInt("autoClearTransfersInterval");
}
public void setAutoClearTransfersInterval(int newValue) {
set("autoClearTransfersInterval", newValue);
}
public boolean getAutoComplete() {
return getBoolean("autoComplete");
}
public void setAutoComplete(boolean newValue) {
set("autoComplete", newValue);
}
public int getAutoDownloadMaxSearches() {
return getInt("autoDownlodMaxSearches");
}
public void setAutoDownloadMaxSearches(int newValue) {
set("autoDownlodMaxSearches", newValue);
}
public int getAutoDownloadSearchInterval() {
return getInt("autoDownlodSearchInterval");
}
public void setAutoDownloadSearchInterval(int newValue) {
set("autoDownlodSearchInterval", newValue);
}
public boolean getAutoVersionCheck() {
return getBoolean("autoVersionCheck");
}
public void setAutoVersionCheck(boolean newValue) {
set("autoVersionCheck", newValue);
}
public boolean getBeepOnChatMessage() {
return getBoolean("beepOnChatMessage");
}
public void setBeepOnChatMessage(boolean newValue) {
set("beepOnChatMessage", newValue);
}
public boolean getBlinkOnChannelJoin() {
return getBoolean("blinkOnChannelJoin");
}
public void setBlinkOnChannelJoin(boolean newValue) {
set("blinkOnChannelJoin", newValue);
}
public boolean getBuildSearchTreeOnStartup() {
return getBoolean("buildSearchTreeOnStartup");
}
public void setBuildSearchTreeOnStartup(boolean newValue) {
set("buildSearchTreeOnStartup", newValue);
}
public boolean getCaptureLauncherOutput() {
return getBoolean("captureLauncherOutput");
}
public void setCaptureLauncherOutput(boolean newValue) {
set("captureLauncherOutput", newValue);
}
public String getChatAwayMessage() {
return get("chatAwayMessage");
}
public void setChatAwayMessage(String newValue) {
set("chatAwayMessage", newValue);
}
public String getChatIgnoreMessage() {
return get("chatIgnoreMessage");
}
public void setChatIgnoreMessage(String newValue) {
set("chatIgnoreMessage", newValue);
}
public int getChatGlobalVerticalDividerLocation() {
return getInt("chatGlobalVerticalDividerLocation");
}
public void setChatGlobalVerticalDividerLocation(int newValue) {
set("chatGlobalVerticalDividerLocation", newValue);
}
public int getChatVerticalDividerLocation() {
return getInt("chatVerticalDividerLocation");
}
public void setChatVerticalDividerLocation(int newValue) {
set("chatVerticalDividerLocation", newValue);
}
public int getCorrectivePixels() {
return getInt("correctivePixels");
}
public void setCorrectivePixels(int newValue) {
set("correctivePixels", newValue);
}
public String getDebugLogFile() {
return get("debugLogFile");
}
public void setDebugLogFile(String newValue) {
set("debugLogFile", newValue);
}
public String getDefaultCompletionMode() {
return get("defaultCompletionMode");
}
public void setDefaultCompletionMode(String newValue) {
set("defaultCompletionMode", newValue);
}
/**
* Returns the default look and feel.
*/
public String getDefaultLookAndFeel() {
String systemLAF = UIManager.getSystemLookAndFeelClassName();
String crossLAF = UIManager.getCrossPlatformLookAndFeelClassName();
boolean fallback = SystemHelper.hasMacOSXToolTipsBug();
// true on System without a native LAF, i.e. Linux
boolean hasNoSystemLAF
= (crossLAF != null && crossLAF.equals(systemLAF));
return (fallback)
? crossLAF
: (hasNoSystemLAF)
? "com.incors.plaf.kunststoff.KunststoffLookAndFeel"
: systemLAF;
}
public String getDefaultViewer(String extension) {
return get("defaultViewer." + extension);
}
public void setDefaultViewer(String extension, String viewerName) {
set("defaultViewer." + extension, viewerName);
}
public boolean getDelIncompleteFiles() {
return getBoolean("delIncompleteFiles");
}
public void setDelIncompleteFiles(boolean newValue) {
set("delIncompleteFiles", newValue);
}
public String getDownloadDir() {
return FileHelper.directory(get("downloadDir"));
}
public void setDownloadDir(String newValue) {
set("downloadDir", FileHelper.directory(newValue));
}
public String getMediaTypeDownloadDir(String type) {
String dir = get(type + "DownloadDir");
if (dir.length() > 0) {
return FileHelper.directory(dir);
}
else {
return dir;
}
}
public void setMediaTypeDownloadDir(String type, String newValue) {
set(type + "DownloadDir", newValue);
}
public int getDownloadMaxTries() {
return getInt("downloadMaxTries");
}
public int getDownloadRetryInterval() {
return getInt("downloadRetryInterval");
}
public void setDownloadRetryInterval(int newValue) {
set("downloadRetryInterval", newValue);
}
public int getDownloadThrottle() {
return getInt("downloadThrottle");
}
public void setDownloadThrottle(int newValue) {
set("downloadThrottle", newValue);
}
public String getEmail() {
return get("email");
}
public void setEmail(String newValue) {
set("email", newValue);
}
public String[] getEnabledPlugins() {
return getArray("enabledPlugins");
}
public void setEnabledPlugins(String[] newValue) {
set("enabledPlugins", newValue);
}
public String getFaqURL() {
return get("faqURL");
}
public String getFeedbackEmail() {
return get("feedbackEmail");
}
public void setFeedbackEmail(String newValue) {
set("feedbackEmail", newValue);
}
public String getFeedbackName() {
return get("feedbackName");
}
public void setFeedbackName(String newValue) {
set("feedbackName", newValue);
}
public String getFeeedbackURL() {
return get("feedbackURL");
}
public String getFileLauncherCmd() {
return get("fileLauncherCmd");
}
public void setFileLauncherCmd(String newValue) {
set("fileLauncherCmd", newValue);
}
public String getFileLauncherType() {
return get("fileLauncherType");
}
public void setFileLauncherType(String newValue) {
set("fileLauncherType", newValue);
}
public boolean getFilterResults() {
return getBoolean("filterResults");
}
public void setFilterResults(boolean newValue) {
set("filterResults", newValue);
}
public boolean getFocusOnAllEvents() {
return getBoolean("focusOnAllEvents");
}
public void setFocusOnAllEvents(boolean newValue) {
set("focusOnAllEvents", newValue);
}
public int getHelpDialogHeight() {
return getInt("helpDialogHeight");
}
public void setHelpDialogHeight(int newValue) {
set("helpDialogHeight", newValue);
}
public int getHelpDialogWidth() {
return getInt("helpDialogWidth");
}
public void setHelpDialogWidth(int newValue) {
set("helpDialogWidth", newValue);
}
public int getHotlistDividerLocation() {
return getInt("hotlistDividerLocation");
}
public void setHotlistDividerLocation(int newValue) {
set("hotlistDividerLocation", newValue);
}
public String getHttpProxyHost() {
return get("httpProxyHost");
}
public void setHttpProxyHost(String newValue) {
set("httpProxyHost", newValue);
}
public int getHttpProxyPort() {
return getInt("httpProxyPort");
}
public void setHttpProxyPort(int newValue) {
set("httpProxyPort", newValue);
}
public String getIconTheme() {
return get("iconTheme");
}
public void setIconTheme(String newValue) {
set("iconTheme", newValue);
}
public String getIncompleteDir() {
return FileHelper.directory(get("incompleteDir"));
}
public void setIncompleteDir(String newValue) {
set("incompleteDir", newValue);
}
public String[] getJarIncludePath()
{
return getArray("jarIncludePath");
}
public void setJarIncludePath(String[] newValue)
{
set("jarIncludePath", newValue);
}
public String getLanguage() {
return get("language");
}
public void setLanguage(String newValue) {
set("language", newValue);
}
public boolean getLimitDownloads() {
return getBoolean("limitDownloads");
}
public void setLimitDownloads(boolean newValue) {
set("limitDownloads", newValue);
}
public boolean getLimitUploads() {
return getBoolean("limitUploads");
}
public void setLimitUploads(boolean newValue) {
set("limitUploads", newValue);
}
public boolean getLimitDownloadsPerUser() {
return getBoolean("limitDownloadsPerUser");
}
public void setLimitDownloadsPerUser(boolean newValue) {
set("limitDownloadsPerUser", newValue);
}
public boolean getLimitUploadsPerUser() {
return getBoolean("limitUploadsPerUser");
}
public void setLimitUploadsPerUser(boolean newValue) {
set("limitUploadsPerUser", newValue);
}
public int getLinkSpeed() {
return getInt("linkSpeed");
}
public void setLinkSpeed(int newValue) {
set("linkSpeed", newValue);
}
public boolean getLogTransfersToFile() {
return getBoolean("logTransfersToFile");
}
public void setLogTransfersToFile(boolean newValue) {
set("logTransfersToFile", newValue);
}
public String getPassword() {
return get("password");
}
public void setPassword(String newValue) {
set("password", newValue);
}
public String getPlayerCommand() {
return get("playerCommand");
}
public void setPlayerCommand(String newValue) {
set("playerCommand", newValue);
}
public String getPlayerType() {
return get("playerType");
}
public void setPlayerType(String newValue) {
set("playerType", newValue);
}
public String getLastLaunchVersion() {
return get("lastLaunchVersion");
}
public void setLastLaunchVersion(String newValue) {
set("lastLaunchVersion", newValue);
}
public long getLastUpdateCheck() {
return getLong("lastUpdateCheck");
}
public void setLastUpdateCheck(long newValue) {
set("lastUpdateCheck", newValue);
}
public String[] getLibraryDirs() {
return getArray("libraryDirs");
}
public void setLibraryDirs(String[] newValue) {
set("libraryDirs", newValue);
}
public int getLibraryHorizontalDividerLocation() {
return getInt("libraryHorizontalDividerLocation");
}
public void setLibraryHorizontalDividerLocation(int newValue) {
set("libraryHorizontalDividerLocation", newValue);
}
public String getLibraryTreeNodes() {
return get("libraryTreeNodes");
}
public String[] getLibraryTreeNodesArray() {
return StringHelper.toArray(getLibraryTreeNodes(), ARRAY_SEPARATOR);
}
public void setLibraryTreeNodes(String newValue) {
set("libraryTreeNodes", newValue);
}
public int getLibraryVerticalDividerLocation() {
return getInt("libraryVerticalDividerLocation");
}
public void setLibraryVerticalDividerLocation(int newValue) {
set("libraryVerticalDividerLocation", newValue);
}
public String getLookAndFeel() {
return get("lookAndFeel");
}
public void setLookAndFeel(String newValue) {
set("lookAndFeel", newValue);
}
public boolean getSeenStartupWizard() {
return getBoolean("seenStartupWizard");
}
public void setSeenStartupWizard(boolean newValue) {
set("seenStartupWizard", newValue);
}
public boolean getSendChatAwayMessage() {
return getBoolean("sendChatAwayMessage");
}
public void setSendChatAwayMessage(boolean newValue) {
set("sendChatAwayMessage", newValue);
}
public boolean getSendChatIgnoreMessage() {
return getBoolean("sendChatIgnoreMessage");
}
public void setSendChatIgnoreMessage(boolean newValue) {
set("sendChatIgnoreMessage", newValue);
}
public boolean getPrintServerNotificationsInChatWindow() {
return getBoolean("PrintServerNotificationsInChatWindow");
}
public void setPrintServerNotificationsInChatWindow(boolean newValue) {
set("PrintServerNotificationsInChatWindow", newValue);
}
public boolean getShareFullPath() {
return getBoolean("shareFullPath");
}
public void setShareFullPath(boolean newValue) {
set("shareFullPath", newValue);
}
public KeyStroke getShortcut(String key) {
return getKeyStroke(key + "Shortcut");
}
public void setShortcut(String key, KeyStroke newValue) {
set(key + "Shortcut", newValue);
}
public boolean shouldCheckForUpdate(int days) {
return (System.currentTimeMillis()
- getLastUpdateCheck() > days * 24 * 60 * 60 * 1000);
}
public boolean getShowSearchOptions() {
return getBoolean("showSearchOptions");
}
public void setShowSearchOptions(boolean newValue) {
set("showSearchOptions", newValue);
}
public boolean getShowChatMsgTime() {
return getBoolean("showChatMsgTime");
}
public void setShowChatMsgTime(boolean newValue) {
set("showChatMsgTime", newValue);
}
/**
* @deprecated
*/
public boolean getShowDialog(String dialogName) {
return getBoolean("show" + dialogName + "Dialog");
}
/**
* @deprecated
*/
public void setShowDialog(String dialogName, boolean newValue) {
set("show" + dialogName + "Dialog", newValue);
}
public boolean getShowIcons() {
return getBoolean("showIcons");
}
public void setShowIcons(boolean newValue) {
set("showIcons", newValue);
}
public boolean getShowSplash() {
return getBoolean("showSplash");
}
public void setShowSplash(boolean newValue) {
set("showSplash", newValue);
}
public boolean getShowToolTips() {
return getBoolean("showToolTips");
}
public void setShowToolTips(boolean newValue) {
set("showToolTips", newValue);
}
public int getMaxDownloads() {
return getInt("maxDownloads");
}
public void setMaxDownloads(int newValue) {
set("maxDownloads", newValue);
}
public int getMaxDownloadsPerUser() {
return getInt("maxDownloadsPerUser");
}
public void setMaxDownloadsPerUser(int newValue) {
set("maxDownloadsPerUser", newValue);
}
public int getMaxConsoleLines() {
return getInt("maxConsoleLines");
}
public void setMaxConsoleLines(int newValue) {
set("maxConsoleLines", newValue);
}
public int getMaxOpenWithCommands() {
return getInt("maxOpenWithCommands");
}
public void setMaxOpenWithCommands(int newValue) {
set("maxOpenWithCommands", newValue);
}
public int getMaxUploads() {
return getInt("maxUploads");
}
public void setMaxUploads(int newValue) {
set("maxUploads", newValue);
}
public int getMaxUploadsPerUser() {
return getInt("maxUploadsPerUser");
}
public void setMaxUploadsPerUser(int newValue) {
set("maxUploadsPerUser", newValue);
}
public int getMaxSwarmedConnects() {
return getInt("maxSwarmedConnects");
}
public int getMinimumShares() {
return getInt("minimumShares");
}
public void setMinimumShares(int newValue) {
set("minimumShares", newValue);
}
public String getMinimumSharesMessage() {
return get("minimumSharesMessage");
}
public void setMinimumSharesMessage(String newValue) {
set("minimumSharesMessage", newValue);
}
public void setLimitDownloadAttempts(boolean newValue) {
set("limitDownloadAttempts", newValue);
}
public boolean getLimitDownloadAttempts() {
return getBoolean("limitDownloadAttempts");
}
public String[] getOpenWithCommands() {
return getArray("openWithCommands");
}
public void setOpenWithCommands(String[] newValue) {
set("openWithCommands", newValue);
}
public int getPrefsWindowHeight() {
return getInt("prefsWindowHeight");
}
public void setPrefsWindowHeight(int newValue) {
set("prefsWindowHeight", newValue);
}
public int getPrefsWindowWidth() {
return getInt("prefsWindowWidth");
}
public void setPrefsWindowWidth(int newValue) {
set("prefsWindowWidth", newValue);
}
public String getProblemReportURL() {
return get("problemReportURL");
}
public boolean getRememberFeedback() {
return getBoolean("rememberFeedback");
}
public boolean getRemoveDuplicateResults() {
return getBoolean("removeDuplicateResults");
}
public void setRemoveDuplicateResults(boolean newValue) {
set("removeDuplicateResults", newValue);
}
public int getSearchBitrate() {
return getInt("searchBitrate");
}
public void setSearchBitrate(int newValue) {
set("searchBitrate", newValue);
}
public int getSearchCompare() {
return getInt("searchCompare");
}
public void setSearchCompare(int newValue) {
set("searchCompare", newValue);
}
public int getSearchDividerLocation() {
return getInt("searchDividerLocation");
}
public void setSearchDividerLocation(int newValue) {
set("searchDividerLocation", newValue);
}
public int getSearchHistorySize() {
return getInt("searchHistorySize");
}
public void setSearchHistorySize(int newValue) {
set("searchHistorySize", newValue);
}
public int getSearchMediaType() {
return getInt("searchMediaType");
}
public void setSearchMediaType(int newValue) {
set("searchMediaType", newValue);
}
public String getSearchResultOpenAction() {
return get("searchResultOpenAction");
}
public boolean getSendMinimumSharesMessage() {
return getBoolean("sendMinimumSharesMessage");
}
public void setSendMinimumSharesMessage(boolean newValue) {
set("sendMinimumSharesMessage", newValue);
}
public String getSocksProxyHost() {
return get("socksProxyHost");
}
public void setSocksProxyHost(String newValue) {
set("socksProxyHost", newValue);
}
public int getSocksProxyPort() {
return getInt("socksProxyPort");
}
public void setSocksProxyPort(int newValue) {
set("socksProxyPort", newValue);
}
public String getTheme() {
return get("theme");
}
public void setTheme(String newValue) {
set("theme", newValue);
}
public int getTransferDividerLocation() {
return getInt("transferDividerLocation");
}
public void setTransferDividerLocation(int newValue) {
set("transferDividerLocation", newValue);
}
public String getTransferLogFile() {
return get("transferLogFile");
}
public void setTransferLogFile(String newValue) {
set("transferLogFile", newValue);
}
public boolean getUpdatePluginsOnStartup() {
return getBoolean("updatePluginsOnStartup");
}
public void setUpdatePluginsOnStartup(boolean newValue) {
set("updatePluginsOnStartup", newValue);
}
public int getUpdaterInterval()
{
return getInt("updaterInterval");
}
public String getUpdateURL() {
return get("updateURL");
}
public String[] getUploadDirs()
{
return getArray("uploadDirs");
}
public void setUploadDirs(String[] newValue)
{
set("uploadDirs", newValue);
}
public int getUploadThrottle() {
return getInt("uploadThrottle");
}
public void setUploadThrottle(int newValue) {
set("uploadThrottle", newValue);
}
public boolean getUseEmacsKeyBindings() {
return getBoolean("useEmacsKeyBindings");
}
public void setUseEmacsKeyBindings(boolean newValue) {
set("useEmacsKeyBindings", newValue);
}
public String getUsername() {
return get("username");
}
public void setUsername(String newValue) {
set("username", newValue);
}
public boolean getUseHttpProxy() {
return getBoolean("useHttpProxy");
}
public void setUseHttpProxy(boolean newValue) {
set("useHttpProxy", newValue);
}
public boolean getUseMinimumShares() {
return getBoolean("useMinimumShares");
}
public void setUseMinimumShares(boolean newValue) {
set("useMinimumShares", newValue);
}
public boolean getUseSmallTransferIcons() {
return getBoolean("useSmallTransferIcons");
}
public boolean getUseSocksProxy() {
return getBoolean("useSocksProxy");
}
public void setUseSocksProxy(boolean newValue) {
set("useSocksProxy", newValue);
}
public boolean getUseSubMenuForPluginMenus() {
return getBoolean("useSubMenuForPluginMenus");
}
public void setUseSubMenuForPluginMenus(boolean newValue) {
set("useSubMenuForPluginMenus", newValue);
}
public boolean getUseTabbedPane() {
return getBoolean("useTabbedPane");
}
public void setUseTabbedPane(boolean newValue) {
set("useTabbedPane", newValue);
}
public boolean getUseTabbedTransferPane() {
return getBoolean("useTabbedTransferPane");
}
public void setUseTabbedTransferPane(boolean newValue) {
set("useTabbedTransferPane", newValue);
}
public String[] getTableColumns(String table) {
return getArray(table + "TableColumns");
}
public void setTableColumns(String table, String[] newValue) {
set(table + "TableColumns", newValue);
}
public int[] getTableColumnWidths(String table) {
return getIntArray(table + "TableColumnWidths");
}
public void setTableColumnWidths(String table, int[] widths) {
set(table + "TableColumnWidths", widths);
}
public boolean getTableMaintainSortOrder(String table) {
return getBoolean(table + "TableMaintainSortOrder");
}
public void setTableMaintainSortOrder(String table, boolean newValue) {
set(table + "TableMaintainSortOrder", newValue);
}
public int getTableSortedColumn(String table) {
return getInt(table + "TableSortedColumn");
}
public void setTableSortedColumn(String table, int newValue) {
set(table + "TableSortedColumn", newValue);
}
public boolean getThrottleDownloads() {
return getBoolean("throttleDownloads");
}
public void setThrottleDownloads(boolean newValue) {
set("throttleDownloads", newValue);
}
public boolean getThrottleUploads() {
return getBoolean("throttleUploads");
}
public void setThrottleUploads(boolean newValue) {
set("throttleUploads", newValue);
}
public int getWindowHeight() {
return getInt("windowHeight");
}
public void setWindowHeight(int newValue) {
set("windowHeight", newValue);
}
public int getWindowWidth() {
return getInt("windowWidth");
}
public void setWindowWidth(int newValue) {
set("windowWidth", newValue);
}
public int getWindowX() {
return getInt("windowX");
}
public void setWindowX(int newValue) {
set("windowX", newValue);
}
public int getWindowY() {
return getInt("windowY");
}
public void setWindowY(int newValue) {
set("windowY", newValue);
}
public String getXNapJarURL() {
return get("xnapJarURL");
}
}
The table below shows all metrics for Preferences.java.




