Quellcode durchsuchen

Add some more events

Change-Id: Ifa2829b6d1c69e3de5ad134b3b4ebd9a60a650c1
Reviewed-on: http://gerrit.dmdirc.com/3254
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
pull/1/head
Chris Smith vor 10 Jahren
Ursprung
Commit
19ea0b98d6

+ 4
- 0
src/com/dmdirc/actions/CoreActionType.java Datei anzeigen

@@ -59,12 +59,16 @@ public enum CoreActionType implements ActionType {
59 59
     @Deprecated
60 60
     CLIENT_FOCUS_GAINED(ClientEvents.CLIENT_EVENT, "Client gained focus"),
61 61
     /** Function key pressed. */
62
+    @Deprecated
62 63
     CLIENT_KEY_PRESSED(ClientEvents.CLIENT_EVENT_WITH_KEY, "Function key pressed"),
63 64
     /** Frame changed. */
65
+    @Deprecated
64 66
     CLIENT_FRAME_CHANGED(ClientEvents.WINDOW_EVENT, "Frame changed"),
65 67
     /** User input. */
68
+    @Deprecated
66 69
     CLIENT_USER_INPUT(ClientEvents.CLIENT_EVENT_WITH_BUFFER, "User input"),
67 70
     /** Line added. */
71
+    @Deprecated
68 72
     CLIENT_LINE_ADDED(ClientEvents.WINDOW_EVENT_WITH_MESSAGE, "Line added to a window"),
69 73
     /** Popup generated. */
70 74
     CLIENT_POPUP_GENERATED(ClientEvents.POPUP_EVENT, "Popup menu generated"),

+ 42
- 0
src/com/dmdirc/events/ClientFrameChangedEvent.java Datei anzeigen

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.FrameContainer;
26
+
27
+/**
28
+ * Event fired when a new frame has been focused.
29
+ */
30
+public class ClientFrameChangedEvent extends DMDircEvent {
31
+
32
+    private final FrameContainer container;
33
+
34
+    public ClientFrameChangedEvent(final FrameContainer container) {
35
+        this.container = container;
36
+    }
37
+
38
+    public FrameContainer getFrameContainer() {
39
+        return container;
40
+    }
41
+
42
+}

+ 44
- 0
src/com/dmdirc/events/ClientKeyPressedEvent.java Datei anzeigen

@@ -0,0 +1,44 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import javax.swing.KeyStroke;
26
+
27
+/**
28
+ * Event describing a function key press.
29
+ *
30
+ * TODO: This should be moved into the Swing UI once the corresponding action types are removed.
31
+ */
32
+public class ClientKeyPressedEvent extends DMDircEvent {
33
+
34
+    private final KeyStroke keyStroke;
35
+
36
+    public ClientKeyPressedEvent(final KeyStroke keyStroke) {
37
+        this.keyStroke = keyStroke;
38
+    }
39
+
40
+    public KeyStroke getKeyStroke() {
41
+        return keyStroke;
42
+    }
43
+
44
+}

+ 48
- 0
src/com/dmdirc/events/ClientLineAddedEvent.java Datei anzeigen

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.FrameContainer;
26
+
27
+/**
28
+ * Event fired when a line has been added to a window.
29
+ */
30
+public class ClientLineAddedEvent extends DMDircEvent {
31
+
32
+    private final FrameContainer container;
33
+    private final String line;
34
+
35
+    public ClientLineAddedEvent(final FrameContainer container, final String line) {
36
+        this.container = container;
37
+        this.line = line;
38
+    }
39
+
40
+    public FrameContainer getFrameContainer() {
41
+        return container;
42
+    }
43
+
44
+    public String getLine() {
45
+        return line;
46
+    }
47
+
48
+}

+ 48
- 0
src/com/dmdirc/events/ClientUserInputEvent.java Datei anzeigen

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.FrameContainer;
26
+
27
+/**
28
+ * Event fired when some input has been entered into the client.
29
+ */
30
+public class ClientUserInputEvent extends DMDircEvent {
31
+
32
+    private final FrameContainer container;
33
+    private final StringBuffer buffer;
34
+
35
+    public ClientUserInputEvent(final FrameContainer container, final StringBuffer buffer) {
36
+        this.container = container;
37
+        this.buffer = buffer;
38
+    }
39
+
40
+    public FrameContainer getFrameContainer() {
41
+        return container;
42
+    }
43
+
44
+    public StringBuffer getBuffer() {
45
+        return buffer;
46
+    }
47
+
48
+}

Laden…
Abbrechen
Speichern