root / tags / v1_0_2_Build_897 / libraries / libIverUtiles / src / com / iver / utiles / console / jedit / ConsoleInputHandler.java @ 10444
History | View | Annotate | Download (854 Bytes)
1 | 4900 | caballero | package com.iver.utiles.console.jedit; |
---|---|---|---|
2 | |||
3 | import java.awt.event.KeyEvent; |
||
4 | import java.util.ArrayList; |
||
5 | |||
6 | import com.iver.utiles.console.JConsole; |
||
7 | |||
8 | public class ConsoleInputHandler extends DefaultInputHandler { |
||
9 | |||
10 | private ArrayList listeners=new ArrayList(); |
||
11 | public void keyPressed(KeyEvent evt) { |
||
12 | super.keyPressed(evt);
|
||
13 | callConsolePressed(evt); |
||
14 | } |
||
15 | |||
16 | public void keyTyped(KeyEvent evt) { |
||
17 | super.keyTyped(evt);
|
||
18 | } |
||
19 | |||
20 | public void keyReleased(KeyEvent arg0) { |
||
21 | callConsoleReleased(arg0); |
||
22 | } |
||
23 | |||
24 | public void addConsoleListener(JConsole console) { |
||
25 | listeners.add(console); |
||
26 | } |
||
27 | private void callConsolePressed(KeyEvent e){ |
||
28 | for (int i=0;i<listeners.size();i++){ |
||
29 | ((JConsole)listeners.get(i)).keyPressed(e); |
||
30 | } |
||
31 | } |
||
32 | private void callConsoleReleased(KeyEvent e){ |
||
33 | for (int i=0;i<listeners.size();i++){ |
||
34 | ((JConsole)listeners.get(i)).keyReleased(e); |
||
35 | } |
||
36 | } |
||
37 | } |