import javax.swing.UIManager;
import jalview.analytics.Plausible;
+import jalview.bin.argparser.Arg;
+import jalview.bin.argparser.ArgParser;
import jalview.datamodel.PDBEntry;
import jalview.gui.Preferences;
import jalview.gui.UserDefinedColours;
import jalview.urls.IdOrgSettings;
import jalview.util.ChannelProperties;
import jalview.util.ColorUtils;
+import jalview.util.HttpUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.ws.sifts.SiftsSettings;
* in the alignment.</li>
* <li>SHOW_CONSENSUS_HISTOGRAM (false) Show consensus annotation row's
* histogram.</li>
+ * <li>SHOW_SSCONSENSUS_HISTOGRAM (false) Show secondary structure consensus annotation row's
+ * histogram.</li>
* <li>SHOW_CONSENSUS_LOGO (false) Show consensus annotation row's sequence
* logo.</li>
* <li>NORMALISE_CONSENSUS_LOGO (false) Show consensus annotation row's sequence
try
{
// props file provided as URL
- fis = new URL(propertiesFile).openStream();
+ fis = HttpUtils.openStream(new URL(propertiesFile));
if (!Jalview.quiet())
{
jalview.bin.Console.outPrintln(
URL url = new URL(remoteBuildPropertiesUrl);
BufferedReader in = new BufferedReader(
- new InputStreamReader(url.openStream()));
+ new InputStreamReader(HttpUtils.openStream(url)));
Properties remoteBuildProperties = new Properties();
remoteBuildProperties.load(in);
{
if (!Jalview.quiet())
{
- jalview.bin.Console.outPrintln(
+ jalview.bin.Console.errPrintln(
"Non-fatal exception when checking version at "
+ remoteBuildPropertiesUrl + ":");
jalview.bin.Console.printStackTrace(ex);
} catch (NumberFormatException e)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln("Error parsing int property '"
+ jalview.bin.Console.errPrintln("Error parsing int property '"
+ property + "' with value '" + string + "'");
}
}
} catch (NumberFormatException e)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln("Error parsing float property '"
+ jalview.bin.Console.errPrintln("Error parsing float property '"
+ property + "' with value '" + string + "'");
}
}
} catch (Exception ex)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln(
+ jalview.bin.Console.errPrintln(
"Error setting property: " + key + " " + obj + "\n" + ex);
}
return oldValue;
} catch (Exception ex)
{
if (!Jalview.quiet())
- jalview.bin.Console.outPrintln("Error saving properties: " + ex);
+ jalview.bin.Console.errPrintln("Error saving properties: " + ex);
}
}
}
}
if (file == null || !file.exists())
{
+ if (file != null)
+ {
+ jalview.bin.Console
+ .errPrintln("Could not load bootstrap preferences file '"
+ + file.getPath() + "'");
+ }
String channelPrefsFilename = ChannelProperties
.getProperty("preferences.filename");
String propertiesFilename = System.getProperty("user.home")
+ File.separatorChar + channelPrefsFilename;
+ jalview.bin.Console.errPrintln(
+ "Using default properties file '" + propertiesFilename + "'");
file = new File(propertiesFilename);
}
if (file == null || !file.exists())
+
{
String releasePrefsFilename = fallbackPropertiesFile;
String releasePropertiesFilename = System.getProperty("user.home")
+ File.separatorChar + releasePrefsFilename;
+ jalview.bin.Console.errPrintln("Falling back to properties file '"
+ + releasePropertiesFilename + "'");
file = new File(releasePropertiesFilename);
}
- if (filename == null)
- return null;
if (!file.exists())
{
jalview.bin.Console
.errPrintln("Could not load bootstrap preferences file '"
- + filename + "'");
+ + file.getPath() + "'");
return null;
}
{
return key == null ? null : sessionProperties.get(key);
}
+
+ public static boolean getArgCacheDefault(Arg a, String pref, boolean def)
+ {
+ ArgParser ap = Jalview.getInstance().getArgParser();
+ return ap.isSet(a) ? ap.getBoolean(a) : getDefault(pref, def);
+ }
}