001    package net.sf.logdistiller.gui;
002    
003    /*
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    import java.io.File;
018    
019    import javax.swing.JFrame;
020    import javax.swing.JComponent;
021    
022    /**
023     * Main gui launcher.
024     */
025    public class Main
026    {
027        public Main()
028        {
029        }
030    
031        public static void main( String[] args )
032        {
033            JFrame frame = new JFrame();
034            frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
035            MainPanel mainPanel = new MainPanel( frame );
036            JComponent panel = mainPanel.buildPanel();
037            frame.getContentPane().add( panel );
038            frame.pack();
039    
040            if ( args.length > 0 )
041            {
042                String rules = args[0];
043                mainPanel.selectConfigurationFile( new File( rules ) );
044            }
045            if ( args.length > 1 )
046            {
047                String logFile = args[1];
048                mainPanel.selectSourceFile( new File( logFile ) );
049            }
050            frame.setVisible( true );
051        }
052    }