X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FChannelProperties.java;h=ffcb6a16f074f5316f9bb25627a7d8068f3dfb2d;hb=dee97314c8d002df2ec57812bf82f0460ba51dd8;hp=40f61106c449663f6f172c1dd08eb76e9884daff;hpb=9b8e039f02800dba0f3a3de2bc57e7a8b4f95f1c;p=jalview.git diff --git a/src/jalview/util/ChannelProperties.java b/src/jalview/util/ChannelProperties.java index 40f6110..ffcb6a1 100644 --- a/src/jalview/util/ChannelProperties.java +++ b/src/jalview/util/ChannelProperties.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview 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 3 + * of the License, or (at your option) any later version. + * + * Jalview 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 Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.util; import java.awt.Image; @@ -57,6 +77,7 @@ public class ChannelProperties defaultProps.put("default_appbase", "https://www.jalview.org/getdown/release/1.8"); defaultProps.put("preferences.filename", ".jalview_properties"); + defaultProps.put("channel", "none"); // load channel_properties Properties tryChannelProps = new Properties(); @@ -65,7 +86,7 @@ public class ChannelProperties if (channelPropsURL == null) { // complete failure of channel_properties, set all properties to defaults - System.err.println("Failed to find '/" + CHANNEL_PROPERTIES_FILENAME + ErrorLog.errPrintln("Failed to find '/" + CHANNEL_PROPERTIES_FILENAME + "' file at '" + (channelPropsURL == null ? "null" : channelPropsURL.toString()) @@ -76,12 +97,12 @@ public class ChannelProperties { try { - InputStream channelPropsIS = channelPropsURL.openStream(); + InputStream channelPropsIS = HttpUtils.openStream(channelPropsURL); tryChannelProps.load(channelPropsIS); channelPropsIS.close(); } catch (IOException e) { - System.err.println(e.getMessage()); + ErrorLog.errPrintln(e.getMessage()); // return false; } } @@ -136,10 +157,10 @@ public class ChannelProperties channelProps.load(is); } catch (FileNotFoundException e) { - System.err.println(e.getMessage()); + ErrorLog.errPrintln(e.getMessage()); } catch (IOException e) { - System.err.println(e.getMessage()); + ErrorLog.errPrintln(e.getMessage()); } } } @@ -193,7 +214,7 @@ public class ChannelProperties } else { - System.err.println("Failed to get channel property '" + key + "'"); + ErrorLog.errPrintln("Failed to get channel property '" + key + "'"); } } return null; @@ -245,7 +266,7 @@ public class ChannelProperties img = imgIcon == null ? null : imgIcon.getImage(); if (img == null) { - System.err.println( + ErrorLog.errPrintln( "Failed to load channel image " + key + "=" + path); if (!useClassDefaultImage) { @@ -272,7 +293,7 @@ public class ChannelProperties { return urlMap().getOrDefault(key, null); } - System.err.println( + ErrorLog.errPrintln( "Do not use getImageURL(key) before using getImage(key...)"); } return null;