Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/tuneology/irremote/IRComponent.java


1   /*
2     IRComponent.java
3   
4     Copyright (C) 2002 Fran Taylor
5   
6     This library is free software; you can redistribute it and/or modify
7     it under the terms of the GNU Lesser General Public License as
8     published by the Free Software Foundation; either version 2.1 of the
9     License, or (at your option) any later version.
10  
11    This library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15  
16    You should have received a copy of the GNU Lesser General Public
17    License along with this library; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19    
20    $Id: IRComponent.java,v 1.1 2002/09/23 14:29:16 xnarf Exp $
21  
22  */
23  
24  package com.tuneology.irremote;
25  
26  import java.awt.event.*;
27  import javax.swing.*;
28  import java.util.*;
29  
30  /**
31   * This is the interface to an IRComponent.  
32   * It detects infrared remote key events and generates
33   * action callbacks based on the key bindings.
34   *
35   * @version $Id: IRComponent.java,v 1.1 2002/09/23 14:29:16 xnarf Exp $
36   * 
37   * @author Fran Taylor
38   */
39  public interface IRComponent {
40      /**
41       * Adds a callback. The callback should have 
42       * its IR_BINDING value set to a comma-separated list of 
43       * commands that will cause the action to be run.
44       * If IR_BINDING is null, the callback is called for ALL
45       * actions.
46       * <p>
47       * It is an error to have more than one action for a command.
48       *
49       * @param listener
50       */
51      public void addActionListener(AbstractAction listener);
52      /**
53       *
54       * @param listener
55       */
56      public void removeActionListener(AbstractAction listener);
57      /**
58       * Returns a vector of all event listeners.
59       *
60       * @return a vectory of all events listeners.
61       */
62      public Vector getListeners();
63      /**
64       * Returns an array of all the possible IR commands.
65       *
66       * @return array of commands.
67       */
68      public String[] getCommands();
69      /**
70       * Returns the listener registered to receive the specified action.
71       *
72       * @param action
73       * @return action corresponding to name.
74       */
75      public AbstractAction getListener(String action);
76      /**
77       * Returns true if the listener is registered.
78       *
79       * @param listener
80       * @return true if the listener is registered.
81       */
82      public boolean contains(AbstractAction listener);
83      /**
84       *
85       */
86      public static final String IR_COMMAND = "IR_COMMAND";
87      /**
88       *
89       */
90      public static final String IR_BINDING = "IR_BINDING";
91  }
92  
93  /*
94     Local Variables:
95     mode:java
96     indent-tabs-mode:nil 
97     c-basic-offset:4 
98     c-indent-level:4 
99     c-continued-statement-offset:4 
100    c-brace-offset:-4 
101    c-brace-imaginary-offset:-4 
102    c-argdecl-indent:0
103    c-label-offset:0
104    End:
105 */