/*
 * @(#) NetworkBuilder.java  1.10 10/09/02
 *
 * Copyright ***,  All Rights Reserved.
 * 
 * This software is the proprietary information of ********  
 * Use is subject to license terms.
 * 
 */

// import java packages
//
import javax.swing.UIManager;
import java.awt.*;

/**
 * This class is the main program for the isip_network_builder
 */
public class NetworkBuilder {

    //-----------------------------------------------------------------
    //
    // static data members
    //
    //-----------------------------------------------------------------

    //-----------------------------------------------------------------
    //
    // instance data members
    //
    //-----------------------------------------------------------------
    boolean packFrame = false;

    //-----------------------------------------------------------------
    //
    // static function members
    //
    //-----------------------------------------------------------------

    /**
     * main method, the entrance of the program
     * 
     * @param args command line arguments
     */
    public static void main(String[] args) {
	try  {
	    // set the look and feel
	    //
	    //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	}
	catch(Exception e) {
	}
	CData.setEnvironment();
	new NetworkBuilder();
    }

    //-----------------------------------------------------------------
    //
    // instance function members
    //
    //-----------------------------------------------------------------

    /**
     * the class constructor
     */
    public NetworkBuilder() {

	CData.main_frame_d = new UIMainFrame();
	UIMainFrame frame = CData.main_frame_d;
	
	/*
	UIMainFrame frame = new UIMainFrame();
	CData.main_frame_d = frame;
	*/

	//Validate frames that have preset sizes
	//Pack frames that have useful preferred size info, 
	//e.g. from their layout
	//
	if (packFrame)
	    frame.pack();
	else
	    frame.validate();

	//Center the window
	//
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	Dimension frameSize = frame.getSize();
	if (frameSize.height > screenSize.height)
	    frameSize.height = screenSize.height;
	if (frameSize.width > screenSize.width)
	    frameSize.width = screenSize.width;
	frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
	frame.setVisible(true);
    }

} // end of the class NetworkBuilder
