import jalview.analysis.scoremodels.PIDModel;
import jalview.analysis.scoremodels.SimilarityParams;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
public class AlignmentSorter
{
+ private AlignmentSorter()
+ {
+ // singleton
+ }
/**
* types of feature ordering: Sort by score : average score - or total score -
* over all features in region Sort by feature label text: (or if null -
public static AlignmentSorter getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.alignmentSorter == null
? j.alignmentSorter = new AlignmentSorter()
: j.alignmentSorter);
import jalview.api.AlignmentViewPanel;
import jalview.api.analysis.ScoreModelI;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.io.DataSourceType;
import jalview.io.FileParse;
import jalview.io.ScoreMatrixFile;
*/
public static ScoreModels getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.scoreModels == null ? j.scoreModels = new ScoreModels()
: j.scoreModels);
}
*/
public void reset()
{
- Jalview.getInstance().scoreModels = new ScoreModels();
+ Instance.getInstance().scoreModels = new ScoreModels();
}
/**
*/
public static Cache getInstance()
{
- Jalview j = Jalview.getInstance();
- return (j.cache == null ? j.cache = new Cache() : j.cache);
+ Instance i = Instance.getInstance();
+ return (i.cache == null ? i.cache = new Cache() : i.cache);
}
/**
private Cache()
{
- // inaccessible
+ // singleton
}
/** Jalview Properties */
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.bin;
+
+import jalview.analysis.AlignmentSorter;
+import jalview.analysis.scoremodels.ScoreModels;
+import jalview.api.StructureSelectionManagerProvider;
+import jalview.ext.ensembl.EnsemblInfo;
+import jalview.fts.service.pdb.PDBFTSRestClient;
+import jalview.fts.service.uniprot.UniProtFTSRestClient;
+import jalview.gui.Desktop;
+import jalview.httpserver.HttpServer;
+import jalview.io.gff.SequenceOntologyI;
+import jalview.rest.RestHandler;
+import jalview.structure.StructureImportSettings;
+import jalview.structure.StructureSelectionManager;
+import jalview.urls.IdOrgSettings;
+import jalview.ws.SequenceFetcher;
+import jalview.ws.jws1.Discoverer;
+import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
+import jalview.ws.rest.RestClient;
+import jalview.ws.sifts.SiftsSettings;
+
+import java.awt.Color;
+import java.util.IdentityHashMap;
+
+/**
+ * a class to hold singleton instances so that they are not shared
+ *
+ * @author hansonr
+ *
+ */
+public class Instance {
+
+ private static Instance instance;
+
+ public static Instance getInstance()
+ {
+ Instance i;
+ @SuppressWarnings("unused")
+ ThreadGroup g = Thread.currentThread().getThreadGroup();
+ /**
+ * @j2sNative i = g._instance;
+ */
+ {
+ i = instance;
+ }
+ if (i == null)
+ {
+ i = instance = new Instance();
+ /**
+ * @j2sNative g._instance = i;
+ */
+ }
+ return i;
+ }
+
+ /**
+ * singleton instance of this class in Java only
+ */
+
+ public Jalview jalview;
+
+ public Desktop desktop;
+
+ public static Jalview getJalview()
+ {
+ Instance i = getInstance();
+ if (i.jalview == null)
+ {
+ new Jalview();
+ }
+ return i.jalview;
+ }
+
+ public static void setJalview(Jalview j)
+ {
+ getInstance().jalview = j;
+ }
+
+ public static Desktop getDesktop()
+ {
+ Instance i = getInstance();
+ return (i.desktop == null ? (i.desktop = new Desktop(true))
+ : i.desktop);
+ }
+
+ public static void setDesktop(Desktop d)
+ {
+ getInstance().desktop = d;
+ }
+
+ public Cache cache;
+
+ public AlignmentSorter alignmentSorter;
+
+ public Color[] rnaHelices = null;
+
+ public Discoverer discoverer;
+
+ public EnsemblInfo ensemblInfo;
+
+ public HttpServer httpServer;
+
+ public IdOrgSettings idOrgSettings;
+
+ public Jws2Discoverer j2s2discoverer;
+
+ public Jws2InstanceFactory jws2InstanceFactory;
+
+ public PDBFTSRestClient pdbFTSRestClient;
+
+ public RestClient restClient;
+
+ public RestHandler restHandler;
+
+ public ScoreModels scoreModels;
+
+ public SequenceFetcher sequenceFetcher;
+
+ public SequenceOntologyI sequenceOntology;
+
+ public SiftsSettings siftsSettings;
+
+ public StructureImportSettings structureImportSettings;
+
+ public UniProtFTSRestClient uniprotFTSRestClient;
+
+ public IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> structureSelections;
+
+}
*/
package jalview.bin;
-import jalview.analysis.AlignmentSorter;
-import jalview.analysis.scoremodels.ScoreModels;
-import jalview.api.StructureSelectionManagerProvider;
-import jalview.ext.ensembl.EnsemblInfo;
import jalview.ext.so.SequenceOntology;
-import jalview.fts.service.pdb.PDBFTSRestClient;
-import jalview.fts.service.uniprot.UniProtFTSRestClient;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.PromptUserConfig;
-import jalview.httpserver.HttpServer;
import jalview.io.AppletFormatAdapter;
import jalview.io.BioJsHTMLOutput;
import jalview.io.DataSourceType;
import jalview.io.IdentifyFile;
import jalview.io.NewickFile;
import jalview.io.gff.SequenceOntologyFactory;
-import jalview.io.gff.SequenceOntologyI;
-import jalview.rest.RestHandler;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
-import jalview.structure.StructureImportSettings;
-import jalview.structure.StructureSelectionManager;
-import jalview.urls.IdOrgSettings;
import jalview.util.MessageManager;
import jalview.util.Platform;
-import jalview.ws.SequenceFetcher;
-import jalview.ws.jws1.Discoverer;
import jalview.ws.jws2.Jws2Discoverer;
-import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
-import jalview.ws.rest.RestClient;
-import jalview.ws.sifts.SiftsSettings;
-import java.awt.Color;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.security.Permissions;
import java.security.Policy;
import java.util.HashMap;
-import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Vector;
import java.util.logging.ConsoleHandler;
public Jalview()
{
- setInstance(this);
+ Instance.setJalview(this);
}
static
public static boolean isHeadlessMode()
{
- return getInstance().headless;
- }
-
- /**
- * singleton instance of this class in Java only
- */
-
- private static Jalview instance;
-
- public static Jalview getInstance()
- {
- if (instance == null)
- {
- instance = new Jalview();
- }
- Jalview j;
- @SuppressWarnings("unused")
- ThreadGroup g = Thread.currentThread().getThreadGroup();
- /**
- * @j2sNative j = g._jalviewInstance;
- */
- {
- j = instance;
- }
- return j;
- }
-
- private static void setInstance(Jalview j)
- {
- @SuppressWarnings("unused")
- ThreadGroup g = Thread.currentThread().getThreadGroup();
- /**
- * @j2sNative g._jalviewInstance = j;
- */
- {
- instance = j;
- }
+ return Instance.getJalview().headless;
}
private Desktop desktop;
public static AlignFrame getCurrentAlignFrame()
{
- return getInstance().currentAlignFrame;
+ return Instance.getJalview().currentAlignFrame;
}
public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
{
- getInstance().currentAlignFrame = currentAlignFrame;
+ Instance.getJalview().currentAlignFrame = currentAlignFrame;
}
static
public static void main(String[] args)
{
// setLogging(); // BH - for event debugging in JavaScript
- new Jalview();
- getInstance().doMain(args);
+ new Jalview().doMain(args);
}
private static void logClass(String name)
}
}
- // singleton instances
-
- public Cache cache;
-
- public AlignmentSorter alignmentSorter;
-
- public EnsemblInfo ensemblInfo;
-
- public HttpServer httpServer;
-
- public IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> structureSelections;
-
- public PDBFTSRestClient pdbFTSRestClient;
-
- public RestHandler restHandler;
-
- public ScoreModels scoreModels;
-
- public SequenceFetcher sequenceFetcher;
-
- public SequenceOntologyI sequenceOntology;
-
- public UniProtFTSRestClient uniprotFTSRestClient;
-
- public StructureSelectionManager nullProvider;
-
- public Color[] rnaHelices = null;
-
- public StructureImportSettings structureImportSettings;
-
- public IdOrgSettings idOrgSettings;
-
- public SiftsSettings siftsSettings;
-
- public RestClient restClient;
-
- public Jws2Discoverer j2s2discoverer;
-
- public Jws2InstanceFactory jws2InstanceFactory;
-
- public Discoverer discoverer;
+ // BH 2019.05.10 moved here from StructureSelectionManager because this is a
+ // singleton; allows it to be cleaned up when the application is closed.
}
package jalview.ext.ensembl;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefSource;
*/
private static EnsemblInfo getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.ensemblInfo == null ? j.ensemblInfo = new EnsemblInfo()
: j.ensemblInfo);
}
*/
package jalview.fts.service.pdb;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.SequenceI;
import jalview.fts.api.FTSData;
import jalview.fts.api.FTSDataColumnI;
public static FTSRestClientI getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.pdbFTSRestClient == null
? j.pdbFTSRestClient = new PDBFTSRestClient()
: j.pdbFTSRestClient);
public static final String PDB_SEARCH_ENDPOINT = "https://www.ebi.ac.uk/pdbe/search/pdb/select?";
- protected PDBFTSRestClient()
+ private PDBFTSRestClient()
{
+ // singleton
}
/**
package jalview.fts.service.uniprot;
import jalview.bin.Cache;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.fts.api.FTSData;
import jalview.fts.api.FTSDataColumnI;
import jalview.fts.api.FTSRestClientI;
public static FTSRestClientI getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.uniprotFTSRestClient == null ? j.uniprotFTSRestClient = new UniProtFTSRestClient()
: j.uniprotFTSRestClient);
}
public final String uniprotSearchEndpoint;
- public UniProtFTSRestClient()
+ private UniProtFTSRestClient()
{
- super();
uniprotSearchEndpoint = Cache.getDefault("UNIPROT_DOMAIN",
DEFAULT_UNIPROT_DOMAIN) + "/uniprot/";
}
import jalview.api.ViewStyleI;
import jalview.api.analysis.SimilarityParamsI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.commands.CommandI;
import jalview.commands.EditCommand;
private void addServiceListeners()
{
final java.beans.PropertyChangeListener thisListener;
- Desktop.getInstance().addJalviewPropertyChangeListener("services",
+ Instance.getDesktop().addJalviewPropertyChangeListener("services",
thisListener = new java.beans.PropertyChangeListener()
{
@Override
javax.swing.event.InternalFrameEvent evt)
{
// System.out.println("deregistering discoverer listener");
- Desktop.getInstance().removeJalviewPropertyChangeListener("services",
+ Instance.getDesktop().removeJalviewPropertyChangeListener("services",
thisListener);
closeMenuItem_actionPerformed(true);
}
@Override
public void addFromFile_actionPerformed(ActionEvent e)
{
- Desktop.getInstance().inputLocalFileMenuItem_actionPerformed(viewport);
+ Instance.getDesktop().inputLocalFileMenuItem_actionPerformed(viewport);
}
@Override
try
{
frames[i].setSelected(true);
- Desktop.getInstance().closeAssociatedWindows();
+ Instance.getDesktop().closeAssociatedWindows();
} catch (java.beans.PropertyVetoException ex)
{
}
}
}
- Desktop.getInstance().closeAssociatedWindows();
+ Instance.getDesktop().closeAssociatedWindows();
FileLoader loader = new FileLoader();
DataSourceType protocol = fileName.startsWith("http:")
@Override
public void addFromText_actionPerformed(ActionEvent e)
{
- Desktop.getInstance()
+ Instance.getDesktop()
.inputTextboxMenuItem_actionPerformed(viewport.getAlignPanel());
}
@Override
public void addFromURL_actionPerformed(ActionEvent e)
{
- Desktop.getInstance().inputURLMenuItem_actionPerformed(viewport);
+ Instance.getDesktop().inputURLMenuItem_actionPerformed(viewport);
}
@Override
StringSelection ss = new StringSelection(output);
- Desktop d = Desktop.getInstance();
+ Desktop d = Instance.getDesktop();
try
{
d.internalCopy = true;
.setContents(new StringSelection(""), null);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss,
- Desktop.getInstance());
+ Instance.getDesktop());
} catch (OutOfMemoryError er)
{
new OOMWarning("copying region", er);
boolean annotationAdded = false;
AlignmentI alignment = null;
- Desktop d = Desktop.getInstance();
+ Desktop d = Instance.getDesktop();
if (d.jalviewClipboard != null)
{
DEFAULT_HEIGHT);
String newtitle = new String("Flanking alignment");
- Desktop d = Desktop.getInstance();
+ Desktop d = Instance.getDesktop();
if (d.jalviewClipboard != null && d.jalviewClipboard[2] != null)
{
@Override
public void gatherViews_actionPerformed(ActionEvent e)
{
- Desktop.getInstance().gatherViews(this);
+ Instance.getDesktop().gatherViews(this);
}
/**
PDBEntry pe = new AssociatePdbFileWithSeq()
.associatePdbWithSeq(fm[0].toString(),
(DataSourceType) fm[1], toassoc, false,
- Desktop.getInstance());
+ Instance.getDesktop());
if (pe != null)
{
System.err.println("Associated file : "
import jalview.api.FeaturesDisplayedI;
import jalview.api.ViewStyleI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.commands.CommandI;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
if (align != null)
{
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
ssm.registerMappings(align.getCodonFrames());
}
if (mappings != null)
{
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
for (AlignedCodonFrame acf : mappings)
{
if (noReferencesTo(acf))
public void sendSelection()
{
jalview.structure.StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance())
+ .getStructureSelectionManager(Instance.getDesktop())
.sendSelection(new SequenceGroup(getSelectionGroup()),
new ColumnSelection(getColumnSelection()),
new HiddenColumns(getAlignment().getHiddenColumns()),
public StructureSelectionManager getStructureSelectionManager()
{
return StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
}
@Override
import jalview.analysis.AlignSeq;
import jalview.analysis.AlignmentUtils;
+import jalview.bin.Instance;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
seqs, omitHidden, alignmentStartEnd);
Toolkit.getDefaultToolkit().getSystemClipboard()
- .setContents(new StringSelection(output), Desktop.getInstance());
+ .setContents(new StringSelection(output), Instance.getDesktop());
HiddenColumns hiddenColumns = null;
av.getAlignment().getHiddenColumns());
}
- Desktop.getInstance().jalviewClipboard = new Object[] { seqs, ds, // what is
+ Instance.getDesktop().jalviewClipboard = new Object[] { seqs, ds, // what is
// the
// dataset
// of a consensus
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureSettingsModelI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
.setGapCharacter(alignFrame.viewport.getGapCharacter());
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
/*
* register any new mappings for sequence mouseover etc
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.gui.ImageExporter.ImageWriterI;
import jalview.io.BackupFiles;
import jalview.util.Platform;
import jalview.util.UrlConstants;
import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.jws1.Discoverer;
import jalview.ws.params.ParamManager;
import jalview.ws.utils.UrlDownloadClient;
listener);
}
- /**
- * Singleton Desktop instance only in Java;
- */
- private static Desktop instance;
-
- public static Desktop getInstance()
- {
- if (instance == null)
- {
- new Desktop(true);
- }
- Desktop d;
- @SuppressWarnings("unused")
- ThreadGroup g = Thread.currentThread().getThreadGroup();
- /**
- * @j2sNative d = g._jalviewDesktopInstance;
- */
- {
- d = instance;
- }
- return d;
- }
-
- private static void setInstance(Desktop d)
- {
- @SuppressWarnings("unused")
- ThreadGroup g = Thread.currentThread().getThreadGroup();
- /**
- * @j2sNative g._jalviewDesktopInstance = d;
- */
- {
- instance = d;
- }
- }
-
- private MyDesktopPane desktopPane;
-
public static MyDesktopPane getDesktopPane()
{
- return getInstance().desktopPane;
- }
-
- private void setDesktopPane(MyDesktopPane pane)
- {
- getInstance().desktopPane = pane;
+ return Instance.getDesktop().desktopPane;
}
static int openFrameCount = 0;
static final int yOffset = 30;
- public jalview.ws.jws1.Discoverer discoverer;
+ public Discoverer discoverer;
public Object[] jalviewClipboard;
public JInternalFrame conservationSlider, PIDSlider;
+ /**
+ * just an instance (for testng, probably); no actual frames
+ */
private boolean instanceOnly;
class MyDesktopManager implements DesktopManager
} catch (NullPointerException npe)
{
Point p = getMousePosition();
- getInstance().showPasteMenu(p.x, p.y);
+ showPasteMenu(p.x, p.y);
}
}
public void endDraggingFrame(JComponent f)
{
delegate.endDraggingFrame(f);
- getDesktopPane().repaint();
+ desktopPane.repaint();
}
@Override
public void endResizingFrame(JComponent f)
{
delegate.endResizingFrame(f);
- getDesktopPane().repaint();
+ desktopPane.repaint();
}
@Override
}
+ public MyDesktopPane desktopPane;
+
public Desktop(boolean forInstance)
{
instanceOnly = true;
- setInstance(this);
}
/**
* Creates a new Desktop object.
* block are spawned off as threads rather than waited for during this
* constructor.
*/
- setInstance(this);
+ Instance.setDesktop(this);
if (!Platform.isJS())
{
doVamsasClientCheck();
false);
boolean showjconsole = jalview.bin.Cache.getDefault("SHOW_JAVA_CONSOLE",
false);
- setDesktopPane(new MyDesktopPane(selmemusage));
+ desktopPane = new MyDesktopPane(selmemusage);
showMemusage.setSelected(selmemusage);
- getDesktopPane().setBackground(Color.white);
+ desktopPane.setBackground(Color.white);
getContentPane().setLayout(new BorderLayout());
// alternate config - have scrollbars - see notes in JAL-153
// JScrollPane sp = new JScrollPane();
getRootPane().putClientProperty("swingjs.overflow.hidden", "false");
}
- getContentPane().add(getDesktopPane(), BorderLayout.CENTER);
- getDesktopPane().setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
+ getContentPane().add(desktopPane, BorderLayout.CENTER);
+ desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
// This line prevents Windows Look&Feel resizing all new windows to maximum
// if previous window was maximised
- getDesktopPane().setDesktopManager(new MyDesktopManager(
+ desktopPane.setDesktopManager(new MyDesktopManager(
(Platform.isWindowsAndNotJS() ? new DefaultDesktopManager()
: Platform.isAMacAndNotJS()
? new AquaInternalFrameManager(
- getDesktopPane().getDesktopManager())
- : getDesktopPane().getDesktopManager())));
+ desktopPane.getDesktopManager())
+ : desktopPane.getDesktopManager())));
Rectangle dims = getLastKnownDimensions("");
if (dims != null)
}
- this.setDropTarget(new java.awt.dnd.DropTarget(getDesktopPane(), this));
+ this.setDropTarget(new java.awt.dnd.DropTarget(desktopPane, this));
this.addWindowListener(new WindowAdapter()
{
}
}
});
- getDesktopPane().addMouseListener(ma);
+ desktopPane.addMouseListener(ma);
}
public void run()
{
long now = System.currentTimeMillis();
- Desktop.getInstance().setProgressBar(
+ setProgressBar(
MessageManager.getString("status.refreshing_news"), now);
jvnews.refreshNews();
- Desktop.getInstance().setProgressBar(null, now);
+ setProgressBar(null, now);
jvnews.showNews();
}
}).start();
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
// IF JALVIEW IS RUNNING HEADLESS
// ///////////////////////////////////////////////
- if (getInstance().instanceOnly || Jalview.isHeadlessMode())
+ if (Instance.getDesktop().instanceOnly || Jalview.isHeadlessMode())
{
return;
}
{
menuItem.removeActionListener(menuItem.getActionListeners()[0]);
}
- getInstance().windowMenu.remove(menuItem);
+ Instance.getDesktop().windowMenu.remove(menuItem);
};
});
getDesktopPane().add(frame);
- getInstance().windowMenu.add(menuItem);
+ Instance.getDesktop().windowMenu.add(menuItem);
frame.toFront();
try
{
if (!internalCopy)
{
- Desktop.getInstance().jalviewClipboard = null;
+ Instance.getDesktop().jalviewClipboard = null;
}
internalCopy = false;
@Override
public void closeAll_actionPerformed(ActionEvent e)
{
- if (getDesktopPane() == null)
+ if (desktopPane == null)
{
return;
}
// TODO show a progress bar while closing?
- JInternalFrame[] frames = getDesktopPane().getAllFrames();
+ JInternalFrame[] frames = desktopPane.getAllFrames();
for (int i = 0; i < frames.length; i++)
{
try
{
progressPanel = new JPanel(new GridLayout(1, 1));
totalProgressCount = 0;
- getInstance().getContentPane().add(progressPanel, BorderLayout.SOUTH);
+ getContentPane().add(progressPanel, BorderLayout.SOUTH);
}
JPanel thisprogress = new JPanel(new BorderLayout(10, 5));
JProgressBar progressBar = new JProgressBar();
((GridLayout) progressPanel.getLayout()).setRows(
((GridLayout) progressPanel.getLayout()).getRows() + 1);
++totalProgressCount;
- getInstance().validate();
+ validate();
return thisprogress;
}
{
source.viewport.setGatherViewsHere(true);
source.viewport.setExplodedGeometry(source.getBounds());
- JInternalFrame[] frames = getDesktopPane().getAllFrames();
+ JInternalFrame[] frames = getAllFrames();
String viewId = source.viewport.getSequenceSetId();
for (int t = 0; t < frames.length; t++)
public JInternalFrame[] getAllFrames()
{
- return getDesktopPane().getAllFrames();
+ return desktopPane.getAllFrames();
}
/**
});
msgPanel.add(jcb);
- JvOptionPane.showMessageDialog(Desktop.getDesktopPane(), msgPanel,
+ JvOptionPane.showMessageDialog(desktopPane, msgPanel,
MessageManager
.getString("label.SEQUENCE_ID_no_longer_used"),
JvOptionPane.WARNING_MESSAGE);
} catch (Exception ex)
{
jalview.bin.Cache.log.error("Groovy Shell Creation failed.", ex);
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(desktopPane,
MessageManager.getString("label.couldnt_create_groovy_shell"),
MessageManager.getString("label.groovy_support_failed"),
// todo: changesupport handlers need to be transferred
if (discoverer == null)
{
- discoverer = new jalview.ws.jws1.Discoverer();
+ discoverer = Discoverer.getInstance();
// register PCS handler for getDesktop().
discoverer.addPropertyChangeListener(changeSupport);
}
*/
public static void showUrl(final String url)
{
- showUrl(url, Desktop.getInstance());
+ showUrl(url, Instance.getDesktop());
}
/**
public static ParamManager getUserParameterStore()
{
- Desktop d = getInstance();
+ Desktop d = Instance.getDesktop();
if (d.wsparamManager == null)
{
d.wsparamManager = new WsParamSetManager();
String topViewId = myTopFrame.viewport.getSequenceSetId();
String bottomViewId = myBottomFrame.viewport.getSequenceSetId();
- JInternalFrame[] frames = getDesktopPane().getAllFrames();
+ JInternalFrame[] frames = desktopPane.getAllFrames();
for (JInternalFrame frame : frames)
{
if (frame instanceof SplitFrame && frame != source)
public static groovy.ui.Console getGroovyConsole()
{
- return getInstance().groovyConsole;
+ return Instance.getDesktop().groovyConsole;
}
/**
Class<? extends StructureViewerBase> structureViewerClass)
{
List<StructureViewerBase> result = new ArrayList<>();
- JInternalFrame[] frames = Desktop.getInstance().getAllFrames();
+ JInternalFrame[] frames = getAllFrames();
for (JInternalFrame frame : frames)
{
*/
package jalview.gui;
+import jalview.bin.Instance;
import jalview.util.MessageManager;
import java.awt.Container;
boolean block, String title, int width, int height)
{
- frame = new JDialog(Desktop.getInstance(), modal);
+ frame = new JDialog(Instance.getDesktop(), modal);
frame.setTitle(title);
- if (Desktop.getInstance() != null)
+ if (Instance.getDesktop() != null)
{
- Rectangle deskr = Desktop.getInstance().getBounds();
+ Rectangle deskr = Instance.getDesktop().getBounds();
frame.setBounds(new Rectangle((int) (deskr.getCenterX() - width / 2),
(int) (deskr.getCenterY() - height / 2), width, height));
}
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.gui.Help.HelpId;
import jalview.gui.StructureViewer.ViewerType;
import jalview.io.BackupFiles;
Integer.toString(getComboIntStringKey(backupfilesPresetsCombo)));
Cache.saveProperties();
- Desktop.getInstance().doConfigureStructurePrefs();
+ Instance.getDesktop().doConfigureStructurePrefs();
try
{
frame.setClosed(true);
package jalview.gui;
import jalview.analysis.Conservation;
+import jalview.bin.Instance;
import jalview.datamodel.SequenceGroup;
import jalview.jbgui.GSliderPanel;
import jalview.renderer.ResidueShaderI;
public static SliderPanel getSliderPanel()
{
- JInternalFrame conservationSlider = Desktop
- .getInstance().conservationSlider;
+ JInternalFrame conservationSlider = Instance
+ .getDesktop().conservationSlider;
- JInternalFrame PIDSlider = Desktop.getInstance().PIDSlider;
+ JInternalFrame PIDSlider = Instance.getDesktop().PIDSlider;
if (conservationSlider != null && conservationSlider.isVisible())
{
{
SliderPanel sliderPanel = null;
- JInternalFrame conservationSlider = Desktop
- .getInstance().conservationSlider;
+ JInternalFrame conservationSlider = Instance
+ .getDesktop().conservationSlider;
if (conservationSlider == null)
{
sliderPanel = new SliderPanel(ap, rs.getConservationInc(), true, rs);
- conservationSlider = Desktop
- .getInstance().conservationSlider = new JInternalFrame();
+ conservationSlider = Instance
+ .getDesktop().conservationSlider = new JInternalFrame();
conservationSlider.setContentPane(sliderPanel);
conservationSlider.setLayer(JLayeredPane.PALETTE_LAYER);
}
*/
public static void hidePIDSlider()
{
- JInternalFrame PIDSlider = Desktop.getInstance().PIDSlider;
+ JInternalFrame PIDSlider = Instance.getDesktop().PIDSlider;
if (PIDSlider != null)
{
try
{
PIDSlider.setClosed(true);
- Desktop.getInstance().PIDSlider = null;
+ Instance.getDesktop().PIDSlider = null;
} catch (PropertyVetoException ex)
{
}
*/
public static void hideConservationSlider()
{
- JInternalFrame conservationSlider = Desktop
- .getInstance().conservationSlider;
+ JInternalFrame conservationSlider = Instance
+ .getDesktop().conservationSlider;
if (conservationSlider != null)
{
try
{
conservationSlider.setClosed(true);
- Desktop.getInstance().conservationSlider = null;
+ Instance.getDesktop().conservationSlider = null;
} catch (PropertyVetoException ex)
{
}
{
hidePIDSlider();
- JInternalFrame conservationSlider = Desktop
- .getInstance().conservationSlider;
+ JInternalFrame conservationSlider = Instance
+ .getDesktop().conservationSlider;
if (!conservationSlider.isVisible())
{
@Override
public void internalFrameClosed(InternalFrameEvent e)
{
- Desktop.getInstance().conservationSlider = null;
+ Instance.getDesktop().conservationSlider = null;
}
});
conservationSlider.setLayer(JLayeredPane.PALETTE_LAYER);
SliderPanel sliderPanel = null;
- JInternalFrame PIDSlider = Desktop.getInstance().PIDSlider;
+ JInternalFrame PIDSlider = Instance.getDesktop().PIDSlider;
if (PIDSlider == null)
{
sliderPanel = new SliderPanel(ap, threshold, false, rs);
- PIDSlider = Desktop.getInstance().PIDSlider = new JInternalFrame();
+ PIDSlider = Instance.getDesktop().PIDSlider = new JInternalFrame();
PIDSlider.setContentPane(sliderPanel);
PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER);
}
{
hideConservationSlider();
- JInternalFrame PIDSlider = Desktop.getInstance().PIDSlider;
+ JInternalFrame PIDSlider = Instance.getDesktop().PIDSlider;
if (!PIDSlider.isVisible())
{
@Override
public void internalFrameClosed(InternalFrameEvent e)
{
- Desktop.getInstance().PIDSlider = null;
+ Instance.getDesktop().PIDSlider = null;
}
});
PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER);
public static int getConservationValue()
{
- return getValue(Desktop.getInstance().conservationSlider);
+ return getValue(Instance.getDesktop().conservationSlider);
}
static int getValue(JInternalFrame slider)
public static int getPIDValue()
{
- return getValue(Desktop.getInstance().PIDSlider);
+ return getValue(Instance.getDesktop().PIDSlider);
}
/**
public String getTitle()
{
String title = null;
- JInternalFrame conservationSlider = Desktop
- .getInstance().conservationSlider;
- JInternalFrame PIDSlider = Desktop.getInstance().PIDSlider;
+ JInternalFrame conservationSlider = Instance
+ .getDesktop().conservationSlider;
+ JInternalFrame PIDSlider = Instance.getDesktop().PIDSlider;
if (isForConservation())
{
*/
package jalview.gui;
+import jalview.bin.Instance;
import jalview.util.Platform;
import java.awt.BorderLayout;
System.err.println("Error when loading images!");
}
} while (!mt.checkAll());
- Desktop.getInstance().setIconImage(logo);
+ Instance.getDesktop().setIconImage(logo);
}
} catch (Exception ex)
{
@SuppressWarnings("unused")
protected boolean refreshText()
{
- String newtext = Desktop.getInstance().getAboutMessage(true).toString();
+ String newtext = Instance.getDesktop().getAboutMessage(true).toString();
// System.err.println("Text found: \n"+newtext+"\nEnd of newtext.");
if (oldtext != newtext.length())
{
authlist.setSize(new Dimension(750, 375));
add(authlist, BorderLayout.CENTER);
revalidate();
- iframe.setBounds((Desktop.getInstance().getWidth() - 750) / 2,
- (Desktop.getInstance().getHeight() - 375) / 2, 750,
+ iframe.setBounds((Instance.getDesktop().getWidth() - 750) / 2,
+ (Instance.getDesktop().getHeight() - 375) / 2, 750,
authlist.getHeight() + iconimg.getHeight());
iframe.validate();
iframe.setVisible(true);
}
closeSplash();
- Desktop.getInstance().startDialogQueue();
+ Instance.getDesktop().startDialogQueue();
}
/**
package jalview.gui;
import jalview.api.SplitContainerI;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentI;
import jalview.jbgui.GAlignFrame;
import jalview.jbgui.GSplitFrame;
// allow about 65 pixels for Desktop decorators on Windows
int newHeight = Math.min(height,
- Desktop.getInstance().getHeight() - DESKTOP_DECORATORS_HEIGHT);
+ Instance.getDesktop().getHeight() - DESKTOP_DECORATORS_HEIGHT);
if (newHeight != height)
{
int oldDividerLocation = getDividerLocation();
// TODO if CommandListener is only ever 1:1 for complementary views,
// may change broadcast pattern to direct messaging (more efficient)
final StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
ssm.addCommandListener(((AlignFrame) getTopFrame()).getViewport());
ssm.addCommandListener(((AlignFrame) getBottomFrame()).getViewport());
}
adjustLayout();
final StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
ssm.addCommandListener(newTopPanel.av);
ssm.addCommandListener(newBottomPanel.av);
}
*/
protected void expandViews_actionPerformed()
{
- Desktop.getInstance().explodeViews(this);
+ Instance.getDesktop().explodeViews(this);
}
/**
*/
protected void gatherViews_actionPerformed()
{
- Desktop.getInstance().gatherViews(this);
+ Instance.getDesktop().gatherViews(this);
}
/**
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
*/
protected void discoverStructureViews()
{
- if (Desktop.getInstance() != null)
+ if (Instance.getDesktop() != null)
{
targetView.removeAllItems();
- Desktop d = Desktop.getInstance();
+ Desktop d = Instance.getDesktop();
if (d.lastTargetedView != null && !d.lastTargetedView.isVisible())
{
d.lastTargetedView = null;
}
int linkedViewsAt = 0;
- for (StructureViewerBase view : Desktop.getInstance()
+ for (StructureViewerBase view : Instance.getDesktop()
.getStructureViewers(null, null))
{
StructureViewer viewHandler = (d.lastTargetedView != null
PDBEntry fileEntry = new AssociatePdbFileWithSeq()
.associatePdbWithSeq(selectedPdbFileName,
DataSourceType.FILE, selectedSequence, true,
- Desktop.getInstance());
+ Instance.getDesktop());
sViewer = launchStructureViewer(
ssm, new PDBEntry[]
}
setProgressBar(null, progressId);
// remember the last viewer we used...
- Desktop.getInstance().lastTargetedView = theViewer;
+ Instance.getDesktop().lastTargetedView = theViewer;
return theViewer;
}
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
*/
protected List<StructureViewerBase> getViewersFor(AlignmentPanel alp)
{
- return Desktop.getInstance().getStructureViewers(alp, this.getClass());
+ return Instance.getDesktop().getStructureViewers(alp, this.getClass());
}
@Override
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
if (reply == JvOptionPane.YES_OPTION)
{
Cache.log.debug("Prompting for vamsas store filename.");
- Desktop.getInstance().vamsasSave_actionPerformed(null);
+ Instance.getDesktop().vamsasSave_actionPerformed(null);
Cache.log
.debug("Finished attempt at storing document.");
}
public void disableGui(boolean b)
{
- Desktop.getInstance().setVamsasUpdate(b);
+ Instance.getDesktop().setVamsasUpdate(b);
}
Hashtable _backup_vobj2jv;
{
final IPickManager pm = vclient.getPickManager();
final StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
final VamsasApplication me = this;
pm.registerMessageHandler(new IMessageHandler()
{
*/
package jalview.gui;
+import jalview.bin.Instance;
import jalview.gui.OptsAndParamsPage.OptionBox;
import jalview.gui.OptsAndParamsPage.ParamBox;
import jalview.util.MessageManager;
public boolean showRunDialog()
{
- frame = new JDialog(Desktop.getInstance(), true);
+ frame = new JDialog(Instance.getDesktop(), true);
frame.setTitle(MessageManager.formatMessage("label.edit_params_for",
new String[]
{ service.getActionText() }));
- Rectangle deskr = Desktop.getInstance().getBounds();
+ Rectangle deskr = Instance.getDesktop().getBounds();
Dimension pref = this.getPreferredSize();
frame.setBounds(
new Rectangle((int) (deskr.getCenterX() - pref.width / 2),
dialogpanel.add(canceljob);
// JAL-1580: setMaximumSize() doesn't work, so just size for the worst case:
// check for null is for JUnit usage
- final int windowHeight = Desktop.getInstance() == null ? 540
- : Desktop.getInstance().getHeight();
+ final int windowHeight = Instance.getDesktop() == null ? 540
+ : Instance.getDesktop().getHeight();
setPreferredSize(new Dimension(540, windowHeight));
add(dialogpanel, BorderLayout.SOUTH);
validate();
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
import jalview.util.MessageManager;
chooser.setDialogTitle(MessageManager
.getString("label.choose_filename_for_param_file"));
chooser.setToolTipText(MessageManager.getString("action.save"));
- int value = chooser.showSaveDialog(Desktop.getInstance());
+ int value = chooser.showSaveDialog(Instance.getDesktop());
if (value == JalviewFileChooser.APPROVE_OPTION)
{
outfile = chooser.getSelectedFile();
File pfile = new File(filename);
if (pfile.exists() && pfile.canWrite())
{
- if (JvOptionPane.showConfirmDialog(Desktop.getInstance(),
+ if (JvOptionPane.showConfirmDialog(Instance.getDesktop(),
"Delete the preset's file, too ?", "Delete User Preset ?",
JvOptionPane.OK_CANCEL_OPTION) == JvOptionPane.OK_OPTION)
{
package jalview.gui;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.jbgui.GWsPreferences;
import jalview.util.MessageManager;
import jalview.ws.jws2.Jws2Discoverer;
if (lastrefresh != update)
{
lastrefresh = update;
- Desktop.getInstance().startServiceDiscovery(true); // wait around for all
+ Instance.getDesktop().startServiceDiscovery(true); // wait around for all
// threads to complete
updateList();
public void run()
{
long ct = System.currentTimeMillis();
- Desktop.getInstance().setProgressBar(MessageManager
+ Instance.getDesktop().setProgressBar(MessageManager
.getString("status.refreshing_web_service_menus"), ct);
if (lastrefresh != update)
{
lastrefresh = update;
- Desktop.getInstance().startServiceDiscovery(true);
+ Instance.getDesktop().startServiceDiscovery(true);
updateList();
}
- Desktop.getInstance().setProgressBar(null, ct);
+ Instance.getDesktop().setProgressBar(null, ct);
}
}).start();
*/
package jalview.httpserver;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.rest.RestHandler;
import java.net.BindException;
{
synchronized (HttpServer.class)
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.httpServer == null ? j.httpServer = new HttpServer()
: j.httpServer);
}
import jalview.api.FeaturesDisplayedI;
import jalview.api.FeaturesSourceI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
Runtime rt = Runtime.getRuntime();
try
{
- if (Desktop.getInstance() != null)
+ if (Instance.getDesktop() != null)
{
- Desktop.getInstance().startLoading(file);
+ Instance.getDesktop().startLoading(file);
}
if (format == null)
{
if (format == null)
{
- Desktop.getInstance().stopLoading();
+ Instance.getDesktop().stopLoading();
System.err.println("The input file \"" + file
+ "\" has null or unidentifiable data content!");
if (!Jalview.isHeadlessMode())
// register PDB entries with desktop's structure selection
// manager
StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance())
+ .getStructureSelectionManager(Instance.getDesktop())
.registerPDBEntry(pdbe);
}
}
}
else
{
- if (Desktop.getInstance() != null)
+ if (Instance.getDesktop() != null)
{
- Desktop.getInstance().stopLoading();
+ Instance.getDesktop().stopLoading();
}
final String errorMessage = MessageManager.getString(
}
}
// remove the visual delay indicator
- if (Desktop.getInstance() != null)
+ if (Instance.getDesktop() != null)
{
- Desktop.getInstance().stopLoading();
+ Instance.getDesktop().stopLoading();
}
}
package jalview.io;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.GraphLine;
// FIND ANY ASSOCIATED TREES
if (Desktop.getDesktopPane() != null)
{
- javax.swing.JInternalFrame[] frames = Desktop.getInstance()
+ javax.swing.JInternalFrame[] frames = Instance.getDesktop()
.getAllFrames();
for (int t = 0; t < frames.length; t++)
if (mappings != null)
{
jalview.structure.StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance())
+ .getStructureSelectionManager(Instance.getDesktop())
.registerMappings(mappings);
}
}
*/
package jalview.io.gff;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
/**
* A factory class that returns a model of the Sequence Ontology. By default a
*/
public class SequenceOntologyFactory
{
+
+ private SequenceOntologyFactory()
+ {
+ // noninstantiable
+ }
// private static SequenceOntologyI instance; // moved to Jalview.instance for
// JavaScript
public static synchronized SequenceOntologyI getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
if (j.sequenceOntology == null)
{
j.sequenceOntology = new SequenceOntologyLite();
public static void setInstance(SequenceOntologyI so)
{
- Jalview.getInstance().sequenceOntology = so;
+ Instance.getInstance().sequenceOntology = so;
}
}
*/
package jalview.io.vamsas;
+import jalview.bin.Instance;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.Mapping;
import jalview.datamodel.SequenceI;
-import jalview.gui.Desktop;
import jalview.io.VamsasAppDatastore;
import java.util.ArrayList;
}
bindjvvobj(mapping, sequenceMapping);
jalview.structure.StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance())
+ .getStructureSelectionManager(Instance.getDesktop())
.registerMapping(acf);
// Try to link up any conjugate database references in the two sequences
// matchConjugateDBRefs(from, to, mapping);
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;
{
// used to attempt to parse as V1 castor-generated xml
}
- if (Desktop.getInstance() != null)
+ if (Instance.getDesktop() != null)
{
- Desktop.getInstance().stopLoading();
+ Instance.getDesktop().stopLoading();
}
if (af != null)
{
*/
for (AlignFrame fr : gatherToThisFrame.values())
{
- Desktop.getInstance().gatherViews(fr);
+ Instance.getDesktop().gatherViews(fr);
}
restoreSplitFrames();
if (ds.getCodonFrames() != null)
{
StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance())
+ .getStructureSelectionManager(Instance.getDesktop())
.registerMappings(ds.getCodonFrames());
}
}
reportErrors();
}
- if (Desktop.getInstance() != null)
+ if (Instance.getDesktop() != null)
{
- Desktop.getInstance().stopLoading();
+ Instance.getDesktop().stopLoading();
}
return af;
*/
for (SplitFrame sf : gatherTo)
{
- Desktop.getInstance().gatherViews(sf);
+ Instance.getDesktop().gatherViews(sf);
}
splitFrameCandidates.clear();
entry.setProperty(prop.getName(), prop.getValue());
}
StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance())
+ .getStructureSelectionManager(Instance.getDesktop())
.registerPDBEntry(entry);
// adds PDBEntry to datasequence's set (since Jalview 2.10)
if (al.getSequenceAt(i).getDatasetSequence() != null)
*/
package jalview.rest;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.httpserver.AbstractRequestHandler;
import java.io.IOException;
{
synchronized (RestHandler.class)
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.restHandler == null ? j.restHandler = new RestHandler()
: j.restHandler);
}
package jalview.schemes;
import jalview.api.AlignViewportI;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
{
if (ann.isRNA())
{
- result = Jalview.getInstance().rnaHelices[(int) aj.value];
+ result = Instance.getInstance().rnaHelices[(int) aj.value];
}
else
{
package jalview.schemes;
import jalview.api.AlignViewportI;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.util.ColorUtils;
public static void initRnaHelicesShading(int n)
{
int i = 0;
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
if (j.rnaHelices == null)
{
*/
public static void resetRnaHelicesShading()
{
- Jalview.getInstance().rnaHelices = null;
+ Instance.getInstance().rnaHelices = null;
}
/**
package jalview.schemes;
import jalview.api.AlignViewportI;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
currentHelix = positionsToHelix.get(j);
if (currentHelix != null)
{
- currentColour = Jalview.getInstance().rnaHelices[Integer
+ currentColour = Instance.getInstance().rnaHelices[Integer
.parseInt(currentHelix)];
}
return currentColour;
*/
package jalview.structure;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
public class StructureImportSettings
{
+ private StructureImportSettings()
+ {
+ // singleton
+ }
+
private static StructureImportSettings getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.structureImportSettings == null
? j.structureImportSettings = new StructureImportSettings()
: j.structureImportSettings);
import jalview.analysis.AlignSeq;
import jalview.api.StructureSelectionManagerProvider;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.commands.CommandI;
import jalview.commands.EditCommand;
import jalview.commands.OrderCommand;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
public class StructureSelectionManager
{
+
+ public StructureSelectionManager()
+ {
+ }
+
public final static String NEWLINE = System.lineSeparator();
+ // BH unnecessary; IdentityHashMap can handle this
+ // private static StructureSelectionManager nullProvider;
+
private List<StructureMapping> mappings = new ArrayList<>();
private boolean processSecondaryStructure = false;
|| pdbIdFileName.containsKey(idOrFile);
}
- public static StructureSelectionManager getStructureSelectionManager(
- StructureSelectionManagerProvider context)
- {
- Jalview j = Jalview.getInstance();
- if (context == null)
- {
- if (j.nullProvider == null)
- {
- if (j.structureSelections != null)
- {
- throw new Error(MessageManager.getString(
- "error.implementation_error_structure_selection_manager_null"),
- new NullPointerException(MessageManager
- .getString("exception.ssm_context_is_null")));
- }
- else
- {
- j.nullProvider = new StructureSelectionManager();
- }
- return j.nullProvider;
- }
- }
- if (j.structureSelections == null)
- {
- j.structureSelections = new java.util.IdentityHashMap<>();
- }
- StructureSelectionManager instance = Jalview
- .getInstance().structureSelections.get(context);
- if (instance == null)
- {
- if (j.nullProvider != null)
- {
- instance = j.nullProvider;
- }
- else
- {
- instance = new StructureSelectionManager();
- }
- j.structureSelections.put(context, instance);
- }
- return instance;
- }
-
/**
* flag controlling whether SeqMappings are relayed from received sequence
* mouse over events to other sequences
}
}
}
-
- /**
- * release all references associated with this manager provider
- *
- * @param jalviewLite
- */
- public static void release(StructureSelectionManagerProvider jalviewLite)
- {
- // synchronized (instances)
- {
- if (Jalview.getInstance().structureSelections == null)
- {
- return;
- }
- StructureSelectionManager mnger = (Jalview
- .getInstance().structureSelections.get(jalviewLite));
- if (mnger != null)
- {
- Jalview.getInstance().structureSelections.remove(jalviewLite);
- try
- {
- mnger.finalize();
- } catch (Throwable x)
- {
- }
- }
- }
- }
-
+
public void registerPDBEntry(PDBEntry pdbentry)
{
if (pdbentry.getFile() != null
return seqmappings;
}
+ public static StructureSelectionManager getStructureSelectionManager(
+ StructureSelectionManagerProvider context)
+ {
+ IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> map = Instance
+ .getInstance().structureSelections;
+
+ if (map == null)
+ {
+ map = Instance
+ .getInstance().structureSelections = new IdentityHashMap<>();
+ }
+ StructureSelectionManager instance = map.get(context);
+ if (instance == null)
+ {
+ // BH: actually, not possible except for coding error; this is an attempt
+ // to discover that.
+ if (context == null && !map.isEmpty())
+ {
+ throw new Error(MessageManager.getString(
+ "error.implementation_error_structure_selection_manager_null"),
+ new NullPointerException(MessageManager
+ .getString("exception.ssm_context_is_null")));
+ }
+ map.put(context,
+ instance = new StructureSelectionManager());
+ }
+ return instance;
+ }
+
+ /**
+ * release all references associated with this manager provider
+ *
+ * @param provider
+ */
+
+ public static void release(StructureSelectionManagerProvider provider)
+ {
+ IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> map = Instance
+ .getInstance().structureSelections;
+ if (map != null)
+ {
+ map.remove(provider);
+ }
+ }
+
}
package jalview.urls;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
/**
* Holds settings for identifiers.org e.g. url, download location
private String url;
private String location;
- public static IdOrgSettings getInstance()
+ private IdOrgSettings()
{
- Jalview j = Jalview.getInstance();
+ // singleton
+ }
+
+ private static IdOrgSettings getInstance()
+ {
+ Instance j = Instance.getInstance();
return (j.idOrgSettings == null ? j.idOrgSettings = new IdOrgSettings()
: j.idOrgSettings);
}
*/
package jalview.ws;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.ws.seqfetcher.ASequenceFetcher;
public class SequenceFetcherFactory
*/
public static ASequenceFetcher getSequenceFetcher()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.sequenceFetcher == null
? j.sequenceFetcher = new SequenceFetcher()
: j.sequenceFetcher);
*/
public static void setSequenceFetcher(SequenceFetcher sf)
{
- Jalview.getInstance().sequenceFetcher = sf;
+ Instance.getInstance().sequenceFetcher = sf;
}
}
*/
package jalview.ws.jws1;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.gui.JvOptionPane;
import jalview.util.MessageManager;
public class Discoverer implements Runnable
{
+ private Discoverer()
+ {
+ };
+
public static Discoverer getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.discoverer == null ? j.discoverer = new Discoverer()
: j.discoverer);
}
package jalview.ws.jws2;
import jalview.bin.Cache;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
*/
public static Jws2Discoverer getDiscoverer()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.j2s2discoverer == null
? j.j2s2discoverer = new Jws2Discoverer()
: j.j2s2discoverer);
package jalview.ws.jws2;
import jalview.api.AlignCalcWorkerI;
+import jalview.bin.Instance;
import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
import jalview.util.MessageManager;
import jalview.ws.jws2.dm.AAConSettings;
@Override
public void actionPerformed(ActionEvent arg0)
{
- Desktop.getInstance().showUrl(service.docUrl);
+ Instance.getDesktop().showUrl(service.docUrl);
}
});
annotservice.setToolTipText(
*/
package jalview.ws.jws2.jabaws2;
+import jalview.bin.Instance;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.util.MessageManager;
try
{
paramStore = new JabaParamStore(this,
- (Desktop.getInstance() != null ? Desktop.getUserParameterStore()
+ (Instance.getDesktop() != null ? Desktop.getUserParameterStore()
: null));
} catch (Exception ex)
{
*/
package jalview.ws.jws2.jabaws2;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.ws.jws2.AAConClient;
import jalview.ws.jws2.RNAalifoldClient;
import jalview.ws.uimodel.AlignAnalysisUIText;
public static Jws2InstanceFactory getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.jws2InstanceFactory == null
? j.jws2InstanceFactory = new Jws2InstanceFactory()
: j.jws2InstanceFactory);
package jalview.ws.rest;
import jalview.bin.Cache;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
private static RestClient getInstance()
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.restClient == null ? j.restClient = new RestClient()
: j.restClient);
}
*/
package jalview.ws.sifts;
-import jalview.bin.Jalview;
+import jalview.bin.Instance;
import java.util.Objects;
private static SiftsSettings getInstance()
{
{
- Jalview j = Jalview.getInstance();
+ Instance j = Instance.getInstance();
return (j.siftsSettings == null
? j.siftsSettings = new SiftsSettings()
: j.siftsSettings);
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
+ jalview.bin.Instance.getDesktop().closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" })
import jalview.api.FeatureRenderer;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
import jalview.gui.JvOptionPane;
import jalview.gui.Preferences;
import jalview.gui.StructureViewer;
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
}
@AfterMethod(alwaysRun = true)
import jalview.api.FeatureColourI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
@AfterMethod(alwaysRun = true)
public void tearDown()
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
}
/**
import static org.testng.AssertJUnit.assertTrue;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
* remove any sequence mappings left lying around by other tests
*/
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
ssm.resetAll();
}
* mappings
*/
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
List<AlignedCodonFrame> sequenceMappings = ssm.getSequenceMappings();
assertEquals(2, sequenceMappings.size());
assertTrue(sequenceMappings.contains(acf1));
@Test(groups = { "Functional" })
public void testDeregisterMapping_withNoReference()
{
- Desktop d = Desktop.getInstance();
+ Desktop d = Instance.getDesktop();
assertNotNull(d);
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
ssm.resetAll();
AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded(
@Test(groups = { "Functional" })
public void testDeregisterMapping_withReference()
{
- Desktop d = Desktop.getInstance();
+ Desktop d = Instance.getDesktop();
assertNotNull(d);
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
ssm.resetAll();
AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded(
import jalview.analysis.AlignmentGenerator;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceGroup;
doStuffInJalview(f);
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
checkUsedMemory(35L);
}
* sanity check - fails if any frame was added after
* closeAll_actionPerformed
*/
- assertEquals(Desktop.getInstance().getAllFrames().length, 0);
+ assertEquals(Instance.getDesktop().getAllFrames().length, 0);
/*
* if this assertion fails
import jalview.api.AlignViewportI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
@AfterMethod(alwaysRun = true)
public void tearDown()
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
}
@Test(groups = "Functional")
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
+ jalview.bin.Instance.getDesktop().closeAll_actionPerformed(null);
}
import jalview.analysis.CrossRef;
import jalview.api.AlignmentViewPanel;
+import jalview.bin.Instance;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentTest;
{
// retrieve dbref
- SequenceFetcher sf = new SequenceFetcher(Desktop.getInstance(),
+ SequenceFetcher sf = new SequenceFetcher(Instance.getDesktop(),
forSource, forAccession);
sf.run();
AlignFrame[] afs = Desktop.getAlignFrames();
}
else
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
// recover stored project
af = new FileLoader(false).LoadFileWaitTillLoaded(
savedProjects.get(first).toString(), DataSourceType.FILE);
}
else
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
pass3 = 0;
// recover stored project
File storedProject = savedProjects.get(nextxref);
}
else
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
// recover stored project
File storedProject = savedProjects.get(nextnextxref);
if (storedProject == null)
import jalview.api.FeatureColourI;
import jalview.api.FeatureRenderer;
+import jalview.bin.Instance;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceDummy;
import jalview.datamodel.features.FeatureMatcherSetI;
import jalview.datamodel.features.SequenceFeatures;
import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
import jalview.gui.JvOptionPane;
import jalview.schemes.FeatureColour;
import jalview.structure.StructureSelectionManager;
* remove any sequence mappings created so they don't pollute other tests
*/
StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance());
+ .getStructureSelectionManager(Instance.getDesktop());
ssm.resetAll();
}
package jalview.io;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.SequenceI;
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
+ jalview.bin.Instance.getDesktop().closeAll_actionPerformed(null);
}
@BeforeTest(alwaysRun = true)
public static void clearDesktop()
{
- if (Desktop.getInstance() != null && Desktop.getFrames() != null
+ if (Instance.getDesktop() != null && Desktop.getFrames() != null
&& Desktop.getFrames().length > 0)
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
}
}
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
+ jalview.bin.Instance.getDesktop().closeAll_actionPerformed(null);
}
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureColourI;
import jalview.api.ViewStyleI;
+import jalview.bin.Instance;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenSequences;
@Test(groups = { "Functional" }, enabled = true)
public void testStoreAndRecoverExpandedviews() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", DataSourceType.FILE);
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverReferenceSeqSettings() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", DataSourceType.FILE);
assertNotNull(af, "Didn't read in the example file correctly.");
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverGroupRepSeqs() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
assertNotNull(af, "Didn't read in the example file correctly.");
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverPDBEntry() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
String exampleFile = "examples/3W5V.pdb";
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(exampleFile,
DataSourceType.FILE);
{
Assert.fail("Didn't save the state", e);
}
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverColourThresholds() throws IOException
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
".jvp");
tfile.deleteOnExit();
new Jalview2XML(false).saveState(tfile);
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
DataSourceType.FILE);
Assert.assertNotNull(af, "Failed to reload project");
@Test(groups = { "Functional" })
public void testMergeDatasetsforManyViews() throws IOException
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
// complex project - one dataset, several views on several alignments
AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded(
@Test(groups = "Functional")
public void testPcaViewAssociation() throws IOException
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
final String PCAVIEWNAME = "With PCA";
// create a new tempfile
File tempfile = File.createTempFile("jvPCAviewAssoc", "jvp");
}
// load again.
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
tempfile.getCanonicalPath(), DataSourceType.FILE);
- JInternalFrame[] frames = Desktop.getInstance().getAllFrames();
+ JInternalFrame[] frames = Instance.getDesktop().getAllFrames();
// PCA and the tabbed alignment view should be the only two windows on the
// desktop
assertEquals(frames.length, 2,
import jalview.api.AlignViewportI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.bin.Jalview;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
import jalview.gui.SequenceRenderer;
import jalview.io.DataSourceType;
import jalview.io.FileLoader;
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
}
@Test(groups = "Functional")
import jalview.analysis.AlignmentUtils;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
+import jalview.bin.Instance;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
{
// for some reason 'BeforeMethod' (which should be inherited from
// Jalview2XmlBase isn't always called)...
- Desktop.getInstance().closeAll_actionPerformed(null);
+ Instance.getDesktop().closeAll_actionPerformed(null);
try {
Thread.sleep(200);
} catch (Exception foo) {};