From 666afaaa93ee3c0e5ca7d7a932d4ed1fcd507785 Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 9 Aug 2001 01:37:26 +0000 Subject: [PATCH] Created an action listener that can be wired up to any action event generator (button, etc.) which will cause the action event to be forwarded into the controller system. git-svn-id: https://samskivert.googlecode.com/svn/trunk@225 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/swing/Controller.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/Controller.java b/projects/samskivert/src/java/com/samskivert/swing/Controller.java index df6a2c8c..7219852a 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/Controller.java +++ b/projects/samskivert/src/java/com/samskivert/swing/Controller.java @@ -1,11 +1,12 @@ // -// $Id: Controller.java,v 1.2 2001/08/09 01:31:27 mdb Exp $ +// $Id: Controller.java,v 1.3 2001/08/09 01:37:26 mdb Exp $ package com.threerings.yohoho.client; import java.awt.Component; import java.awt.EventQueue; import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import com.threerings.yohoho.Log; @@ -26,6 +27,18 @@ import com.threerings.yohoho.Log; */ public abstract class Controller { + /** + * This action listener can be wired up to any action event generator + * and it will take care of forwarding that event on to the controller + * in scope for the component that generated the action event. + */ + public static final ActionListener DISPATCHER = new ActionListener() { + public void actionPerformed (ActionEvent event) + { + Controller.postAction(event); + } + }; + /** * Instructs this controller to process this action event. When an * action is posted by a user interface element, it will be posted to