import jalview.api.analysis.SimilarityParamsI;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
-import jalview.bin.Instance;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
* only view *should* be coped with sensibly.
*/
// This must have been loaded, is it still visible?
- JInternalFrame[] frames = Desktop.getDesktopPane().getAllFrames();
+ JInternalFrame[] frames = Desktop.desktop.getAllFrames();
String matchedFile = null;
for (int f = frames.length - 1; f > -1; f--)
{
{
// FIND ANY ASSOCIATED TREES
// NOT IMPLEMENTED FOR HEADLESS STATE AT PRESENT
- if (Desktop.getDesktopPane() != null)
+ if (Desktop.desktop != null)
{
- JInternalFrame[] frames = Desktop.getDesktopPane().getAllFrames();
+ JInternalFrame[] frames = Desktop.desktop.getAllFrames();
for (int t = 0; t < frames.length; t++)
{
/*
* save PCA viewers
*/
- if (!storeDS && Desktop.getDesktopPane() != null)
+ if (!storeDS && Desktop.desktop != null)
{
- for (JInternalFrame frame : Desktop.getDesktopPane().getAllFrames())
+ for (JInternalFrame frame : Desktop.desktop.getAllFrames())
{
if (frame instanceof PCAPanel)
{
// using save and then load
try
{
- fileName = fileName.replace('\\', '/');
+ fileName = fileName.replace('\\', '/');
System.out.println("Writing jar entry " + fileName);
JarEntry entry = new JarEntry(fileName);
jout.putNextEntry(entry);
final SequenceI jds, List<String> viewIds, AlignmentPanel ap,
boolean storeDataset)
{
- if (Desktop.getDesktopPane() == null)
+ if (Desktop.desktop == null)
{
return;
}
- JInternalFrame[] frames = Desktop.getDesktopPane().getAllFrames();
+ JInternalFrame[] frames = Desktop.desktop.getAllFrames();
for (int f = frames.length - 1; f > -1; f--)
{
if (frames[f] instanceof AppVarna)
return af;
}
- @SuppressWarnings("unused")
- private jarInputStreamProvider createjarInputStreamProvider(final Object ofile) throws MalformedURLException {
+ @SuppressWarnings("unused")
+ private jarInputStreamProvider createjarInputStreamProvider(final Object ofile) throws MalformedURLException {
- // BH 2018 allow for bytes already attached to File object
- try {
- String file = (ofile instanceof File ? ((File) ofile).getCanonicalPath() : ofile.toString());
+ // BH 2018 allow for bytes already attached to File object
+ try {
+ String file = (ofile instanceof File ? ((File) ofile).getCanonicalPath() : ofile.toString());
byte[] bytes = Platform.isJS() ? Platform.getFileBytes((File) ofile)
: null;
- URL url = null;
- errorMessage = null;
- uniqueSetSuffix = null;
- seqRefIds = null;
- viewportsAdded.clear();
- frefedSequence = null;
-
- if (file.startsWith("http://")) {
- url = new URL(file);
- }
- final URL _url = url;
- return new jarInputStreamProvider() {
-
- @Override
- public JarInputStream getJarInputStream() throws IOException {
- if (bytes != null) {
-// System.out.println("Jalview2XML: opening byte jarInputStream for bytes.length=" + bytes.length);
- return new JarInputStream(new ByteArrayInputStream(bytes));
- }
- if (_url != null) {
-// System.out.println("Jalview2XML: opening url jarInputStream for " + _url);
- return new JarInputStream(_url.openStream());
- } else {
-// System.out.println("Jalview2XML: opening file jarInputStream for " + file);
- return new JarInputStream(new FileInputStream(file));
- }
- }
-
- @Override
- public String getFilename() {
- return file;
- }
- };
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- }
- }
+ URL url = null;
+ errorMessage = null;
+ uniqueSetSuffix = null;
+ seqRefIds = null;
+ viewportsAdded.clear();
+ frefedSequence = null;
+
+ if (file.startsWith("http://")) {
+ url = new URL(file);
+ }
+ final URL _url = url;
+ return new jarInputStreamProvider() {
+
+ @Override
+ public JarInputStream getJarInputStream() throws IOException {
+ if (bytes != null) {
+// System.out.println("Jalview2XML: opening byte jarInputStream for bytes.length=" + bytes.length);
+ return new JarInputStream(new ByteArrayInputStream(bytes));
+ }
+ if (_url != null) {
+// System.out.println("Jalview2XML: opening url jarInputStream for " + _url);
+ return new JarInputStream(_url.openStream());
+ } else {
+// System.out.println("Jalview2XML: opening file jarInputStream for " + file);
+ return new JarInputStream(new FileInputStream(file));
+ }
+ }
+
+ @Override
+ public String getFilename() {
+ return file;
+ }
+ };
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
/**
* Recover jalview session from a jalview project archive. Caller may
{
// used to attempt to parse as V1 castor-generated xml
}
- if (Instance.getDesktop() != null)
+ if (Desktop.instance != null)
{
- Instance.getDesktop().stopLoading();
+ Desktop.instance.stopLoading();
}
if (af != null)
{
*/
for (AlignFrame fr : gatherToThisFrame.values())
{
- Instance.getDesktop().gatherViews(fr);
+ Desktop.instance.gatherViews(fr);
}
restoreSplitFrames();
if (ds.getCodonFrames() != null)
{
StructureSelectionManager
- .getStructureSelectionManager(Instance.getDesktop())
+ .getStructureSelectionManager(Desktop.instance)
.registerMappings(ds.getCodonFrames());
}
}
reportErrors();
}
- if (Instance.getDesktop() != null)
+ if (Desktop.instance != null)
{
- Instance.getDesktop().stopLoading();
+ Desktop.instance.stopLoading();
}
return af;
*/
for (SplitFrame sf : gatherTo)
{
- Instance.getDesktop().gatherViews(sf);
+ Desktop.instance.gatherViews(sf);
}
splitFrameCandidates.clear();
@Override
public void run()
{
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(Desktop.desktop,
finalErrorMessage,
"Error " + (saving ? "saving" : "loading")
+ " Jalview file",
entry.setProperty(prop.getName(), prop.getValue());
}
StructureSelectionManager
- .getStructureSelectionManager(Instance.getDesktop())
+ .getStructureSelectionManager(Desktop.instance)
.registerPDBEntry(entry);
// adds PDBEntry to datasequence's set (since Jalview 2.10)
if (al.getSequenceAt(i).getDatasetSequence() != null)
int height = safeInt(structureState.getHeight());
// Probably don't need to do this anymore...
- // Desktop.getDesktop().getComponentAt(x, y);
+ // Desktop.desktop.getComponentAt(x, y);
// TODO: NOW: check that this recovers the PDB file correctly.
String pdbFile = loadPDBFile(jprovider, pdbid.getId(),
pdbid.getFile());
String reformatedOldFilename = oldfilenam.replaceAll("/", "\\\\");
filedat = oldFiles.get(new File(reformatedOldFilename));
}
- newFileLoc.append(Platform.escapeString(filedat.getFilePath()));
+ newFileLoc.append(Platform.escapeBackslashes(filedat.getFilePath()));
pdbfilenames.add(filedat.getFilePath());
pdbids.add(filedat.getPdbId());
seqmaps.add(filedat.getSeqList().toArray(new SequenceI[0]));
{
try
{
- frames = Desktop.getDesktopPane().getAllFrames();
+ frames = Desktop.desktop.getAllFrames();
} catch (ArrayIndexOutOfBoundsException e)
{
// occasional No such child exceptions are thrown here...
af = new AlignFrame(al, safeInt(view.getWidth()),
safeInt(view.getHeight()), uniqueSeqSetId, viewId)
// {
-//
-// @Override
-// protected void processKeyEvent(java.awt.event.KeyEvent e) {
-// System.out.println("Jalview2XML AF " + e);
-// super.processKeyEvent(e);
-//
-// }
-//
+//
+// @Override
+// protected void processKeyEvent(java.awt.event.KeyEvent e) {
+// System.out.println("Jalview2XML AF " + e);
+// super.processKeyEvent(e);
+//
+// }
+//
// }
;
}
else
{
- featureOrder.put(featureType, new Float(
+ featureOrder.put(featureType, Float.valueOf(
fs / jm.getFeatureSettings().getSetting().size()));
}
if (safeBoolean(setting.isDisplay()))
for (int gs = 0; gs < jm.getFeatureSettings().getGroup().size(); gs++)
{
Group grp = jm.getFeatureSettings().getGroup().get(gs);
- fgtable.put(grp.getName(), new Boolean(grp.isDisplay()));
+ fgtable.put(grp.getName(), Boolean.valueOf(grp.isDisplay()));
}
// FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder,
// fgtable, featureColours, jms.getFeatureSettings().hasTransparency() ?