⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagedialog.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
字号:
/*
 *    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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 * Created on 2005/1/11
 *
 * $Author$
 * $Date$
 * $Revision$
 * 
 * This is a commen message dialog to be used in order to standardize
 * the layout of all message dialogs to shown on the application.
 */

package eti.bi.alphaminer.ui.dialog;


import javax.swing.JFrame;
import javax.swing.JOptionPane;

import eti.bi.alphaminer.ui.IMessageDialog;
import eti.bi.alphaminer.ui.KBBIApplication;


/**
 * @author kelvinj
 *
 */
public class MessageDialog extends JOptionPane implements IMessageDialog{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static JFrame m_Frame;

	public void showMessageDialog(String a_Message, String a_Title, int a_Type){
		if (!KBBIApplication.BACKGOUND_EXECUTION)
		{
			showMessageDialog(m_Frame, a_Message, a_Title, a_Type);
		}
	}
	
	/* 
	 * Use show Error for all system level exception and error messages 
	 * i.e. this error message indicates that some of exceptions are handled well
	 * 
	 * */
	public void showError(String a_Message, String a_Title)
	{
		if (!KBBIApplication.BACKGOUND_EXECUTION)
		{
			showMessageDialog(null, a_Message, a_Title, JOptionPane.ERROR_MESSAGE);
		}
	}
	
	/* 
	 * User showWarning for some warning messages or user input errors.
	 * i.e. this warning idicates that user has to change the inputs, configurations or
	 * parameters.
	 */
	public void showWarning(String a_Message, String a_Title)
	{
		if (!KBBIApplication.BACKGOUND_EXECUTION)
		{
			showMessageDialog(m_Frame, a_Message, a_Title, JOptionPane.WARNING_MESSAGE);
		}
	}

	/*
	 * User showInformation to display some information that the user got to know.
	 * i.e. this information indicates no problem, just to show some informative messages to user.
	 */
	public void showInformation(String a_Message, String a_Title)
	{
		if (!KBBIApplication.BACKGOUND_EXECUTION)
		{
			showMessageDialog(m_Frame, a_Message, a_Title, JOptionPane.INFORMATION_MESSAGE);
		}
	}

	/*
	 * Set the fram to hold this message dialog. Usually it would be the main application window.
	 */
	public static void setFrame(JFrame a_Frame)
	{
		m_Frame = a_Frame;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -