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

📄 wmvccontroller.java

📁 绝对经典!好动西和大家一起分享 呵呵 你们不应该如此限制的,不好
💻 JAVA
字号:
/* * WmvcController - implements a general purpose Swing based *     Controler using the Command pattern - for Wmvc framework * Used to simplify Swing controls * * (c) 2001, Bruce E. Wampler */import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.event.*;public class WmvcController        implements      ActionListener,                        ItemListener{    protected JComponent myComponent;    private WmvcExecutor wmvcExecutor;  // The Executor object    // This constructor is use by the subobjects    public WmvcController(JComponent comp,    // the component			  String tip,    			  WmvcExecutor wExec)    {	myComponent = comp;	wmvcExecutor = wExec;	if (tip != null)	    myComponent.setToolTipText(tip);    }    public WmvcExecutor getWmvcExecutor()        { return wmvcExecutor; }    /* ------------------------------------------------------     * Implement the Listeners for components.     * Each listener will send a message to the appropriate     * execute method from the associated WmvcExecutor. The type     * of event determines the signature of the execute method.     */    // implment the ActionListener    public void actionPerformed(ActionEvent event)    {        if (wmvcExecutor != null)            wmvcExecutor.execute(event);    }    // implement ItemLisetener    public void itemStateChanged(ItemEvent event)    {        if (wmvcExecutor != null)            wmvcExecutor.execute(event);    }}

⌨️ 快捷键说明

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