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

📄 applicationwindow.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
//					+ "( ID:"
//					+ m_ManagementWindow.getCaseListPanel().getCaseListTree().getFormatedCaseID(CaseHandler.getInstance().getCase(a_CaseID,false).getCaseID()) + " )";
					CaseHandler.getInstance().removeCase(a_CaseID);
					m_ManagementWindow.getCaseListPanel().getCaseListTree().removeChildNode(a_CaseID);
					sendNotifytoObserver(NOTIFY_DELETE_CASE+"|"+a_CaseID);
//					21/03/2005 Mark Li: modify to update caseList when press delete button>>
				} catch (Exception e) {
					e.printStackTrace();
				}
		}
	}

	/**
	 * Opens CaseWindow of a specific Case.
	 * @param a_CaseID ID of the Case to be edited.
	 * @param a_IsEdit true to open the CaseWindow in the edit mode; false to open
	 * it in the view mode.
	 */
	public CaseWindow editCase(String a_CaseID, boolean a_IsEdit) {
		CaseWindow caseWin = null;
		JInternalFrame[] frames = m_ContentApplicationWindow.getAllFrames();
		if (frames != null) {
			for (int i = 0; i < frames.length; i++) {
				if (frames[i].isVisible()) {
					if (frames[i] instanceof CaseWindow) {
						if (((CaseWindow) frames[i]).getCaseID().equals(a_CaseID))
						{
							caseWin = (CaseWindow) frames[i];
							break;
						}
					}
				}
			}
		}

		if (caseWin == null) {
			caseWin = new CaseWindow(this, false, a_CaseID, a_IsEdit, m_DMEngineType);
			caseWin.setSize(400, 300);
			m_ContentApplicationWindow.add(caseWin);
			CaseWindowList.add(caseWin);
			caseWin.setVisible(true);
		} else if (a_IsEdit != caseWin.getEditMode()) {
			caseWin.setEditMode(a_IsEdit);
		}

		caseWin.moveToFront();
		//cascadeWindows();
		try {
			caseWin.setMaximum(true);
			caseWin.setSelected(true);
		} catch (java.beans.PropertyVetoException pe) {
		}
		return caseWin;
	}
	//<<06/04/2005, Frank J. Xu
	/**
	 * Opens CaseWindow of a specific Case.
	 * @param a_CaseID ID of the Case to be edited.
	 * @param a_IsEdit true to open the CaseWindow in the edit mode; false to open
	 * it in the view mode.
	 */
	public CaseWindow editCaseByName(String a_CaseName, boolean a_IsEdit) {
		CaseWindow caseWin = null;
		JInternalFrame[] frames = m_ContentApplicationWindow.getAllFrames();
		if (frames != null) {
			for (int i = 0; i < frames.length; i++) {
				if (frames[i].isVisible()) {
					if (frames[i] instanceof CaseWindow) {
						if (((CaseWindow) frames[i]).getCaseName().equals(a_CaseName))
						{
							caseWin = (CaseWindow) frames[i];
							break;
						}
					}
				}
			}
		}

		if (caseWin == null) {
			caseWin = new CaseWindow(this, false, a_CaseName, a_IsEdit, m_DMEngineType);
			caseWin.setSize(400, 300);
			m_ContentApplicationWindow.add(caseWin);
			CaseWindowList.add(caseWin);
			caseWin.setVisible(true);
		} else if (a_IsEdit != caseWin.getEditMode()) {
			caseWin.setEditMode(a_IsEdit);
		}

		caseWin.moveToFront();
		//cascadeWindows();
		try {
			caseWin.setMaximum(true);
			caseWin.setSelected(true);
		} catch (java.beans.PropertyVetoException pe) {
		}
		return caseWin;
	}
	
	/**
	 * @param a_CaseID ID of the case to be got
	 * @return the case Window with the specific case ID
	 * */
	public CaseWindow getCaseWindow(String a_CaseID){
		JInternalFrame[] frames = m_ContentApplicationWindow.getAllFrames();
		if (frames != null) {
			for (int i = 0; i < frames.length; i++) {
				if (frames[i].isVisible()) {
					if (frames[i] instanceof CaseWindow) {
						if (((CaseWindow) frames[i]).getCaseID().equals(a_CaseID))
						{
							return (CaseWindow) frames[i];
						}
					}
				}
			}
		}
		return null;
	}
	
	
	//06/04/2005, Frank J. Xu>>

	/**
	 * Activate/Deactivate a specific Case.
	 * @param a_CaseID ID of the case to be activate/deactivate.
	 * @param a_IsActivated true to activate the Case; false to deactivate
	 * the Case.
	 * @throws BaseException
	 */
	public void activateCase(String a_CaseID, boolean a_IsActivated)
		throws BaseException {
		CaseHandler.getInstance().setCaseStatus(
			a_CaseID,
			a_IsActivated ? BICase.ACTIVATE : BICase.DEACTIVATE);
		CaseInfoListHandler.getInstance().updateCaseStatus(
			a_CaseID,
			a_IsActivated ? BICase.ACTIVATE : BICase.DEACTIVATE);
	}

	/**
	 * Shows a Searching Criteria Dialog (modal) box.
	 * It is called when user chooses File->Search from the menu bar; 
	 * or user presses Alt+S; or user presses the Search Cases button
	 * in the tool bar.
	 */
	@SuppressWarnings("deprecation")
	public void showSearchingCriteria() {
		if (m_SearchingCriteria == null)
			m_SearchingCriteria = new SearchingCriteria(this);

		Dimension dlgSize = m_SearchingCriteria.getPreferredSize();
		Dimension frmSize = getSize();
		Point loc = getLocation();
		m_SearchingCriteria.setLocation(
			(frmSize.width - dlgSize.width) / 2 + loc.x,
			(frmSize.height - dlgSize.height) / 2 + loc.y);

		m_SearchingCriteria.setModal(true);
		m_SearchingCriteria.pack();
		m_SearchingCriteria.show();
	}
	
	/**
	 * Shows the ManagementWindow on the ApplicationWindow desktop pane.
	 * It is called when user chooses Window->Case Management Window from the
	 * menu bar; or user presses Ctrl+M; or user presses the Case Management Window
	 * button in the tool bar.
	 * @param a_IsSearchResult if it is true, updated search result will be shown
	 * in the ManagementWindow.
	 * @throws SysException
	 */
	public void showManagementWindow(boolean a_IsSearchResult) throws SysException {

		if (m_ManagementWindow == null) {
			m_ManagementWindow = new ManagementWindow(this);
			m_ManagementWindow.setLocation(10, 10);
			m_ManagementWindow.setSize(400, 300);
			m_ContentApplicationWindow.add(m_ManagementWindow);
		}
		
		if (a_IsSearchResult)
			m_ManagementWindow.displaySearchResult();

		try {
			if (!m_ManagementWindow.isVisible())
				m_ManagementWindow.setVisible(true);
			if (!m_ManagementWindow.isMaximum())
				m_ManagementWindow.setMaximum(true);
			if (!m_ManagementWindow.isSelected())
				m_ManagementWindow.setSelected(true);
			
			m_ManagementWindow.getCaseListPanel().getCaseListTree().TreeSelectedUpdate();//<<31/03/2005 Mark Li : Update the management bar when re-open the Case List Panel
		} catch (java.beans.PropertyVetoException pe) {
		}
	}

	/**
	 * Close the ManagementWindow which is currently opened and shown in
	 * the desktop pane.
	 */
	public void closeManagementWindow() {
		m_ManagementWindow.close();
	}

	/**
	 * Quits the KBBI-client Application.
	 * It is called when user chooses File->Exit from the menu bar; or
	 * user presses Ctrl+Q.
	 */
	public void quitApplication() {
		windowClosing();
	}

	/**
	 * Tiles all internal windows horizontally in the ApplicationWindow.
	 * It is called when user chooses Window->Tile Window Horizontally 
	 * from the menu bar.
	 */
	public void tileWindowsHorizontally() {
		DesktopUtils.tileHorizontal(m_ContentApplicationWindow);
	}

	/**
	 * Tiles all internal windows vertically in the ApplicationWindow.
	 * It is called when user chooses Window->Tile Window Vertically
	 * from the menu bar.
	 */
	public void tileWindowsVertically() {
		DesktopUtils.tileVertical(m_ContentApplicationWindow);
	}

	/**
	 * Cascades all internal windows opened in the ApplicationWindow.
	 * It is called when user chooses Window->Cascade Windows from the menu bar.
	 */
	public void cascadeWindows() {
		DesktopUtils.cascadeAll(m_ContentApplicationWindow);
	}

	/**
	 * Minimizes all internal windows opened in the AmpplicationWindow 
	 * desktop pane.
	 * It is called when user chooses Window->Minimize Windows from the menu bar.
	 */
	public void minimizeWindows() {
		DesktopUtils.minimizeAll(m_ContentApplicationWindow);
		DesktopUtils.arrangeIcons(m_ContentApplicationWindow);
	}

	/**
	 * Shows an About Dialog (modal) box.
	 * It is called when user chooses Help->About from the menu bar.
	 * @throws SysException
	 */
	@SuppressWarnings("deprecation")
	public void showAbout() throws SysException {
		if (m_AboutDialog == null)
			m_AboutDialog = new AboutDialog(this);

		Dimension dlgSize = m_AboutDialog.getPreferredSize();
		Dimension frmSize = getSize();
		Point loc = getLocation();
		m_AboutDialog.setLocation(
			(frmSize.width - dlgSize.width) / 2 + loc.x,
			(frmSize.height - dlgSize.height) / 2 + loc.y);

		m_AboutDialog.setModal(true);
		m_AboutDialog.pack();
		m_AboutDialog.show();
	}

	public void updateAbout() throws SysException{
		if(m_AboutDialog!=null){
			m_AboutDialog.dispose();
			m_AboutDialog = new AboutDialog(this);
		}
	}
	
	public AboutDialog getAboutDialog()
	{
		return m_AboutDialog;
	}
	
	/**
	 * Clears current message in the status bar.
	 */
	public void clearStatusBarMessage() {
		m_StatusBarMessage.setText("");
	}

	/**
	 * Sets message to be shown in the status bar.
	 * @param a_Message the message to be set.
	 */
	public void setStatusBarMessage(String a_Message) {
		m_StatusBarMessage.setText(a_Message);
	}

	/**
	 * monitor the specific case window if this case widow hasn't been monitored, else dismonitore
	 * @param a_CaseID the ID of the case to be monitored or dismonitored
	 * */
	public void ActionCaseToolBarHandler(String a_CaseID){
		CaseWindow casewindow = getFirstCaseWindow();
		if(casewindow==null){
			return;
		}
		if(casewindow.hasCaseHelpToolBarHandler()){
			casewindow.ActionCaseHelpToolBar();
		}
		else{
			
			try {
				CaseHelpToolBarHandler caseHelpToolBarHandler;
				caseHelpToolBarHandler = new CaseHelpToolBarHandler(casewindow);
				casewindow.addCaseHelpToolBarHandler(caseHelpToolBarHandler);
			} catch (NullPointerException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (SysException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}
	}
	
	/**
	 * Sets focus to the first internal window opened.
	 * @param a_IsMaximize if it is true, the internal window going to be focused is to
	 * be maximized too; otherwise, the interal window is not maximized.
	 */
	public void setFocusToFirstWindow(boolean a_IsMaximize) {
		JInternalFrame[] frames = m_ContentApplicationWindow.getAllFrames();
		if (frames != null) {
			for (int i = frames.length - 1; i >= 0; i--) {
				if (frames[i].isVisible()) {
					try {
						frames[i].setSelected(true);
						if (a_IsMaximize)
							frames[i].setMaximum(true);
					} catch (java.beans.PropertyVetoException pe) {
					}
					break;
				}
			}
		}
	}
	
	/**
	 * Sets focus to the first internal CaseWindow opened.
	 * TWang. Apri 1, 2005.
	 * @param a_IsMaximize if it is true, the internal window going to be focused is to
	 * be maximized too; otherwise, the interal window is not maximized.
	 */
	public void setFocusToFirstCaseWindow(boolean a_IsMaximize) {
		JInternalFrame[] frames = m_ContentApplicationWindow.getAllFrames();
		boolean selected = false;
		if (frames != null) {
			for (int i = frames.length - 1; i >= 0; i--) {
				if (frames[i].isVisible()) {
					if (frames[i] instanceof CaseWindow){
						try {
							frames[i].setSelected(true);
							selected = true;
							if (a_IsMaximize)
								frames[i].setMaximum(true);
						} catch (java.beans.PropertyVetoException pe) {
						}
						break;
					}else {
					   	
					}
				}
			} 
			if (!selected){
			// Focus on the visible ManagementWindow if no CaseWindow visible. 	
				for (int i = 0; i < frames.length; i++) {			
					if (frames[i].isVisible() && (frames[i] instanceof ManagementWindow)) {
						try {
							frames[i].setSelected(true);  
						} catch (java.beans.PropertyVetoException pe) {
						}
						break;
					}
				}
			} 
		}
	}

	/**
	 * @author Xiaojun Chen
	 * @return the first internal CaseWindow opened.
	 */
	public CaseWindow getFirstCaseWindow(){
		JInternalFrame[] frames = m_ContentApplicationWindow.getAllFrames();
		if (frames != null) {
			for (int i = frames.length - 1; i >= 0; i--) {
				if (frames[i].isVisible()) {
					if (frames[i] instanceof CaseWindow){
						return (CaseWindow) frames[i];
					}
				}
			} 
		}
		
		return null;
	}
	
	/**
	 * Shows a Login Dialog for user to input his login information.
	 */
	@SuppressWarnings("deprecation")
	public void connect() {		
				
		//<<20/01/2005, Frank J. Xu
		if(POPUP_WINDOW){
			//pop up login dialog		
			LoginDialog dlg = new LoginDialog(this);
			Dimension dlgSize = dlg.getPreferredSize();
			Dimension frmSize = getSize();
			Point loc = getLocation();
			dlg.setLocation(
				(frmSize.width - dlgSize.width) / 2 + loc.x,
				(frmSize.height - dlgSize.height) / 2 + loc.y);
			dlg.setModal(true);
			dlg.pack();
			dlg.show();		
			
			//To Adapt to Different Data Mining Engine
			if(dlg.getDMEngine().equalsIgnoreCase("ETI DM"))
			{
				AccessController.getInstance().setM_DMEngineName("ETI DM");
				AccessController.getInstance().setM_DMEngineType(OperatorPanelFactory.ETI_DM);
			}
			else if (dlg.getDMEngine().equalsIgnoreCase("SAS EM"))
			{
				AccessController.getInstance().setM_DMEngineName("SAS EM");
				AccessController.getInstance().setM_DMEngineType(OperatorPanelFactory.SAS_EM);
			}			
		}
		else{
			AccessController.getInstance().setM_DMEngineName("ETI DM");
			AccessController.getInstance().setM_DMEngineType(OperatorPanelFactory.ETI_DM);			
		}
		//20/01/2005, Frank J. Xu>>
		
		m_DMEngineType = AccessController.getInstance().getM_DMEngineType();

⌨️ 快捷键说明

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