import java.util.SortedMap;
import java.util.TreeMap;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.RemoveGapColCommand;
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.AlignedCodonFrame;
}
else
{
- Cache.error(
+ Console.error(
"JAL-2154 regression: warning - found (and ignored) a duplicate CDS sequence:" + mtch.toString());
}
}
package jalview.analysis;
import java.util.Locale;
-
-import jalview.bin.Cache;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.StringTokenizer;
+import jalview.bin.Console;
+
/**
* A singleton that provides instances of genetic code translation tables
*
}
} catch (IOException | NullPointerException e)
{
- Cache.error(
+ Console.error(
"Error reading genetic codes data file " + fileName + ": "
+ e.getMessage());
}
}
} catch (IOException e)
{
- Cache.error(
+ Console.error(
"Error reading nucleotide ambiguity codes data file: "
+ e.getMessage());
}
line.lastIndexOf(QUOTE));
if (aminos.length() != NUCS_COUNT_CUBED) // 4 * 4 * 4 combinations
{
- Cache.error("wrong data length in code table: " + line);
+ Console.error("wrong data length in code table: " + line);
}
else
{
import jalview.api.analysis.ScoreModelI;
import jalview.api.analysis.SimilarityParamsI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.Point;
import jalview.math.MatrixI;
eigenMatrix.tqli();
} catch (Exception q)
{
- Cache.error("Error computing PCA: " + q.getMessage());
+ Console.error("Error computing PCA: " + q.getMessage());
q.printStackTrace();
}
}
import jalview.datamodel.PDBEntry;
import jalview.gui.Preferences;
import jalview.gui.UserDefinedColours;
-import jalview.log.JLogger;
import jalview.log.JLoggerLog4j;
import jalview.schemes.ColourSchemeLoader;
import jalview.schemes.ColourSchemes;
import jalview.urls.IdOrgSettings;
import jalview.util.ChannelProperties;
import jalview.util.ColorUtils;
-import jalview.util.Log4j;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.ws.sifts.SiftsSettings;
public final static String JALVIEW_LOGGER_NAME = "JalviewLogger";
- public static JLoggerLog4j log;
-
// save the proxy properties set at startup
public final static String[] startupProxyProperties = {
System.getProperty("http.proxyHost"),
private final static String JS_PROPERTY_PREFIX = "jalview_";
- public final static String LOGGING_TEST_MESSAGE = "Logging to STDERR";
-
- public static JLogger.LogLevel getCachedLogLevel()
- {
- return getCachedLogLevel(JALVIEWLOGLEVEL);
- }
-
- public static JLogger.LogLevel getCachedLogLevel(String key)
- {
- return JLogger.toLevel(Cache.getDefault(key, "INFO"));
- }
-
- public static boolean initLogger()
- {
- if (log != null)
- {
- return true;
- }
- try
- {
- JLogger.LogLevel cachedLevel = getCachedLogLevel();
- if (!Platform.isJS())
- {
- Log4j.init(cachedLevel);
- }
- // log output
- // is laxis used? Does getLogger do anything without a Logger object?
- // Logger laxis = Log4j.getLogger("org.apache.axis", myLevel);
- JLoggerLog4j.getLogger("org.apache.axis", cachedLevel);
-
- // The main application logger
- log = JLoggerLog4j.getLogger(JALVIEW_LOGGER_NAME, cachedLevel);
- } catch (NoClassDefFoundError e)
- {
- System.err.println("Could not initialise the logger framework");
- e.printStackTrace();
- }
-
- // Test message
- if (log != null)
- {
- // Logging test message should got through the logger object
- if (log.loggerExists())
- log.debug(LOGGING_TEST_MESSAGE);
- // Tell the user that debug is enabled
- Cache.debug(ChannelProperties.getProperty("app_name")
- + " Debugging Output Follows.");
- return true;
- }
- else
- {
- return false;
- }
- }
-
/**
* Loads properties from the given properties file. Any existing properties
* are first cleared.
default:
String message = "Incorrect PROXY_TYPE - should be 'none' (clear proxy properties), 'false' (system settings), 'true' (custom settings): "
+ proxyType;
- Cache.warn(message);
+ Console.warn(message);
}
// LOAD THE AUTHORS FROM THE authors.props file
if (jalview.jbgui.GDesktop.class.getClassLoader()
.loadClass("uk.ac.vamsas.client.VorbaId") != null)
{
- debug("Found Vamsas Classes (uk.ac..vamsas.client.VorbaId can be loaded)");
+ Console.debug("Found Vamsas Classes (uk.ac..vamsas.client.VorbaId can be loaded)");
vamsasJarsArePresent = 1;
JLoggerLog4j lvclient = JLoggerLog4j.getLogger("uk.ac.vamsas",
- getCachedLogLevel("logs.Vamsas.Level"));
- JLoggerLog4j.addAppender(lvclient, log, JALVIEW_LOGGER_NAME);
+ Console.getCachedLogLevel("logs.Vamsas.Level"));
+ JLoggerLog4j.addAppender(lvclient, Console.log, JALVIEW_LOGGER_NAME);
// Tell the user that debug is enabled
lvclient.debug(ChannelProperties.getProperty("app_name")
+ " Vamsas Client Debugging Output Follows.");
} catch (Exception e)
{
vamsasJarsArePresent = 0;
- debug("Vamsas Classes are not present");
+ Console.debug("Vamsas Classes are not present");
}
}
return (vamsasJarsArePresent > 0);
if (Cache.class.getClassLoader()
.loadClass("groovy.lang.GroovyObject") != null)
{
- debug("Found Groovy (groovy.lang.GroovyObject can be loaded)");
+ Console.debug("Found Groovy (groovy.lang.GroovyObject can be loaded)");
groovyJarsArePresent = 1;
JLoggerLog4j lgclient = JLoggerLog4j.getLogger("groovy",
- getCachedLogLevel("logs.Groovy.Level"));
- JLoggerLog4j.addAppender(lgclient, log, JALVIEW_LOGGER_NAME);
+ Console.getCachedLogLevel("logs.Groovy.Level"));
+ JLoggerLog4j.addAppender(lgclient, Console.log, JALVIEW_LOGGER_NAME);
// Tell the user that debug is enabled
lgclient.debug(ChannelProperties.getProperty("app_name")
+ " Groovy Client Debugging Output Follows.");
} catch (Error e)
{
groovyJarsArePresent = 0;
- debug("Groovy Classes are not present", e);
+ Console.debug("Groovy Classes are not present", e);
} catch (Exception e)
{
groovyJarsArePresent = 0;
- debug("Groovy Classes are not present");
+ Console.debug("Groovy Classes are not present");
}
}
return (groovyJarsArePresent > 0);
.loadClass("com.boxysystems.jgoogleanalytics.FocusPoint");
} catch (Exception e)
{
- debug("com.boxysystems.jgoogleanalytics package is not present - tracking not enabled.");
+ Console.debug("com.boxysystems.jgoogleanalytics package is not present - tracking not enabled.");
tracker = null;
jgoogleanalyticstracker = null;
trackerfocus = null;
{
if (re != null)
{
- debug("Caught runtime exception in googletracker init:", re);
+ Console.debug("Caught runtime exception in googletracker init:", re);
}
if (ex != null)
{
- warn("Failed to initialise GoogleTracker for Jalview Desktop with version "
+ Console.warn("Failed to initialise GoogleTracker for Jalview Desktop with version "
+ vrs, ex);
}
if (err != null)
{
- error("Whilst initing GoogleTracker for Jalview Desktop version "
+ Console.error("Whilst initing GoogleTracker for Jalview Desktop version "
+ vrs, err);
}
}
else
{
- debug("Successfully initialised tracker.");
+ Console.debug("Successfully initialised tracker.");
}
}
}
Color col = ColorUtils.parseColourString(colprop);
if (col == null)
{
- warn("Couldn't parse '" + colprop + "' as a colour for " + property);
+ Console.warn("Couldn't parse '" + colprop + "' as a colour for " + property);
}
return (col == null) ? defcolour : col;
}
? " [" + startupProxyProperties[6] + "]"
: "");
- Cache.debug(sb.toString());
+ Console.debug(sb.toString());
}
public static void setProxyPropertiesFromPreferences()
case Cache.PROXYTYPE_NONE:
if (!previousProxyType.equals(proxyType))
{
- Cache.info("Setting no proxy settings");
+ Console.info("Setting no proxy settings");
Cache.setProxyProperties(null, null, null, null, null, null, null,
null, null);
}
case Cache.PROXYTYPE_CUSTOM:
// always re-set a custom proxy -- it might have changed, particularly
// password
- Cache.info("Setting custom proxy settings");
+ Console.info("Setting custom proxy settings");
boolean proxyAuthSet = Cache.getDefault("PROXY_AUTH", false);
Cache.setProxyProperties(Cache.getDefault("PROXY_SERVER", null),
Cache.getDefault("PROXY_PORT", null),
proxyAuthSet ? Cache.proxyAuthPassword : null, "localhost");
break;
default: // system proxy settings by default
- Cache.info("Setting system proxy settings");
+ Console.info("Setting system proxy settings");
Cache.resetProxyProperties();
}
}
char[] displayHttpPw = new char[httpPassword == null ? 0
: httpPassword.length];
Arrays.fill(displayHttpPw, '*');
- Cache.debug("CACHE Proxy: setting new Authenticator with httpUser='"
+ Console.debug("CACHE Proxy: setting new Authenticator with httpUser='"
+ httpUser + "' httpPassword='" + displayHttpPw + "'");
if (!Platform.isJS())
/* *
&& getRequestingPort() == Integer
.valueOf(httpPort))
{
- Cache.debug(
+ Console.debug(
"AUTHENTICATOR returning PasswordAuthentication(\""
+ httpUser + "\", '"
+ new String(displayHttpPw) + "')");
{
char[] displayHttpsPw = new char[httpPassword.length];
Arrays.fill(displayHttpsPw, '*');
- Cache.debug(
+ Console.debug(
"AUTHENTICATOR returning PasswordAuthentication(\""
+ httpsUser + "\", '" + displayHttpsPw
+ "'");
}
} catch (NumberFormatException e)
{
- Cache.error("Problem with proxy port values [http:"
+ Console.error("Problem with proxy port values [http:"
+ httpPort + ", https:" + httpsPort + "]");
}
- Cache.debug(
+ Console.debug(
"AUTHENTICATOR after trying to get PasswordAuthentication");
}
}
// non proxy request
- Cache.debug("AUTHENTICATOR returning null");
+ Console.debug("AUTHENTICATOR returning null");
return null;
}
});
// required to re-enable basic authentication (should be okay for a
// local proxy)
- Cache.debug(
+ Console.debug(
"AUTHENTICATOR setting property 'jdk.http.auth.tunneling.disabledSchemes' to \"\"");
System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
} catch (SecurityException e)
{
- Cache.error("Could not set default Authenticator");
- Cache.debug(getStackTraceString(e));
+ Console.error("Could not set default Authenticator");
+ Console.debug(getStackTraceString(e));
}
}
else
*
*/
{
- Cache.debug("AUTHENTICATOR setting default Authenticator to null");
+ Console.debug("AUTHENTICATOR setting default Authenticator to null");
Authenticator.setDefault(null);
}
}
// nonProxyHosts not currently configurable in Preferences
- Cache.debug("AUTHENTICATOR setting property 'http.nonProxyHosts' to \""
+ Console.debug("AUTHENTICATOR setting property 'http.nonProxyHosts' to \""
+ nonProxyHosts + "\"");
setOrClearSystemProperty("http.nonProxyHosts", nonProxyHosts);
}
}
}
- public static void trace(String message)
- {
- if (initLogger())
- {
- log.trace(message, null);
- }
- else
- {
- System.out.println(message);
- }
- }
-
- public static void trace(String message, Throwable t)
- {
- if (initLogger())
- {
- log.trace(message, t);
- }
- else
- {
- System.out.println(message);
- t.printStackTrace();
- }
- }
-
- public static void debug(String message)
- {
- if (initLogger())
- {
- log.debug(message, null);
- }
- else
- {
- System.out.println(message);
- }
-
- }
-
- public static void debug(String message, Throwable t)
- {
- if (initLogger())
- {
- log.debug(message, t);
- }
- else
- {
- System.out.println(message);
- t.printStackTrace();
- }
-
- }
-
- public static void info(String message)
- {
- if (initLogger())
- {
- log.info(message, null);
- }
- else
- {
- System.out.println(message);
- }
-
- }
-
- public static void info(String message, Throwable t)
- {
- if (initLogger())
- {
- log.info(message, t);
- }
- else
- {
- System.out.println(message);
- t.printStackTrace();
- }
-
- }
-
- public static void warn(String message)
- {
- if (initLogger())
- {
- log.warn(message, null);
- }
- else
- {
- System.out.println(message);
- }
-
- }
-
- public static void warn(String message, Throwable t)
- {
- if (initLogger())
- {
- log.warn(message, t);
- }
- else
- {
- System.out.println(message);
- t.printStackTrace();
- }
-
- }
-
- public static void error(String message)
- {
- if (initLogger())
- {
- log.error(message, null);
- }
- else
- {
- System.err.println(message);
- }
-
- }
-
- public static void error(String message, Throwable t)
- {
- if (initLogger())
- {
- log.error(message, t);
- }
- else
- {
- System.err.println(message);
- t.printStackTrace(System.err);
- }
-
- }
-
- public static void fatal(String message)
- {
- if (initLogger())
- {
- log.fatal(message, null);
- }
- else
- {
- System.err.println(message);
- }
-
- }
-
- public static void fatal(String message, Throwable t)
- {
- if (initLogger())
- {
- log.fatal(message, t);
- }
- else
- {
- System.err.println(message);
- t.printStackTrace(System.err);
- }
-
- }
-
- public static boolean isDebugEnabled()
- {
- return log == null ? false : log.isDebugEnabled();
- }
-
- public static boolean isTraceEnabled()
- {
- return log == null ? false : log.isTraceEnabled();
- }
-
/**
* Getdown appbase methods
*/
--- /dev/null
+package jalview.bin;
+
+import jalview.log.JLogger;
+import jalview.log.JLoggerI.LogLevel;
+import jalview.log.JLoggerLog4j;
+import jalview.util.ChannelProperties;
+import jalview.util.Log4j;
+import jalview.util.Platform;
+
+public class Console
+{
+
+ public static JLoggerLog4j log;
+
+ public static void debug(String message, Throwable t)
+ {
+ if (Console.initLogger())
+ {
+ log.debug(message, t);
+ }
+ else
+ {
+ System.out.println(message);
+ t.printStackTrace();
+ }
+
+ }
+
+ public static void info(String message)
+ {
+ if (Console.initLogger())
+ {
+ log.info(message, null);
+ }
+ else
+ {
+ System.out.println(message);
+ }
+
+ }
+
+ public static void trace(String message, Throwable t)
+ {
+ if (Console.initLogger())
+ {
+ log.trace(message, t);
+ }
+ else
+ {
+ System.out.println(message);
+ t.printStackTrace();
+ }
+ }
+
+ public static void debug(String message)
+ {
+ if (Console.initLogger())
+ {
+ log.debug(message, null);
+ }
+ else
+ {
+ System.out.println(message);
+ }
+
+ }
+
+ public static void info(String message, Throwable t)
+ {
+ if (Console.initLogger())
+ {
+ log.info(message, t);
+ }
+ else
+ {
+ System.out.println(message);
+ t.printStackTrace();
+ }
+
+ }
+
+ public static void warn(String message)
+ {
+ if (Console.initLogger())
+ {
+ log.warn(message, null);
+ }
+ else
+ {
+ System.out.println(message);
+ }
+
+ }
+
+ public static void trace(String message)
+ {
+ if (Console.initLogger())
+ {
+ log.trace(message, null);
+ }
+ else
+ {
+ System.out.println(message);
+ }
+ }
+
+ public static void warn(String message, Throwable t)
+ {
+ if (Console.initLogger())
+ {
+ log.warn(message, t);
+ }
+ else
+ {
+ System.out.println(message);
+ t.printStackTrace();
+ }
+
+ }
+
+ public static void error(String message)
+ {
+ if (Console.initLogger())
+ {
+ log.error(message, null);
+ }
+ else
+ {
+ System.err.println(message);
+ }
+
+ }
+
+ public static void error(String message, Throwable t)
+ {
+ if (Console.initLogger())
+ {
+ log.error(message, t);
+ }
+ else
+ {
+ System.err.println(message);
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ public static void fatal(String message)
+ {
+ if (Console.initLogger())
+ {
+ log.fatal(message, null);
+ }
+ else
+ {
+ System.err.println(message);
+ }
+
+ }
+
+ public static void fatal(String message, Throwable t)
+ {
+ if (Console.initLogger())
+ {
+ log.fatal(message, t);
+ }
+ else
+ {
+ System.err.println(message);
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ public static boolean isDebugEnabled()
+ {
+ return log == null ? false : log.isDebugEnabled();
+ }
+
+ public static boolean isTraceEnabled()
+ {
+ return log == null ? false : log.isTraceEnabled();
+ }
+
+ public static JLogger.LogLevel getCachedLogLevel()
+ {
+ return Console.getCachedLogLevel(Cache.JALVIEWLOGLEVEL);
+ }
+
+ public static JLogger.LogLevel getCachedLogLevel(String key)
+ {
+ return JLogger.toLevel(Cache.getDefault(key, "INFO"));
+ }
+
+ public static boolean initLogger()
+ {
+ if (log != null)
+ {
+ return true;
+ }
+ try
+ {
+ JLogger.LogLevel cachedLevel = getCachedLogLevel();
+ if (!Platform.isJS())
+ {
+ Log4j.init(cachedLevel);
+ }
+ // log output
+ // is laxis used? Does getLogger do anything without a Logger object?
+ // Logger laxis = Log4j.getLogger("org.apache.axis", myLevel);
+ JLoggerLog4j.getLogger("org.apache.axis", cachedLevel);
+
+ // The main application logger
+ log = JLoggerLog4j.getLogger(Cache.JALVIEW_LOGGER_NAME, cachedLevel);
+ } catch (NoClassDefFoundError e)
+ {
+ System.err.println("Could not initialise the logger framework");
+ e.printStackTrace();
+ }
+
+ // Test message
+ if (log != null)
+ {
+ // Logging test message should got through the logger object
+ if (log.loggerExists())
+ log.debug(Console.LOGGING_TEST_MESSAGE);
+ // Tell the user that debug is enabled
+ debug(ChannelProperties.getProperty("app_name")
+ + " Debugging Output Follows.");
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public final static String LOGGING_TEST_MESSAGE = "Logging to STDERR";
+
+}
try
{
- Cache.initLogger();
+ Console.initLogger();
} catch (NoClassDefFoundError error)
{
error.printStackTrace();
JalviewTaskbar.setTaskbar(this);
} catch (Exception e)
{
- Cache.info("Cannot set Taskbar");
- Cache.error(e.getMessage());
+ Console.info("Cannot set Taskbar");
+ Console.error(e.getMessage());
// e.printStackTrace();
} catch (Throwable t)
{
- Cache.info("Cannot set Taskbar");
- Cache.error(t.getMessage());
+ Console.info("Cannot set Taskbar");
+ Console.error(t.getMessage());
// t.printStackTrace();
}
{
// Start the desktop questionnaire prompter with the specified
// questionnaire
- Cache.debug("Starting questionnaire url at " + url);
+ Console.debug("Starting questionnaire url at " + url);
desktop.checkForQuestionnaire(url);
System.out.println("CMD questionnaire[-" + url
+ "] executed successfully!");
// "http://anaplog.compbio.dundee.ac.uk/cgi-bin/questionnaire.pl";
// //
String defurl = "https://www.jalview.org/cgi-bin/questionnaire.pl";
- Cache.debug(
+ Console.debug(
"Starting questionnaire with default url: " + defurl);
desktop.checkForQuestionnaire(defurl);
}
lafSet = setCrossPlatformLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "system":
lafSet = setSystemLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "gtk":
lafSet = setGtkLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "metal":
lafSet = setMetalLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "nimbus":
lafSet = setNimbusLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "quaqua":
lafSet = setQuaquaLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "vaqua":
lafSet = setVaquaLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "mac":
lafSet = setMacLookAndFeel();
if (!lafSet)
{
- Cache.error("Could not set requested laf=" + laf);
+ Console.error("Could not set requested laf=" + laf);
}
break;
case "none":
break;
default:
- Cache.error("Requested laf=" + laf + " not implemented");
+ Console.error("Requested laf=" + laf + " not implemented");
}
if (!lafSet)
{
set = true;
} catch (Exception ex)
{
- Cache.error("Unexpected Look and Feel Exception");
- Cache.error(ex.getMessage());
- Cache.debug(Cache.getStackTraceString(ex));
+ Console.error("Unexpected Look and Feel Exception");
+ Console.error(ex.getMessage());
+ Console.debug(Cache.getStackTraceString(ex));
}
return set;
}
set = true;
} catch (Exception ex)
{
- Cache.error("Unexpected Look and Feel Exception");
- Cache.error(ex.getMessage());
- Cache.debug(Cache.getStackTraceString(ex));
+ Console.error("Unexpected Look and Feel Exception");
+ Console.error(ex.getMessage());
+ Console.debug(Cache.getStackTraceString(ex));
}
return set;
}
set = true;
} catch (Exception ex)
{
- Cache.error("Unexpected Look and Feel Exception");
- Cache.error(ex.getMessage());
- Cache.debug(Cache.getStackTraceString(ex));
+ Console.error("Unexpected Look and Feel Exception");
+ Console.error(ex.getMessage());
+ Console.debug(Cache.getStackTraceString(ex));
}
return set;
}
@Override
public void run()
{
- Cache.debug("Initialising googletracker for usage stats.");
+ Console.debug("Initialising googletracker for usage stats.");
Cache.initGoogleTracker();
- Cache.debug("Tracking enabled.");
+ Console.debug("Tracking enabled.");
}
}, new Runnable()
{
@Override
public void run()
{
- Cache.debug("Not enabling Google Tracking.");
+ Console.debug("Not enabling Google Tracking.");
}
}, null, true);
desktop.addDialogThread(prompter);
*/
package jalview.ext.ensembl;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.GeneLociI;
import jalview.datamodel.GeneLocus;
chromosome, map);
} catch (NullPointerException | NumberFormatException e)
{
- Cache.error("Error looking up gene loci: " + e.getMessage());
+ Console.error("Error looking up gene loci: " + e.getMessage());
e.printStackTrace();
}
return null;
import jalview.analysis.AlignmentUtils;
import jalview.analysis.Dna;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
if (upx.size() > 1)
{
- Cache.warn(
+ Console.warn(
"Implementation issue - multiple uniprot acc on product sequence.");
}
}
*/
package jalview.ext.htsjdk;
-import jalview.bin.Cache;
-
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.vcf.VCFFileReader;
import htsjdk.variant.vcf.VCFHeader;
+import jalview.bin.Console;
/**
* A thin wrapper for htsjdk classes to read either plain, or compressed, or
}
else
{
- Cache.error("File not found: " + filePath);
+ Console.error("File not found: " + filePath);
}
}
import jalview.api.FeatureRenderer;
import jalview.api.FeatureSettingsModelI;
import jalview.api.SequenceRenderer;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.gui.AppJmol;
private String jmolScript(String script)
{
- Cache.debug(">>Jmol>> " + script);
+ Console.debug(">>Jmol>> " + script);
String s = jmolViewer.evalStringQuiet(script); // scriptWait(script); BH
- Cache.debug("<<Jmol<< " + s);
+ Console.debug("<<Jmol<< " + s);
return s;
}
import java.util.List;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.Preferences;
import jalview.structure.StructureCommand;
import jalview.structure.StructureCommandI;
int rc = conn.getResponseCode();
if (rc != HttpURLConnection.HTTP_OK)
{
- Cache.error(
+ Console.error(
String.format("Error status from %s: %d", rpcUrl, rc));
return result;
}
} catch (SocketException e)
{
// thrown when 'quit' command is sent to PyMol
- Cache.warn(String.format("Request to %s returned %s", rpcUrl,
+ Console.warn(String.format("Request to %s returned %s", rpcUrl,
e.toString()));
} catch (Exception e)
{
{
out.close();
}
- if (Cache.isTraceEnabled())
+ if (Console.isTraceEnabled())
{
- Cache.trace("Sent: " + command.toString());
+ Console.trace("Sent: " + command.toString());
if (result != null)
{
- Cache.trace("Received: " + result);
+ Console.trace("Received: " + result);
}
}
}
this.pymolXmlRpcPort = getPortNumber();
if (pymolXmlRpcPort > 0)
{
- Cache.info("PyMOL XMLRPC started on port " + pymolXmlRpcPort);
+ Console.info("PyMOL XMLRPC started on port " + pymolXmlRpcPort);
}
else
{
error += "Failed to read PyMOL XMLRPC port number";
- Cache.error(error);
+ Console.error(error);
pymolProcess.destroy();
pymolProcess = null;
}
}
} catch (Exception e)
{
- Cache.error("Failed to get REST port number from " + responses
+ Console.error("Failed to get REST port number from " + responses
+ ": " + e.getMessage());
// logger.error("Failed to get REST port number from " + responses + ": "
// + e.getMessage());
}
if (port == 0)
{
- Cache.error("Failed to start PyMOL with XMLRPC, response was: "
+ Console.error("Failed to start PyMOL with XMLRPC, response was: "
+ responses);
}
- Cache.error("PyMOL started with XMLRPC on port " + port);
+ Console.error("PyMOL started with XMLRPC on port " + port);
return port;
}
import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
import ext.edu.ucsf.rbvi.strucviz2.StructureManager.ModelType;
import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SearchResultMatchI;
import jalview.datamodel.SearchResultsI;
if (getResponse)
{
reply = lastReply;
- if (Cache.isDebugEnabled()) {
- Cache.debug(
+ if (Console.isDebugEnabled()) {
+ Console.debug(
"Response from command ('" + cmd + "') was:\n" + lastReply);
}
}
else
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Command executed: " + cmd);
+ Console.debug("Command executed: " + cmd);
}
}
atomSpecs.add(spec);
} catch (IllegalArgumentException e)
{
- Cache.error("Failed to parse atomspec: " + atomSpec);
+ Console.error("Failed to parse atomspec: " + atomSpec);
}
}
return atomSpecs;
spec = parseAtomSpec(atomSpec);
} catch (IllegalArgumentException e)
{
- Cache.error("Problem parsing atomspec " + atomSpec);
+ Console.error("Problem parsing atomspec " + atomSpec);
continue;
}
import org.biojava.nbio.ontology.io.OboParser;
import org.biojava.nbio.ontology.utils.Annotation;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.io.gff.SequenceOntologyI;
/**
}
}
long elapsed = System.currentTimeMillis() - now;
- Cache.info("Loaded Sequence Ontology from " + zipFile + " ("
+ Console.info("Loaded Sequence Ontology from " + zipFile + " ("
+ elapsed + "ms)");
} catch (Exception e)
{
boolean oldTermIsObsolete = isObsolete(replaced);
if (newTermIsObsolete && !oldTermIsObsolete)
{
- Cache.debug("Ignoring " + term.getName()
+ Console.debug("Ignoring " + term.getName()
+ " as obsolete and duplicated by "
+ replaced.getName());
term = replaced;
}
else if (!newTermIsObsolete && oldTermIsObsolete)
{
- Cache.debug("Ignoring " + replaced.getName()
+ Console.debug("Ignoring " + replaced.getName()
+ " as obsolete and duplicated by " + term.getName());
}
else
{
- Cache.debug("Warning: " + term.getName()
+ Console.debug("Warning: " + term.getName()
+ " has replaced " + replaced.getName()
+ " for lookup of '" + description + "'");
}
{
if (!termsNotFound.contains(term))
{
- Cache.error("SO term " + term + " invalid");
+ Console.error("SO term " + term + " invalid");
termsNotFound.add(term);
}
}
import java.util.Map;
import java.util.Objects;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.SequenceI;
}
} catch (Exception mfe)
{
- Cache.debug("Exception accessing urls", mfe);
+ Console.debug("Exception accessing urls", mfe);
continue;
}
int colCounter = 0;
import org.json.JSONArray;
import org.json.JSONObject;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.fts.api.FTSDataColumnI;
import jalview.fts.api.FTSRestClientI;
}
} catch (Exception x)
{
- Cache.warn(
+ Console.warn(
"Couldn't retrieve 3d-beacons model for uniprot id"
+ searchTerm + " : " + tdbURL,
x);
import jalview.api.ViewStyleI;
import jalview.api.analysis.SimilarityParamsI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.bin.Jalview;
import jalview.commands.CommandI;
import jalview.commands.EditCommand;
}
else
{
- Cache.error(MessageManager
+ Console.error(MessageManager
.formatMessage("label.couldnt_save_file", new Object[]
{ lastFilenameSaved }));
}
BackupFiles backupfiles = null;
if (doBackup)
{
- Cache.trace(
+ Console.trace(
"ALIGNFRAME making backupfiles object for " + file);
backupfiles = new BackupFiles(file);
}
{
String tempFilePath = doBackup ? backupfiles.getTempFilePath()
: file;
- Cache.trace("ALIGNFRAME setting PrintWriter");
+ Console.trace("ALIGNFRAME setting PrintWriter");
PrintWriter out = new PrintWriter(new FileWriter(tempFilePath));
if (backupfiles != null)
{
- Cache.trace("ALIGNFRAME about to write to temp file "
+ Console.trace("ALIGNFRAME about to write to temp file "
+ backupfiles.getTempFilePath());
}
out.print(output);
- Cache.trace("ALIGNFRAME about to close file");
+ Console.trace("ALIGNFRAME about to close file");
out.close();
- Cache.trace("ALIGNFRAME closed file");
+ Console.trace("ALIGNFRAME closed file");
AlignFrame.this.setTitle(file);
statusBar.setText(MessageManager.formatMessage(
"label.successfully_saved_to_file_in_format",
} catch (IOException e)
{
lastSaveSuccessful = false;
- Cache.error(
+ Console.error(
"ALIGNFRAME Something happened writing the temp file");
- Cache.error(e.getMessage());
- Cache.debug(Cache.getStackTraceString(e));
+ Console.error(e.getMessage());
+ Console.debug(Cache.getStackTraceString(e));
} catch (Exception ex)
{
lastSaveSuccessful = false;
- Cache.error(
+ Console.error(
"ALIGNFRAME Something unexpected happened writing the temp file");
- Cache.error(ex.getMessage());
- Cache.debug(Cache.getStackTraceString(ex));
+ Console.error(ex.getMessage());
+ Console.debug(Cache.getStackTraceString(ex));
}
if (doBackup)
{
backupfiles.setWriteSuccess(lastSaveSuccessful);
- Cache.debug("ALIGNFRAME writing temp file was "
+ Console.debug("ALIGNFRAME writing temp file was "
+ (lastSaveSuccessful ? "" : "NOT ") + "successful");
// do the backup file roll and rename the temp file to actual file
- Cache.trace(
+ Console.trace(
"ALIGNFRAME about to rollBackupsAndRenameTempFile");
lastSaveSuccessful = backupfiles.rollBackupsAndRenameTempFile();
- Cache.debug(
+ Console.debug(
"ALIGNFRAME performed rollBackupsAndRenameTempFile "
+ (lastSaveSuccessful ? "" : "un")
+ "successfully");
{
if (originalSource != viewport)
{
- Cache.warn(
+ Console.warn(
"Implementation worry: mismatch of viewport origin for undo");
}
originalSource.updateHiddenColumns();
if (originalSource != viewport)
{
- Cache.warn(
+ Console.warn(
"Implementation worry: mismatch of viewport origin for redo");
}
originalSource.updateHiddenColumns();
}
} catch (Exception e)
{
- Cache.debug(
+ Console.debug(
"Exception during web service menu building process.",
e);
}
showProducts.setEnabled(showp);
} catch (Exception e)
{
- Cache.warn(
+ Console.warn(
"canShowProducts threw an exception - please report to help@jalview.org",
e);
return false;
al = dna.translateCdna(codeTable);
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Exception during translation. Please report this !", ex);
final String msg = MessageManager.getString(
"label.error_when_translating_sequences_submit_bug_report");
}
} catch (Exception x)
{
- Cache.debug(
+ Console.debug(
"Exception when processing data source as T-COFFEE score file",
x);
tcf = null;
import jalview.api.FeaturesDisplayedI;
import jalview.api.ViewStyleI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.CommandI;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
// TODO remove these once 2.4.VAMSAS release finished
if (seqsetid != null)
{
- Cache.debug(
+ Console.debug(
"Setting viewport's sequence set id : " + sequenceSetID);
}
if (viewId != null)
{
- Cache.debug("Setting viewport's view id : " + viewId);
+ Console.debug("Setting viewport's view id : " + viewId);
}
init();
// TODO remove these once 2.4.VAMSAS release finished
if (seqsetid != null)
{
- Cache.debug(
+ Console.debug(
"Setting viewport's sequence set id : " + sequenceSetID);
}
if (viewId != null)
{
- Cache.debug("Setting viewport's view id : " + viewId);
+ Console.debug("Setting viewport's view id : " + viewId);
}
if (hiddenColumns != null)
// calculator.getRegisteredWorkersOfClass(settings.getWorkerClass())
if (needsUpdate)
{
- Cache.debug("trigger update for " + calcId);
+ Console.debug("trigger update for " + calcId);
}
}
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
// could not be validated and it is not clear if it is now being
// called. Log warning here in case it is called and unforeseen
// problems occur
- Cache.warn(
+ Console.warn(
"Unexpected path through code: Wrapped jar file opened with wrap alignment set in preferences");
// scroll to start of panel
}
else
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.warn("Closing alignment panel which is already closed.");
+ Console.warn("Closing alignment panel which is already closed.");
}
}
}
import javax.swing.event.InternalFrameEvent;
import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.StructureViewerModel;
} catch (OutOfMemoryError oomerror)
{
new OOMWarning("When trying to open the Jmol viewer!", oomerror);
- Cache.debug("File locations are " + filesString);
+ Console.debug("File locations are " + filesString);
} catch (Exception ex)
{
- Cache.error("Couldn't open Jmol viewer!", ex);
+ Console.error("Couldn't open Jmol viewer!", ex);
ex.printStackTrace();
return;
}
{
new OOMWarning("When trying to add structures to the Jmol viewer!",
oomerror);
- Cache.debug("File locations are " + filesString);
+ Console.debug("File locations are " + filesString);
return;
} catch (Exception ex)
{
- Cache.error("Couldn't add files to Jmol viewer!", ex);
+ Console.error("Couldn't add files to Jmol viewer!", ex);
ex.printStackTrace();
return;
}
{
try
{
- Cache.debug("Waiting around for jmb notify.");
+ Console.debug("Waiting around for jmb notify.");
waitTotal += waitFor;
// Thread.sleep() throws an exception in JS
import jalview.api.AlignmentViewPanel;
import jalview.api.structures.JalviewStructureDisplayI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
jalview.util.BrowserLauncher.openURL(url);
} catch (Exception e)
{
- Cache.error("Failed to launch Jmol-associated url " + url, e);
+ Console.error("Failed to launch Jmol-associated url " + url, e);
// TODO: 2.6 : warn user if browser was not configured.
}
}
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
{
if (parent != null)
{
- Cache.debug("News window closed.");
+ Console.debug("News window closed.");
jd = null;
parent.showNews(false);
}
public BlogReader(Desktop desktop)
{
- Cache.debug("Constructing news reader.");
+ Console.debug("Constructing news reader.");
parent = desktop;
_channelModel = new ChannelListModel();
if (setvisible)
{
- Cache.debug("Will show jalview news automatically");
+ Console.debug("Will show jalview news automatically");
showNews();
}
- Cache.debug("Completed construction of reader.");
+ Console.debug("Completed construction of reader.");
}
MessageManager.getString("label.news_from_jalview"),
bounds.width, bounds.height);
jd.frame.setModalExclusionType(ModalExclusionType.NO_EXCLUDE);
- Cache.debug("Displaying news.");
+ Console.debug("Displaying news.");
jd.waitForInput();
}
}
}
if (chan != null && chan.getItems() != null)
{
- Cache.debug("Scanning news items: newsnew=" + newsnew
+ Console.debug("Scanning news items: newsnew=" + newsnew
+ " and lastDate is " + lastDate);
for (Item i : (List<Item>) chan.getItems())
{
{
String formatted = Cache
.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", lastDate);
- Cache.debug("Saved last read date as " + formatted);
+ Console.debug("Saved last read date as " + formatted);
}
}
}
// this tests the detection of new news based on the last read date stored
// in jalview properties
Cache.loadProperties(null);
- Cache.initLogger();
+ Console.initLogger();
// test will advance read date each time
Calendar today = Calendar.getInstance(),
lastread = Calendar.getInstance();
System.out.println("Set last date to " + formattedDate);
if (me.isNewsNew())
{
- Cache.debug("There is news to read.");
+ Console.debug("There is news to read.");
}
else
{
- Cache.debug("There is no new news.");
+ Console.debug("There is no new news.");
me.xf.setTitle("Testing : Last read is " + me.lastDate);
me.showNews();
me.xf.toFront();
}
- Cache.debug("Waiting for closure.");
+ Console.debug("Waiting for closure.");
do
{
try
if (me.isNewsNew())
{
- Cache.debug("Still new news after reader displayed.");
+ Console.debug("Still new news after reader displayed.");
}
if (lastread.getTime().before(me.lastDate))
{
- Cache.debug("The news was read.");
+ Console.debug("The news was read.");
lastread.setTime(me.lastDate);
}
else
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureRenderer;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.StructureViewerModel;
initChimera();
} catch (Exception ex)
{
- Cache.error("Couldn't open Chimera viewer!", ex);
+ Console.error("Couldn't open Chimera viewer!", ex);
}
}
int num = -1;
oomerror);
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Couldn't open " + pe.getFile() + " in Chimera viewer!",
ex);
} finally
{
- Cache.debug("File locations are " + files);
+ Console.debug("File locations are " + files);
}
}
}
import javax.swing.border.Border;
import javax.swing.text.DefaultCaret;
-import jalview.bin.Cache;
import jalview.log.JLoggerI.LogLevel;
import jalview.log.JLoggerLog4j;
import jalview.log.JalviewAppender;
// logLevelCombo.addItem(LogLevel.ERROR);
// logLevelCombo.addItem(LogLevel.OFF);
// set startingLogLevel
- startingLogLevel = Cache.log == null ? LogLevel.INFO
- : Cache.log.getLevel();
+ startingLogLevel = jalview.bin.Console.log == null ? LogLevel.INFO
+ : jalview.bin.Console.log.getLevel();
setChosenLogLevelCombo();
logLevelCombo.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- if (Cache.log != null)
+ if (jalview.bin.Console.log != null)
{
- Cache.log.setLevel((LogLevel) logLevelCombo.getSelectedItem());
+ jalview.bin.Console.log.setLevel((LogLevel) logLevelCombo.getSelectedItem());
}
}
JalviewAppender jappender = new JalviewAppender(level);
JalviewAppender.setTextArea(textArea);
jappender.start();
- if (Cache.log != null && Cache.log instanceof JLoggerLog4j)
+ if (jalview.bin.Console.log != null && jalview.bin.Console.log instanceof JLoggerLog4j)
{
- JLoggerLog4j.addAppender(Cache.log, jappender);
+ JLoggerLog4j.addAppender(jalview.bin.Console.log, jappender);
}
}
}
else
{
// reset log level to what it was before
- if (Cache.log != null)
+ if (jalview.bin.Console.log != null)
{
- Cache.log.setLevel(startingLogLevel);
+ jalview.bin.Console.log.setLevel(startingLogLevel);
}
unredirectStreams();
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureSettingsModelI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
new OOMWarning("whilst fetching crossreferences", e);
} catch (Throwable e)
{
- Cache.error("Error when finding crossreferences", e);
+ Console.error("Error when finding crossreferences", e);
} finally
{
alignFrame.setProgressBar(MessageManager.formatMessage(
awtAppClassNameField.setAccessible(true);
awtAppClassNameField.set(xToolkit, title);
} else {
- Cache.debug("XToolkit: awtAppClassName not found");
+ jalview.bin.Console.debug("XToolkit: awtAppClassName not found");
}
} catch (Exception e) {
- Cache.debug("Error setting awtAppClassName");
- Cache.trace(Cache.getStackTraceString(e));
+ jalview.bin.Console.debug("Error setting awtAppClassName");
+ jalview.bin.Console.trace(Cache.getStackTraceString(e));
}
}
System.out.println("Cannot set APQHandlers");
// e.printStackTrace();
} catch (Throwable t) {
- Cache.warn("Error setting APQHandlers: " + t.toString());
- Cache.trace(Cache.getStackTraceString(t));
+ jalview.bin.Console.warn("Error setting APQHandlers: " + t.toString());
+ jalview.bin.Console.trace(Cache.getStackTraceString(t));
}
setIconImages(ChannelProperties.getIconList());
new Thread(new Runnable() {
@Override
public void run() {
- Cache.debug("Filechooser init thread started.");
+ jalview.bin.Console.debug("Filechooser init thread started.");
String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
JalviewFileChooser.forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat);
- Cache.debug("Filechooser init thread finished.");
+ jalview.bin.Console.debug("Filechooser init thread finished.");
}
}).start();
// Add the service change listener
@Override
public void propertyChange(PropertyChangeEvent evt) {
- Cache.debug("Firing service changed event for " + evt.getNewValue());
+ jalview.bin.Console.debug("Firing service changed event for " + evt.getNewValue());
JalviewServicesChanged(evt);
}
});
new Thread(new Runnable() {
@Override
public void run() {
- Cache.debug("Starting news thread.");
+ jalview.bin.Console.debug("Starting news thread.");
jvnews = new BlogReader(me);
showNews.setVisible(true);
- Cache.debug("Completed news thread.");
+ jalview.bin.Console.debug("Completed news thread.");
}
}).start();
}
new Thread(new Runnable() {
@Override
public void run() {
- Cache.debug("Downloading data from identifiers.org");
+ jalview.bin.Console.debug("Downloading data from identifiers.org");
try {
UrlDownloadClient.download(IdOrgSettings.getUrl(), IdOrgSettings.getDownloadLocation());
} catch (IOException e) {
- Cache.debug("Exception downloading identifiers.org data" + e.getMessage());
+ jalview.bin.Console.debug("Exception downloading identifiers.org data" + e.getMessage());
}
}
}).start();
}
void showNews(boolean visible) {
- Cache.debug((visible ? "Showing" : "Hiding") + " news.");
+ jalview.bin.Console.debug((visible ? "Showing" : "Hiding") + " news.");
showNews.setSelected(visible);
if (visible && !jvnews.isVisible()) {
new Thread(new Runnable() {
iy = (int) (iy * sh);
ih = (int) (ih * sh);
while (ix >= screenSize.width) {
- Cache.debug("Window geometry location recall error: shifting horizontal to within screenbounds.");
+ jalview.bin.Console.debug("Window geometry location recall error: shifting horizontal to within screenbounds.");
ix -= screenSize.width;
}
while (iy >= screenSize.height) {
- Cache.debug("Window geometry location recall error: shifting vertical to within screenbounds.");
+ jalview.bin.Console.debug("Window geometry location recall error: shifting vertical to within screenbounds.");
iy -= screenSize.height;
}
- Cache.debug("Got last known dimensions for " + windowName + ": x:" + ix + " y:" + iy + " width:" + iw
+ jalview.bin.Console.debug("Got last known dimensions for " + windowName + ": x:" + ix + " y:" + iy + " width:" + iw
+ " height:" + ih);
}
// return dimensions for new instance
frame.requestFocus();
} catch (java.beans.PropertyVetoException ve) {
} catch (java.lang.ClassCastException cex) {
- Cache.warn(
+ jalview.bin.Console.warn(
"Squashed a possible GUI implementation error. If you can recreate this, please look at https://issues.jalview.org/browse/JAL-869",
cex);
}
}
private void storeLastKnownDimensions(String string, Rectangle jc) {
- Cache.debug("Storing last known dimensions for " + string + ": x:" + jc.x + " y:" + jc.y + " width:" + jc.width
+ jalview.bin.Console.debug("Storing last known dimensions for " + string + ": x:" + jc.x + " y:" + jc.y + " width:" + jc.width
+ " height:" + jc.height);
Cache.setProperty(string + "SCREEN_X", jc.x + "");
@Override
protected void garbageCollect_actionPerformed(ActionEvent e) {
// We simply collect the garbage
- Cache.debug("Collecting garbage...");
+ jalview.bin.Console.debug("Collecting garbage...");
System.gc();
- Cache.debug("Finished garbage collection.");
+ jalview.bin.Console.debug("Finished garbage collection.");
}
/*
} catch (OutOfMemoryError oom) {
new OOMWarning("Whilst saving current state to " + chosenFile.getName(), oom);
} catch (Exception ex) {
- Cache.error("Problems whilst trying to save to " + chosenFile.getName(), ex);
+ jalview.bin.Console.error("Problems whilst trying to save to " + chosenFile.getName(), ex);
JvOptionPane.showMessageDialog(me,
MessageManager.formatMessage("label.error_whilst_saving_current_state_to",
new Object[] { chosenFile.getName() }),
} catch (OutOfMemoryError oom) {
new OOMWarning("Whilst loading project from " + choice, oom);
} catch (Exception ex) {
- Cache.error("Problems whilst loading project from " + choice, ex);
+ jalview.bin.Console.error("Problems whilst loading project from " + choice, ex);
JvOptionPane.showMessageDialog(Desktop.desktop,
MessageManager.formatMessage("label.error_whilst_loading_project_from", new Object[] { choice }),
MessageManager.getString("label.couldnt_load_project"), JvOptionPane.WARNING_MESSAGE);
try {
openGroovyConsole();
} catch (Exception ex) {
- Cache.error("Groovy Shell Creation failed.", ex);
+ jalview.bin.Console.error("Groovy Shell Creation failed.", ex);
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.getString("label.couldnt_create_groovy_shell"),
});
}
} else {
- Cache.error("Errors reported by JABA discovery service. Check web services preferences.\n" + ermsg);
+ jalview.bin.Console.error("Errors reported by JABA discovery service. Check web services preferences.\n" + ermsg);
}
}
}
Desktop.showUrl(url);
} catch (Exception x) {
if (url != null) {
- Cache.error("Couldn't handle string " + url + " as a URL.");
+ jalview.bin.Console.error("Couldn't handle string " + url + " as a URL.");
}
// ignore any exceptions due to dud links.
}
try {
SwingUtilities.invokeAndWait(prompter);
} catch (Exception q) {
- Cache.warn("Unexpected Exception in dialog thread.", q);
+ jalview.bin.Console.warn("Unexpected Exception in dialog thread.", q);
}
}
});
@Override
public void exportImage(Graphics g) throws Exception {
paintAll(g);
- Cache.info("Successfully written snapshot to file " + of.getAbsolutePath());
+ jalview.bin.Console.info("Successfully written snapshot to file " + of.getAbsolutePath());
}
};
String title = "View of desktop";
try {
urlFlavour = new DataFlavor("application/x-java-url; class=java.net.URL");
} catch (ClassNotFoundException cfe) {
- Cache.debug("Couldn't instantiate the URL dataflavor.", cfe);
+ jalview.bin.Console.debug("Couldn't instantiate the URL dataflavor.", cfe);
}
if (urlFlavour != null && t.isDataFlavorSupported(urlFlavour)) {
if (url != null) {
protocols.add(DataSourceType.URL);
files.add(url.toString());
- Cache.debug("Drop handled as URL dataflavor " + files.get(files.size() - 1));
+ jalview.bin.Console.debug("Drop handled as URL dataflavor " + files.get(files.size() - 1));
return;
} else {
if (Platform.isAMacAndNotJS()) {
}
}
} catch (Throwable ex) {
- Cache.debug("URL drop handler failed.", ex);
+ jalview.bin.Console.debug("URL drop handler failed.", ex);
}
}
if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
// Works on Windows and MacOSX
- Cache.debug("Drop handled as javaFileListFlavor");
+ jalview.bin.Console.debug("Drop handled as javaFileListFlavor");
for (Object file : (List) t.getTransferData(DataFlavor.javaFileListFlavor)) {
files.add(file);
protocols.add(DataSourceType.FILE);
boolean added = false;
String data = null;
if (t.isDataFlavorSupported(uriListFlavor)) {
- Cache.debug("Drop handled as uriListFlavor");
+ jalview.bin.Console.debug("Drop handled as uriListFlavor");
// This is used by Unix drag system
data = (String) t.getTransferData(uriListFlavor);
}
if (data == null) {
// fallback to text: workaround - on OSX where there's a JVM bug
- Cache.debug("standard URIListFlavor failed. Trying text");
+ jalview.bin.Console.debug("standard URIListFlavor failed. Trying text");
// try text fallback
DataFlavor textDf = new DataFlavor("text/plain;class=java.lang.String");
if (t.isDataFlavorSupported(textDf)) {
data = (String) t.getTransferData(textDf);
}
- Cache.debug("Plain text drop content returned " + (data == null ? "Null - failed" : data));
+ jalview.bin.Console.debug("Plain text drop content returned " + (data == null ? "Null - failed" : data));
}
if (data != null) {
while (protocols.size() < files.size()) {
- Cache.debug("Adding missing FILE protocol for " + files.get(protocols.size()));
+ jalview.bin.Console.debug("Adding missing FILE protocol for " + files.get(protocols.size()));
protocols.add(DataSourceType.FILE);
}
for (java.util.StringTokenizer st = new java.util.StringTokenizer(data, "\r\n"); st.hasMoreTokens();) {
}
}
- if (Cache.isDebugEnabled()) {
+ if (jalview.bin.Console.isDebugEnabled()) {
if (data == null || !added) {
if (t.getTransferDataFlavors() != null && t.getTransferDataFlavors().length > 0) {
- Cache.debug("Couldn't resolve drop data. Here are the supported flavors:");
+ jalview.bin.Console.debug("Couldn't resolve drop data. Here are the supported flavors:");
for (DataFlavor fl : t.getTransferDataFlavors()) {
- Cache.debug("Supported transfer dataflavor: " + fl.toString());
+ jalview.bin.Console.debug("Supported transfer dataflavor: " + fl.toString());
Object df = t.getTransferData(fl);
if (df != null) {
- Cache.debug("Retrieves: " + df);
+ jalview.bin.Console.debug("Retrieves: " + df);
} else {
- Cache.debug("Retrieved nothing");
+ jalview.bin.Console.debug("Retrieved nothing");
}
}
} else {
- Cache.debug("Couldn't resolve dataflavor for drop: " + t.toString());
+ jalview.bin.Console.debug("Couldn't resolve dataflavor for drop: " + t.toString());
}
}
}
}
if (Platform.isWindowsAndNotJS()) {
- Cache.debug("Scanning dropped content for Windows Link Files");
+ jalview.bin.Console.debug("Scanning dropped content for Windows Link Files");
// resolve any .lnk files in the file drop
for (int f = 0; f < files.size(); f++) {
Object obj = files.get(f);
File lf = (obj instanceof File ? (File) obj : new File((String) obj));
// process link file to get a URL
- Cache.debug("Found potential link file: " + lf);
+ jalview.bin.Console.debug("Found potential link file: " + lf);
WindowsShortcut wscfile = new WindowsShortcut(lf);
String fullname = wscfile.getRealFilename();
protocols.set(f, FormatAdapter.checkProtocol(fullname));
files.set(f, fullname);
- Cache.debug("Parsed real filename " + fullname + " to extract protocol: " + protocols.get(f));
+ jalview.bin.Console.debug("Parsed real filename " + fullname + " to extract protocol: " + protocols.get(f));
} catch (Exception ex) {
- Cache.error("Couldn't parse " + files.get(f) + " as a link file.", ex);
+ jalview.bin.Console.error("Couldn't parse " + files.get(f) + " as a link file.", ex);
}
}
}
AffineTransform t = gg.getTransform();
double scaleX = t.getScaleX();
double scaleY = t.getScaleY();
- Cache.debug(debugScaleMessage + scaleX + " (X)");
- Cache.debug(debugScaleMessage + scaleY + " (Y)");
+ jalview.bin.Console.debug(debugScaleMessage + scaleX + " (X)");
+ jalview.bin.Console.debug(debugScaleMessage + scaleY + " (Y)");
debugScaleMessageDone = true;
} else {
- Cache.debug("Desktop graphics null");
+ jalview.bin.Console.debug("Desktop graphics null");
}
} catch (Exception e) {
- Cache.debug(Cache.getStackTraceString(e));
+ jalview.bin.Console.debug(Cache.getStackTraceString(e));
}
}
}
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureColourI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.GraphLine;
import jalview.datamodel.features.FeatureAttributes;
import jalview.datamodel.features.FeatureAttributes.Datatype;
attName = (String) attCombo.getSelectedItem();
} catch (Exception e)
{
- Cache.error("Problem casting Combo box entry to String");
+ Console.error("Problem casting Combo box entry to String");
attName = attCombo.getSelectedItem().toString();
}
Condition cond = (Condition) condCombo.getSelectedItem();
*/
package jalview.gui;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.MessageManager;
import java.awt.Component;
desktop = instance;
if (oomex != null)
{
- Cache.error("Out of Memory when " + action,
+ Console.error("Out of Memory when " + action,
oomex);
}
javax.swing.SwingUtilities.invokeLater(this);
import jalview.api.AlignViewportI;
import jalview.api.analysis.ScoreModelI;
import jalview.api.analysis.SimilarityParamsI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
// JAL-2647 disabled after load from project (until save to project done)
if (getPcaModel().getInputData() == null)
{
- Cache.info(
+ Console.info(
"Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action.");
return;
}
import jalview.analysis.AlignmentUtils;
import jalview.analysis.Conservation;
import jalview.api.AlignViewportI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.ChangeCaseCommand;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
urlLink = new UrlLink(link);
} catch (Exception foo)
{
- Cache.error("Exception for URLLink '" + link + "'", foo);
+ Console.error("Exception for URLLink '" + link + "'", foo);
continue;
}
if (!urlLink.isValid())
{
- Cache.error(urlLink.getInvalidMessage());
+ Console.error(urlLink.getInvalidMessage());
continue;
}
urlLink = new GroupUrlLink(link);
} catch (Exception foo)
{
- Cache.error("Exception for GroupURLLink '" + link + "'", foo);
+ Console.error("Exception for GroupURLLink '" + link + "'", foo);
continue;
}
if (!urlLink.isValid())
{
- Cache.error(urlLink.getInvalidMessage());
+ Console.error(urlLink.getInvalidMessage());
continue;
}
final String label = urlLink.getLabel();
import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.bin.MemorySetting;
import jalview.ext.pymol.PymolManager;
import jalview.gui.Help.HelpId;
}
} catch (IllegalArgumentException e)
{
- Cache.error("Unknown structure viewer type: " + viewerType
+ Console.error("Unknown structure viewer type: " + viewerType
+ ", defaulting to Jmol");
type = ViewerType.JMOL;
}
}
} catch (IllegalArgumentException x)
{
- Cache.error("Failed to set path - unknown viewer type",x);
+ Console.error("Failed to set path - unknown viewer type",x);
}
}
}
proxyType.setSelected(customProxy.getModel(), true);
break;
default:
- Cache.warn(
+ Console.warn(
"Incorrect PROXY_TYPE - should be 'none' (clear proxy properties), 'false' (system settings), 'true' (custom settings): "
+ proxyTypeString);
}
if (index == -1)
{
// button no longer enabled if row is not selected
- Cache.debug("Edit with no row selected in linkUrlTable");
+ Console.debug("Edit with no row selected in linkUrlTable");
return;
}
if (index == -1)
{
// button no longer enabled if row is not selected
- Cache.debug("Delete with no row selected in linkUrlTable");
+ Console.debug("Delete with no row selected in linkUrlTable");
return;
}
else
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Console;
import java.awt.Component;
if (lastq == null)
{
raiseDialog();
- Cache.debug("Got user response.");
+ Console.debug("Got user response.");
}
lastq = Cache.getProperty(property);
String extype = "";
// report any exceptions
if (e != null)
{
- Cache.warn("Unexpected exception when executing the " + extype
+ Console.warn("Unexpected exception when executing the " + extype
+ " runnable for property " + property, e);
}
}
*/
private void raiseDialog()
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Prompting user for " + dialogTitle
+ Console.debug("Prompting user for " + dialogTitle
+ " for Cache property " + property);
}
try
JvOptionPane.QUESTION_MESSAGE);
// and finish parsing the result
- Cache.debug("Got response : " + reply);
+ Console.debug("Got response : " + reply);
if (reply == JvOptionPane.YES_OPTION)
{
Cache.setProperty(property, "true");
}
else
{
- Cache.debug("User cancelled setting " + property);
+ Console.debug("User cancelled setting " + property);
return;
}
// verify the property is set for debugging
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("User set property to "
+ Console.debug("User set property to "
+ Cache.getProperty(property));
}
} catch (Exception e)
{
- Cache.warn(
+ Console.warn(
"Unexpected exception when prompting user for yes/no setting for property "
+ property,
e);
import java.util.Map;
import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.ext.pymol.PymolCommands;
}
else
{
- Cache.error("Failed to launch PyMOL!");
+ Console.error("Failed to launch PyMOL!");
}
return pymol != null;
}
// pdbId.replace('-', 0)
} catch (Exception x)
{
- Cache.error("Unxpected encoding exception for '"+pdbId+"'",x);
+ Console.error("Unxpected encoding exception for '"+pdbId+"'",x);
}
cmd.addParameter(pdbId);
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureRenderer;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.StructureViewerModel;
initPymol();
} catch (Exception ex)
{
- Cache.error("Couldn't open PyMOL viewer!", ex);
+ Console.error("Couldn't open PyMOL viewer!", ex);
}
}
int num = -1;
binding.stashFoundChains(pdb, pe.getFile());
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Couldn't open " + pe.getFile() + " in Chimera viewer!",
ex);
} finally
boolean opened = binding.openSession(pymolSessionFile);
if (!opened)
{
- Cache.error(
+ Console.error(
"An error occurred opening PyMOL session file "
+ pymolSessionFile);
}
import javax.swing.ToolTipManager;
import jalview.api.AlignViewportI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
import jalview.commands.EditCommand.Edit;
{
if (av.getAlignment() == null)
{
- Cache.warn("alignviewport av SeqSetId=" + av.getSequenceSetId()
+ Console.warn("alignviewport av SeqSetId=" + av.getSequenceSetId()
+ " ViewId=" + av.getViewId()
+ " 's alignment is NULL! returning immediately.");
return;
import jalview.api.FeatureSettingsModelI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
}
} catch (Exception e)
{
- Cache.info("Error retrieving " + accession + " from "
+ Console.info("Error retrieving " + accession + " from "
+ proxy.getDbName(), e);
}
return success;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.StructureViewerModel;
}
else
{
- Cache.error(UNKNOWN_VIEWER_TYPE + getViewerType().toString());
+ Console.error(UNKNOWN_VIEWER_TYPE + getViewerType().toString());
}
return sview;
}
}
else
{
- Cache.error(UNKNOWN_VIEWER_TYPE + getViewerType().toString());
+ Console.error(UNKNOWN_VIEWER_TYPE + getViewerType().toString());
}
return sview;
}
viewer = new PymolViewer(viewerData, alignPanel, sessionFile, vid);
break;
default:
- Cache.error(UNKNOWN_VIEWER_TYPE + type.toString());
+ Console.error(UNKNOWN_VIEWER_TYPE + type.toString());
}
return viewer;
}
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
{
sp.append("'" + alignPanel.getViewName() + "' ");
}
- Cache.info("Couldn't align structures with the " + sp.toString()
+ Console.info("Couldn't align structures with the " + sp.toString()
+ "associated alignment panels.", e);
}
return reply;
import jalview.api.analysis.ScoreModelI;
import jalview.api.analysis.SimilarityParamsI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.CommandI;
import jalview.commands.OrderCommand;
import jalview.datamodel.Alignment;
AlignmentView originalData = tree.getOriginalData();
if (originalData == null)
{
- Cache.info(
+ Console.info(
"Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action.");
return;
}
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.MessageManager;
import java.io.BufferedReader;
{
if (url.indexOf("questionnaire.pl") == -1)
{
- Cache.error("'" + url
+ Console.error("'" + url
+ "' is an Invalid URL for the checkForQuestionnaire() method.\n"
+ "This argument is only for questionnaires derived from jalview's questionnaire.pl cgi interface.");
}
private boolean checkresponse(URL qurl) throws Exception
{
- Cache.debug("Checking Response for : " + qurl);
+ Console.debug("Checking Response for : " + qurl);
boolean prompt = false;
// see if we have already responsed to this questionnaire or get a new
// qid/rid pair
{
String qurl = url + (url.indexOf('?') > -1 ? "&" : "?") + "qid="
+ qid + "&rid=" + rid;
- Cache.info("Prompting user for questionnaire at " + qurl);
+ Console.info("Prompting user for questionnaire at " + qurl);
int reply = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
MessageManager.getString("label.jalview_new_questionnaire"),
MessageManager.getString("label.jalview_user_survey"),
if (reply == JvOptionPane.YES_OPTION)
{
- Cache.debug("Opening " + qurl);
+ Console.debug("Opening " + qurl);
jalview.util.BrowserLauncher.openURL(qurl);
}
}
} catch (Exception e)
{
- Cache.warn("When trying to access questionnaire URL " + url, e);
+ Console.warn("When trying to access questionnaire URL " + url, e);
}
}
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
} catch (Exception e)
{
- Cache.error("Couldn't instantiate vamsas client !",
+ Console.error("Couldn't instantiate vamsas client !",
e);
return false;
}
}
} catch (Error e)
{
- Cache.warn(
+ Console.warn(
"Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
e);
} catch (Exception e)
{
- Cache.warn(
+ Console.warn(
"Probable VAMSAS client incompatibility - carrying on regardless",
e);
}
addStoreDocumentHandler();
startSession();
inInitialUpdate = true;
- Cache.debug(
+ Console.debug(
"Jalview loading the Vamsas Session for the first time.");
dealWithDocumentUpdate(false); // we don't push an update out to the
inInitialUpdate = false;
// document yet.
- Cache.debug("... finished update for the first time.");
+ Console.debug("... finished update for the first time.");
}
/**
}
} catch (Exception e)
{
- Cache.warn(
+ Console.warn(
"Exception whilst refreshing jalview windows after a vamsas document update.",
e);
}
@Override
public void run()
{
- Cache.info("Jalview updating to the Vamsas Session.");
+ Console.info("Jalview updating to the Vamsas Session.");
dealWithDocumentUpdate(true);
- Cache.info("Jalview finished updating to the Vamsas Session.");
+ Console.info("Jalview finished updating to the Vamsas Session.");
}
});
{
throw new Error("Jalview not connected to Vamsas session");
}
- Cache.info("Jalview disconnecting from the Vamsas Session.");
+ Console.info("Jalview disconnecting from the Vamsas Session.");
try
{
if (joinedSession)
boolean ourprompt = this.promptUser;
this.promptUser = promptUser;
vclient.finalizeClient();
- Cache.info("Jalview has left the session.");
+ Console.info("Jalview has left the session.");
this.promptUser = ourprompt; // restore default value
}
else
{
- Cache.warn(
+ Console.warn(
"JV Client leaving a session that's its not joined yet.");
}
joinedSession = false;
vobj2jv = null;
} catch (Exception e)
{
- Cache.error("Vamsas Session finalization threw exceptions!", e);
+ Console.error("Vamsas Session finalization threw exceptions!", e);
}
}
public void updateJalview(IClientDocument cdoc)
{
- Cache.debug("Jalview updating from sesion document ..");
+ Console.debug("Jalview updating from sesion document ..");
ensureJvVamsas();
VamsasAppDatastore vds = new VamsasAppDatastore(cdoc, vobj2jv, jv2vobj,
baseProvEntry(), alRedoState);
vds.updateToJalview();
} catch (Exception e)
{
- Cache.error("Failed to update Jalview from vamsas document.", e);
+ Console.error("Failed to update Jalview from vamsas document.", e);
}
try
{
}
} catch (Exception e)
{
- Cache.error(
+ Console.error(
"Exception when updating Jalview settings from Appdata.", e);
}
- Cache.debug(".. finished updating from sesion document.");
+ Console.debug(".. finished updating from sesion document.");
}
} catch (Exception e)
{
errorsDuringUpdate = true;
- Cache.error("Exception synchronizing " + af.getTitle()
+ Console.error("Exception synchronizing " + af.getTitle()
+ " "
+ (af.getViewport().getViewName() == null ? ""
: " view " + af.getViewport().getViewName())
}
} catch (Exception e)
{
- Cache.error("Exception synchronizing Views to Document :", e);
+ Console.error("Exception synchronizing Views to Document :", e);
errorsDuringUpdate = true;
}
}
} catch (Exception e)
{
- Cache.error("Client Appdata Write exception", e);
+ Console.error("Client Appdata Write exception", e);
errorsDuringAppUpdate = true;
}
vds.clearSkipList();
{
int storedviews = 0;
// called by update handler for document update.
- Cache.debug("Updating jalview from changed vamsas document.");
+ Console.debug("Updating jalview from changed vamsas document.");
disableGui(true);
try
{
long time = System.currentTimeMillis();
IClientDocument cdoc = vclient.getClientDocument();
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Time taken to get ClientDocument = "
+ Console.debug("Time taken to get ClientDocument = "
+ (System.currentTimeMillis() - time));
time = System.currentTimeMillis();
}
if (fromJalview)
{
storedviews += updateVamsasDocument(cdoc);
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Time taken to update Vamsas Document from jalview\t= "
+ (System.currentTimeMillis() - time));
time = System.currentTimeMillis();
}
cdoc.setVamsasRoots(cdoc.getVamsasRoots());
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Time taken to set Document Roots\t\t= "
+ Console.debug("Time taken to set Document Roots\t\t= "
+ (System.currentTimeMillis() - time));
time = System.currentTimeMillis();
}
else
{
updateJalview(cdoc);
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Time taken to update Jalview from vamsas document Roots\t= "
+ (System.currentTimeMillis() - time));
time = System.currentTimeMillis();
}
vclient.updateDocument(cdoc);
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Time taken to update Session Document\t= "
+ Console.debug("Time taken to update Session Document\t= "
+ (System.currentTimeMillis() - time));
time = System.currentTimeMillis();
}
recover_objectMappingBackup();
storedviews = 0;
}
- Cache.debug("Finished updating from document change.");
+ Console.debug("Finished updating from document change.");
disableGui(false);
return storedviews;
}
@Override
public void propertyChange(PropertyChangeEvent evt)
{
- Cache.debug("Dealing with document update event.");
+ Console.debug("Dealing with document update event.");
client.dealWithDocumentUpdate(false);
- Cache.debug("finished dealing with event.");
+ Console.debug("finished dealing with event.");
}
});
- Cache.debug("Added Jalview handler for vamsas document updates.");
+ Console.debug("Added Jalview handler for vamsas document updates.");
}
private void addStoreDocumentHandler()
{
if (client.promptUser)
{
- Cache.debug(
+ Console.debug(
"Asking user if the vamsas session should be stored.");
int reply = JvOptionPane.showInternalConfirmDialog(
Desktop.desktop,
if (reply == JvOptionPane.YES_OPTION)
{
- Cache.debug("Prompting for vamsas store filename.");
+ Console.debug("Prompting for vamsas store filename.");
Desktop.instance.vamsasSave_actionPerformed(null);
- Cache.debug("Finished attempt at storing document.");
+ Console.debug("Finished attempt at storing document.");
}
- Cache.debug(
+ Console.debug(
"finished dealing with REQUESTTOCLOSE event.");
}
else
{
- Cache.debug(
+ Console.debug(
"Ignoring store document request (promptUser==false)");
}
}
});
- Cache.debug("Added Jalview handler for vamsas document updates.");
+ Console.debug("Added Jalview handler for vamsas document updates.");
}
public void disableGui(boolean b)
} catch (Exception e)
{
// Complain to GUI
- Cache.error("Failed to join vamsas session.", e);
+ Console.error("Failed to join vamsas session.", e);
vclient = null;
}
try
{
if (vobj2jv == null)
{
- Cache.warn(
+ Console.warn(
"Selection listener still active for dead session.");
// not in a session.
return;
if (sm != null)
{
sm.validate(); // debug
- Cache.debug("Selection Message\n" + sm.getRawMessage());
+ Console.debug("Selection Message\n" + sm.getRawMessage());
pm.sendMessage(sm);
}
}
ssm.addSelectionListener(selecter);
} catch (Exception e)
{
- Cache.error("Failed to init Vamsas Picking", e);
+ Console.error("Failed to init Vamsas Picking", e);
}
}
}
import compbio.metadata.Preset;
import compbio.metadata.PresetManager;
import compbio.metadata.RunnerConfig;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.OptsAndParamsPage.OptionBox;
import jalview.gui.OptsAndParamsPage.ParamBox;
import jalview.util.MessageManager;
if (e.getSource() == setName && e.getStateChange() == e.SELECTED)
{
final String setname = (String) setName.getSelectedItem();
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Item state changed for " + setname
+ Console.debug("Item state changed for " + setname
+ " (handling ? " + !settingDialog + ")");
}
if (settingDialog)
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
import jalview.util.MessageManager;
}
} catch (IOException e)
{
- Cache.info("Failed to parse parameter file " + pfile
+ Console.info("Failed to parse parameter file " + pfile
+ " (Check that all JALVIEW_WSPARAMFILES entries are valid!)",
e);
}
{
if (filename != null && !((outfile = new File(filename)).canWrite()))
{
- Cache.warn("Can't write to " + filename
+ Console.warn("Can't write to " + filename
+ " - Prompting for new file to write to.");
filename = null;
}
parameterSet.setSourceFile(filename);
} catch (Exception e)
{
- Cache.error("Couldn't write parameter file to " + outfile, e);
+ Console.error("Couldn't write parameter file to " + outfile, e);
}
}
}
}
} catch (Exception e)
{
- Cache.error(
+ Console.error(
"Exception when trying to delete webservice user preset: ",
e);
}
import javax.swing.JTable;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.PDBEntry;
pdbEntry.setType(PDBEntry.Type.valueOf(strucFormat));
} catch (Exception q)
{
- Cache.warn("Unknown filetype for 3D Beacons Model from: "
+ Console.warn("Unknown filetype for 3D Beacons Model from: "
+ strucFormat + " - " + pdbIdStr + " - " + modelPage);
}
import java.util.TreeMap;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.Desktop;
import jalview.gui.JvOptionPane;
import jalview.util.MessageManager;
{
String tempfilename = file.getName();
File tempdir = file.getParentFile();
- Cache.trace(
+ Console.trace(
"BACKUPFILES [file!=null] attempting to create temp file for "
+ tempfilename + " in dir " + tempdir);
temp = File.createTempFile(tempfilename,
TEMP_FILE_EXT + newTempFileSuffix, tempdir);
- Cache.debug(
+ Console.debug(
"BACKUPFILES using temp file " + temp.getAbsolutePath());
}
else
{
- Cache.trace(
+ Console.trace(
"BACKUPFILES [file==null] attempting to create default temp file "
+ DEFAULT_TEMP_FILE + " with extension "
+ TEMP_FILE_EXT);
}
} catch (IOException e)
{
- Cache.error("Could not create temp file to save to (IOException)");
- Cache.error(e.getMessage());
- Cache.debug(Cache.getStackTraceString(e));
+ Console.error("Could not create temp file to save to (IOException)");
+ Console.error(e.getMessage());
+ Console.debug(Cache.getStackTraceString(e));
} catch (Exception e)
{
- Cache.error("Exception creating temp file for saving");
- Cache.debug(Cache.getStackTraceString(e));
+ Console.error("Exception creating temp file for saving");
+ Console.debug(Cache.getStackTraceString(e));
}
this.setTempFile(temp);
}
public static void classInit()
{
- Cache.initLogger();
- Cache.trace("BACKUPFILES classInit");
+ Console.initLogger();
+ Console.trace("BACKUPFILES classInit");
boolean e = Cache.getDefault(ENABLED, !Platform.isJS());
setEnabled(e);
- Cache.trace("BACKUPFILES " + (e ? "enabled" : "disabled"));
+ Console.trace("BACKUPFILES " + (e ? "enabled" : "disabled"));
BackupFilesPresetEntry bfpe = BackupFilesPresetEntry
.getSavedBackupEntry();
- Cache.trace("BACKUPFILES preset scheme " + bfpe.toString());
+ Console.trace("BACKUPFILES preset scheme " + bfpe.toString());
setConfirmDelete(bfpe.confirmDelete);
- Cache.trace("BACKUPFILES confirm delete " + bfpe.confirmDelete);
+ Console.trace("BACKUPFILES confirm delete " + bfpe.confirmDelete);
}
public static void setEnabled(boolean flag)
path = this.getTempFile().getCanonicalPath();
} catch (IOException e)
{
- Cache.error("IOException when getting Canonical Path of temp file '"
+ Console.error("IOException when getting Canonical Path of temp file '"
+ this.getTempFile().getName() + "'");
- Cache.debug(Cache.getStackTraceString(e));
+ Console.debug(Cache.getStackTraceString(e));
}
return path;
}
|| suffix.length() == 0)
{
// nothing to do
- Cache.debug("BACKUPFILES rollBackupFiles nothing to do." + ", "
+ Console.debug("BACKUPFILES rollBackupFiles nothing to do." + ", "
+ "filename: " + (file != null ? file.getName() : "null")
+ ", " + "file exists: " + file.exists() + ", " + "enabled: "
+ enabled + ", " + "max: " + max + ", " + "suffix: '" + suffix
return true;
}
- Cache.trace("BACKUPFILES rollBackupFiles starting");
+ Console.trace("BACKUPFILES rollBackupFiles starting");
String dir = "";
File dirFile;
{
dirFile = file.getParentFile();
dir = dirFile.getCanonicalPath();
- Cache.trace("BACKUPFILES dir: " + dir);
+ Console.trace("BACKUPFILES dir: " + dir);
} catch (Exception e)
{
- Cache.error("Could not get canonical path for file '" + file + "'");
- Cache.error(e.getMessage());
- Cache.debug(Cache.getStackTraceString(e));
+ Console.error("Could not get canonical path for file '" + file + "'");
+ Console.error(e.getMessage());
+ Console.debug(Cache.getStackTraceString(e));
return false;
}
String filename = file.getName();
String basename = filename;
- Cache.trace("BACKUPFILES filename is " + filename);
+ Console.trace("BACKUPFILES filename is " + filename);
boolean ret = true;
// Create/move backups up one
File[] backupFiles = dirFile.listFiles(bff);
int nextIndexNum = 0;
- Cache.trace("BACKUPFILES backupFiles.length: " + backupFiles.length);
+ Console.trace("BACKUPFILES backupFiles.length: " + backupFiles.length);
if (backupFiles.length == 0)
{
// No other backup files. Just need to move existing file to backupfile_1
- Cache.trace(
+ Console.trace(
"BACKUPFILES no existing backup files, setting index to 1");
nextIndexNum = 1;
}
if (reverseOrder)
{
// backup style numbering
- Cache.trace("BACKUPFILES rolling files in reverse order");
+ Console.trace("BACKUPFILES rolling files in reverse order");
int tempMax = noMax ? -1 : max;
// noMax == true means no limits
// no "oldest" file to delete
previousFile = backupfile_n;
fileToBeDeleted = null;
- Cache.trace("BACKUPFILES No oldest file to delete");
+ Console.trace("BACKUPFILES No oldest file to delete");
continue;
}
File replacementFile = backupfile_n;
long fileToBeDeletedLMT = fileToBeDeleted.lastModified();
long replacementFileLMT = replacementFile.lastModified();
- Cache.trace("BACKUPFILES fileToBeDeleted is "
+ Console.trace("BACKUPFILES fileToBeDeleted is "
+ fileToBeDeleted.getAbsolutePath());
- Cache.trace("BACKUPFILES replacementFile is "
+ Console.trace("BACKUPFILES replacementFile is "
+ backupfile_n.getAbsolutePath());
try
.format(fileToBeDeletedLMT);
String replacementFileLMTString = sdf
.format(replacementFileLMT);
- Cache.warn("WARNING! I am set to delete backupfile "
+ Console.warn("WARNING! I am set to delete backupfile "
+ fileToBeDeleted.getName()
+ " has modification time "
+ fileToBeDeletedLMTString
boolean delete = confirmNewerDeleteFile(fileToBeDeleted,
replacementFile, true);
- Cache.trace("BACKUPFILES " + (delete ? "confirmed" : "not")
+ Console.trace("BACKUPFILES " + (delete ? "confirmed" : "not")
+ " deleting file "
+ fileToBeDeleted.getAbsolutePath()
+ " which is newer than "
}
else
{
- Cache.debug("BACKUPFILES moving "
+ Console.debug("BACKUPFILES moving "
+ fileToBeDeleted.getAbsolutePath() + " to "
+ oldestTempFile.getAbsolutePath());
moveFileToFile(fileToBeDeleted, oldestTempFile);
}
else
{
- Cache.debug("BACKUPFILES going to move "
+ Console.debug("BACKUPFILES going to move "
+ fileToBeDeleted.getAbsolutePath() + " to "
+ oldestTempFile.getAbsolutePath());
moveFileToFile(fileToBeDeleted, oldestTempFile);
} catch (Exception e)
{
- Cache.error(
+ Console.error(
"Error occurred, probably making new temp file for '"
+ fileToBeDeleted.getName() + "'");
- Cache.error(Cache.getStackTraceString(e));
+ Console.error(Cache.getStackTraceString(e));
}
// reset
}
bfsb.append(backupFiles[i].getName());
}
- Cache.trace("BACKUPFILES backupFiles: " + bfsb.toString());
+ Console.trace("BACKUPFILES backupFiles: " + bfsb.toString());
// noMax == true means keep all backup files
if ((!noMax) && bfTreeMap.size() >= max)
{
- Cache.trace("BACKUPFILES noMax: " + noMax + ", " + "max: " + max
+ Console.trace("BACKUPFILES noMax: " + noMax + ", " + "max: " + max
+ ", " + "bfTreeMap.size(): " + bfTreeMap.size());
// need to delete some files to keep number of backups to designated
// max.
int numToDelete = suffix.indexOf(NUM_PLACEHOLDER) > -1
? bfTreeMap.size() - max + 1
: 0;
- Cache.trace("BACKUPFILES numToDelete: " + numToDelete);
+ Console.trace("BACKUPFILES numToDelete: " + numToDelete);
// the "replacement" file is the latest backup file being kept (it's
// not replacing though)
File replacementFile = numToDelete < backupFiles.length
File fileToBeDeleted = backupFiles[i];
boolean delete = true;
- Cache.trace("BACKUPFILES fileToBeDeleted: " + fileToBeDeleted);
+ Console.trace("BACKUPFILES fileToBeDeleted: " + fileToBeDeleted);
boolean newer = false;
if (replacementFile != null)
String replacementFileLMTString = sdf
.format(replacementFileLMT);
- Cache.warn("WARNING! I am set to delete backupfile '"
+ Console.warn("WARNING! I am set to delete backupfile '"
+ fileToBeDeleted.getName()
+ "' has modification time "
+ fileToBeDeletedLMTString
{
// User has confirmed delete -- no need to add it to the list
fileToBeDeleted.delete();
- Cache.debug("BACKUPFILES deleting fileToBeDeleted: "
+ Console.debug("BACKUPFILES deleting fileToBeDeleted: "
+ fileToBeDeleted);
delete = false;
}
else
{
// keeping file, nothing to do!
- Cache.debug("BACKUPFILES keeping fileToBeDeleted: "
+ Console.debug("BACKUPFILES keeping fileToBeDeleted: "
+ fileToBeDeleted);
}
}
if (delete)
{
addDeleteFile(fileToBeDeleted);
- Cache.debug("BACKUPFILES addDeleteFile(fileToBeDeleted): "
+ Console.debug("BACKUPFILES addDeleteFile(fileToBeDeleted): "
+ fileToBeDeleted);
}
String latestBackupFilename = dir + File.separatorChar
+ BackupFilenameParts.getBackupFilename(nextIndexNum, basename,
suffix, digits);
- Cache.trace("BACKUPFILES Moving old file [" + file
+ Console.trace("BACKUPFILES Moving old file [" + file
+ "] to latestBackupFilename [" + latestBackupFilename + "]");
// using boolean '&' instead of '&&' as don't want moveFileToFile attempt to
// be conditional (short-circuit)
ret = ret & moveFileToFile(file, new File(latestBackupFilename));
- Cache.debug("BACKUPFILES moving " + file + " to " + latestBackupFilename
+ Console.debug("BACKUPFILES moving " + file + " to " + latestBackupFilename
+ " was " + (ret ? "" : "NOT ") + "successful");
if (tidyUp)
{
- Cache.debug("BACKUPFILES tidying up files");
+ Console.debug("BACKUPFILES tidying up files");
tidyUpFiles();
}
saveFile = nextTempFile(ftbd.getName(), ftbd.getParentFile());
} catch (Exception e)
{
- Cache.error(
+ Console.error(
"Error when confirming to keep backup file newer than other backup files.");
e.printStackTrace();
}
for (int i = 0; i < deleteFiles.size(); i++)
{
File fileToDelete = deleteFiles.get(i);
- Cache.trace("BACKUPFILES about to delete fileToDelete:"
+ Console.trace("BACKUPFILES about to delete fileToDelete:"
+ fileToDelete);
fileToDelete.delete();
- Cache.warn("deleted '" + fileToDelete.getName() + "'");
+ Console.warn("deleted '" + fileToDelete.getName() + "'");
}
}
dirFile = file.getParentFile();
} catch (Exception e)
{
- Cache.error("Could not get canonical path for file '" + file + "'");
+ Console.error("Could not get canonical path for file '" + file + "'");
return new TreeMap<>();
}
int pos = deleteFiles.indexOf(fileToBeDeleted);
if (pos > -1)
{
- Cache.debug("BACKUPFILES not adding file "
+ Console.debug("BACKUPFILES not adding file "
+ fileToBeDeleted.getAbsolutePath()
+ " to the delete list (already at index" + pos + ")");
return true;
}
else
{
- Cache.debug("BACKUPFILES adding file "
+ Console.debug("BACKUPFILES adding file "
+ fileToBeDeleted.getAbsolutePath() + " to the delete list");
deleteFiles.add(fileToBeDeleted);
}
public static boolean moveFileToFile(File oldFile, File newFile)
{
- Cache.initLogger();
+ Console.initLogger();
boolean ret = false;
Path oldPath = Paths.get(oldFile.getAbsolutePath());
Path newPath = Paths.get(newFile.getAbsolutePath());
try
{
// delete destination file - not usually necessary but Just In Case...
- Cache.trace("BACKUPFILES deleting " + newFile.getAbsolutePath());
+ Console.trace("BACKUPFILES deleting " + newFile.getAbsolutePath());
newFile.delete();
- Cache.trace("BACKUPFILES moving " + oldFile.getAbsolutePath() + " to "
+ Console.trace("BACKUPFILES moving " + oldFile.getAbsolutePath() + " to "
+ newFile.getAbsolutePath());
Files.move(oldPath, newPath, StandardCopyOption.REPLACE_EXISTING);
ret = true;
- Cache.trace("BACKUPFILES move seems to have succeeded");
+ Console.trace("BACKUPFILES move seems to have succeeded");
} catch (IOException e)
{
- Cache.warn("Could not move file '" + oldPath.toString() + "' to '"
+ Console.warn("Could not move file '" + oldPath.toString() + "' to '"
+ newPath.toString() + "'");
- Cache.error(e.getMessage());
- Cache.debug(Cache.getStackTraceString(e));
+ Console.error(e.getMessage());
+ Console.debug(Cache.getStackTraceString(e));
ret = false;
} catch (Exception e)
{
- Cache.error(e.getMessage());
- Cache.debug(Cache.getStackTraceString(e));
+ Console.error(e.getMessage());
+ Console.debug(Cache.getStackTraceString(e));
ret = false;
}
return ret;
import java.util.StringTokenizer;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.MessageManager;
public class BackupFilesPresetEntry
confirmDelete = Boolean.valueOf(st.nextToken());
} catch (Exception e)
{
- Cache.error("Error parsing backupfiles scheme '" + line + "'");
+ Console.error("Error parsing backupfiles scheme '" + line + "'");
}
return new BackupFilesPresetEntry(suffix, digits, reverse, keepAll,
import java.util.Map.Entry;
import java.util.TreeMap;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.FeatureProperties;
int slashPos = line.indexOf('/');
if (slashPos == -1)
{
- Cache.error("Unexpected EMBL line ignored: " + line);
+ Console.error("Unexpected EMBL line ignored: " + line);
line = nextLine();
continue;
}
data.codonStart = Integer.parseInt(featureValue.trim());
} catch (NumberFormatException e)
{
- Cache.error("Invalid codon_start in XML for " + this.accession
+ Console.error("Invalid codon_start in XML for " + this.accession
+ ": " + e.getMessage());
}
}
}
else
{
- Cache.error("Ignoring CDS feature with no protein_id for "
+ Console.error("Ignoring CDS feature with no protein_id for "
+ sourceDb + ":" + accession);
}
{
if (this.accession == null || this.sequenceString == null)
{
- Cache.error("Failed to parse data from EMBL");
+ Console.error("Failed to parse data from EMBL");
return;
}
* workaround until we handle all 'location' formats fully
* e.g. X53828.1:60..1058 or <123..>289
*/
- Cache.error(String.format(
+ Console.error(String.format(
"Implementation Notice: EMBLCDS location '%s'not properly supported yet"
+ " - Making up the CDNA region of (%s:%s)... may be incorrect",
data.cdsLocation, sourceDb, this.accession));
if (peptideLength * 3 == completeCodonsLength)
{
// this might occur for CDS sequences where no features are marked
- Cache.warn("Assuming no stop codon at end of cDNA fragment");
+ Console.warn("Assuming no stop codon at end of cDNA fragment");
mappedDnaEnd = dna.getEnd();
}
else if ((peptideLength + 1) * 3 == completeCodonsLength)
{
- Cache.warn("Assuming stop codon at end of cDNA fragment");
+ Console.warn("Assuming stop codon at end of cDNA fragment");
mappedDnaEnd = dna.getEnd() - 3;
}
return MappingUtils.rangeListToArray(ranges);
} catch (ParseException e)
{
- Cache.warn(
+ Console.warn(
String.format("Not parsing inexact CDS location %s in ENA %s",
location, accession));
return new int[] {};
String[] tokens = line.split(WHITESPACE);
if (tokens.length < 2)
{
- Cache.error("Ignoring bad EMBL line for " + this.accession
+ Console.error("Ignoring bad EMBL line for " + this.accession
+ ": " + line);
break;
}
import java.io.IOException;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.util.DBRefUtils;
this.length = Integer.valueOf(bits[0]);
} catch (NumberFormatException e)
{
- Cache.error("bad length read in flatfile, line: " + line);
+ Console.error("bad length read in flatfile, line: " + line);
}
}
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureSettingsModelI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.MessageManager;
import jalview.util.Platform;
{
if (!input.markSupported())
{
- Cache.error(
+ Console.error(
"FileParse.izGzipStream: input stream must support mark/reset");
return false;
}
*/
package jalview.io;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.GraphLine;
Vobject obj = getjv2vObj(seqsetidobj);
if (obj != null && !(obj instanceof Alignment))
{
- Cache.warn(
+ Console.warn(
"IMPLEMENTATION ERROR?: Unexpected mapping for unmapped jalview string object content:"
+ seqsetidobj + " to object " + obj);
}
}
else
{
- Cache.warn("Unexpected mapping for Jalview String Object ID "
+ Console.warn("Unexpected mapping for Jalview String Object ID "
+ seqsetidobj + " to another jalview dataset object "
+ seqsetidobj);
}
}
}
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Returning null VorbaID binding for jalview object " + jvobj);
}
return null;
if (id == null)
{
id = cdoc.registerObject(vobj);
- Cache.debug(
+ Console.debug(
"Registering new object and returning null for getvObj2jv");
return null;
}
if (id == null || vobj.getVorbaId() == null
|| cdoc.getObject(id) != vobj)
{
- Cache.error("Failed to get id for "
+ Console.error("Failed to get id for "
+ (vobj.isRegisterable() ? "registerable"
: "unregisterable")
+ " object " + vobj);
if (vobj2jv.containsKey(vobj.getVorbaId())
&& !((VorbaId) vobj2jv.get(vobj.getVorbaId())).equals(jvobj))
{
- Cache.debug(
+ Console.debug(
"Warning? Overwriting existing vamsas id binding for "
+ vobj.getVorbaId(),
new Exception(MessageManager.getString(
else if (jv2vobj.containsKey(jvobj)
&& !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
{
- Cache.debug(
+ Console.debug(
"Warning? Overwriting existing jalview object binding for "
+ jvobj,
new Exception("Overwriting jalview object binding."));
* bindjvvobj")); }
*/
// we just update the hash's regardless!
- Cache.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
+ Console.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
vobj2jv.put(vobj.getVorbaId(), jvobj);
// JBPNote - better implementing a hybrid invertible hash.
jv2vobj.put(jvobj, vobj.getVorbaId());
DataSet dataset = null;
if (jds == null)
{
- Cache.warn("Creating new dataset for an alignment.");
+ Console.warn("Creating new dataset for an alignment.");
jal.setDataset(null);
jds = jal.getDataset();
}
if (dataset == null)
{
- Cache.warn("Creating new vamsas dataset for alignment view "
+ Console.warn("Creating new vamsas dataset for alignment view "
+ av.getSequenceSetId());
// we create a new dataset on the default vamsas root.
root = cdoc.getVamsasRoots()[0]; // default vamsas root for modifying.
if (aa[i].groupRef != null)
{
// TODO: store any group associated annotation references
- Cache.warn(
+ Console.warn(
"Group associated sequence annotation is not stored in VAMSAS document.");
continue;
}
// LOCK METHODS)
{
// verify annotation - update (perhaps)
- Cache.info(
+ Console.info(
"update alignment sequence annotation. not yet implemented.");
}
else
{
// verify annotation - update (perhaps)
- Cache.info(
+ Console.info(
"updated alignment sequence annotation added.");
}
}
}
if (getjv2vObj(jvalsq.getDatasetSequence()) == null)
{
- Cache.warn(
+ Console.warn(
"Serious Implementation error - Unbound dataset sequence in alignment: "
+ jvalsq.getDatasetSequence());
}
alseq.setDescription(valseq.getDescription());
modal = true;
}
- if (modal && Cache.isDebugEnabled())
+ if (modal && Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Updating apparently edited sequence " + alseq.getName());
}
}
}
else
{
- Cache.error(
+ Console.error(
"Invalid dataset sequence id (null) for alignment sequence "
+ valseq.getVorbaId());
}
@Override
public JarInputStream getJarInputStream() throws IOException
{
- Cache.debug(
+ Console.debug(
"Returning client input stream for Jalview from Vamsas Document.");
return new JarInputStream(cappdata.getClientInputStream());
}
@Override
public JarInputStream getJarInputStream() throws IOException
{
- Cache.debug(
+ Console.debug(
"Returning user input stream for Jalview from Vamsas Document.");
return new JarInputStream(cappdata.getUserInputStream());
}
// TODO implement this : af.getNumberOfViews
String seqsetidobj = av.getSequenceSetId();
views = Desktop.getViewports(seqsetidobj);
- Cache.debug("Found " + (views == null ? " no " : "" + views.length)
+ Console.debug("Found " + (views == null ? " no " : "" + views.length)
+ " views for '" + av.getSequenceSetId() + "'");
if (views.length > 1)
{
} catch (Exception e)
{
// TODO raise GUI warning if user requests it.
- Cache.error(
+ Console.error(
"Couldn't update jalview client application data. Giving up - local settings probably lost.",
e);
}
}
else
{
- Cache.error(
+ Console.error(
"Couldn't access client application data for vamsas session. This is probably a vamsas client bug.");
}
}
int jremain = 0;
if (jdataset == null)
{
- Cache.debug("Initialising new jalview dataset fields");
+ Console.debug("Initialising new jalview dataset fields");
newds = true;
dsseqs = new Vector();
}
else
{
- Cache.debug("Update jalview dataset from vamsas.");
+ Console.debug("Update jalview dataset from vamsas.");
jremain = jdataset.getHeight();
dsseqs = jdataset.getSequences();
}
dsseqs.set(i, null);
}
jdataset = new jalview.datamodel.Alignment(seqs);
- Cache.debug("New vamsas dataset imported into jalview.");
+ Console.debug("New vamsas dataset imported into jalview.");
bindjvvobj(jdataset, dataset);
}
// ////////
// annotations
if (dsSeq == null)
{
- Cache.warn(
+ Console.warn(
"Couldn't resolve jalview sequenceI for dataset object reference "
+ ((Vobject) dataset
.getDataSetAnnotations(dsa)
// JBPNote: we could just add them to all alignments but
// that may complicate cross references in the jalview
// datamodel
- Cache.warn(
+ Console.warn(
"Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
}
}
}
else
{
- Cache.warn(
+ Console.warn(
"Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
}
}
// OBJECT LOCK
// METHODS)
{
- Cache.info(
+ Console.info(
"UNIMPLEMENTED: not recovering user modifiable sequence alignment annotation");
// TODO: should at least replace with new one - otherwise
// things will break
dsseqs.set(i, null);
}
jal = new jalview.datamodel.Alignment(seqs);
- Cache.debug("New vamsas alignment imported into jalview "
+ Console.debug("New vamsas alignment imported into jalview "
+ alignment.getVorbaId().getId());
jal.setDataset(jdataset);
}
// jan.update(getjAlignmentAnnotation(jal, an[a])); // update
// from another annotation object in place.
- Cache.debug(
+ Console.debug(
"update from vamsas alignment annotation to existing jalview alignment annotation.");
if (an[j].getModifiable() == null) // TODO: USE VAMSAS
// LIBRARY OBJECT LOCK
{
// TODO: user defined annotation is totally mutable... - so
// load it up or throw away if locally edited.
- Cache.info(
+ Console.info(
"NOT IMPLEMENTED - Recovering user-modifiable annotation - yet...");
}
// TODO: compare annotation element rows
AlignFrame alignFrame;
if (av == null)
{
- Cache.debug("New alignframe for alignment "
+ Console.debug("New alignframe for alignment "
+ alignment.getVorbaId());
// ///////////////////////////////
// construct alignment view
}
// TODO: automatically create meaningful title for a vamsas
// alignment using its provenance.
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
title = title + "(" + alignment.getVorbaId() + ")";
vstree.UpdateSequenceTreeMap(tp);
} catch (RuntimeException e)
{
- Cache.warn("update of labels failed.", e);
+ Console.warn("update of labels failed.", e);
}
}
else
{
- Cache.warn("Cannot create tree for tree " + t
+ Console.warn("Cannot create tree for tree " + t
+ " in document ("
+ alignment.getTree(t).getVorbaId());
}
if (anot[row][pos] != null)
{
// only time this should happen is if the After flag is set.
- Cache.debug("Ignoring duplicate annotation site at " + pos);
+ Console.debug("Ignoring duplicate annotation site at " + pos);
continue;
}
if (anot[1 - row][pos] != null)
else if (glyphs[g].getDict().equals(
uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
{
- Cache.debug("ignoring hydrophobicity glyph marker.");
+ Console.debug("ignoring hydrophobicity glyph marker.");
AeContent[HASHPHOB] = true;
char c = (dc = glyphs[g].getContent()).charAt(0);
// dc may get overwritten - but we still set the colour.
}
else
{
- Cache.debug(
+ Console.debug(
"IMPLEMENTATION TODO: Ignoring unknown glyph type "
+ glyphs[g].getDict());
}
AeContent[HASVALS] = true;
if (ae[aa].getValueCount() > 1)
{
- Cache.warn(
+ Console.warn(
"ignoring additional " + (ae[aa].getValueCount() - 1)
+ " values in annotation element.");
}
}
else
{
- Cache.warn("Ignoring out of bound annotation element " + aa
+ Console.warn("Ignoring out of bound annotation element " + aa
+ " in " + annotation.getVorbaId().getId());
}
}
val = Float.valueOf(props[p].getContent());
} catch (Exception e)
{
- Cache.warn("Failed to parse threshold property");
+ Console.warn("Failed to parse threshold property");
}
if (val != null)
{
}
if (parsedRangeAnnotation == null)
{
- Cache.debug(
+ Console.debug(
"Inserting empty annotation row elements for a whole-alignment annotation.");
}
else
{
if (parsedRangeAnnotation[3] != null)
{
- Cache.warn("Ignoring 'After' annotation row in "
+ Console.warn("Ignoring 'After' annotation row in "
+ annotation.getVorbaId());
}
jalview.datamodel.Annotation[] arow = (jalview.datamodel.Annotation[]) parsedRangeAnnotation[2];
}
if (annotation.getLinkCount() > 0)
{
- Cache.warn("Ignoring " + annotation.getLinkCount()
+ Console.warn("Ignoring " + annotation.getLinkCount()
+ "links added to AlignmentAnnotation.");
}
if (annotation.getModifiable() == null
}
} catch (Exception e)
{
- Cache.info(
+ Console.info(
"UNIMPLEMENTED : Couldn't parse non-integer group value for setting graphGroup correctly.");
}
return jan;
DataSet dataset = null;
if (jal.getDataset() == null)
{
- Cache.warn("Creating new dataset for an alignment.");
+ Console.warn("Creating new dataset for an alignment.");
jal.setDataset(null);
}
dataset = (DataSet) ((Alignment) getjv2vObj(
if (dataset == null)
{
dataset = (DataSet) getjv2vObj(jal.getDataset());
- Cache.error(
+ Console.error(
"Can't find the correct dataset for the alignment in this view. Creating new one.");
}
}
else
{
- Cache.warn(
+ Console.warn(
"NO Vamsas Binding for local sequence! NOT CREATING MAPPING FOR "
+ dmps[smp].getDisplayId(true) + " to "
+ mps[smp].getTo().getName());
import java.util.IdentityHashMap;
import java.util.Vector;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.io.VamsasAppDatastore;
import jalview.log.JLoggerLog4j;
import jalview.util.MessageManager;
{
return cdoc.getObject((VorbaId) jv2vobj.get(jvobj));
}
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Returning null VorbaID binding for jalview object " + jvobj);
}
return null;
if (id == null)
{
id = cdoc.registerObject(vobj);
- Cache.debug(
+ Console.debug(
"Registering new object and returning null for getvObj2jv");
return null;
}
if (id == null || vobj.getVorbaId() == null
|| cdoc.getObject(id) != vobj)
{
- Cache.error("Failed to get id for "
+ Console.error("Failed to get id for "
+ (vobj.isRegisterable() ? "registerable"
: "unregisterable")
+ " object " + vobj);
if (vobj2jv.containsKey(vobj.getVorbaId())
&& !(vobj2jv.get(vobj.getVorbaId())).equals(jvobj))
{
- Cache.debug(
+ Console.debug(
"Warning? Overwriting existing vamsas id binding for "
+ vobj.getVorbaId(),
new Exception(MessageManager.getString(
else if (jv2vobj.containsKey(jvobj)
&& !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
{
- Cache.debug(
+ Console.debug(
"Warning? Overwriting existing jalview object binding for "
+ jvobj,
new Exception(MessageManager.getString(
* bindjvvobj")); }
*/
// we just update the hash's regardless!
- Cache.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
+ Console.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
vobj2jv.put(vobj.getVorbaId(), jvobj);
// JBPNote - better implementing a hybrid invertible hash.
jv2vobj.put(jvobj, vobj.getVorbaId());
{
if (this.jvobj != null && this.vobj != null)
{
- Cache.debug("updating dsobj registry. (" + this.getClass().getName()
+ Console.debug("updating dsobj registry. (" + this.getClass().getName()
+ ")");
}
this.jvobj = jvobj;
*/
package jalview.io.vamsas;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
import jalview.io.VamsasAppDatastore;
}
else
{
- Cache.debug(
+ Console.debug(
"Ignoring mapless DbRef.Map " + jvobj.getSrcAccString());
}
// TODO: Jalview ignores all the other maps
if (vobj.getMapCount() > 1)
{
- Cache.debug("Ignoring additional mappings on DbRef: "
+ Console.debug("Ignoring additional mappings on DbRef: "
+ jvobj.getSource() + ":" + jvobj.getAccessionId());
}
jalview.datamodel.Mapping mp = new jalview.datamodel.Mapping(
{
DbRef vobj = (DbRef) this.vobj;
DBRefEntry jvobj = (DBRefEntry) this.jvobj;
- Cache.debug("Conflict in dbentry update for " + vobj.getAccessionId()
+ Console.debug("Conflict in dbentry update for " + vobj.getAccessionId()
+ vobj.getSource() + " " + vobj.getVorbaId());
// TODO Auto-generated method stub
// TODO: Jalview ignores all the other maps
if (vobj.getMapCount() > 1)
{
- Cache.debug("Ignoring additional mappings on DbRef: "
+ Console.debug("Ignoring additional mappings on DbRef: "
+ jvobj.getSource() + ":" + jvobj.getAccessionId());
}
jalview.datamodel.Mapping mp = new jalview.datamodel.Mapping(
}
else
{
- Cache.debug(
+ Console.debug(
"Ignoring mapless DbRef.Map " + jvobj.getSrcAccString());
}
}
*/
package jalview.io.vamsas;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.io.VamsasAppDatastore;
import jalview.util.MessageManager;
{
if (!map.getLocal().hasUnit() || map.getMapped().hasUnit())
{
- Cache.warn("using default mapping length of 1:1 for map "
+ Console.warn("using default mapping length of 1:1 for map "
+ (map.isRegistered() ? map.getVorbaId().toString()
: ("<no Id registered> " + map.toString())));
}
*/
package jalview.io.vamsas;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.io.VamsasAppDatastore;
DataSetAnnotations dsa = (DataSetAnnotations) vobj;
if (dsa.getSeqRefCount() != 1)
{
- Cache.warn("Not binding " + dsa.getVorbaId()
+ Console.warn("Not binding " + dsa.getVorbaId()
+ " to Sequence Feature - has multiple dataset sequence references.");
return;
}
if (dsa.getSeqRefCount() != 1)
{
replaceJvObjMapping(feature, null);
- Cache.warn(
+ Console.warn(
"Binding of annotation to jalview feature has changed. Removing binding and recreating.");
doSync(); // re-verify bindings.
}
getDSAnnotationFromJalview(dsa, feature);
if (oldref != dsa.hashCode())
{
- Cache.debug("Updated dataset sequence annotation from feature.");
+ Console.debug("Updated dataset sequence annotation from feature.");
addProvenance(dsa.getProvenance(), "modified");
}
}
{
// conflicting update from document - we cannot map this feature anymore.
replaceJvObjMapping(feature, null);
- Cache.warn("annotation (" + dsa.getVorbaId()
+ Console.warn("annotation (" + dsa.getVorbaId()
+ " bound to jalview feature cannot be mapped. Removing binding, deleting feature, and deleting feature.");
// - consider deleting the feature ?
dsSeq.deleteFeature(feature);
vSeg.setInclusive(true);
if (dsa.getSegCount() > 1)
{
- Cache.debug(
+ Console.debug(
"About to destroy complex annotation in vamsas document mapped to sequence feature ("
+ dsa.getVorbaId() + ")");
}
*/
package jalview.io.vamsas;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
}
if (from != null && sequenceMapping.getLoc() != from)
{
- Cache.warn("Probable IMPLEMENTATION ERROR: " + from
+ Console.warn("Probable IMPLEMENTATION ERROR: " + from
+ " doesn't match the local mapping sequence.");
}
if (ds != null && sequenceMapping.is__stored_in_document()
&& sequenceMapping.getV_parent() != ds)
{
- Cache.warn("Probable IMPLEMENTATION ERROR: " + ds
+ Console.warn("Probable IMPLEMENTATION ERROR: " + ds
+ " doesn't match the parent of the bound sequence mapping object.");
}
}
SequenceType to = (SequenceType) getjv2vObj(jvto);
if (to == null)
{
- Cache.warn(
+ Console.warn(
"FIXME NONFATAL - do a second update: Ignoring Forward Reference to seuqence not yet bound to vamsas seuqence object");
return;
}
if (!dnaToProt)
{
- Cache.warn(
+ Console.warn(
"Ignoring Mapping - don't support protein to protein mapping in vamsas document yet.");
return;
}
// mapping
bindjvvobj(mjvmapping.getMap(), sequenceMapping);
- Cache.debug(
+ Console.debug(
"Successfully created mapping " + sequenceMapping.getVorbaId());
}
// private void update(jalview.util.MapList mjvmapping,
// SequenceMapping sequenceMapping)
{
- Cache.error("Not implemented: Jalview Update Alcodon Mapping:TODO!");
+ Console.error("Not implemented: Jalview Update Alcodon Mapping:TODO!");
}
private void update(SequenceMapping sequenceMapping,
jalview.datamodel.Mapping mjvmapping)
{
- Cache.error("Not implemented: Update DBRef Mapping from Jalview");
+ Console.error("Not implemented: Update DBRef Mapping from Jalview");
}
private void update(jalview.datamodel.Mapping mjvmapping,
SequenceMapping sequenceMapping)
{
- Cache.error(
+ Console.error(
"Not implemented: Jalview Update Sequence DBRef Mapping");
}
}
if (sdloc == null || sdmap == null)
{
- Cache.info("Ignoring non sequence-sequence mapping");
+ Console.info("Ignoring non sequence-sequence mapping");
return;
}
mobj = this.getvObj2jv(sdloc);
if (from == null || to == null)
{
- Cache.error(
+ Console.error(
"Probable Vamsas implementation error : unbound dataset sequences involved in a mapping are being parsed!");
return;
}
{
if (from.getDBRefs() == null && to.getDBRefs() == null)
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Not matching conjugate refs for "
+ Console.debug("Not matching conjugate refs for "
+ from.getName() + " and " + to.getName());
}
return;
}
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Matching conjugate refs for "
+ Console.debug("Matching conjugate refs for "
+ from.getName() + " and " + to.getName());
}
List<DBRefEntry> fdb = from.getDBRefs();
import jalview.analysis.TreeBuilder;
import jalview.analysis.TreeModel;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.BinaryNode;
}
} catch (Exception e)
{
- Cache.warn("Problems parsing treefile '"
+ Console.warn("Problems parsing treefile '"
+ tree.getNewick(0).getContent() + "'", e);
}
}
@Override
public void conflict()
{
- Cache.info(
+ Console.info(
"Update (with conflict) from vamsas document to alignment associated tree not implemented yet.");
}
*/
private Provenance makeTreeProvenance(AlignmentI jal, TreePanel tp)
{
- Cache.debug("Making Tree provenance for " + tp.getTitle());
+ Console.debug("Making Tree provenance for " + tp.getTitle());
Provenance prov = new Provenance();
prov.addEntry(new Entry());
prov.getEntry(0).setAction("imported " + tp.getTitle());
vInput.addSeg(visSeg);
}
}
- Cache.debug("Finished Tree provenance for " + tp.getTitle());
+ Console.debug("Finished Tree provenance for " + tp.getTitle());
return prov;
}
}
if (alsq.size() < sequences.length)
{
- Cache.warn(
+ Console.warn(
"Not recovered all alignment sequences for given set of input sequence CIGARS");
}
return alsq;
if (tp.getTree() == null)
{
- Cache.warn(
+ Console.warn(
"Not updating SequenceTreeMap for " + tree.getVorbaId());
return;
}
{
if (tp.getEntry(pe).getInputCount() > 1)
{
- Cache.warn(
+ Console.warn(
"Ignoring additional input spec in provenance entry "
+ tp.getEntry(pe).toString());
}
// bidirection alignments yet.
if (to < se[1])
{
- Cache.warn("Ignoring invalid segment in InputData spec.");
+ Console.warn("Ignoring invalid segment in InputData spec.");
}
else
{
return new Object[] { new AlignmentView(view), jal };
}
}
- Cache.debug(
+ Console.debug(
"Returning null for input data recovery from provenance.");
return null;
}
return true;
} catch (Exception e)
{
- Cache.debug("Failed to parse newick tree string", e);
+ Console.debug("Failed to parse newick tree string", e);
}
return false;
}
import jalview.analysis.Dna;
import jalview.api.AlignViewControllerGuiI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.GeneLociI;
import jalview.datamodel.Mapping;
VCFHeaderLine headerLine = header.getOtherHeaderLine(VCFHeader.REFERENCE_KEY);
if (headerLine == null)
{
- Cache.error("VCF reference header not found");
+ Console.error("VCF reference header not found");
return null;
}
String ref = headerLine.getValue();
}
else
{
- Cache.error("VCF reference not found: " + ref);
+ Console.error("VCF reference not found: " + ref);
}
return seq;
{
if (reference == null)
{
- Cache.error("No VCF ##reference found, defaulting to "
+ Console.error("No VCF ##reference found, defaulting to "
+ DEFAULT_REFERENCE + ":" + DEFAULT_SPECIES);
reference = DEFAULT_REFERENCE; // default to GRCh37 if not specified
}
GeneLociI seqCoords = seq.getGeneLoci();
if (seqCoords == null)
{
- Cache.warn(String.format(
+ Console.warn(String.format(
"Can't query VCF for %s as chromosome coordinates not known",
seq.getName()));
return null;
// returned with the Ensembl sequence; todo: support aliases?
if (!vcfSpecies.equalsIgnoreCase(species))
{
- Cache.warn("No VCF loaded to " + seq.getName()
+ Console.warn("No VCF loaded to " + seq.getName()
+ " as species not matched");
return null;
}
vcfAssembly);
if (newRange == null)
{
- Cache.error(
+ Console.error(
String.format("Failed to map %s:%s:%s:%d:%d to %s", species,
chromosome, seqRef, range[0], range[1],
vcfAssembly));
*/
String msg = String.format("Error reading VCF for %s:%d-%d: %s ",
map.chromosome, vcfStart, vcfEnd,e.getLocalizedMessage());
- Cache.error(msg);
+ Console.error(msg);
}
}
VCFInfoHeaderLine infoHeader = header.getInfoHeaderLine(infoId);
if (infoHeader == null)
{
- Cache.error("Field " + infoId + " has no INFO header");
+ Console.error("Field " + infoId + " has no INFO header");
return false;
}
VCFHeaderLineType infoType = infoHeader.getType();
if (!badData.contains(token))
{
badData.add(token);
- Cache.error(String.format("Invalid VCF data at %s:%d %s=%s",
+ Console.error(String.format("Invalid VCF data at %s:%d %s=%s",
variant.getContig(), variant.getStart(), infoId, value));
}
}
import javax.swing.table.TableCellRenderer;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.bin.MemorySetting;
import jalview.fts.core.FTSDataColumnPreferences;
import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
}
else
{
- Cache.error(
+ Console.error(
"Preset '" + value + "' [key:" + key + "] not implemented");
}
.getSelectedItem();
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Problem casting Combo entry to IntKeyStringValueEntry.");
e = null;
}
e = (IntKeyStringValueEntry) backupfilesPresetsCombo2.getItemAt(i);
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Problem casting Combo entry to IntKeyStringValueEntry. Skipping item. ");
continue;
}
i = ((Integer) s.getValue()).intValue();
} catch (Exception e)
{
- Cache.error(
+ Console.error(
"Exception casting the initial value of s.getValue()");
}
}
i = (Integer) s.getValue();
} catch (Exception e)
{
- Cache.error("Failed casting (Integer) JSpinner s.getValue()");
+ Console.error("Failed casting (Integer) JSpinner s.getValue()");
}
return i;
}
import java.util.HashMap;
import java.util.Map;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.Platform;
public abstract class JLogger implements JLoggerI
return LogLevel.valueOf(levelString);
} catch (IllegalArgumentException e)
{
- Cache.error("Could not parse LogLevel '" + levelString + "'", e);
+ Console.error("Could not parse LogLevel '" + levelString + "'", e);
return LogLevel.INFO;
}
}
import jalview.api.analysis.SimilarityParamsI;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
} catch (Exception e)
{
- Cache.error("Couln't write Jalview state to " + statefile, e);
+ Console.error("Couln't write Jalview state to " + statefile, e);
// TODO: inform user of the problem - they need to know if their data was
// not saved !
if (errorMessage == null)
}
else
{
- Cache.error(
+ Console.error(
"Failed to save viewer state for " + viewerType);
}
}
.getHiddenColumns();
if (hidden == null)
{
- Cache.warn("REPORT BUG: avoided null columnselection bug (DMAM reported). Please contact Jim about this.");
+ Console.warn("REPORT BUG: avoided null columnselection bug (DMAM reported). Please contact Jim about this.");
}
else
{
object.getPcaViewer().add(viewer);
} catch (Throwable t)
{
- Cache.error("Error saving PCA: " + t.getMessage());
+ Console.error("Error saving PCA: " + t.getMessage());
}
}
}
else if (!matchedFile.equals(pdbentry.getFile()))
{
- Cache.warn(
+ Console.warn(
"Probably lost some PDB-Sequence mappings for this structure file (which apparently has same PDB Entry code): "
+ pdbentry.getFile());
}
calcIdParam.getParameters().replace("|\\n|", "\n"));
} catch (IOException x)
{
- Cache.warn("Couldn't parse parameter data for "
+ Console.warn("Couldn't parse parameter data for "
+ calcIdParam.getCalcId(), x);
return false;
}
}
else
{
- Cache.warn("Cannot resolve a service for the parameters used in this project. Try configuring a JABAWS server.");
+ Console.warn("Cannot resolve a service for the parameters used in this project. Try configuring a JABAWS server.");
return false;
}
}
return id.toString();
}
// give up and warn that something has gone wrong
- Cache.warn("Cannot find ID for object in external mapping : " + jvobj);
+ Console.warn("Cannot find ID for object in external mapping : " + jvobj);
}
return altCode;
}
mp.setDseqFor(jmpid);
if (!seqRefIds.containsKey(jmpid))
{
- Cache.debug("creatign new DseqFor ID");
+ Console.debug("creatign new DseqFor ID");
seqRefIds.put(jmpid, ps);
}
else
{
- Cache.debug("reusing DseqFor ID");
+ Console.debug("reusing DseqFor ID");
}
// mp.setMappingChoice(mpc);
}
else
{
- Cache.warn("Couldn't find entry in Jalview Jar for " + jarEntryName);
+ Console.warn("Couldn't find entry in Jalview Jar for " + jarEntryName);
}
} catch (Exception ex)
{
tp.getTreeCanvas().setApplyToAllViews(tree.isLinkToAllViews());
if (tp == null)
{
- Cache.warn("There was a problem recovering stored Newick tree: \n"
+ Console.warn("There was a problem recovering stored Newick tree: \n"
+ tree.getNewick());
continue;
}
else
{
errorMessage = ("The Jmol views in this project were imported\nfrom an older version of Jalview.\nPlease review the sequence colour associations\nin the Colour by section of the Jmol View menu.\n\nIn the case of problems, see note at\nhttp://issues.jalview.org/browse/JAL-747");
- Cache.warn(errorMessage);
+ Console.warn(errorMessage);
}
}
}
} catch (IllegalArgumentException | NullPointerException e)
{
// TODO JAL-3619 show error dialog / offer an alternative viewer
- Cache.error("Invalid structure viewer type: " + type);
+ Console.error("Invalid structure viewer type: " + type);
}
}
}
else
{
- Cache.warn("Couldn't recover parameters for "
+ Console.warn("Couldn't recover parameters for "
+ calcIdParam.getCalcId());
}
}
String id = object.getViewport().get(0).getSequenceSetId();
if (skipList.containsKey(id))
{
- Cache.debug("Skipping seuqence set id " + id);
+ Console.debug("Skipping seuqence set id " + id);
return true;
}
return false;
{
if (ds != null && ds != seqSetDS)
{
- Cache.warn("JAL-3171 regression: Overwriting a dataset reference for an alignment"
+ Console.warn("JAL-3171 regression: Overwriting a dataset reference for an alignment"
+ " - CDS/Protein crossreference data may be lost");
if (xtant_ds != null)
{
// This can only happen if the unique sequence set ID was bound to a
// dataset that did not contain any of the sequences in the view
// currently being restored.
- Cache.warn("JAL-3171 SERIOUS! TOTAL CONFUSION - please consider contacting the Jalview Development team so they can investigate why your project caused this message to be displayed.");
+ Console.warn("JAL-3171 SERIOUS! TOTAL CONFUSION - please consider contacting the Jalview Development team so they can investigate why your project caused this message to be displayed.");
}
}
ds = seqSetDS;
SequenceI[] dsseqs = new SequenceI[dseqs.size()];
dseqs.copyInto(dsseqs);
ds = new jalview.datamodel.Alignment(dsseqs);
- Cache.debug("Created new dataset " + vamsasSet.getDatasetId()
+ Console.debug("Created new dataset " + vamsasSet.getDatasetId()
+ " for alignment " + System.identityHashCode(al));
addDatasetRef(vamsasSet.getDatasetId(), ds);
}
AlignmentI prevDS = seqToDataset.put(restoredSeq.getDsseqid(), ds);
if (prevDS != null && prevDS != ds)
{
- Cache.warn("Dataset sequence appears in many datasets: "
+ Console.warn("Dataset sequence appears in many datasets: "
+ restoredSeq.getDsseqid());
// TODO: try to merge!
}
{
if (dataset.getDataset() != null)
{
- Cache.warn("Serious issue! Dataset Object passed to getDatasetIdRef is not a Jalview DATASET alignment...");
+ Console.warn("Serious issue! Dataset Object passed to getDatasetIdRef is not a Jalview DATASET alignment...");
}
String datasetId = makeHashCode(dataset, null);
if (datasetId == null)
seqRefIds.put(sqid, djs);
}
- Cache.debug("about to recurse on addDBRefs.");
+ Console.debug("about to recurse on addDBRefs.");
addDBRefs(djs, ms);
}
if (!jvann.annotationId.equals(anid))
{
// TODO verify that this is the correct behaviour
- Cache.warn("Overriding Annotation ID for " + anid
+ Console.warn("Overriding Annotation ID for " + anid
+ " from different id : " + jvann.annotationId);
jvann.annotationId = anid;
}
}
else
{
- Cache.debug("Ignoring " + jvobj.getClass() + " (ID = " + id);
+ Console.debug("Ignoring " + jvobj.getClass() + " (ID = " + id);
}
}
}
}
else
{
- Cache.warn("Couldn't find entry in Jalview Jar for " + jarEntryName);
+ Console.warn("Couldn't find entry in Jalview Jar for " + jarEntryName);
}
} catch (Exception ex)
{
}
} catch (Exception ex)
{
- Cache.error("Error loading PCA: " + ex.toString());
+ Console.error("Error loading PCA: " + ex.toString());
}
}
});
} catch (InvocationTargetException | InterruptedException ex)
{
- Cache.warn("Unexpected error when opening " + viewerType
+ Console.warn("Unexpected error when opening " + viewerType
+ " structure viewer", ex);
}
}
}
} catch (IOException e)
{
- Cache.error("Error restoring Jmol session: " + e.toString());
+ Console.error("Error restoring Jmol session: " + e.toString());
}
return null;
}
maxcol = new Color(Integer.parseInt(colourModel.getRGB(), 16));
} catch (Exception e)
{
- Cache.warn("Couldn't parse out graduated feature color.", e);
+ Console.warn("Couldn't parse out graduated feature color.", e);
}
NoValueColour noCol = colourModel.getNoValueColour();
import jalview.analysis.AlignSeq;
import jalview.api.StructureSelectionManagerProvider;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.CommandI;
import jalview.commands.EditCommand;
import jalview.commands.OrderCommand;
} catch (SiftsException e)
{
isMapUsingSIFTs = false;
- Cache.error("SIFTS mapping failed", e);
- Cache.error("Falling back on Needleman & Wunsch alignment");
+ Console.error("SIFTS mapping failed", e);
+ Console.error("Falling back on Needleman & Wunsch alignment");
siftsClient = null;
}
} catch (SiftsException e)
{
// fall back to NW alignment
- Cache.error(e.getMessage());
+ Console.error(e.getMessage());
StructureMapping nwMapping = getNWMappings(seq, pdbFile,
targetChainId, maxChain, pdb, maxAlignseq);
seqToStrucMapping.add(nwMapping);
import jalview.api.SequenceRenderer;
import jalview.api.StructureSelectionManagerProvider;
import jalview.api.structures.JalviewStructureDisplayI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.MappedFeatures;
saveSession(f);
} catch (IOException e)
{
- Cache.error(String.format("Error saving %s session: %s", prefix,
+ Console.error(String.format("Error saving %s session: %s", prefix,
e.toString()));
}
package jalview.urls;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.urls.api.UrlProviderI;
import jalview.util.UrlLink;
dataProvider.setUrlData(data);
} catch (IllegalArgumentException ex)
{
- Cache.error(ex.getMessage());
+ Console.error(ex.getMessage());
}
}
});
import java.util.BitSet;
import java.util.List;
-import jalview.bin.Cache;
+import jalview.bin.Console;
/**
* A simple way of bijectively mapping a non-contiguous linear range to another
if (range.length != 2)
{
// throw new IllegalArgumentException(range);
- Cache.error("Invalid format for fromRange "
+ Console.error("Invalid format for fromRange "
+ Arrays.toString(range) + " may cause errors");
}
fromLowest = Math.min(fromLowest, Math.min(range[0], range[1]));
if (range.length != 2)
{
// throw new IllegalArgumentException(range);
- Cache.error("Invalid format for toRange "
+ Console.error("Invalid format for toRange "
+ Arrays.toString(range) + " may cause errors");
}
toLowest = Math.min(toLowest, Math.min(range[0], range[1]));
import jalview.analysis.AlignmentSorter;
import jalview.api.AlignViewportI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.CommandI;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
action = action.getUndoAction();
}
// TODO write this
- Cache.error("MappingUtils.mapCutOrPaste not yet implemented");
+ Console.error("MappingUtils.mapCutOrPaste not yet implemented");
}
/**
{
if (range.length % 2 != 0)
{
- Cache.error(
+ Console.error(
"Error unbalance start/end ranges: " + ranges.toString());
return 0;
}
/*
* not coded for [start1, end1, start2, end2, ...]
*/
- Cache.error(
+ Console.error(
"MappingUtils.removeEndPositions doesn't handle multiple ranges");
return;
}
/*
* not coded for a reverse strand range (end < start)
*/
- Cache.error(
+ Console.error(
"MappingUtils.removeEndPositions doesn't handle reverse strand");
return;
}
*/
package jalview.ws;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
throw (new Exception(
"Timed out when communicating with server\nTry again later.\n"));
}
- Cache.debug("Job " + j + " Result state "
+ Console.debug("Job " + j + " Result state "
+ jobs[j].getState() + "(ServerError="
+ jobs[j].isServerError() + ")");
} catch (Exception ex)
.formatMessage("info.server_exception", new Object[]
{ WebServiceName, ex.getMessage() }));
// always output the exception's stack trace to the log
- Cache.warn(WebServiceName + " job(" + jobs[j].jobnum
+ Console.warn(WebServiceName + " job(" + jobs[j].jobnum
+ ") Server exception.");
// todo: could limit trace to cause if this is a SOAPFaultException.
ex.printStackTrace();
if (jobs[j].allowedServerExceptions > 0)
{
jobs[j].allowedServerExceptions--;
- Cache.debug("Sleeping after a server exception.");
+ Console.debug("Sleeping after a server exception.");
try
{
Thread.sleep(5000);
}
else
{
- Cache.warn("Dropping job " + j + " " + jobs[j].jobId);
+ Console.warn("Dropping job " + j + " " + jobs[j].jobId);
jobs[j].subjobComplete = true;
wsInfo.setStatus(jobs[j].jobnum,
WebserviceInfo.STATE_STOPPED_SERVERERROR);
jobs[j].clearResponse(); // may contain out of date result data
wsInfo.setStatus(jobs[j].jobnum,
WebserviceInfo.STATE_STOPPED_ERROR);
- Cache.error("Out of memory when retrieving Job " + j
+ Console.error("Out of memory when retrieving Job " + j
+ " id:" + WsUrl + "/" + jobs[j].jobId, er);
new jalview.gui.OOMWarning(
"retrieving result for " + WebServiceName, er);
Thread.sleep(5000);
} catch (InterruptedException e)
{
- Cache.debug("Interrupted sleep waiting for next job poll.",
+ Console.debug("Interrupted sleep waiting for next job poll.",
e);
}
// System.out.println("I'm alive "+alTitle);
}
else
{
- Cache.debug(
+ Console.debug(
"WebServiceJob poll loop finished with no jobs created.");
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
wsInfo.appendProgressText(
import jalview.analysis.AlignSeq;
import jalview.api.FeatureSettingsModelI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
AlignmentI retrieved = null;
try
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug("Querying " + dbsource.getDbName()
+ Console.debug("Querying " + dbsource.getDbName()
+ " with : '" + queryString.toString() + "'");
}
retrieved = dbsource.getSequenceRecords(queryString.toString());
import com.stevesoft.pat.Regex;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
if (al == null)
{
- Cache.error(
+ Console.error(
"No record found for '" + dbName + ":" + query + "'");
}
}
import com.stevesoft.pat.Regex;
import jalview.analysis.SequenceIdMatcher;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
return listToArray(ranges);
} catch (ParseException e)
{
- Cache.warn(
+ Console.warn(
String.format("Not parsing inexact CDS location %s in ENA %s",
location, accession));
return new int[] {};
import java.util.Locale;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.io.DataSourceType;
// TODO: trap HTTP 404 exceptions and return null
String xfamUrl = getURL(queries);
- Cache.debug("XFAM URL for retrieval is: " + xfamUrl);
+ Console.debug("XFAM URL for retrieval is: " + xfamUrl);
AlignmentI rcds = new FormatAdapter().readFile(xfamUrl,
DataSourceType.URL, FileFormat.Stockholm);
package jalview.ws.jws1;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.JvOptionPane;
import jalview.util.MessageManager;
// timeout
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Serious! Service location failed\nfor URL :" + WsURL + "\n",
ex);
}
else
{
- Cache.info("Ignoring duplicate url in DISCOVERY_URLS list");
+ Console.info("Ignoring duplicate url in DISCOVERY_URLS list");
}
} catch (Exception ex)
{
- Cache.warn("Problem whilst trying to make a URL from '"
+ Console.warn("Problem whilst trying to make a URL from '"
+ ((url != null) ? url : "<null>") + "'");
- Cache.warn(
+ Console.warn(
"This was probably due to a malformed comma separated list"
+ " in the DISCOVERY_URLS entry of $(HOME)/.jalview_properties)");
- Cache.debug("Exception was ", ex);
+ Console.debug("Exception was ", ex);
}
}
} catch (Exception ex)
{
- Cache.warn(
+ Console.warn(
"Error parsing comma separated list of urls in DISCOVERY_URLS.",
ex);
}
*/
static public void doDiscovery()
{
- Cache.debug("(Re)-Initialising the discovery URL list.");
+ Console.debug("(Re)-Initialising the discovery URL list.");
try
{
reallyDiscoverServices = Cache
}
else
{
- Cache.debug("Setting default services");
+ Console.debug("Setting default services");
services = new Hashtable<>();
// Muscle, Clustal and JPred.
ServiceHandle[] defServices = { new ServiceHandle("MsaWS",
ServiceHandles shs = null;
try
{
- Cache.debug("Discovering services using " + location);
+ Console.debug("Discovering services using " + location);
shs = locateWebService(location).getServices();
} catch (org.apache.axis.AxisFault f)
{
}
else
{
- Cache.warn("No Discovery service at " + location);
- Cache.debug("Axis Fault", f);
+ Console.warn("No Discovery service at " + location);
+ Console.debug("Axis Fault", f);
}
} catch (Exception e)
{
- Cache.warn("No Discovery service at " + location);
- Cache.debug("Discovery Service General Exception", e);
+ Console.warn("No Discovery service at " + location);
+ Console.debug("Discovery Service General Exception", e);
}
if ((shs != null) && shs.getServices().length > 0)
{
{
if (!cat.contains(sh[i]))
{
- Cache.debug("A " + sh[i].getAbstractName()
+ Console.debug("A " + sh[i].getAbstractName()
+ " service called " + sh[i].getName() + " exists at "
+ sh[i].getEndpointURL() + "\n");
if (!sscat.containsKey(sh[i].getAbstractName()))
disc_serv = new java.net.URL(sh[i].getEndpointURL());
if (!ServiceURLList.contains(disc_serv))
{
- Cache.debug(
+ Console.debug(
"Adding new discovery service at " + disc_serv);
ServiceURLList.add(disc_serv);
seenNewDiscovery = true;
}
} catch (Exception e)
{
- Cache.debug("Ignoring bad discovery service URL "
+ Console.debug("Ignoring bad discovery service URL "
+ sh[i].getEndpointURL(), e);
}
}
int s_url = 0;
if (ServiceURLList == null)
{
- Cache.debug("No service endpoints to use for service discovery.");
+ Console.debug("No service endpoints to use for service discovery.");
return;
}
while (s_url < ServiceURLList.size())
}
else
{
- Cache.warn("No services at "
+ Console.warn("No services at "
+ (ServiceURLList.get(s_url))
+ " - check DISCOVERY_URLS property in .jalview_properties");
}
import java.util.Locale;
import jalview.analysis.AlignSeq;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.SeqCigar;
import jalview.datamodel.SequenceI;
Jpred server = locateWebService();
if (server == null)
{
- Cache.warn("Couldn't find a Jpred webservice to invoke!");
+ Console.warn("Couldn't find a Jpred webservice to invoke!");
return;
}
SeqCigar[] msf = null;
import jalview.analysis.AlignSeq;
import jalview.analysis.SeqsetUtils;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
JpredResult result = (JpredResult) this.result;
- Cache.debug("Parsing output from JNet job.");
+ Console.debug("Parsing output from JNet job.");
// JPredFile prediction = new JPredFile("C:/JalviewX/files/jpred.txt",
// "File");
JPredFile prediction = new JPredFile(result.getPredfile(),
DataSourceType.PASTE);
SequenceI[] preds = prediction.getSeqsAsArray();
- Cache.debug("Got prediction profile.");
+ Console.debug("Got prediction profile.");
if ((this.msa != null) && (result.getAligfile() != null))
{
- Cache.debug("Getting associated alignment.");
+ Console.debug("Getting associated alignment.");
// we ignore the returned alignment if we only predicted on a single
// sequence
FileFormatI format = new IdentifyFile()
{
job.setSubmitted(true);
job.setSubjobComplete(false);
- Cache.info(WsUrl + " Job Id '" + job.getJobId() + "'");
+ Console.info(WsUrl + " Job Id '" + job.getJobId() + "'");
}
}
else
"JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n"
+ e.getMessage() + "\n");
- Cache.warn("Server Exception", e);
+ Console.warn("Server Exception", e);
}
else
{
"info.failed_to_submit_prediction", new String[]
{ e.getMessage(), wsInfo.getProgressText() }));
- Cache.debug("Failed Submission of job " + j.getJobnum(), e);
+ Console.debug("Failed Submission of job " + j.getJobnum(), e);
}
j.setAllowedServerExceptions(-1);
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Unexpected exception when processing results for " + altitle,
ex);
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
msa = (j.msa != null) ? true : msa;
try
{
- Cache.debug("Parsing output of job " + jn);
+ Console.debug("Parsing output of job " + jn);
jobres = j.getResultSet();
- Cache.debug("Finished parsing output.");
+ Console.debug("Finished parsing output.");
if (jobs.length == 1)
{
res = jobres;
}
} catch (Exception e)
{
- Cache.error("JNet Client: JPred Annotation Parse Error", e);
+ Console.error("JNet Client: JPred Annotation Parse Error", e);
wsInfo.setStatus(j.getJobnum(),
WebserviceInfo.STATE_STOPPED_ERROR);
wsInfo.appendProgressText(j.getJobnum(),
}
else
{
- Cache.info("Append results onto existing alignment.");
+ Console.info("Append results onto existing alignment.");
}
}
}
package jalview.ws.jws1;
import jalview.analysis.AlignSeq;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
{
cancelledMessage += ("\nProblems cancelling the job : Exception received...\n"
+ exc + "\n");
- Cache.warn(
+ Console.warn(
"Exception whilst cancelling " + jobs[job].getJobId(),
exc);
}
MsaWSJob j = (MsaWSJob) job;
if (j.isSubmitted())
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Tried to submit an already submitted job " + j.getJobId());
}
return;
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Unexpected exception when processing results for " + alTitle,
ex);
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
*/
package jalview.ws.jws1;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
.getSupportedDatabases();
} catch (Exception e)
{
- Cache.warn(
+ Console.warn(
"Database list request failed, so disabling SeqSearch Service client "
+ sh.getName() + " at " + sh.getEndpointURL(),
e);
import jalview.analysis.AlignSeq;
import jalview.api.FeatureColourI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
{
cancelledMessage += ("\nProblems cancelling the job : Exception received...\n"
+ exc + "\n");
- Cache.warn(
+ Console.warn(
"Exception whilst cancelling " + jobs[job].getJobId(),
exc);
}
SeqSearchWSJob j = (SeqSearchWSJob) job;
if (j.isSubmitted())
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Tried to submit an already submitted job " + j.getJobId());
}
return;
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Unexpected exception when processing results for " + alTitle,
ex);
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
package jalview.ws.jws2;
import jalview.api.FeatureColourI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.GraphLine;
import jalview.datamodel.SequenceFeature;
scores = scoremanager.getAnnotationForSequence(seqId);
} catch (Exception q)
{
- Cache.info("Couldn't recover disorder prediction for sequence "
+ Console.info("Couldn't recover disorder prediction for sequence "
+ seq.getName() + "(Prediction name was " + seqId
+ ")"
+ "\nSee http://issues.jalview.org/browse/JAL-1319 for one possible reason why disorder predictions might fail.");
import jalview.analysis.SeqsetUtils;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
}
if (collectAnnotationResultsFor(rslt))
{
- Cache.debug("Updating result annotation from Job "
+ Console.debug("Updating result annotation from Job "
+ rslt + " at " + service.getUri());
updateResultAnnotation(true);
ap.adjustAnnotationHeight();
*/
package jalview.ws.jws2;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
else
{
jws2Discoverer.addInvalidServiceUrl(jwsserver);
- Cache.warn("Ignoring invalid Jws2 service url " + jwsserver);
+ Console.warn("Ignoring invalid Jws2 service url " + jwsserver);
}
} catch (Exception e)
{
e.printStackTrace();
- Cache.warn("Exception when discovering Jws2 services.", e);
+ Console.warn("Exception when discovering Jws2 services.", e);
jws2Discoverer.addInvalidServiceUrl(jwsserver);
} catch (Error e)
{
- Cache.error("Exception when discovering Jws2 services.", e);
+ Console.error("Exception when discovering Jws2 services.", e);
jws2Discoverer.addInvalidServiceUrl(jwsserver);
}
running = false;
import compbio.metadata.Argument;
import jalview.api.AlignCalcWorkerI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
if (service != null
&& !fave.getService().hosturl.equals(service.hosturl))
{
- Cache.debug("Changing AACon service to " + service.hosturl
+ Console.debug("Changing AACon service to " + service.hosturl
+ " from " + fave.getService().hosturl);
fave.setService(service);
}
if (!service.serviceType.toString()
.equals(compbio.ws.client.Services.AAConWS.toString()))
{
- Cache.warn(
+ Console.warn(
"Ignoring invalid preferred service for AACon calculations (service type was "
+ service.serviceType + ")");
service = null;
package jalview.ws.jws2;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
{
try
{
- Cache.debug(
+ Console.debug(
"Waiting around for old discovery thread to finish.");
// wait around until old discoverer dies
Thread.sleep(100);
}
}
aborted = false;
- Cache.debug("Old discovery thread has finished.");
+ Console.debug("Old discovery thread has finished.");
}
running = true;
}
if (aborted)
{
- Cache.debug(
+ Console.debug(
"Aborting " + qrys.size() + " JABAWS discovery threads.");
for (JabaWsServerQuery squery : qrys)
{
}
else
{
- Cache.warn("Ignoring duplicate url " + url + " in "
+ Console.warn("Ignoring duplicate url " + url + " in "
+ JWS2HOSTURLS + " list");
}
} catch (MalformedURLException ex)
{
- Cache.warn("Problem whilst trying to make a URL from '"
+ Console.warn("Problem whilst trying to make a URL from '"
+ ((url != null) ? url : "<null>") + "'");
- Cache.warn(
+ Console.warn(
"This was probably due to a malformed comma separated list"
+ " in the " + JWS2HOSTURLS
+ " entry of $(HOME)/.jalview_properties)");
- Cache.debug("Exception was ", ex);
+ Console.debug("Exception was ", ex);
}
}
} catch (Exception ex)
{
- Cache.warn("Error parsing comma separated list of urls in "
+ Console.warn("Error parsing comma separated list of urls in "
+ JWS2HOSTURLS + " preference.", ex);
}
return urls;
package jalview.ws.jws2;
import jalview.analysis.AlignSeq;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
{
cancelledMessage += ("\nProblems cancelling the job : Exception received...\n"
+ exc + "\n");
- Cache.warn(
+ Console.warn(
"Exception whilst cancelling " + jobs[job].getJobId(),
exc);
}
MsaWSJob j = (MsaWSJob) job;
if (j.isSubmitted())
{
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Tried to submit an already submitted job " + j.getJobId());
}
return;
} catch (Exception e)
{
- Cache.warn(
+ Console.warn(
"Exception when retrieving remaining Job progress data for job "
+ msjob.getJobId() + " on server " + WsUrl);
e.printStackTrace();
}
} while (nunchanged > 0 && nexcept > 0);
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
System.out.println("Job Execution file for job: "
+ msjob.getJobId() + " on server " + WsUrl);
{
// job has failed for some reason - probably due to invalid
// parameters
- Cache.debug(
+ Console.debug(
"Results not available for finished job - marking as broken job.",
e);
msjob.jobProgress.append(
msjob.setjobStatus(JobStatus.FAILED);
} catch (Exception e)
{
- Cache.error("Couldn't get Alignment for job.", e);
+ Console.error("Couldn't get Alignment for job.", e);
// TODO: Increment count and retry ?
msjob.setjobStatus(JobStatus.UNDEFINED);
}
} catch (Exception ex)
{
- Cache.error(
+ Console.error(
"Unexpected exception when processing results for " + alTitle,
ex);
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
*/
package jalview.ws.rest;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.io.FileParse;
import jalview.io.packed.DataProvider;
import jalview.io.packed.DataProvider.JvDataType;
{
error = true;
errormessage = "Couldn't parse message from web service.";
- Cache.warn("Failed to parse MIME multipart content", me);
+ Console.warn("Failed to parse MIME multipart content", me);
en.consumeContent();
}
return new ParsePackedSet().getAlignment(ds,
: en.getContentEncoding().getValue();
if (en.getContentType() != null)
{
- Cache.debug("Result Type: " + en.getContentType().toString());
+ Console.debug("Result Type: " + en.getContentType().toString());
}
else
{
- Cache.debug("No Result Type Specified.");
+ Console.debug("No Result Type Specified.");
}
if (enc == null || enc.length() < 1)
{
- Cache.debug("Assuming 'Default' Result Encoding.");
+ Console.debug("Assuming 'Default' Result Encoding.");
}
else
{
- Cache.debug("Result Encoded as : " + enc);
+ Console.debug("Result Encoded as : " + enc);
}
// attempt to identify file and construct an appropriate DataSource
// identifier for it.
: new InputStreamReader(en.getContent());
} catch (UnsupportedEncodingException e)
{
- Cache.error("Can't handle encoding '" + enc
+ Console.error("Can't handle encoding '" + enc
+ "' for response from webservice.", e);
en.consumeContent();
error = true;
import java.util.Locale;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+ "</a><br>See Console output for details.";
rj.setAllowedServerExceptions(0);// unrecoverable;
rj.error = true;
- Cache.fatal("Unexpected REST Job " + getStage(stg)
+ Console.fatal("Unexpected REST Job " + getStage(stg)
+ "exception for URL " + rj.rsd.postUrl);
throw (he);
} catch (IOException e)
+ "Job. <br>Problematic url was <a href=\""
+ request.getURI() + "\">" + request.getURI()
+ "</a><br>See Console output for details.";
- Cache.warn("IO Exception for REST Job " + getStage(stg)
+ Console.warn("IO Exception for REST Job " + getStage(stg)
+ "exception for URL " + rj.rsd.postUrl);
throw (e);
{
case 200:
rj.running = false;
- Cache.debug("Processing result set.");
+ Console.debug("Processing result set.");
processResultSet(rj, response, request);
break;
case 202:
{
if (loc.length > 1)
{
- Cache.warn("Ignoring additional " + (loc.length - 1)
+ Console.warn("Ignoring additional " + (loc.length - 1)
+ " location(s) provided in response header ( next one is '"
+ loc[1].getValue() + "' )");
}
default:
// Some other response. Probably need to pop up the content in a window.
// TODO: deal with all other HTTP response codes from server.
- Cache.warn("Unhandled response status when " + getStage(stg)
+ Console.warn("Unhandled response status when " + getStage(stg)
+ "for " + postUrl + ": " + response.getStatusLine());
rj.error = true;
rj.setAllowedServerExceptions(0);
+ "</a><br/>Filtered response content below:<br/>");
} catch (IOException e)
{
- Cache.debug("IOException when consuming unhandled response",
+ Console.debug("IOException when consuming unhandled response",
e);
}
;
{
job.setSubjobComplete(true);
job.setAllowedServerExceptions(-1);
- Cache.error("Exception when trying to start Rest Job.", ex);
+ Console.error("Exception when trying to start Rest Job.", ex);
}
}
{
// crazy users will see this message
// TODO: finish this! and remove the message below!
- Cache.warn("Rest job result parser is currently INCOMPLETE!");
+ Console.warn("Rest job result parser is currently INCOMPLETE!");
int validres = 0;
for (RestJob rj : (RestJob[]) jobs)
{
String ln = null;
try
{
- Cache.debug("Parsing data for job " + rj.getJobId());
+ Console.debug("Parsing data for job " + rj.getJobId());
rj.parseResultSet();
if (rj.hasResults())
{
validres++;
}
- Cache.debug("Finished parsing data for job " + rj.getJobId());
+ Console.debug("Finished parsing data for job " + rj.getJobId());
} catch (Error ex)
{
- Cache.warn(
+ Console.warn(
"Failed to finish parsing data for job " + rj.getJobId());
ex.printStackTrace();
} catch (Exception ex)
{
- Cache.warn(
+ Console.warn(
"Failed to finish parsing data for job " + rj.getJobId());
ex.printStackTrace();
} finally
{
// TODO: decide if multiple multiple alignments returned by
// non-vseparable services are allowed.
- Cache.warn(
+ Console.warn(
"dealing with multiple alignment products returned by non-vertically separable service.");
}
// recover reference to last alignment created for this rest frame
}
else
{
- Cache.warn(
+ Console.warn(
"Couldn't resolve original sequence for new sequence.");
}
}
grass = groupNames.get(alan[nrj][an].groupRef.getName());
if (grass == null)
{
- Cache.error(
+ Console.error(
"Couldn't relocate group referemce for group "
+ alan[nrj][an].groupRef.getName());
}
{
// TODO: process each newick file, lifting over sequence refs to
// current alignment, if necessary.
- Cache.error(
+ Console.error(
"Tree recovery from restjob not yet implemented.");
}
}
package jalview.ws.seqfetcher;
import jalview.api.FeatureSettingsModelI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
return true;
}
}
- Cache.warn("isFetchable doesn't know about '" + source + "'");
+ Console.warn("isFetchable doesn't know about '" + source + "'");
return false;
}
*/
package jalview.gui;
-import jalview.bin.Cache;
-
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import jalview.bin.Console;
+
public class JAL1353bugdemo
{
@Test(groups = { "Functional" }, enabled = false)
public void test()
{
- Cache.initLogger();
+ Console.initLogger();
// final Desktop foo = new Desktop();
final JFrame cfoo = new JFrame("Crash Java");
final JDesktopPane foo = new JDesktopPane();
import org.testng.annotations.Test;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
public void setUp() throws IOException
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
- Cache.initLogger();
+ Console.initLogger();
String inMenuString = ("EMBL-EBI Search | http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$"
+ SEQUENCE_ID
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence.DBModList;
@BeforeClass(alwaysRun = true)
public void setUp()
{
- Cache.initLogger();
+ Console.initLogger();
}
/**
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.JvOptionPane;
/**
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
- Cache.initLogger();
+ Console.initLogger();
}
/**
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.Mapping;
import jalview.datamodel.SequenceFeature;
@BeforeClass(alwaysRun = true)
public void setUp()
{
- Cache.initLogger();
+ Console.initLogger();
}
/**
import static org.testng.Assert.assertTrue;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.Mapping;
Cache.setProperty("VCF_FIELDS", ".*");
Cache.setProperty("VEP_FIELDS", ".*");
Cache.setProperty("VCF_ASSEMBLY", "GRCh38=GRCh38");
- Cache.initLogger();
+ Console.initLogger();
}
@BeforeTest(alwaysRun = true)
import io.github.classgraph.ClassGraph;
import io.github.classgraph.ScanResult;
-import jalview.bin.Cache;
+import jalview.bin.Console;
public class Log4jTest
{
{
break;
}
- if (ln.contains(Cache.LOGGING_TEST_MESSAGE))
+ if (ln.contains(Console.LOGGING_TEST_MESSAGE))
{
logTestFound = true;
break;
if (!logTestFound)
{
Assert.fail("Did not find Log4j Test message line '"
- + Cache.LOGGING_TEST_MESSAGE + "'");
+ + Console.LOGGING_TEST_MESSAGE + "'");
}
}
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.JvOptionPane;
public class MapListTest
@BeforeClass(alwaysRun = true)
public void setUp()
{
- Cache.initLogger();
+ Console.initLogger();
}
@BeforeClass(alwaysRun = true)
import org.testng.annotations.Test;
import jalview.api.AlignViewportI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
import jalview.commands.EditCommand.Edit;
@BeforeClass(alwaysRun = true)
public void setUp()
{
- Cache.initLogger();
+ Console.initLogger();
}
@BeforeClass(alwaysRun = true)
import java.util.Locale;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.JvOptionPane;
import jalview.gui.WsJobParameters;
import jalview.util.MessageManager;
public static void setUpBeforeClass() throws Exception
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
- Cache.initLogger();
+ Console.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
}
import static org.testng.AssertJUnit.assertTrue;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.gui.JvOptionPane;
public static void setUpBeforeClass() throws Exception
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
- Cache.initLogger();
+ Console.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
while (disc.isRunning())
import static org.testng.AssertJUnit.assertTrue;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.gui.JvOptionPane;
public static void setUpBeforeClass() throws Exception
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
- Cache.initLogger();
+ Console.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer(false);
while (disc.isRunning())
import static org.testng.AssertJUnit.assertTrue;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.gui.JvOptionPane;
import jalview.ws.jabaws.JalviewJabawsTestUtils;
import jalview.ws.jws2.jabaws2.Jws2Instance;
{
serviceTests.add("AAConWS".toLowerCase(Locale.ROOT));
Cache.loadProperties("test/jalview/io/testProps.jvprops");
- Cache.initLogger();
+ Console.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
}
RestClient rc = new RestClient(_rc.service, alf, true);
assertNotNull("Couldn't creat RestClient job.", rc);
- jalview.bin.Cache.initLogger();
+ jalview.bin.Console.initLogger();
RestJob rjb = new RestJob(0, new RestJobThread(rc),
rc.av.getAlignment(), null);
rjb.setAlignmentForInputs(rc.service.getInputParams().values(),
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
- jalview.bin.Cache.initLogger();
+ jalview.bin.Console.initLogger();
}
/**