Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Public Attributes | Static Package Attributes | Static Private Member Functions
WIMSchem.MainWindow Class Reference
Inheritance diagram for WIMSchem.MainWindow:
Inheritance graph
[legend]
Collaboration diagram for WIMSchem.MainWindow:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MainWindow (String LoadFN, boolean StreamMode, Properties Translation)
MainPanel MainPanel ()

Static Public Member Functions

static void main (String[] args)

Public Attributes

MainPanel mainPanel = null

Static Package Attributes

static String[] args

Static Private Member Functions

static void createAndShowGUI ()

Detailed Description

Definition at line 27 of file MainWindow.java.


Constructor & Destructor Documentation

WIMSchem.MainWindow.MainWindow ( String  LoadFN,
boolean  StreamMode,
Properties  Translation 
) [inline]

Definition at line 31 of file MainWindow.java.

    {
       super("WIMSchem");

       // application
       
       JFrame.setDefaultLookAndFeelDecorated(false); 
       setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

       // main panel

       getContentPane().setLayout(new BorderLayout());
       mainPanel=new MainPanel(LoadFN,StreamMode,false,this,null,Translation,null,null,null,true,true);
       getContentPane().add(mainPanel,BorderLayout.CENTER);
       pack();

       setIconImage(mainPanel.mainIcon.getImage());
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

static void WIMSchem.MainWindow.createAndShowGUI ( ) [inline, static, private]

Definition at line 56 of file MainWindow.java.

    {
       boolean dump=false,stream=false;
       ArrayList<String> openfiles=new ArrayList<String>();
       boolean dsmode=false;
       
       int i=0;
       while (i<args.length)
       {
           if (args[i].charAt(0)=='-')
           {
              if (args[i].compareTo("-h")==0 || args[i].compareTo("--help")==0) {dump=true; break;}
              else if (args[i].compareTo("-v")==0 || args[i].compareTo("--version")==0) {dump=true; break;}
              else if (args[i].compareTo("-s")==0 || args[i].compareTo("--stream")==0) {stream=true; i++;}
              else if (args[i].compareTo("-m")==0 || args[i].compareTo("--molecule")==0) {dsmode=false; i++;}
              else if (args[i].compareTo("-d")==0 || args[i].compareTo("--datasheet")==0) {dsmode=true; i++;}
              else
              {
                  System.out.println("Error: unexpected argument:");
                  System.out.println(args[i]);
                  return;
              }
           }
           else
           {
              File f=new File(args[i]);
              if (f.exists()) openfiles.add(args[i]);
              else System.out.println("Warning: Filename ["+args[i]+"] does not exist.");
              i++;
           }
       }
       
       if (stream && dsmode)
       {
           System.out.println("Invalid: stream mode cannot be combined with datasheet mode");
           return;
       }
       
       if (dump)
       {
           System.out.println("WIMSchem: Molecular drawing tool");
           System.out.println("          Version "+MainPanel.VERSION+"  2005-7 Dr. Alex M. Clark");
           System.out.println("          Open source, released under the Gnu Public License (GPL),");
           System.out.println("          see www.gnu.org. For home page and documentation, see");
           System.out.println("          http://sketchel.sf.net\n");

           System.out.println("Command line parameters:");
           System.out.println(" -h|--help|-v|--version    Show parameters and summary info");
           System.out.println(" -s|--stream               Read from <stdin> at startup, write to");
           System.out.println(" -m|--molecule             Open in new Molecule mode");
           System.out.println(" -d|--datasheet            Open in new DataSheet mode");
           System.out.println("                           <stdout> on quit.");
           System.out.println(" filenames                 Open files on startup.");
       }
       else
       {
           if (stream || openfiles.size()==0) 
           {
              if (!dsmode) new MainWindow(null,stream,null).setVisible(true);
              else new DataWindow(null).setVisible(true);
           }
           else 
           {
              for (int n=0;n<openfiles.size();n++) 
              {
                  if (!dsmode) new MainWindow(openfiles.get(n),false,null).setVisible(true);
                  else new DataWindow(openfiles.get(n)).setVisible(true);
              }
           }
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static void WIMSchem.MainWindow.main ( String[]  args) [inline, static]

Definition at line 128 of file MainWindow.java.

    {
       MainWindow.args=args;
        javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() {createAndShowGUI();}});
    }

Here is the call graph for this function:

Definition at line 50 of file MainWindow.java.

{return mainPanel;}

Here is the caller graph for this function:


Member Data Documentation

String [] WIMSchem.MainWindow.args [static, package]

Definition at line 54 of file MainWindow.java.

Definition at line 29 of file MainWindow.java.


The documentation for this class was generated from the following file: