/*
 * LOGICAL-PARADOX.ORG
 * Copyright (C)2005 satoshi akabane(akabane@logical-paradox.org)
 * $Id: DacConsole.java,v 1.2 2005/09/07 13:38:06 rampil Exp $
 */
package org.logical_paradox.vsan.tools.console;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;

import javax.swing.JFrame;

import org.logical_paradox.console.ConsoleConfig;
import org.logical_paradox.console.gui.ConsolePanel;

/**
 * disk array controller管理用クライアント
 * @author satoshi akabane@logical-paradox.org
 * @version $Revision: 1.2 $
 */
public class DacConsole {
	/**
	 * メインメソッド
	 * @param args プログラム引数
	 * @throws Exception プログラム実行中に発生した例外
	 */
	public static void main(String[] args) throws Exception {
		PropertyResourceBundle resource = (PropertyResourceBundle)ResourceBundle.getBundle("console");
		int width = Integer.parseInt(resource.getString("WINDOW_WIDTH"));
		int height = Integer.parseInt(resource.getString("WINDOW_HEIGHT"));
		JFrame mainFrm = new JFrame();
		mainFrm.getContentPane().add(new ConsolePanel(new ConsoleConfig("console")));

		mainFrm.setTitle(resource.getString("WINDOW_TITLE"));

		mainFrm.addWindowListener(new WindowAdapter() {
				public void windowClosing(WindowEvent e) {
					System.exit(0);
				}
			}
		);

		Dimension windowLocation = Toolkit.getDefaultToolkit().getScreenSize();
		mainFrm.setLocation(((int)windowLocation.getWidth() - width) /2, ((int)windowLocation.getHeight() - height) /2);
		mainFrm.setSize(new Dimension(width, height));
		mainFrm.setVisible(true);
	}
}
