X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FDesktop.java;h=e239a10652b8cee6bda162d4e53d3b6eb50cb181;hb=4ebc6d5b362bc093c39312aa1a69836e3dd6ae84;hp=ad7cb847643442b58f66d4f030656599227101b8;hpb=2a15dbb3db1c89edd6bbc0d1ddf80863feb2203f;p=jalview.git diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index ad7cb84..e239a10 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -1,258 +1,469 @@ -/******************** - * 2004 Jalview Reengineered - * Barton Group - * Dundee University +/* + * Jalview - A Sequence Alignment Editor and Viewer + * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * - * AM Waterhouse - *******************/ - - + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ package jalview.gui; -import jalview.gui.*; -import jalview.io.*; -import jalview.datamodel.*; -import javax.swing.*; import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; import java.awt.event.*; +import javax.swing.*; +import jalview.datamodel.*; +import jalview.io.*; -public class Desktop extends jalview.jbgui.GDesktop +public class Desktop + extends jalview.jbgui.GDesktop implements DropTargetListener { public static JDesktopPane desktop; static int openFrameCount = 0; - static final int xOffset = 30, yOffset = 30; + static final int xOffset = 30; + static final int yOffset = 30; public Desktop() { - Image image =null; - try{ - java.net.URL url = getClass().getResource("/BartonGroupBanner.gif"); - if(url!=null) + Image image = null; + + try + { + java.net.URL url = getClass().getResource("/images/logo.gif"); + + if (url != null) { image = java.awt.Toolkit.getDefaultToolkit().createImage(url); + MediaTracker mt = new MediaTracker(this); mt.addImage(image, 0); mt.waitForID(0); setIconImage(image); } - - }catch(Exception ex){} + } + catch (Exception ex) + { + } setTitle("Jalview 2005"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setVisible(true); desktop = new JDesktopPane(); + desktop.setBackground(Color.white); setContentPane(desktop); desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); + // This line prevents Windows Look&Feel resizing all new windows to maximum + // if previous window was maximised + desktop.setDesktopManager(new DefaultDesktopManager()); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - int width = 1200, height = 800; - if(screenSize.getWidth() 0)) + { + AlignFrame af = new AlignFrame(new Alignment(sequences)); + addInternalFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH, + AlignFrame.NEW_WINDOW_HEIGHT); + af.currentFileFormat = format; + af.statusBar.setText("Successfully loaded file " + file); + + try + { + af.setMaximum(Preferences.showFullscreen); + } + catch (Exception ex) + { + } + } + else + { + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Couldn't open file.\n" + + "Formats currently supported are\n" + + "Fasta, MSF, Clustal, BLC, PIR, MSP, and PFAM" // JBPNote - message should be generated through FormatAdapter! + , "Error loading file", + JOptionPane.WARNING_MESSAGE); + } + } + } }