Bladeren bron

Added new Window interface



git-svn-id: http://svn.dmdirc.com/trunk@1544 00569f92-eb28-0410-84fd-f71c24880f
tags/0.5
Chris Smith 17 jaren geleden
bovenliggende
commit
1a04925dec

+ 0
- 1
src/com/dmdirc/ui/MainFrame.java Bestand weergeven

@@ -52,7 +52,6 @@ import java.awt.Font;
52 52
 import java.awt.GraphicsConfiguration;
53 53
 import java.awt.GraphicsDevice;
54 54
 import java.awt.Insets;
55
-import java.awt.MenuBar;
56 55
 import java.awt.MouseInfo;
57 56
 import java.awt.PointerInfo;
58 57
 import java.awt.Rectangle;

+ 3
- 57
src/com/dmdirc/ui/interfaces/InputWindow.java Bestand weergeven

@@ -22,45 +22,14 @@
22 22
 
23 23
 package com.dmdirc.ui.interfaces;
24 24
 
25
-import com.dmdirc.FrameContainer;
26
-import com.dmdirc.Server;
27 25
 import com.dmdirc.commandparser.CommandParser;
28
-import com.dmdirc.identities.ConfigManager;
29 26
 
30 27
 /**
31
- * A command window is a window that allows the user to input a command (that's
32
- * passed to a command parser). This interface includes methods that are required
33
- * to allow the commands to interact with the user via the window.
28
+ * The Input Window interface specifies additional methods that windows should
29
+ * implement if they have an input field.
34 30
  * @author chris
35 31
  */
36
-public interface InputWindow {
37
-    
38
-    /**
39
-     * Formats the arguments using the Formatter, then adds the result to the
40
-     * main text area.
41
-     * @param messageType The type of this message
42
-     * @param args The arguments for the message
43
-     */
44
-    void addLine(String messageType, Object... args);
45
-    
46
-    /**
47
-     * Formats the arguments using the Formatter, then adds the result to the
48
-     * main text area.
49
-     * @param messageType The type of this message
50
-     * @param args The arguments for the message
51
-     */
52
-    void addLine(StringBuffer messageType, Object... args);
53
-    
54
-    /**
55
-     * Clears the main text area of the command window.
56
-     */
57
-    void clear();
58
-    
59
-    /**
60
-     * Retrieves the config manager for this command window.
61
-     * @return This window's config manager
62
-     */
63
-    ConfigManager getConfigManager();
32
+public interface InputWindow extends Window {
64 33
     
65 34
     /**
66 35
      * Retrieves the command Parser for this command window.
@@ -68,27 +37,4 @@ public interface InputWindow {
68 37
      */
69 38
     CommandParser getCommandParser();
70 39
     
71
-    /**
72
-     * Retrieves the server associated with this command window.
73
-     * @return This window's associated server instance
74
-     * @deprecated No point proxying this - use getContainer().getServer()
75
-     */
76
-    @Deprecated
77
-    Server getServer();
78
-    
79
-    /**
80
-     * Retrieves the container that owns this command window.
81
-     * @return The container that owns this command window.
82
-     */
83
-    FrameContainer getContainer();
84
-    
85
-    /**
86
-     * Determines if the current frame is visible.
87
-     *
88
-     * @return boolean visibility
89
-     * @deprecated Visibility is of no concern to command windows
90
-     */
91
-    @Deprecated
92
-    boolean isVisible();
93
-    
94 40
 }

+ 87
- 0
src/com/dmdirc/ui/interfaces/Window.java Bestand weergeven

@@ -0,0 +1,87 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack, Gregory Holmes
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.ui.interfaces;
24
+
25
+import com.dmdirc.FrameContainer;
26
+import com.dmdirc.Server;
27
+import com.dmdirc.identities.ConfigManager;
28
+
29
+/**
30
+ * The Window interface specifies common methods that should be implemented
31
+ * by all windows. It is assumed that all windows have a main text area.
32
+ */
33
+public interface Window {
34
+    
35
+    /**
36
+     * Formats the arguments using the Formatter, then adds the result to the
37
+     * main text area.
38
+     *
39
+     * @param messageType The type of this message
40
+     * @param args The arguments for the message
41
+     */
42
+    void addLine(String messageType, Object... args);
43
+    
44
+    /**
45
+     * Formats the arguments using the Formatter, then adds the result to the
46
+     * main text area.
47
+     *
48
+     * @param messageType The type of this message
49
+     * @param args The arguments for the message
50
+     */
51
+    void addLine(StringBuffer messageType, Object... args);
52
+    
53
+    /**
54
+     * Clears the main text area of the command window.
55
+     */
56
+    void clear();
57
+    
58
+    /**
59
+     * Retrieves the config manager for this command window.
60
+     *
61
+     * @return This window's config manager
62
+     */
63
+    ConfigManager getConfigManager();
64
+    
65
+    /**
66
+     * Retrieves the server associated with this command window.
67
+     *
68
+     * @return This window's associated server instance
69
+     * @deprecated No point proxying this - use getContainer().getServer()
70
+     */
71
+    @Deprecated
72
+    Server getServer();
73
+    
74
+    /**
75
+     * Retrieves the container that owns this command window.
76
+     *
77
+     * @return The container that owns this command window.
78
+     */
79
+    FrameContainer getContainer();
80
+    
81
+    /**
82
+     * Determines if the current frame is visible.
83
+     *
84
+     * @return boolean visibility
85
+     */
86
+    boolean isVisible();
87
+}

Laden…
Annuleren
Opslaan