1 /* 2 * Copyright 2006-2025 The JGUIraffe Team. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License") 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package net.sf.jguiraffe.gui.platform.swing.builder.event; 17 18 import java.awt.event.ActionListener; 19 import java.awt.event.FocusListener; 20 import java.awt.event.MouseListener; 21 22 /** 23 * <p> 24 * Definition of an interface for registering and unregistering Swing event 25 * listeners. 26 * </p> 27 * <p> 28 * This interface is used internally by the Swing specific form builder 29 * implementation to receive Swing events and transform them to the general form 30 * builder events. The Swing event manager needs a way to register itself at 31 * different GUI components. This is done through the methods provided by this 32 * interface. 33 * </p> 34 * <p> 35 * To be compatible with the pattern used thoroughly in Swing for registering 36 * and unregistering event listeners the methods are named 37 * <code>addXXXListener()</code> and <code>removeXXXListener()</code>. 38 * However, for each event type only a single listener will be set by the Swing 39 * event manager. 40 * </p> 41 * 42 * @author Oliver Heger 43 * @version $Id: SwingEventSource.java 205 2012-01-29 18:29:57Z oheger $ 44 */ 45 public interface SwingEventSource 46 { 47 /** 48 * Adds the specified action listener at this event source. 49 * 50 * @param l the listener to register 51 */ 52 void addActionListener(ActionListener l); 53 54 /** 55 * Removes the specified action listener from this event source. 56 * 57 * @param l the listener to remove 58 */ 59 void removeActionListener(ActionListener l); 60 61 /** 62 * Adds the specified focus listener at this event source. 63 * 64 * @param l the listener to register 65 */ 66 void addFocusListener(FocusListener l); 67 68 /** 69 * Removes the specified focus listener from this event source. 70 * 71 * @param l the listener to remove 72 */ 73 void removeFocusListener(FocusListener l); 74 75 /** 76 * Adds the specified change listener at this event source 77 * 78 * @param l the listener to register 79 */ 80 void addChangeListener(ChangeListener l); 81 82 /** 83 * Removes the specified change listener from this event source. 84 * 85 * @param l the listener to remove 86 */ 87 void removeChangeListener(ChangeListener l); 88 89 /** 90 * Adds the specified mouse listener to this event source. 91 * 92 * @param l the listener to be added 93 */ 94 void addMouseListener(MouseListener l); 95 96 /** 97 * Removes the specified mouse listener from this event source. 98 * 99 * @param l the listener to remove 100 */ 101 void removeMouseListener(MouseListener l); 102 }