Settings.java

Index Score
tvbrowser.core
TV-Browser

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.

MetricDescription
JAVA0116JAVA0116 Missing javadoc: field 'field'
SIZESize of the file in bytes
DECL_COMMENTSComments in declarations
UNIQUE_OPERANDSNumber of unique operands
OPERATORSNumber of operators
PROGRAM_LENGTHHalstead program length
PROGRAM_VOCABHalstead program vocabulary
OPERANDSNumber of operands
ELOCEffective lines of code
LOGICAL_LINESNumber of statements
LINESNumber of lines in the source file
LOCLines of code
WHITESPACENumber of whitespace lines
JAVA0049JAVA0049 Nested block at depth N (maximum: M)
EXITSProcedure exits
COMPARISONSNumber of comparison operators
JAVA0166JAVA0166 Generic exception caught
BLOCKSNumber of blocks
CYCLOMATICCyclomatic complexity
JAVA0144JAVA0144 Line exceeds maximum M characters
JAVA0008JAVA0008 Empty catch block
COMMENTSComment lines
DOC_COMMENTNumber of javadoc comment lines
JAVA0034JAVA0034 Missing braces in if statement
NEST_DEPTHMaximum nesting depth
JAVA0270JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
UNIQUE_OPERATORSNumber of unique operators
PROGRAM_VOLUMEHalstead program volume
JAVA0126JAVA0126 Method declares unchecked exception in throws
LINE_COMMENTNumber of line comments
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
BLOCK_COMMENTNumber of block comment lines
PARAMSNumber of formal parameter declarations
JAVA0145JAVA0145 Tab character used in source file
/* * TV-Browser * Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org) * * 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; either version 2 * of the License, or (at your option) any later version. * * 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. * * CVS information: * $RCSfile$ * $Source$ * $Date: 2008-07-16 04:12:18 -0400 (Wed, 16 Jul 2008) $ * $Author: Bananeweizen $ * $Revision: 4866 $ */ package tvbrowser.core; import com.jgoodies.looks.plastic.PlasticLookAndFeel; import devplugin.ProgramFieldType; import tvbrowser.TVBrowser; import tvbrowser.core.plugin.DefaultSettings; import tvbrowser.core.tvdataservice.TvDataServiceProxyManager; import tvbrowser.ui.mainframe.MainFrame; import tvbrowser.ui.programtable.DefaultProgramTableModel; import tvbrowser.ui.programtable.ProgramTableScrollPane; import tvbrowser.ui.waiting.dlgs.TvDataCopyWaitingDlg; import util.exc.TvBrowserException; import util.io.IOUtilities; import util.settings.BooleanProperty; import util.settings.ByteProperty; import util.settings.ChannelArrayProperty; import util.settings.ChoiceProperty; import util.settings.ColorProperty; import util.settings.DateProperty; import util.settings.EncodedStringProperty; import util.settings.FontProperty; import util.settings.IntArrayProperty; import util.settings.IntProperty; import util.settings.PluginPictureSettings; import util.settings.ProgramFieldTypeArrayProperty; import util.settings.ProgramPanelSettings; import util.settings.Property; import util.settings.PropertyManager; import util.settings.ShortProperty; import util.settings.StringArrayProperty; import util.settings.StringProperty; import util.settings.VersionProperty; import util.settings.WindowSetting; import util.ui.Localizer; import util.ui.view.SplitViewProperty; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.UIManager; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GraphicsEnvironment; import java.awt.Window; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FilenameFilter; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.HashMap; import java.util.Properties; import java.util.Set; import java.util.logging.Level; /** * The Settings class provides access to the settings of the whole application * (except the plugins). * * @author Martin Oberhauser */ public class Settings { public static final String INFO_ID = "info.id"; public static final String PICTURE_ID = "picture.id"; private static java.util.logging.Logger mLog = java.util.logging.Logger .getLogger(Settings.class.getName()); private static DefaultSettings mDefaultSettings = new DefaultSettings(); private static final long PROXY_PASSWORD_SEED = 6528587292713416704L; public static final int GET_DATA_FROM_SERVER = 0, GET_DATA_FROM_LOCAL_DISK = 1; public static final int NEVER = 0, DAILY = 1, ONSTARTUP = DAILY, EVERY3DAYS = 2, WEEKLY = 3; private static final String SETTINGS_FILE = "settings.prop"; private static final String DEFAULT_USER_DIR = ".tvbrowser"; private static final String WINDOW_SETTINGS_FILE = "window.settings.dat"; private static final Font PROGRAMTITLEFONT = new Font("Dialog", Font.BOLD, 12); private static final Font PROGRAMINFOFONT = new Font("Dialog", Font.PLAIN, 10); private static final Font CHANNELNAMEFONT = new Font("Dialog", Font.BOLD, 12); private static final Font PROGRAMTIMEFONT = new Font("Dialog", Font.BOLD, 12); private static PropertyManager mProp = new PropertyManager(); private static boolean mShowWaiting; private static HashMap<String,WindowSetting> mWindowSettings; /** * Returns the Default-Settings. These Settings are stored in the mac, windows * and linux.properties-Files * * @return Default-Settings */ public static DefaultSettings getDefaultSettings() { return mDefaultSettings; } /** * Returns the user directory. (e.g.: ~/.tvbrowser/) */ public static String getUserDirectoryName() { String dir = new StringBuffer(System.getProperty("user.home")).append( File.separator).append(DEFAULT_USER_DIR).toString(); return TVBrowser.isTransportable() ? new File("settings").getAbsolutePath() : mDefaultSettings.getProperty("userdir", dir); } public static String getUserSettingsDirName() { String version = TVBrowser.ALL_VERSIONS[0]; if(version.toLowerCase().indexOf("nightly") != -1) { version = version.substring(0,version.indexOf("-")); } return new StringBuffer(getUserDirectoryName()) .append(File.separator).append(version).toString(); } /** * Store all settings. This method is called on quitting the application. * @throws util.exc.TvBrowserException Exception while saving the settings */ public static void storeSettings() throws TvBrowserException { File f = new File(getUserSettingsDirName()); if (!f.exists()) { f.mkdirs(); } File settingsFile = new File(getUserSettingsDirName(), SETTINGS_FILE); File firstSettingsBackupFile = new File(getUserSettingsDirName(), SETTINGS_FILE+ "_backup1"); File secondSettingsBackupFile = new File(getUserSettingsDirName(), SETTINGS_FILE+ "_backup2"); // Create backup of settings file backup try { if(firstSettingsBackupFile.isFile()) { secondSettingsBackupFile.delete(); firstSettingsBackupFile.renameTo(secondSettingsBackupFile); } }catch(Exception e) {} try { mProp.writeToFile(settingsFile); try { if(settingsFile.isFile()) { IOUtilities.copy(settingsFile,firstSettingsBackupFile); } }catch (Exception e) {} } catch (IOException exc) { throw new TvBrowserException(Settings.class, "error.1", "Error when saving settings!\n({0})", settingsFile.getAbsolutePath(), exc); } storeWindowSettings(); } /** * Stores the window settings for this plugin */ private static void storeWindowSettings() { try { File windowSettingsFile = new File(Settings.getUserSettingsDirName(),WINDOW_SETTINGS_FILE); ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(windowSettingsFile)); out.writeInt(1); // write version out.writeInt(mWindowSettings.size()); Set<String> keys = mWindowSettings.keySet(); for(String key : keys) { out.writeUTF(key); mWindowSettings.get(key).saveSettings(out); } out.close(); } catch (FileNotFoundException e) { // Ignore } catch (IOException e) { // Ignore } } /** * Reads the settings from settings file. If there is no settings file, * default settings are used. */ public static void loadSettings() { String oldDirectoryName = System.getProperty("user.home", "") + File.separator + ".tvbrowser"; String newDirectoryName = getUserSettingsDirName(); File settingsFile = new File(newDirectoryName, SETTINGS_FILE); File firstSettingsBackupFile = new File(getUserSettingsDirName(), SETTINGS_FILE+ "_backup1"); File secondSettingsBackupFile = new File(getUserSettingsDirName(), SETTINGS_FILE+ "_backup2"); if (settingsFile.exists() || firstSettingsBackupFile.exists() || secondSettingsBackupFile.exists()) { try { mProp.readFromFile(settingsFile); if((mProp.getProperty("subscribedchannels") == null || mProp.getProperty("subscribedchannels").trim().length() < 1) && (firstSettingsBackupFile.isFile() || secondSettingsBackupFile.isFile())) { throw new IOException(); } else { mLog.info("Using settings from file " + settingsFile.getAbsolutePath()); } } catch (IOException evt) { if(firstSettingsBackupFile.isFile() || secondSettingsBackupFile.isFile()) { Localizer localizer = Localizer.getLocalizerFor(Settings.class); if(JOptionPane.showConfirmDialog(null,localizer.msg("settingBroken","Settings file broken.\nWould you like to load the backup file?\n\n(If you select No, the\ndefault settings are used)"),Localizer.getLocalization(Localizer.I18N_ERROR),JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION) { boolean loadSecondBackup = !firstSettingsBackupFile.isFile(); if(firstSettingsBackupFile.isFile()) { try { mProp.readFromFile(firstSettingsBackupFile); if((mProp.getProperty("subscribedchannels") == null || mProp.getProperty("subscribedchannels").trim().length() < 1) && secondSettingsBackupFile.isFile()) { loadSecondBackup = true; } else { mLog.info("Using settings from file " + firstSettingsBackupFile.getAbsolutePath()); loadSecondBackup = false; } }catch(Exception e) { loadSecondBackup = true; } } if(loadSecondBackup && secondSettingsBackupFile.isFile()) { try { mProp.readFromFile(secondSettingsBackupFile); mLog.info("Using settings from file " + secondSettingsBackupFile.getAbsolutePath()); loadSecondBackup = false; }catch(Exception e) { loadSecondBackup = true; } } if(loadSecondBackup) { mLog.info("Could not read settings - using default user settings"); } else { try { storeSettings(); }catch(Exception e) {} } } } else { mLog.info("Could not read settings - using default user settings"); } } } /* * If the settings file doesn't exist, we try to import the settings created * by a previous version of TV-Browser */ else if (!oldDirectoryName.equals(newDirectoryName)) { mLog.info("Try to load settings from a previous version of TV-Browser"); File oldDir = null; File testFile = null; String[] directories = {getUserDirectoryName() ,System.getProperty("user.home") + "/TV-Browser",System.getProperty("user.home") + "/Library/Preferences/TV-Browser", System.getProperty("user.home") + "/.tvbrowser"}; for(int j = 0; j < (TVBrowser.isTransportable() ? directories.length : 1); j++) { for (int i = (j == 0 ? 1 : 0); i < TVBrowser.ALL_VERSIONS.length; i++) { testFile = new File(directories[j] + File.separator + TVBrowser.ALL_VERSIONS[i], SETTINGS_FILE); if(testFile.isFile()) { oldDir = new File(directories[j],TVBrowser.ALL_VERSIONS[i]); break; } } if(oldDir == null) { testFile = new File(directories[j], SETTINGS_FILE); if(testFile.isFile()) { oldDir = new File(directories[j]); } else { testFile = new File(oldDirectoryName, SETTINGS_FILE); if(testFile.isFile()) { oldDir = new File(oldDirectoryName); } } } if(oldDir != null) { break; } } if (oldDir != null && oldDir.isDirectory() && oldDir.exists()) { final File newDir = new File(getUserSettingsDirName()); File oldTvDataDir = null; if(TVBrowser.isTransportable() && !(new File(getUserDirectoryName(),"tvdata").isDirectory())) { try { Properties p = new Properties(); FileInputStream in = new FileInputStream(testFile); p.load(in); String temp = p.getProperty("dir.tvdata",null); if(temp != null) { oldTvDataDir = new File(temp); } else if(new File(oldDir, "tvdata").isDirectory()) { oldTvDataDir = new File(oldDir, "tvdata"); } else if(new File(oldDir.getParent(), "tvdata").isDirectory()) { oldTvDataDir = new File(oldDir.getParent(), "tvdata"); } in.close(); }catch(Exception e) {} } if (newDir.mkdirs()) { try { IOUtilities.copy(oldDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return !name.equalsIgnoreCase("tvdata") && !name.equals(newDir.getName()) && !name.equalsIgnoreCase("backup") && !name.equalsIgnoreCase("lang"); } }), newDir); mLog.info("settings from previous version copied successfully"); File newSettingsFile = new File(newDir, SETTINGS_FILE); mProp.readFromFile(newSettingsFile); mLog.info("settings from previous version read succesfully"); /* * This is the .tvbrowser dir, if there are settings form version * 1.0 change the name to start with java. */ if (oldDirectoryName.equals(oldDir.getAbsolutePath())) { File[] settings = newDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return (name.toLowerCase().endsWith(".prop") && name .toLowerCase().indexOf("settings") == -1) || (name.toLowerCase().endsWith(".dat") && name .toLowerCase().indexOf("tv-data-inventory") == -1); } }); boolean version1 = false; if (settings != null) { for (int i = 0; i < settings.length; i++) { String name = "java." + settings[i].getName(); if (!settings[i].getName().toLowerCase().startsWith("java.")) { version1 = true; settings[i].renameTo(new File(settings[i].getParent(), name)); } } } if (version1 && !(new File(oldDirectoryName, newDir.getName())) .isDirectory()) { oldDir.renameTo(new File(System.getProperty("user.home", "") + File.separator + "tvbrowser_BACKUP")); } } /* * Test if and copy TV data for the portable version. */ if(oldTvDataDir != null && oldTvDataDir.isDirectory()) { final File targetDir = new File(getUserDirectoryName(),"tvdata"); if(!oldTvDataDir.equals(targetDir)) { targetDir.mkdirs(); final TvDataCopyWaitingDlg waiting = new TvDataCopyWaitingDlg(new JFrame(), false); mShowWaiting = true; final File srcDir = oldTvDataDir; Thread copyDataThread = new Thread("Copy TV data directory") { public void run() { try { IOUtilities.copy(srcDir.listFiles(), targetDir, true); }catch(Exception e) {} mShowWaiting = false; waiting.setVisible(false); } }; copyDataThread.start(); waiting.setVisible(mShowWaiting); } } /* * Test if a settings file exist in the user directory, move the * settings to backup. */ if ((new File(getUserDirectoryName(), SETTINGS_FILE)).isFile()) { final File backupDir = new File(getUserDirectoryName(), "BACKUP"); if (backupDir.mkdirs()) { mLog.info("moving the settings of old settings dir to backup"); File[] files = oldDir.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.compareTo(newDir) != 0 && pathname.getName().compareToIgnoreCase("tvdata") != 0 && pathname.compareTo(backupDir) != 0; } }); if (files != null) { for (int i = 0; i < files.length; i++) { files[i].renameTo(new File(backupDir,files[i].getName())); } } } } } catch (IOException e) { mLog.log(Level.WARNING, "Could not import user settings from '" + oldDir.getAbsolutePath() + "' to '" + newDir.getAbsolutePath() + "'", e); } } else { mLog.info("Could not create directory '" + newDir.getAbsolutePath() + "' - using default user settings"); } } else { mLog .info("No previous version of TV-Browser found - using default user settings"); } } File settingsDir = new File(newDirectoryName); if (!settingsDir.exists()) { mLog.info("Creating " + newDirectoryName); settingsDir.mkdir(); } loadWindowSettings(); } private static void loadWindowSettings() { try { try { File windowSettingsFile = new File(Settings.getUserSettingsDirName(),WINDOW_SETTINGS_FILE); if(windowSettingsFile.isFile()) { ObjectInputStream in = new ObjectInputStream(new FileInputStream(windowSettingsFile)); if(in.available() > 0) { in.readInt(); // read version int n = in.readInt(); // read number of window settings mWindowSettings = new HashMap<String,WindowSetting>(n); for(int i = 0; i < n; i++) { mWindowSettings.put(in.readUTF(), new WindowSetting(in)); } } in.close(); } }catch(Exception e) {// Ignore } if(mWindowSettings == null) { mWindowSettings = new HashMap<String,WindowSetting>(1); } }catch(Exception e) {} } public static void handleChangedSettings() { Property[] propArr; MainFrame mainFrame = MainFrame.getInstance(); propArr = new Property[] { propProgramTitleFont, propProgramInfoFont, propProgramTimeFont, propChannelNameFont, propUseDefaultFonts, propEnableAntialiasing, propProgramTableOnAirProgramsShowingBorder, propProgramPanelUsesExtraSpaceForMarkIcons, propProgramPanelWithMarkingsShowingBoder, propProgramPanelUsedDefaultMarkPriority, propProgramPanelMarkedLowerMediumPriorityColor, propProgramPanelMarkedMinPriorityColor, propProgramPanelMarkedMediumPriorityColor, propProgramPanelMarkedMaxPriorityColor, propProgramTableColorOnAirLight, propProgramTableColorOnAirDark, propProgramPanelForegroundColor, propProgramTableBackgroundSingleColor}; if (mProp.hasChanged(propArr)) { util.ui.ProgramPanel.updateFonts(); tvbrowser.ui.programtable.ChannelPanel.fontChanged(); ProgramTableScrollPane scrollPane = mainFrame.getProgramTableScrollPane(); scrollPane.forceRepaintAll(); } propArr = new Property[] {propPictureType, propPictureStartTime, propPictureEndTime, propIsPictureShowingDescription, propPicturePluginIds, propPictureDuration}; if(mProp.hasChanged(propArr)) { mainFrame.getProgramTableScrollPane().forceRepaintAll(); } if (mProp.hasChanged(propColumnWidth)) { util.ui.ProgramPanel.updateColumnWidth(); ProgramTableScrollPane scrollPane = mainFrame.getProgramTableScrollPane(); scrollPane.setColumnWidth(propColumnWidth.getInt()); scrollPane.forceRepaintAll(); } if (mProp.hasChanged(propTableLayout)) { ProgramTableScrollPane scrollPane = mainFrame.getProgramTableScrollPane(); scrollPane.getProgramTable().setProgramTableLayout(null); scrollPane.forceRepaintAll(); } if (mProp.hasChanged(propDeactivatedPlugins)) { mainFrame.updatePluginsMenu(); mainFrame.updateToolbar(); } propArr = new Property[] { propTableBackgroundStyle, propOneImageBackground, propTimeBlockSize, propTimeBlockBackground1, propTimeBlockBackground2, propTimeBlockShowWest, propTimeBlockWestImage1, propTimeBlockWestImage2, propTimeOfDayBackgroundEdge, propTimeOfDayBackgroundEarly, propTimeOfDayBackgroundMidday, propTimeOfDayBackgroundAfternoon, propTimeOfDayBackgroundEvening }; if (mProp.hasChanged(propArr)) { ProgramTableScrollPane scrollPane = mainFrame.getProgramTableScrollPane(); scrollPane.getProgramTable().updateBackground(); } if(mProp.hasChanged(propTimeBlockSize)) { mainFrame.getProgramTableScrollPane().forceRepaintAll(); } propArr = new Property[] { propToolbarButtonStyle, propToolbarButtons, propToolbarLocation, propIsTooolbarVisible, propToolbarUseBigIcons }; if (mProp.hasChanged(propArr)) { mainFrame.updateToolbar(); } if (mProp.hasChanged(propTimeButtons)) { mainFrame.updateTimeButtons(); } if (mProp.hasChanged(propSubscribedChannels)) { ChannelList.reload(); DefaultProgramTableModel model = mainFrame.getProgramTableModel(); model.setChannels(ChannelList.getSubscribedChannels()); mainFrame.updateChannellist(); } propArr = new Property[] { propProgramTableStartOfDay, propProgramTableEndOfDay }; if (mProp.hasChanged(propArr)) { DefaultProgramTableModel model = mainFrame.getProgramTableModel(); int startOfDay = propProgramTableStartOfDay.getInt(); int endOfDay = propProgramTableEndOfDay.getInt(); model.setTimeRange(startOfDay, endOfDay); model.setDate(mainFrame.getCurrentSelectedDate(), null, null); } propArr = new Property[] { propProgramTableIconPlugins, propProgramInfoFields }; if (mProp.hasChanged(propArr)) { // Force a recreation of the table content DefaultProgramTableModel model = mainFrame.getProgramTableModel(); model.setDate(mainFrame.getCurrentSelectedDate(), null, null); } propArr = new Property[] { propShowChannelIconsInProgramTable, propShowChannelIconsInChannellist, propShowChannelNamesInProgramTable, propShowChannelNamesInChannellist }; if (mProp.hasChanged(propArr)) { mainFrame.getProgramTableScrollPane().updateChannelPanel(); mainFrame.updateChannelChooser(); } if(mProp.hasChanged(propTVDataDirectory)) { TvDataServiceProxyManager.getInstance().setTvDataDir(new File(propTVDataDirectory.getString())); TvDataBase.getInstance().updateTvDataBase(); TvDataBase.getInstance().checkTvDataInventory(); MainFrame.getInstance().handleChangedTvDataDir(); } mProp.clearChanges(); try { storeSettings(); }catch(Exception e) {} } /** * @return The Time-Pattern for SimpleFormatter's */ public static String getTimePattern() { if (propTwelveHourFormat.getBoolean()) { return "hh:mm a"; } else { return "HH:mm"; } } public static final VersionProperty propTVBrowserVersion = new VersionProperty( mProp, "version", null); public static final BooleanProperty propTVBrowserVersionIsStable = new BooleanProperty( mProp, "versionIsStable", false); public static final BooleanProperty propUseDefaultFonts = new BooleanProperty( mProp, "usedefaultfonts", true); public static final BooleanProperty propEnableAntialiasing = new BooleanProperty( mProp, "enableantialiasing", false); private static String getDefaultTvDataDir() { return TVBrowser.isTransportable() ? "./settings/tvdata" : getUserDirectoryName() + File.separator + "tvdata"; } private static String getDefaultPluginsDir() { return getUserSettingsDirName() + "/plugins"; } public static final StringProperty propTVDataDirectory = new StringProperty( mProp, "dir.tvdata", mDefaultSettings.getProperty("tvdatadir", getDefaultTvDataDir())); public static final StringProperty propPluginsDirectory = new StringProperty( mProp, "dir.plugins", mDefaultSettings.getProperty("pluginsdir", getDefaultPluginsDir())); public static final StringProperty propFilterDirectory = new StringProperty( mProp, "directory.filters", getUserSettingsDirName() + File.separator + "filters"); public static final ChannelArrayProperty propSubscribedChannels = new ChannelArrayProperty( mProp, "subscribedchannels", new devplugin.Channel[] {}); /** * @deprecated */ public static final IntProperty propEarlyTime = new IntProperty(mProp, "timebutton.early", 6 * 60); /** * @deprecated */ public static final IntProperty propMiddayTime = new IntProperty(mProp, "timebutton.midday", 12 * 60); /** * @deprecated */ public static final IntProperty propAfternoonTime = new IntProperty(mProp, "timebutton.afternoon", 18 * 60); /** * @deprecated */ public static final IntProperty propEveningTime = new IntProperty(mProp, "timebutton.evening", 20 * 60); public static final ChoiceProperty propTableLayout = new ChoiceProperty( mProp, "table.layout", "compactTimeBlock", new String[] { "timeSynchronous", "compact", "realSynchronous" , "realCompact", "timeBlock", "compactTimeBlock"}); public static final ChoiceProperty propTableBackgroundStyle = new ChoiceProperty( mProp, "tablebackground.style", "timeBlock", new String[] { "singleColor", "oneImage", "timeBlock", "timeOfDay" }); public static final StringProperty propOneImageBackground = new StringProperty( mProp, "tablebackground.oneImage.image", "imgs/columns_evening.jpg"); public static final IntProperty propTimeBlockSize = new IntProperty(mProp, "tablebackground.timeBlock.size", 2); public static final StringProperty propTimeBlockBackground1 = new StringProperty( mProp, "tablebackground.timeBlock.image1", "imgs/time_block_white.jpg");//imgs/columns_evening.jpg public static final StringProperty propTimeBlockBackground2 = new StringProperty( mProp, "tablebackground.timeBlock.image2", "imgs/time_block_gray.jpg");//imgs/columns_afternoon.jpg public static final StringProperty propTimeBlockWestImage1 = new StringProperty( mProp, "tablebackground.timeBlock.west1", "imgs/time_block_white.jpg");//imgs/columns_evening.jpg public static final StringProperty propTimeBlockWestImage2 = new StringProperty( mProp, "tablebackground.timeBlock.west2", "imgs/time_block_gray.jpg");//imgs/columns_afternoon.jpg public static final BooleanProperty propTimeBlockShowWest = new BooleanProperty( mProp, "tablebackground.timeBlock.showWest", true); public static final StringProperty propTimeOfDayBackgroundEdge = new StringProperty( mProp, "tablebackground.timeofday.edge", "imgs/columns_edge.jpg"); public static final StringProperty propTimeOfDayBackgroundEarly = new StringProperty( mProp, "tablebackground.timeofday.early", "imgs/columns_early.jpg"); public static final StringProperty propTimeOfDayBackgroundMidday = new StringProperty( mProp, "tablebackground.timeofday.midday", "imgs/columns_midday.jpg"); public static final StringProperty propTimeOfDayBackgroundAfternoon = new StringProperty( mProp, "tablebackground.timeofday.afternoon", "imgs/columns_afternoon.jpg"); public static final StringProperty propTimeOfDayBackgroundEvening = new StringProperty( mProp, "tablebackground.timeofday.evening", "imgs/columns_evening.jpg"); public static final BooleanProperty propShowAssistant = new BooleanProperty( mProp, "showassistant", true); public static final StringProperty propUserDefinedWebbrowser = new StringProperty( mProp, "webbrowser", null); public static final ColorProperty propProgramTableBackgroundSingleColor = new ColorProperty( mProp, "backgroundSingleColor", Color.white); /* * Basic tray settings */ public static final BooleanProperty propTrayIsEnabled = new BooleanProperty( mProp, "trayIsEnabled", true); public static final BooleanProperty propTrayMinimizeTo = new BooleanProperty( mProp, "MinimizeToTray", false); public static final BooleanProperty propOnlyMinimizeWhenWindowClosing = new BooleanProperty( mProp, "onlyMinimizeWhenWindowClosing", false); public static final BooleanProperty propNowOnRestore = new BooleanProperty( mProp, "jumpNowOnRestore",true); /* * Channel settings for the tray. */ public static final BooleanProperty propTrayUseSpecialChannels = new BooleanProperty( mProp, "trayUseSpecialChannels", false); public static final ChannelArrayProperty propTraySpecialChannels = new ChannelArrayProperty( mProp, "traySpecialChannels", new devplugin.Channel[] {}); public static final IntProperty propTrayChannelWidth = new IntProperty( mProp, "trayChannelWidth", 72); /* * Settings for the ON_TIME_TYPE of the ProgramMenuItem. */ public static final BooleanProperty propTrayOnTimeProgramsEnabled = new BooleanProperty( mProp, "trayOnTimeProgramsEnabled", true); public static final BooleanProperty propTrayOnTimeProgramsInSubMenu = new BooleanProperty( mProp, "trayOnTimeProgramsInSubMenus", true); public static final BooleanProperty propTrayOnTimeProgramsContainsTime = new BooleanProperty( mProp, "trayOnTimeProgramsContainsTime", false); public static final BooleanProperty propTrayOnTimeProgramsContainsIcon = new BooleanProperty( mProp, "trayOnTimeProgramsContainsIcon", true); public static final BooleanProperty propTrayOnTimeProgramsContainsName = new BooleanProperty( mProp, "trayOnTimeProgramsContainsName", true); public static final BooleanProperty propTrayOnTimeProgramsContainsToolTip = new BooleanProperty( mProp, "trayOnTimeProgramsContainsToolTip", true); public static final BooleanProperty propTrayOnTimeProgramsShowProgress = new BooleanProperty( mProp, "trayOnTimeProgramsShowProgress", true); public static final ColorProperty propTrayOnTimeProgramsDarkBackground = new ColorProperty( mProp, "trayOnTimeProgramsDarkBackground", new Color(255, 150, 0, 80)); public static final ColorProperty propTrayOnTimeProgramsLightBackground = new ColorProperty( mProp, "trayOnTimeProgramsLightBackground", new Color(255, 150, 0, 40)); /* * Settings for the NOW_TYPE of the ProgramMenuItem. */ public static final BooleanProperty propTrayNowProgramsEnabled = new BooleanProperty( mProp, "trayNowProgramsEnabled", true); public static final BooleanProperty propTrayNowProgramsInSubMenu = new BooleanProperty( mProp, "trayNowProgramsInSubMenus", false); public static final BooleanProperty propTrayNowProgramsContainsTime = new BooleanProperty( mProp, "trayNowProgramsContainsTime", false); public static final BooleanProperty propTrayNowProgramsContainsIcon = new BooleanProperty( mProp, "trayNowProgramsContainsIcon", true); public static final BooleanProperty propTrayNowProgramsContainsName = new BooleanProperty( mProp, "trayNowProgramsContainsName", true); public static final BooleanProperty propTrayNowProgramsContainsToolTip = new BooleanProperty( mProp, "trayNowProgramsContainsToolTip", true); /* * Settings for the SOON_TYPE of the ProgramMenuItem. */ public static final BooleanProperty propTraySoonProgramsEnabled = new BooleanProperty( mProp, "traySoonProgramsEnabled", true); public static final BooleanProperty propTraySoonProgramsContainsTime = new BooleanProperty( mProp, "traySoonProgramsContainsTime", true); public static final BooleanProperty propTraySoonProgramsContainsIcon = new BooleanProperty( mProp, "traySoonProgramsContainsIcon", true); public static final BooleanProperty propTraySoonProgramsContainsName = new BooleanProperty( mProp, "traySoonProgramsContainsName", true); public static final BooleanProperty propTraySoonProgramsContainsToolTip = new BooleanProperty( mProp, "traySoonProgramsContainsToolTip", true); /* * Settings for the IMPORTANT_TYPE of the ProgramMenuItem. */ public static final IntProperty propTrayImportantProgramsPriority = new IntProperty( mProp, "trayImportantProgramsPriority", 0 ); public static final BooleanProperty propTrayImportantProgramsEnabled = new BooleanProperty( mProp, "trayImportantProgramsEnabled", true); public static final BooleanProperty propTrayImportantProgramsInSubMenu = new BooleanProperty( mProp, "trayImportantProgramsInSubMenu", false); public static final IntProperty propTrayImportantProgramsSize = new IntProperty( mProp, "trayImportantProgramsSize", 5); public static final BooleanProperty propTrayImportantProgramsContainsIcon = new BooleanProperty( mProp, "trayImportantProgramsContainsIcon", true); public static final BooleanProperty propTrayImportantProgramsContainsName = new BooleanProperty( mProp, "trayImportantProgramsContainsName", true); public static final BooleanProperty propTrayImportantProgramsContainsDate = new BooleanProperty( mProp, "trayImportantProgramsContainsDate", true); public static final BooleanProperty propTrayImportantProgramsContainsTime = new BooleanProperty( mProp, "trayImportantProgramsContainsTime", true); public static final BooleanProperty propTrayImportantProgramsContainsToolTip = new BooleanProperty( mProp, "trayImportantProgramsContainsToolTip", true); /* * Toolbar settings */ public static final ChoiceProperty propToolbarButtonStyle = new ChoiceProperty( mProp, "buttontype", "icon", new String[] { "text&icon", "text", "icon" }); public static final BooleanProperty propIsTooolbarVisible = new BooleanProperty( mProp, "isToolbarVisible", true); public static final BooleanProperty propIsStatusbarVisible = new BooleanProperty( mProp, "isStatusbarVisible", true); /** * @deprecated Deprecated with Version 2.2, now propLookAndFeel is used */ public static final BooleanProperty propIsSkinLFEnabled = new BooleanProperty( mProp, "skinLF.enabled", false); public static final StringProperty propSkinLFThemepack = new StringProperty( mProp, "skinLF.themepack", "themepacks/themepack.zip"); public static final StringProperty propJGoodiesTheme = new StringProperty( mProp, "jgoodies.theme", ""); public static final BooleanProperty propJGoodiesShadow = new BooleanProperty( mProp, "jgoodies.dropshadow", false); public static final StringProperty propLookAndFeel = new StringProperty( mProp, "lookandfeel1_1", mDefaultSettings.getProperty("lookandfeel", UIManager.getCrossPlatformLookAndFeelClassName())); public static final IntProperty propColumnWidth = new IntProperty(mProp, "columnwidth", 200); public static final IntArrayProperty propTimeButtons = new IntArrayProperty( mProp, "timeButtons", new int[] { 6 * 60, 12 * 60, 18 * 60, 20 * 60 + 15 }); /** * @deprecated */ public static final StringArrayProperty propHiddenPluginButtons = new StringArrayProperty( mProp, "hiddenPluginButtons", new String[0]); public static final StringArrayProperty propToolbarButtons = new StringArrayProperty( mProp, "toolbarButtons_2.0", null // we show all buttons, if this property // is not set ); public static final BooleanProperty propToolbarUseBigIcons = new BooleanProperty( mProp, "toolbarUseBigIcons", true); public static final StringProperty propToolbarLocation = new StringProperty( mProp, "toolbarLocation", "north"); public static final StringProperty propLeftSingleClickIf = new StringProperty( mProp, "leftSingleClickIf", "programinfo.ProgramInfo"); public static final StringProperty propDefaultContextMenuIf = new StringProperty( mProp, "contextmenudefaultplugin", "programinfo.ProgramInfo"); public static final StringProperty propMiddleClickIf = new StringProperty( mProp, "middleclickplugin", "programinfo.ProgramInfo"); /** * the last active program filter */ public static final StringProperty propLastUsedFilter = new StringProperty( mProp, "lastusedfilter", null); /** * the last active channel group for filtering the channel list */ public static final StringProperty propLastUsedChannelGroup = new StringProperty( mProp, "lastchannelgroup", null); /** * The order of the plugin IDs. * <p> * In former times this property hold the list of plugin class names that * should be activated on startup (in the right order). Now it holds IDs, not * class names and activation is controlled by {@link #propDeactivatedPlugins}. */ public static final StringArrayProperty propPluginOrder = new StringArrayProperty( mProp, "plugins", null); /** * Order of the Plugins in the Context-Menu. */ public static final StringArrayProperty propContextMenuOrder = new StringArrayProperty( mProp, "contextMenuOrder", null); /** * All disabled Items of the ContextMenu */ public static final StringArrayProperty propContextMenuDisabledItems = new StringArrayProperty( mProp, "contextMenuDisabledItems", null); /** * The ID's of the plugins that have been deactivated. * <p> * NOTE: By remembering the deactivated plugins rather the activated plugins * new plugins are activated automatically. */ public static final StringArrayProperty propDeactivatedPlugins = new StringArrayProperty( mProp, "deactivatedPlugins", null); public static final IntProperty propDownloadPeriod = new IntProperty(mProp, "downloadperiod", 1); public static final ChoiceProperty propAutoDownloadType = new ChoiceProperty( mProp, "autodownload", "never", new String[] { "startup", "daily", "every3days", "weekly", "never" }); public static final IntProperty propAutoDownloadPeriod = new IntProperty( mProp, "autodownloadperiod", 0); public static final BooleanProperty propAskForAutoDownload = new BooleanProperty( mProp, "askForAutoDownload", false); public static final DateProperty propLastDownloadDate = new DateProperty( mProp, "lastdownload", null); public static final FontProperty propProgramTitleFont = new FontProperty( mProp, "font.programtitle", PROGRAMTITLEFONT); public static final FontProperty propProgramInfoFont = new FontProperty( mProp, "font.programinfo", PROGRAMINFOFONT); public static final FontProperty propChannelNameFont = new FontProperty( mProp, "font.channelname", CHANNELNAMEFONT); public static final FontProperty propProgramTimeFont = new FontProperty( mProp, "font.programtime", PROGRAMTIMEFONT); public static final ProgramFieldTypeArrayProperty propProgramInfoFields = new ProgramFieldTypeArrayProperty( mProp, "programpanel.infoFields", new ProgramFieldType[] { ProgramFieldType.GENRE_TYPE, ProgramFieldType.EPISODE_TYPE, ProgramFieldType.ORIGIN_TYPE, ProgramFieldType.PRODUCTION_YEAR_TYPE, ProgramFieldType.SHOWVIEW_NR_TYPE, ProgramFieldType.SHORT_DESCRIPTION_TYPE }); public static final StringArrayProperty propProgramTableIconPlugins = new StringArrayProperty( mProp, "programpanel.iconPlugins", new String[] { PICTURE_ID,INFO_ID, "tvraterplugin.TVRaterPlugin", }); /** Used to enable border on on air programs */ public static final BooleanProperty propProgramTableOnAirProgramsShowingBorder = new BooleanProperty( mProp, "programpanel.onAirProgramsShowingBorder", false); /** Color for Program on Air - This shows how much was shown til now */ public static final ColorProperty propProgramTableColorOnAirDark = new ColorProperty( mProp, "programpanel.ColorOnAirDark", new Color(0, 0, 255, 60)); /** Color for Program on Air - This shows how much is not shown til now */ public static final ColorProperty propProgramTableColorOnAirLight = new ColorProperty( mProp, "programpanel.ColorOnAirLight", new Color(0, 0, 255, 30)); /** Used to enable color marking for default mark priority * @deprecated since 2.5.3 */ public static final BooleanProperty propProgramTableMarkedDefaultPriorityShowsColor = new BooleanProperty( mProp, "programpanel.markedShowsColor", true); /** Used to track if a program panel should use addtional space for the mark icons */ public static final BooleanProperty propProgramPanelUsesExtraSpaceForMarkIcons = new BooleanProperty( mProp, "programpanel.usesExtraSpaceForMarkIcons", true ); /** Used to enable border on marked programs */ public static final BooleanProperty propProgramPanelWithMarkingsShowingBoder = new BooleanProperty( mProp, "programpanel.markingsShowingBorder", true); /** Used default mark priority for markings of plugins. */ public static final IntProperty propProgramPanelUsedDefaultMarkPriority = new IntProperty( mProp, "programpanel.defaultMarkPriority", 0); /** Color for Programs marked with MIN_PRIORITY */ public static final ColorProperty propProgramPanelMarkedMinPriorityColor = new ColorProperty( mProp, "programpanel.ColorMarked", new Color(255, 0, 0, 30)); /** Color for Programs marked with LOWER_MEDIUM_PRIORITY */ public static final ColorProperty propProgramPanelMarkedLowerMediumPriorityColor = new ColorProperty( mProp, "programpanel.ColorMarkedLowerMedium", new Color(0, 255, 255, 50)); /** Color for Programs marked with MEDIUM_PRIORITY */ public static final ColorProperty propProgramPanelMarkedMediumPriorityColor = new ColorProperty( mProp, "programpanel.ColorMarkedMedium", new Color(140, 255, 0, 60)); /** Color for Programs marked with HIGHER_MEDIUM_PRIORITY */ public static final ColorProperty propProgramPanelMarkedHigherMediumPriorityColor = new ColorProperty( mProp, "programpanel.ColorMarkedHigherMedium", new Color(255, 255, 0, 60)); /** Color for Programs marked with MAX_PRIORITY */ public static final ColorProperty propProgramPanelMarkedMaxPriorityColor = new ColorProperty( mProp, "programpanel.ColorMarkedMax", new Color(255, 180, 0, 110)); /** Color of the foreground of a program pranel */ public static final ColorProperty propProgramPanelForegroundColor = new ColorProperty( mProp, "programpanel.ColorForeground", Color.black); public static final BooleanProperty propMouseOver = new BooleanProperty( mProp, "programpanel.MouseOver", false); /** Color for Mouse-Over */ public static final ColorProperty propMouseOverColor = new ColorProperty( mProp, "programpanel.MouseOverColor", new Color(200, 200, 0, 60)); /** Color for selected Program */ public static final ColorProperty propKeyboardSelectedColor = new ColorProperty( mProp, "programpanel.KeyboardSelectedColor", new Color(130, 255, 0, 120)); public static final BooleanProperty propTitelAlwaysVisible = new BooleanProperty( mProp, "programpanel.TitelAlwaysVisible", false); public static final BooleanProperty propIsWindowMaximized = new BooleanProperty( mProp, "window.isMaximized", false); public static final BooleanProperty propIsUsingFullscreen = new BooleanProperty( mProp, "isUsingFullscreen", false); public static final IntProperty propWindowWidth = new IntProperty(mProp, "window.width", 770); public static final IntProperty propWindowHeight = new IntProperty(mProp, "window.height", 500); public static final IntProperty propWindowX = new IntProperty(mProp, "window.x", -1); public static final IntProperty propWindowY = new IntProperty(mProp, "window.y", -1); public static final IntProperty propSettingsDialogDividerLocation = new IntProperty(mProp, "settingsDialogDividerLocation", 200); public static final IntProperty propProgramTableStartOfDay = new IntProperty( mProp, "programtable.startofday", 0); public static final IntProperty propProgramTableEndOfDay = new IntProperty( mProp, "programtable.endofday", 5 * 60); public static final BooleanProperty propHttpProxyUseProxy = new BooleanProperty( mProp, "proxy.http.useProxy", false); public static final IntProperty propDefaultNetworkConnectionTimeout = new IntProperty( mProp, "network.defaultConnectionTimeout", 60000); public static final IntProperty propNetworkCheckTimeout = new IntProperty( mProp, "network.checkTimeout", 10000); public static final IntProperty propPictureType = new IntProperty( mProp, "pictures.type", ProgramPanelSettings.SHOW_PICTURES_IN_TIME_RANGE); public static final StringArrayProperty propPicturePluginIds = new StringArrayProperty( mProp, "pictures.pluginIds", new String[0]); public static final IntProperty propPictureStartTime = new IntProperty( mProp, "pictures.startTime", 18 * 60); public static final IntProperty propPictureEndTime = new IntProperty( mProp, "pictures.endTime", 23 * 60); public static final IntProperty propPictureDuration = new IntProperty( mProp, "pictures.duration", 10); public static final BooleanProperty propIsPictureShowingDescription = new BooleanProperty( mProp, "pictures.showDescription", true); public static final StringProperty propHttpProxyHost = new StringProperty( mProp, "proxy.http.host", ""); public static final StringProperty propHttpProxyPort = new StringProperty( mProp, "proxy.http.port", ""); public static final BooleanProperty propHttpProxyAuthentifyAtProxy = new BooleanProperty( mProp, "proxy.http.authentifyAtProxy", false); public static final StringProperty propHttpProxyUser = new StringProperty( mProp, "proxy.http.user", ""); public static final EncodedStringProperty propHttpProxyPassword = new EncodedStringProperty( mProp, "proxy.http.password", "", PROXY_PASSWORD_SEED); public static final StringArrayProperty propDataServicesForUpdate = new StringArrayProperty( mProp, "tvdataservices.update", null); public static final BooleanProperty propShowPluginView = new BooleanProperty( mProp, "show.pluginview", false); public static final BooleanProperty propShowTimeButtons = new BooleanProperty( mProp, "show.timebuttons", true); public static final BooleanProperty propShowChannels = new BooleanProperty( mProp, "show.channels", true); public static final BooleanProperty propShowDatelist = new BooleanProperty( mProp, "show.datelist", true); public static final BooleanProperty propShowFilterBar = new BooleanProperty( mProp, "show.filterbar", true); public static final SplitViewProperty propViewRoot = new SplitViewProperty( mProp, "view.root", false, true, 200); public static final SplitViewProperty propViewMainframe = new SplitViewProperty( mProp, "view.mainframe", false, false, 150); public static final SplitViewProperty propViewNavigation = new SplitViewProperty( mProp, "view.navigation", true, true, 150); public static final SplitViewProperty propViewDateChannel = new SplitViewProperty( mProp, "view.date_channel", true, true, 150); public static final BooleanProperty propSplashShow = new BooleanProperty( mProp, "splash.show", true); /** * The Splash-Image */ public static final StringProperty propSplashImage = new StringProperty( mProp, "splash.file", "imgs/splash.png"); /** * The X-Position of the Text in the Splash */ public static final IntProperty propSplashTextPosX = new IntProperty(mProp, "splash.textPosX", 10); /** * The Y-Position of the Text in the Splash */ public static final IntProperty propSplashTextPosY = new IntProperty(mProp, "splash.textPosY", 262); /** * Background-Color */ public static final ColorProperty propSplashBackgroundColor = new ColorProperty( mProp, "splash.BackgroundColor", new Color(63, 114, 133)); /** * Foreground-Color */ public static final ColorProperty propSplashForegroundColor = new ColorProperty( mProp, "splash.ForegroundColor", Color.WHITE); public static final StringProperty propLanguage = new StringProperty(mProp, "language", System.getProperty("user.language")); public static final StringProperty propCountry = new StringProperty(mProp, "country", System.getProperty("user.country", "")); public static final StringProperty propVariant = new StringProperty(mProp, "variant", System.getProperty("user.variant","")); public static final StringProperty propTimezone = new StringProperty(mProp, "timeZone", null); public static final BooleanProperty propMinimizeAfterStartup = new BooleanProperty( mProp, "minimizeAfterStartup", false); public static final StringProperty propLogdirectory = new StringProperty( mProp, "logdirectory", mDefaultSettings.getProperty("logdirectory", null)); public static final BooleanProperty propShowChannelIconsInProgramTable = new BooleanProperty( mProp, "showChannelIconsInProgramtable", true); public static final BooleanProperty propShowChannelNamesInProgramTable = new BooleanProperty( mProp, "showChannelNamesInProgramtable", true); public static final BooleanProperty propShowChannelIconsInChannellist = new BooleanProperty( mProp, "showChannelIconsInChannellist", true); public static final BooleanProperty propShowChannelNamesInChannellist = new BooleanProperty( mProp, "showChannelNamesInChannellist", true); public static final StringArrayProperty propUsedChannelGroups = new StringArrayProperty( mProp, "usedChannelGroups", null); public static final StringArrayProperty propDeleteFilesAtStart = new StringArrayProperty( mProp, "deleteFilesAtStart", new String[0]); /** * The IconTheme */ public static final StringProperty propIcontheme = new StringProperty(mProp, "icontheme", mDefaultSettings.getProperty("icontheme", null)); /** * Show the "The Browser was opened"-Dialog */ public static final BooleanProperty propShowBrowserOpenDialog = new BooleanProperty( mProp, "showBrowserOpenDialog", true); /** * Show the SearchField in the Toolbar */ public static final BooleanProperty propIsSearchFieldVisible = new BooleanProperty( mProp, "isSearchFieldVisible", true); /** * Use 12-Hour Format? */ public static final BooleanProperty propTwelveHourFormat = new BooleanProperty( mProp, "uswTwelveHourFormat", false); static { if (!GraphicsEnvironment.isHeadless()) { propJGoodiesTheme.setDefault(PlasticLookAndFeel.createMyDefaultTheme().getClass().getName()); } } /** An array with the ids of the TV data service which license was accepted. */ public static final StringArrayProperty propAcceptedLicenseArrForServiceIds = new StringArrayProperty( mProp, "licnseIds", new String[] {}); /** the class name of the last settings tab that has been closed with OK before */ public static final StringProperty propLastUsedSettingsPath = new StringProperty(mProp, "lastUsedSettingsTabClassName", "#channels"); /** * maximum width of the program table columns */ public static final int MAX_COLUMN_WIDTH = 300; /** * minimum width of the program table columns */ public static final int MIN_COLUMN_WIDTH = 60; /** The setting that contains the global picture settings value */ public static final IntProperty propPluginsPictureSetting = new IntProperty( mProp, "pluginsPictureSetting", PluginPictureSettings.PICTURE_AND_DISCRIPTION_TYPE); /** The user selected default filter */ public static final StringProperty propDefaultFilter = new StringProperty( mProp, "defaultFilter", ""); /** If the plugin updates should be found automatically */ public static final BooleanProperty propAutoUpdatePlugins = new BooleanProperty( mProp, "autoUpdatePlugins", true); public static final DateProperty propLastPluginsUpdate = new DateProperty( mProp, "lastPluginsUpdate", null); /** * enable checking date and time via NTP if no TV data can be downloaded */ public static final BooleanProperty propNTPTimeCheck = new BooleanProperty(mProp, "ntpTimeCheckEnabled", true); /** * date of last NTP internet time check */ public static final DateProperty propLastNTPCheck = new DateProperty(mProp, "lastNTPCheck", null); /** If the internet connection should be checked before accessing internet */ public static final BooleanProperty propInternetConnectionCheck = new BooleanProperty( mProp, "internetConnectionCheck", true); /** * If the plugin view is on the left side and the channel list on the right side. * @since 2.7 */ public static final BooleanProperty propPluginViewIsLeft = new BooleanProperty( mProp, "pluginViewIsLeft", true); /** * The time between auto updates of data services * @since 2.7 */ public static final IntProperty propDataServiceAutoUpdateTime = new IntProperty( mProp, "dataServiceAutoUpdateTime", 30); /** * list of hidden message boxes * @since 2.7 */ public static final StringArrayProperty propHiddenMessageBoxes = new StringArrayProperty(mProp, "hideMessageBox", new String[] {}); /** * show tooltip with large channel icon * @since 2.7 */ public static final BooleanProperty propShowChannelTooltipInProgramTable = new BooleanProperty( mProp, "showChannelTooltipInProgramtable", true); /** Saves the date of the very first TV-Browser start */ public static final DateProperty propFirstStartDate = new DateProperty( mProp, "firstStartDate", null); /** Saves if the plugin info dialog was allready shown */ public static final BooleanProperty propPluginInfoDialogWasShown = new BooleanProperty( mProp, "pluginInfoDialogWasShown", false); /** Saves the selected channel category filter index */ public static final ByteProperty propSelectedChannelCategoryIndex = new ByteProperty( mProp, "selectedChannelCategoryIndex", (byte)1); /** Saves the selected channel country filter index */ public static final ShortProperty propSelectedChannelCountryIndex = new ShortProperty( mProp, "selectedChannelCountryIndex", (short)0); public static final BooleanProperty propAutoDataDownloadEnabled = new BooleanProperty( mProp, "autoDataDownloadEnabled", false); /** * Sets the window position and size for the given window with the values of the given id. * @param windowId The id of the values to set. * @param window The window to layout. * * @since 2.7 */ public static final void layoutWindow(String windowId, Window window) { layoutWindow(windowId, window, null); } /** * Sets the window position and size for the given window with the values of the given id. * @param windowId The id of the values to set. * @param window The window to layout. * @param defaultSize The default size for the window. * * @since 2.7 */ public static final void layoutWindow(String windowId, Window window, Dimension defaultSize) { WindowSetting setting = mWindowSettings.get(windowId); if(setting == null) { setting = new WindowSetting(defaultSize); mWindowSettings.put(windowId, setting); } setting.layout(window); } }

The table below shows all metrics for Settings.java.

MetricValueDescription
BLOCKS115.00Number of blocks
BLOCK_COMMENT61.00Number of block comment lines
COMMENTS234.00Comment lines
COMMENT_DENSITY 0.29Comment density
COMPARISONS102.00Number of comparison operators
CYCLOMATIC114.00Cyclomatic complexity
DECL_COMMENTS71.00Comments in declarations
DOC_COMMENT170.00Number of javadoc comment lines
ELOC800.00Effective lines of code
EXEC_COMMENTS 7.00Comments in executable code
EXITS112.00Procedure exits
FUNCTIONS17.00Number of function declarations
HALSTEAD_DIFFICULTY71.66Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY30.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 1.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 1.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 7.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 1.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA0034 0.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA004913.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 0.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 0.00JAVA0067 Array descriptor on identifier name
JAVA0068 0.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 0.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 0.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 0.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 0.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 1.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 1.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 0.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116146.00JAVA0116 Missing javadoc: field 'field'
JAVA0117 2.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 0.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 0.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 0.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 0.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 6.00JAVA0144 Line exceeds maximum M characters
JAVA0145 2.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA016610.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 0.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 1.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 0.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 0.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 2.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 0.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 0.00JAVA0288 Inconsistent null check
LINES1420.00Number of lines in the source file
LINE_COMMENT 3.00Number of line comments
LOC885.00Lines of code
LOGICAL_LINES443.00Number of statements
LOOPS 5.00Number of loops
NEST_DEPTH 9.00Maximum nesting depth
OPERANDS2460.00Number of operands
OPERATORS4745.00Number of operators
PARAMS10.00Number of formal parameter declarations
PROGRAM_LENGTH7205.00Halstead program length
PROGRAM_VOCAB890.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS20.00Number of return points from functions
SIZE56861.00Size of the file in bytes
UNIQUE_OPERANDS841.00Number of unique operands
UNIQUE_OPERATORS49.00Number of unique operators
WHITESPACE301.00Number of whitespace lines