?? wmvccontroller.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 + -