*/
package jalview.gui;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
+import jalview.io.FileLoader;
+import jalview.io.FormatAdapter;
+import jalview.io.IdentifyFile;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GSplitFrame;
+import jalview.jbgui.GStructureViewer;
+import jalview.structure.StructureSelectionManager;
+import jalview.util.ImageMaker;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.params.ParamManager;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
-import jalview.api.AlignViewportI;
-import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
-import jalview.io.FileLoader;
-import jalview.io.FormatAdapter;
-import jalview.io.IdentifyFile;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GSplitFrame;
-import jalview.jbgui.GStructureViewer;
-import jalview.structure.StructureSelectionManager;
-import jalview.util.ImageMaker;
-import jalview.util.MessageManager;
-import jalview.viewmodel.AlignmentViewport;
-import jalview.ws.params.ParamManager;
-
/**
* Jalview Desktop
*
private static final int THREE = 3;
+ private static AlignFrame currentAlignFrame;
+
public static jalview.ws.jws1.Discoverer discoverer;
public static Object[] jalviewClipboard;
delegate.openFrame(f);
}
+ @Override
public void resizeFrame(JComponent f, int newX, int newY, int newWidth,
int newHeight)
{
- Rectangle b = desktop.getBounds();
if (newY < 0)
{
newY = 0;
{
new FileLoader().LoadFile(viewport, choice, FormatAdapter.FILE,
format);
+ // viewport.setShowSequenceFeatures(JSONFile.isSeqFeaturesEnabled());
+ // AlignFrame af = viewport.getAlignPanel().alignFrame;
+ // if (af != null)
+ // {
+ // af.changeColour(JSONFile.getColourScheme());
+ // af.setMenusForViewport();
+ // }
}
else
{
public void inputTextboxMenuItem_actionPerformed(AlignViewport viewport)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
- cap.setForInput(viewport);
+// cap.setForInput(viewport.getAlignPanel());
+ cap.setForInput(null);
Desktop.addInternalFrame(cap,
MessageManager.getString("label.cut_paste_alignmen_file"),
true, 600, 500);
{
dialogExecutor.shutdownNow();
}
-
+ closeAll_actionPerformed(null);
System.exit(0);
}
if (v_client != null)
{
// TODO clear binding to vamsas document objects on close_all
+ }
+ /*
+ * reset state of singleton objects as appropriate (clear down session state
+ * when all windows are closed)
+ */
+ StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(this);
+ if (ssm != null)
+ {
+ ssm.resetAll();
}
}
final java.io.File choice = chooser.getSelectedFile();
setProjectFile(choice);
- // TODO or move inside the new Thread?
- saveChimeraSessions(choice.getAbsolutePath());
-
new Thread(new Runnable()
{
public void run()
}
}
- /**
- * Request any open, linked Chimera sessions to save their state.
- *
- * @param jalviewProjectFilename
- * the filename of the Jalview project; Chimera session files should
- * be given distinct, but obviously related, names.
- */
- public void saveChimeraSessions(String jalviewProjectFilename)
- {
- int i = 0;
- for (JInternalFrame frame : getAllFrames())
- {
- if (frame instanceof ChimeraViewFrame)
- {
- /*
- * Construct a filename for the Chimera session by append _chimera<n>.py
- * to the Jalview project file name.
- */
- String chimeraPath = jalviewProjectFilename + "_chimera_" + i
- + ".py";
- ((ChimeraViewFrame) frame).saveSession(chimeraPath);
- i++;
- }
- }
- }
-
private void setProjectFile(File choice)
{
this.projectFile = choice;
}
}
+ @Override
public void paintComponent(Graphics g)
{
if (showMemoryUsage && g != null && df != null)
public void registerHandler(final long id,
final IProgressIndicatorHandler handler)
{
- if (progressBarHandlers == null || !progressBars.contains(new Long(id)))
+ if (progressBarHandlers == null
+ || !progressBars.containsKey(new Long(id)))
{
throw new Error(
MessageManager
(t0 = new Thread(discoverer)).start();
}
- // ENFIN services are EOLed as of Jalview 2.8.1 release
- if (false)
- {
- try
- {
- if (Cache.getDefault("SHOW_ENFIN_SERVICES", true))
- {
- // EnfinEnvision web service menu entries are rebuild every time the
- // menu is shown, so no changeSupport events are needed.
- jalview.ws.EnfinEnvision2OneWay.getInstance();
- (t1 = new Thread(jalview.ws.EnfinEnvision2OneWay.getInstance()))
- .start();
- }
- } catch (Exception e)
- {
- Cache.log
- .info("Exception when trying to launch Envision2 workflow discovery.",
- e);
- Cache.log.info(e.getStackTrace());
- }
- }
-
if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
{
if (jalview.ws.jws2.Jws2Discoverer.getDiscoverer().isRunning())
*/
AlignmentPanel topPanel = (AlignmentPanel) topPanels.get(i);
AlignFrame newTopFrame = new AlignFrame(topPanel);
+ newTopFrame.setSize(new Dimension(AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT));
newTopFrame.setVisible(true);
AlignmentPanel bottomPanel = (AlignmentPanel) bottomPanels.get(i);
AlignFrame newBottomFrame = new AlignFrame(bottomPanel);
+ newBottomFrame.setSize(new Dimension(AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT));
newBottomFrame.setVisible(true);
topPanel.av.setGatherViewsHere(false);
bottomPanel.av.setGatherViewsHere(false);
myTopFrame.setDisplayedView(myTopFrame.alignPanel);
}
+
+ // public static AlignFrame getCurrentAlignFrame()
+ // {
+ // return currentAlignFrame;
+ // }
+ //
+ // public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
+ // {
+ // Desktop.currentAlignFrame = currentAlignFrame;
+ // }
+
+
}