import jalview.analysis.AlignmentUtils;
import jalview.api.StructureSelectionManagerProvider;
import jalview.appletgui.AlignFrame;
import jalview.analysis.AlignmentUtils;
import jalview.api.StructureSelectionManagerProvider;
import jalview.appletgui.AlignFrame;
import jalview.datamodel.SequenceI;
import jalview.io.AnnotationFile;
import jalview.io.AppletFormatAdapter;
import jalview.datamodel.SequenceI;
import jalview.io.AnnotationFile;
import jalview.io.AppletFormatAdapter;
import jalview.io.FileParse;
import jalview.io.IdentifyFile;
import jalview.io.JPredFile;
import jalview.io.FileParse;
import jalview.io.IdentifyFile;
import jalview.io.JPredFile;
import jalview.javascript.MouseOverStructureListener;
import jalview.structure.SelectionListener;
import jalview.structure.StructureSelectionManager;
import jalview.javascript.MouseOverStructureListener;
import jalview.structure.SelectionListener;
import jalview.structure.StructureSelectionManager;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
-public class JalviewLite extends Applet implements
- StructureSelectionManagerProvider, JalviewLiteJsApi
+public class JalviewLite extends Applet
+ implements StructureSelectionManagerProvider, JalviewLiteJsApi
// use vamsas listener to broadcast to all listeners in scope
if (alignedPosition != null
&& (alignedPosition.trim().length() == 0 || alignedPosition
// use vamsas listener to broadcast to all listeners in scope
if (alignedPosition != null
&& (alignedPosition.trim().length() == 0 || alignedPosition
boolean seqlimits = suffix.equalsIgnoreCase(TRUE);
if (alf.viewport.getSelectionGroup() != null)
{
// JBPNote: getSelectionAsNewSequence behaviour has changed - this
// method now returns a full copy of sequence data
// TODO consider using getSequenceSelection instead here
boolean seqlimits = suffix.equalsIgnoreCase(TRUE);
if (alf.viewport.getSelectionGroup() != null)
{
// JBPNote: getSelectionAsNewSequence behaviour has changed - this
// method now returns a full copy of sequence data
// TODO consider using getSequenceSelection instead here
- String reply = new AppletFormatAdapter().formatSequences(format,
+ FileFormatI theFormat = FileFormats.getInstance().forName(format);
+ String reply = new AppletFormatAdapter().formatSequences(theFormat,
public void loadAnnotationFrom(AlignFrame alf, String annotation)
{
if (new AnnotationFile().annotateAlignmentView(alf.getAlignViewport(),
public void loadAnnotationFrom(AlignFrame alf, String annotation)
{
if (new AnnotationFile().annotateAlignmentView(alf.getAlignViewport(),
{
alf.alignPanel.fontChanged();
alf.alignPanel.setScrollValues(0, 0);
}
else
{
{
alf.alignPanel.fontChanged();
alf.alignPanel.setScrollValues(0, 0);
}
else
{
public boolean loadFeaturesFrom(AlignFrame alf, String features,
boolean autoenabledisplay)
{
public boolean loadFeaturesFrom(AlignFrame alf, String features,
boolean autoenabledisplay)
{
- al = new AppletFormatAdapter().readFile(text,
- AppletFormatAdapter.PASTE, format);
+ FileFormatI format = new IdentifyFile().identify(text,
+ DataSourceType.PASTE);
+ al = new AppletFormatAdapter().readFile(text, DataSourceType.PASTE,
+ format);
if (al.getHeight() > 0)
{
return new AlignFrame(al, this, title, false);
}
if (al.getHeight() > 0)
{
return new AlignFrame(al, this, title, false);
}
- System.err.println("Added a mouseover listener for "
- + ((af == null) ? "All frames" : "Just views for "
- + af.getAlignViewport().getSequenceSetId()));
- System.err.println("There are now " + javascriptListeners.size()
- + " listeners in total.");
+ jalview.bin.Console.errPrintln("Added a mouseover listener for "
+ + ((af == null) ? "All frames"
+ : "Just views for "
+ + af.getAlignViewport().getSequenceSetId()));
+ jalview.bin.Console.errPrintln("There are now "
+ + javascriptListeners.size() + " listeners in total.");
- System.err.println("Added a selection listener for "
- + ((af == null) ? "All frames" : "Just views for "
- + af.getAlignViewport().getSequenceSetId()));
- System.err.println("There are now " + javascriptListeners.size()
- + " listeners in total.");
+ jalview.bin.Console.errPrintln("Added a selection listener for "
+ + ((af == null) ? "All frames"
+ : "Just views for "
+ + af.getAlignViewport().getSequenceSetId()));
+ jalview.bin.Console.errPrintln("There are now "
+ + javascriptListeners.size() + " listeners in total.");
- System.err.println("Added a javascript structure viewer listener '"
- + listener + "'");
- System.err.println("There are now " + javascriptListeners.size()
- + " listeners in total.");
+ jalview.bin.Console
+ .errPrintln("Added a javascript structure viewer listener '"
+ + listener + "'");
+ jalview.bin.Console.errPrintln("There are now "
+ + javascriptListeners.size() + " listeners in total.");
- if ((af == null || lstner.getAlignFrame() == af)
- && (listener == null || lstner.getListenerFunction().equals(
- listener)))
+ if ((af == null || lstner.getAlignFrame() == af) && (listener == null
+ || lstner.getListenerFunction().equals(listener)))
- System.err.println("There are now " + javascriptListeners.size()
- + " listeners in total.");
+ jalview.bin.Console.errPrintln("There are now "
+ + javascriptListeners.size() + " listeners in total.");
- public void mouseOverStructure(final String pdbResNum,
- final String chain, final String pdbfile)
+ public void mouseOverStructure(final String pdbResNum, final String chain,
+ final String pdbfile)
- System.err.println("mouseOver for '" + pdbResNum
- + "' in chain '" + chain + "' in structure '" + pdbfile
- + "'");
+ System.err
+ .println("mouseOver for '" + pdbResNum + "' in chain '"
+ + chain + "' in structure '" + pdbfile + "'");
- alf.scrollTo(new Integer(topRow).intValue(), new Integer(
- leftHandColumn).intValue());
+ alf.scrollTo(Integer.valueOf(topRow).intValue(),
+ Integer.valueOf(leftHandColumn).intValue());
- System.err.println("Couldn't parse integer arguments (topRow='"
- + topRow + "' and leftHandColumn='" + leftHandColumn
- + "')");
+ jalview.bin.Console
+ .errPrintln("Couldn't parse integer arguments (topRow='"
+ + topRow + "' and leftHandColumn='"
+ + leftHandColumn + "')");
+ getAppletContext().getClass().toString() + "'");
}
JSObject scriptObject = JSObject.getWindow(this);
if (debug && scriptObject != null)
{
+ getAppletContext().getClass().toString() + "'");
}
JSObject scriptObject = JSObject.getWindow(this);
if (debug && scriptObject != null)
{
- System.err.println("JalviewLite Version " + getVersion());
- System.err.println("Build Date : " + getBuildDate());
- System.err.println("Installation : " + getInstallation());
+ jalview.bin.Console.errPrintln("JalviewLite Version " + getVersion());
+ jalview.bin.Console.errPrintln("Build Date : " + getBuildDate());
+ jalview.bin.Console.errPrintln("Installation : " + getInstallation());
{
// do onInit with the JS executor thread
new JSFunctionExec(this).executeJavascriptFunction(true,
{
// do onInit with the JS executor thread
new JSFunctionExec(this).executeJavascriptFunction(true,
*
* public void windowDeactivated(WindowEvent e) { if (currentAlignFrame ==
* frame) { currentAlignFrame = null; if (debug) {
*
* public void windowDeactivated(WindowEvent e) { if (currentAlignFrame ==
* frame) { currentAlignFrame = null; if (debug) {
g.fillRect(0, 0, getSize().width, getSize().height);
g.setColor(Color.red);
g.drawString(
g.fillRect(0, 0, getSize().width, getSize().height);
g.setColor(Color.red);
g.drawString(
- System.err.println("Prepended document base '" + documentBase
- + "' to make: '" + withDocBase + "'");
+ jalview.bin.Console.errPrintln("Prepended document base '"
+ + documentBase + "' to make: '" + withDocBase + "'");
al = new AppletFormatAdapter().readFile(resolvedFile, protocol,
format);
if ((al != null) && (al.getHeight() > 0))
al = new AppletFormatAdapter().readFile(resolvedFile, protocol,
format);
if ((al != null) && (al.getHeight() > 0))
- newAlignFrame.setTitle(MessageManager.formatMessage(
- "label.sequences_from", new Object[] { applet
- .getDocumentBase().toString() }));
+ newAlignFrame.setTitle(MessageManager
+ .formatMessage("label.sequences_from", new Object[]
+ { applet.getDocumentBase().toString() }));
Vector pdbs = new Vector();
// create a lazy matcher if we're asked to
jalview.analysis.SequenceIdMatcher matcher = (applet
Vector pdbs = new Vector();
// create a lazy matcher if we're asked to
jalview.analysis.SequenceIdMatcher matcher = (applet
- .getDefaultParameter("relaxedidmatch", false)) ? new jalview.analysis.SequenceIdMatcher(
- alignFrame.getAlignViewport().getAlignment()
- .getSequencesArray()) : null;
+ .getDefaultParameter("relaxedidmatch", false))
+ ? new jalview.analysis.SequenceIdMatcher(
+ alignFrame.getAlignViewport().getAlignment()
+ .getSequencesArray())
+ : null;
- seqs = new SequenceI[] { matcher == null ? (Sequence) alignFrame
- .getAlignViewport().getAlignment().findName(sequence)
+ seqs = new SequenceI[] { matcher == null
+ ? (Sequence) alignFrame.getAlignViewport()
+ .getAlignment().findName(sequence)
- tmp.add(matcher == null ? (Sequence) alignFrame
- .getAlignViewport().getAlignment()
- .findName(seqstring) : matcher.findIdMatch(seqstring));
+ tmp.add(matcher == null
+ ? (Sequence) alignFrame.getAlignViewport()
+ .getAlignment().findName(seqstring)
+ : matcher.findIdMatch(seqstring));
- StructureSelectionManager.getStructureSelectionManager(
- applet).registerPDBEntry(pdb);
+ StructureSelectionManager
+ .getStructureSelectionManager(applet)
+ .registerPDBEntry(pdb);
- pdbs.addElement(new Object[] { pdb, seqs, chains,
- new String(protocol) });
+ pdbs.addElement(new Object[] { pdb, seqs, chains, protocol });
PDBEntry[] pdb = new PDBEntry[pdbs.size()];
String[][] chains = new String[pdbs.size()][];
String[] protocols = new String[pdbs.size()];
PDBEntry[] pdb = new PDBEntry[pdbs.size()];
String[][] chains = new String[pdbs.size()][];
String[] protocols = new String[pdbs.size()];
JnetAnnotationMaker.add_annotation(predictions,
alignFrame.viewport.getAlignment(), 0, false);
// false == do not add sequence profile from concise output
JnetAnnotationMaker.add_annotation(predictions,
alignFrame.viewport.getAlignment(), 0, false);
// false == do not add sequence profile from concise output
- SequenceI repseq = alignFrame.viewport.getAlignment()
- .getSequenceAt(0);
- alignFrame.viewport.getAlignment().setSeqrep(repseq);
- ColumnSelection cs = new ColumnSelection();
- cs.hideInsertionsFor(repseq);
- alignFrame.viewport.setColumnSelection(cs);
+
+ alignFrame.viewport.getAlignment().setupJPredAlignment();
+
alignFrame.alignPanel.fontChanged();
alignFrame.alignPanel.setScrollValues(0, 0);
result = true;
alignFrame.alignPanel.fontChanged();
alignFrame.alignPanel.setScrollValues(0, 0);
result = true;
final String groups, boolean state)
{
final boolean st = state;// !(state==null || state.equals("") ||
final String groups, boolean state)
{
final boolean st = state;// !(state==null || state.equals("") ||
- private Hashtable<String, Hashtable<String, String[]>> jsmessages = new Hashtable<String, Hashtable<String, String[]>>();
+ private Hashtable<String, Hashtable<String, String[]>> jsmessages = new Hashtable<>();
jsmessages.put(messageclass, msgset);
}
msgset.put(viewId, colcommands);
jsmessages.put(messageclass, msgset);
}
msgset.put(viewId, colcommands);
- try
- {
- col = new jalview.schemes.UserColourScheme(colprop).findColour('A');
- } catch (Exception ex)
- {
- System.err.println("Couldn't parse '" + colprop
- + "' as a colour for " + colparam);
- col = null;
- }
+ jalview.bin.Console.errPrintln("Couldn't parse '" + colprop
+ + "' as a colour for " + colparam);
String codebase = localref.toString();
String localfile = localref.getFile();
resolvedPath = codebase.substring(0,
String codebase = localref.toString();
String localfile = localref.getFile();
resolvedPath = codebase.substring(0,
- url = resolveUrlForLocalOrAbsolute(
- url,
- prepend = getDefaultParameter("resolvetocodebase", false) ? getCodeBase()
+ url = resolveUrlForLocalOrAbsolute(url,
+ prepend = getDefaultParameter("resolvetocodebase", false)
+ ? getCodeBase()
- System.err
- .println("Show url (prepended "
- + prepend
- + " - toggle resolvetocodebase if code/docbase resolution is wrong): "
- + url);
+ jalview.bin.Console.errPrintln("Show url (prepended " + prepend
+ + " - toggle resolvetocodebase if code/docbase resolution is wrong): "
+ + url);