* operation that affects the data in the current view (selection changed,
* etc) to update the menus to reflect the new state.
*/
+ @Override
public void setMenusForViewport()
{
setMenusFromViewport(viewport);
alignPanel.makeEPS(f);
}
+ @Override
public void createSVG(File f)
{
alignPanel.makeSVG(f);
}
}
+ @Override
public void addHistoryItem(CommandI command)
{
if (command.getSize() > 0)
return;
}
- format = new IdentifyFile().Identify(str, "Paste");
+ format = new IdentifyFile().identify(str, "Paste");
} catch (OutOfMemoryError er)
{
* @param cs
* DOCUMENT ME!
*/
+ @Override
public void changeColour(ColourSchemeI cs)
{
// TODO: pull up to controller method
String type = null;
try
{
- type = new IdentifyFile().Identify(file, protocol);
+ type = new IdentifyFile().identify(file, protocol);
} catch (Exception ex)
{
type = null;
/**
* Attempt to load a "dropped" file or URL string: First by testing whether
- * it's and Annotation file, then a JNet file, and finally a features file. If
+ * it's an Annotation file, then a JNet file, and finally a features file. If
* all are false then the user may have dropped an alignment file onto this
* AlignFrame.
*
{
if (protocol == null)
{
- protocol = jalview.io.FormatAdapter.checkProtocol(file);
+ protocol = FormatAdapter.checkProtocol(file);
}
// if the file isn't identified, or not positively identified as some
// other filetype (PFAM is default unidentified alignment file type) then
// try to parse it as a features file
if (format == null)
{
- format = new IdentifyFile().Identify(file, protocol);
+ format = new IdentifyFile().identify(file, protocol);
}
if (format.equalsIgnoreCase("JnetFile"))
{
viewport.setColumnSelection(cs);
isAnnotation = true;
}
- else
+ else if (IdentifyFile.FeaturesFile.equals(format))
{
- /*
- * if (format.equalsIgnoreCase("PDB")) {
- *
- * String pdbfn = ""; // try to match up filename with sequence id
- * try { if (protocol == jalview.io.FormatAdapter.FILE) { File fl =
- * new File(file); pdbfn = fl.getName(); } else if (protocol ==
- * jalview.io.FormatAdapter.URL) { URL url = new URL(file); pdbfn =
- * url.getFile(); } } catch (Exception e) { } ; if (assocSeq ==
- * null) { SequenceIdMatcher idm = new SequenceIdMatcher(viewport
- * .getAlignment().getSequencesArray()); if (pdbfn.length() > 0) {
- * // attempt to find a match in the alignment SequenceI mtch =
- * idm.findIdMatch(pdbfn); int l = 0, c = pdbfn.indexOf("."); while
- * (mtch == null && c != -1) { while ((c = pdbfn.indexOf(".", l)) >
- * l) { l = c; } if (l > -1) { pdbfn = pdbfn.substring(0, l); } mtch
- * = idm.findIdMatch(pdbfn); } if (mtch != null) { // try and
- * associate // prompt ? PDBEntry pe = new AssociatePdbFileWithSeq()
- * .associatePdbWithSeq(file, protocol, mtch, true); if (pe != null)
- * { System.err.println("Associated file : " + file + " with " +
- * mtch.getDisplayId(true)); alignPanel.paintAlignment(true); } } //
- * TODO: maybe need to load as normal otherwise return; } }
- */
- // try to parse it as a features file
- boolean isGroupsFile = parseFeaturesFile(file, protocol);
- // if it wasn't a features file then we just treat it as a general
- // alignment file to load into the current view.
- if (!isGroupsFile)
+ if (parseFeaturesFile(file, protocol))
{
- new FileLoader().LoadFile(viewport, file, protocol, format);
+ alignPanel.paintAlignment(true);
}
+ }
else
{
- alignPanel.paintAlignment(true);
+ new FileLoader().LoadFile(viewport, file, protocol, format);
}
- }
}
}
if (isAnnotation)
} catch (Exception x)
{
}
- ;
new OOMWarning(
"loading data "
+ (protocol != null ? (protocol.equals(FormatAdapter.PASTE) ? "from clipboard."
viewport.firePropertyChange("alignment", null, al);
}
+ @Override
public void setShowSeqFeatures(boolean b)
{
showSeqFeatures.setSelected(b);