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

📄 searchresultpanel.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.
 */

package eti.bi.alphaminer.ui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import eti.bi.alphaminer.core.handler.CaseInfoListHandler;
import eti.bi.alphaminer.core.observer.Observer;

import eti.bi.common.Locale.Resource;

/**
 * SearchResultPanel is an Panel containing a Search Result table
 * and a Searching Criteria button.
 */
public class SearchResultPanel
	extends JPanel
	implements Observer, ActionListener {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel jPanel6;
	private JButton jButton5;
	private JPanel jPanel5;
	private SearchResultTable m_SearchResultTable;
	private JScrollPane jScrollPane2;
	
	/* ManagementWindow that contains this SearchResultPanel */
	private ManagementWindow m_Container;

	/**
	 * Constructs a SearchResultPanel.
	 * @param a_Window the ManagementWindow that contains this SearchResultPanel.
	 */
	public SearchResultPanel(ManagementWindow a_Window) {
		m_Container = a_Window;
		CaseInfoListHandler.getInstance().registerInterest(this);
		createSearchResultPanel();
	}

	/**
	 * Gets the SearchResultTable.
	 * @return SearchResultTable contained in this SearchResultPanel.
	 */
	public SearchResultTable getSearchResultTable() {
		return m_SearchResultTable;
	}

	/**
	 * @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
	 */
	public void actionPerformed(ActionEvent e) {
		((ApplicationWindow) m_Container.getApplicationWindow())
			.showSearchingCriteria();
	}

	/**
	 * @see eti.bi.alphaminer.core.observer.Observer#sendNotify(String)
	 */
	public void sendNotify(String a_Message) {
		if (a_Message == null)
			return;
		if (a_Message.equals("search result")) {
			m_SearchResultTable.setSearchResult(
				CaseInfoListHandler.getInstance().getSearchedCaseInfoList());
			m_SearchResultTable.setObserverState();
			m_Container.getCaseInformationPanel().setShownDetail(false);
			m_Container.getCaseInformationPanel().clearDetail();
			m_Container.getCaseInformationPanel().setButtonActionCommand(null);
		}
	}

	/**
	 * Creates UI of SearchResultPanel.
	 */
	private void createSearchResultPanel() {

		jPanel6 = new JPanel();
		jButton5 = new JButton();
		jPanel5 = new JPanel(new BorderLayout());
		m_SearchResultTable = new SearchResultTable(m_Container);
		jScrollPane2 = new JScrollPane(m_SearchResultTable);

		m_SearchResultTable.registerInterest(
			m_Container.getCaseInformationPanel());
		m_SearchResultTable.registerInterest(
			m_Container.getApplicationWindow().getMenuBarHandler());
		m_SearchResultTable.registerInterest(
			m_Container.getApplicationWindow().getToolBarHandler());

		this.setLayout(new BorderLayout());
		jButton5.setText(Resource.srcStr("jButton5"));
		jButton5.addActionListener(this);
		jPanel5.setBorder(null);
		jPanel5.setDebugGraphicsOptions(0);
		jPanel5.setMinimumSize(new Dimension(40, 50));
		jPanel5.setPreferredSize(new Dimension(184, 205));

		jScrollPane2.getViewport().setBackground(Color.white);
		jScrollPane2.setBorder(BorderFactory.createLoweredBevelBorder());
		jScrollPane2.setMaximumSize(new Dimension(32767, 32767));
		jScrollPane2.setMinimumSize(new Dimension(40, 50));
		jScrollPane2.setOpaque(true);
		jScrollPane2.setPreferredSize(new Dimension(180, 190));

		this.add(jPanel6, BorderLayout.SOUTH);
		jPanel6.add(jButton5, null);
		this.add(jPanel5, BorderLayout.CENTER);
		jPanel5.add(jScrollPane2, BorderLayout.CENTER);
	}

	/* (non-Javadoc)
	 * @see eti.bi.alphaminer.core.observer.Observer#sendNotify(int)
	 */
	public void sendNotify(int a_Message) {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see eti.bi.alphaminer.core.observer.Observer#sendNotify(int, java.lang.Object)
	 */
	public void sendNotify(int a_Message, Object a_Object) {
		// TODO Auto-generated method stub
		
	}
	
	/**
	 * reset language
	 */
	public synchronized void resetLocale(){
		jButton5.setText(Resource.srcStr("jButton5"));
		m_SearchResultTable.resetLocale();
	}
}

⌨️ 快捷键说明

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