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

📄 crmspanel.java

📁 发泄网! 发泄网! 发泄网! 发泄网! 发泄网! 发泄网! 发泄网! 发泄网!
💻 JAVA
字号:
    /* CRMS, customer relationship management system    Copyright (C) 2003  Service To Youth Council    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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    For further information contact the SYC ICT department on GPL@syc.net.au    98 Kermode Street    North Adelaide    South Australia    SA 5006     +61 (0)8 8367 0755    *//* *  CRMSPanel.java * *  Created on 31 March 2003, 02:46 */package crms.applet;import javax.swing.*;import java.awt.BorderLayout;import java.awt.*;import java.lang.reflect.*;import crms.vo.Permission;/** *@author     dmurphy */public abstract class CRMSPanel extends JPanel {    /** The Panel is intended to <b>add</b> an item. */    public static final int PANEL_TYPE_ADD	= 0;    /** The panel mode is to edit an existing item, requires an ID */    public static final int PANEL_TYPE_EDIT = 1;	/** Indicate when the panel has not been initialised properly. */	public static int PANEL_TYPE_INVALID	= 2;    CRMSPanel currentPanel = null;    CRMSPanel parent = null;    Permission entityPermission = null;    /**     *  This method, when implemented on a concrete class will be responsible     *  for instantiating components and adding them to this panel.     */    public abstract void init();        /**     *  This method is used by concrete classes to indicate that the      *  currently visible panel has changed.     *     *@param  newPanel  Integer representing the newly active panel.     *///    public void firePanelChanged(int newPanel) {//        remove(getCurrentPanel());////        CRMSPanel panel = null;////        try {//            panel = (CRMSPanel) getPanel(newPanel).newInstance();//            System.out.println("Just created new instance of: " + panel.getClass());//        } catch (Exception ex) {//            throw new RuntimeException(ex);//        }////        add(panel, BorderLayout.CENTER);//        setCurrentPanel(panel);//        panel.setVisible(true);//        panel.init();////        // Yay! The following line <b>Must</b> be called to//        // ensure that the panel repaints itself properly.//        panel.revalidate();//    }    /**     *  Allows the currently active child panel to be stored on this object.      *  This must be implemented by the concrete class to ensure that panel     *  switching can occur.      *     *@param  panel  The currently active panel     */    public void setCurrentPanel(CRMSPanel panel) {        currentPanel = panel;        boolean result = panel.requestFocusInWindow();        System.out.println("CRMSPanel.setCurrentPanel: Attempt to requestFocusInWindow = " + result);    }    /**     *  Returns the currently active child panel stored on this object.     *     *@return    The currently active child panel.     */    public CRMSPanel getCurrentPanel() {        return currentPanel;    }    /**     *  Overridden method from parent. (Probably unnecessary).     *     *@param  g  Description of the Parameter     */    public void paintComponent(Graphics g) {        super.paintComponent(g);    }    /**     *  Returns a new instance of a CRMSPanel object with certain default     *  properties. This is used to build new panels on the fly.     *     *@return    New CRMSPanel instance.     */    public static CRMSPanel getEmptyPanel() {        CRMSPanel empty =            new CRMSPanel() {                public Class getPanel(int i) {                    return null;                }                public void init() {                }            };        empty.setBackground(Color.WHITE);        return empty;    }}

⌨️ 快捷键说明

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