浏览代码

Use Connection iface in place of Server.

Change-Id: I871f3e5e99c1112189065f143d97d8bfbebf83ef
Reviewed-on: http://gerrit.dmdirc.com/2933
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.8
Chris Smith 10 年前
父节点
当前提交
f7cd4ab287

+ 15
- 15
src/com/dmdirc/addons/dcc/DCCCommand.java 查看文件

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.addons.dcc;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.Server;
27 26
 import com.dmdirc.actions.ActionManager;
28 27
 import com.dmdirc.addons.dcc.actions.DCCActions;
29 28
 import com.dmdirc.addons.dcc.io.DCC;
@@ -41,6 +40,7 @@ import com.dmdirc.commandparser.commands.IntelligentCommand;
41 40
 import com.dmdirc.commandparser.commands.context.CommandContext;
42 41
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
43 42
 import com.dmdirc.interfaces.CommandController;
43
+import com.dmdirc.interfaces.Connection;
44 44
 import com.dmdirc.messages.MessageSinkManager;
45 45
 import com.dmdirc.parser.interfaces.Parser;
46 46
 import com.dmdirc.ui.WindowManager;
@@ -108,8 +108,8 @@ public class DCCCommand extends Command implements IntelligentCommand {
108 108
             final CommandArguments args, final CommandContext context) {
109 109
         if (args.getArguments().length > 1) {
110 110
             final String target = args.getArguments()[1];
111
-            final Server server = ((ServerCommandContext) context).getServer();
112
-            final Parser parser = server.getParser();
111
+            final Connection connection = ((ServerCommandContext) context).getServer();
112
+            final Parser parser = connection.getParser();
113 113
             final String myNickname = parser.getLocalClient().getNickname();
114 114
 
115 115
             if (parser.isValidChannelName(target)
@@ -137,9 +137,9 @@ public class DCCCommand extends Command implements IntelligentCommand {
137 137
             }
138 138
             final String type = args.getArguments()[0];
139 139
             if (type.equalsIgnoreCase("chat")) {
140
-                startChat(parser, server, origin, myNickname, target, true);
140
+                startChat(parser, connection, origin, myNickname, target, true);
141 141
             } else if (type.equalsIgnoreCase("send")) {
142
-                sendFile(target, origin, server, true,
142
+                sendFile(target, origin, connection, true,
143 143
                         args.getArgumentsAsString(2));
144 144
             } else {
145 145
                 sendLine(origin, args.isSilent(), FORMAT_ERROR,
@@ -154,13 +154,13 @@ public class DCCCommand extends Command implements IntelligentCommand {
154 154
      * Starts a DCC Chat.
155 155
      *
156 156
      * @param parser Parser from which command originated
157
-     * @param server Server from which command originated
157
+     * @param connection Server from which command originated
158 158
      * @param origin Frame container from which command originated
159 159
      * @param myNickname My current nickname
160 160
      * @param target Target of the command
161 161
      * @param isSilent Is this a silent command
162 162
      */
163
-    private void startChat(final Parser parser, final Server server,
163
+    private void startChat(final Parser parser, final Connection connection,
164 164
             final FrameContainer origin, final String myNickname,
165 165
             final String target, final boolean isSilent) {
166 166
         final DCCChat chat = new DCCChat();
@@ -172,7 +172,7 @@ public class DCCCommand extends Command implements IntelligentCommand {
172 172
             parser.sendCTCP(target, "DCC", "CHAT chat " + DCC.ipToLong(
173 173
                     myPlugin.getListenIP(parser)) + " " + chat.getPort());
174 174
             ActionManager.getActionManager().triggerEvent(
175
-                    DCCActions.DCC_CHAT_REQUEST_SENT, null, server, target);
175
+                    DCCActions.DCC_CHAT_REQUEST_SENT, null, connection, target);
176 176
             sendLine(origin, isSilent, "DCCChatStarting", target,
177 177
                     chat.getHost(), chat.getPort());
178 178
             window.addLine("DCCChatStarting", target, chat.getHost(),
@@ -189,13 +189,13 @@ public class DCCCommand extends Command implements IntelligentCommand {
189 189
      *
190 190
      * @param target Person this dcc is to.
191 191
      * @param origin The InputWindow this command was issued on
192
-     * @param server The server instance that this command is being executed on
192
+     * @param connection The server instance that this command is being executed on
193 193
      * @param isSilent Whether this command is silenced or not
194 194
      * @param filename The file to send
195 195
      * @since 0.6.3m1
196 196
      */
197 197
     public void sendFile(final String target, final FrameContainer origin,
198
-            final Server server, final boolean isSilent, final String filename) {
198
+            final Connection connection, final boolean isSilent, final String filename) {
199 199
         // New thread to ask the user what file to send
200 200
         final File givenFile = new File(filename);
201 201
         final File selectedFile = UIUtilities.invokeAndWait(new Callable<File>() {
@@ -233,7 +233,7 @@ public class DCCCommand extends Command implements IntelligentCommand {
233 233
 
234 234
                 ActionManager.getActionManager().triggerEvent(
235 235
                         DCCActions.DCC_SEND_REQUEST_SENT,
236
-                        null, server, target, selectedFile);
236
+                        null, connection, target, selectedFile);
237 237
 
238 238
                 sendLine(origin, isSilent, FORMAT_OUTPUT,
239 239
                         "Starting DCC Send with: " + target);
@@ -243,10 +243,10 @@ public class DCCCommand extends Command implements IntelligentCommand {
243 243
 
244 244
                 if (origin.getConfigManager().getOptionBool(
245 245
                         myPlugin.getDomain(), "send.reverse")) {
246
-                    final Parser parser = server.getParser();
246
+                    final Parser parser = connection.getParser();
247 247
                     final TransferContainer container = new TransferContainer(myPlugin, send,
248 248
                             origin.getConfigManager(), "Send: " + target,
249
-                            target, server);
249
+                            target, connection);
250 250
                     windowManager.addWindow(myPlugin.getContainer(), container);
251 251
                     parser.sendCTCP(target, "DCC", "SEND \""
252 252
                             + selectedFile.getName() + "\" "
@@ -255,11 +255,11 @@ public class DCCCommand extends Command implements IntelligentCommand {
255 255
                             + send.makeToken()
256 256
                             + (send.isTurbo() ? " T" : ""));
257 257
                 } else {
258
-                    final Parser parser = server.getParser();
258
+                    final Parser parser = connection.getParser();
259 259
                     if (myPlugin.listen(send)) {
260 260
                         final TransferContainer container = new TransferContainer(myPlugin, send,
261 261
                                 origin.getConfigManager(), "*Send: "
262
-                                + target, target, server);
262
+                                + target, target, connection);
263 263
                         windowManager.addWindow(myPlugin.getContainer(), container);
264 264
                         parser.sendCTCP(target, "DCC", "SEND \""
265 265
                                 + selectedFile.getName() + "\" "

+ 6
- 6
src/com/dmdirc/addons/dcc/DCCManager.java 查看文件

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.dcc;
24 24
 
25
-import com.dmdirc.Server;
26 25
 import com.dmdirc.actions.ActionManager;
27 26
 import com.dmdirc.actions.CoreActionType;
28 27
 import com.dmdirc.addons.dcc.actions.DCCActions;
@@ -40,6 +39,7 @@ import com.dmdirc.config.prefs.PreferencesSetting;
40 39
 import com.dmdirc.config.prefs.PreferencesType;
41 40
 import com.dmdirc.interfaces.ActionListener;
42 41
 import com.dmdirc.interfaces.CommandController;
42
+import com.dmdirc.interfaces.Connection;
43 43
 import com.dmdirc.interfaces.actions.ActionType;
44 44
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
45 45
 import com.dmdirc.interfaces.config.ConfigProvider;
@@ -412,7 +412,7 @@ public class DCCManager implements ActionListener {
412 412
             } catch (NumberFormatException nfe) {
413 413
                 return;
414 414
             }
415
-            final String myNickname = ((Server) arguments[0]).getParser()
415
+            final String myNickname = ((Connection) arguments[0]).getParser()
416 416
                     .getLocalClient().getNickname();
417 417
             final DCCFrameContainer f = new ChatContainer(chat, config, commandController,
418 418
                     "Chat: " + nickname, myNickname, nickname, tabCompleterFactory,
@@ -426,7 +426,7 @@ public class DCCManager implements ActionListener {
426 426
                     DCCActions.DCC_CHAT_REQUEST, null, arguments[0],
427 427
                     nickname);
428 428
             askQuestion("User " + nickname + " on "
429
-                    + ((Server) arguments[0]).getName()
429
+                    + ((Connection) arguments[0]).getAddress()
430 430
                     + " would like to start a DCC Chat with you.\n\n"
431 431
                     + "Do you want to continue?",
432 432
                     "DCC Chat Request", JOptionPane.YES_OPTION,
@@ -519,7 +519,7 @@ public class DCCManager implements ActionListener {
519 519
                         DCCActions.DCC_SEND_REQUEST, null,
520 520
                         arguments[0], nickname, filename);
521 521
                 askQuestion("User " + nickname + " on "
522
-                        + ((Server) arguments[0]).getName()
522
+                        + ((Connection) arguments[0]).getAddress()
523 523
                         + " would like to send you a file over DCC.\n\nFile: "
524 524
                         + filename + "\n\nDo you want to continue?",
525 525
                         "DCC Send Request", JOptionPane.YES_OPTION, type,
@@ -540,7 +540,7 @@ public class DCCManager implements ActionListener {
540 540
             if (newSend) {
541 541
                 send.setFileName(filename);
542 542
                 send.setFileSize(size);
543
-                saveFile(nickname, send, ((Server) arguments[0]).getParser(),
543
+                saveFile(nickname, send, ((Connection) arguments[0]).getParser(),
544 544
                         "0".equals(port), token);
545 545
             } else {
546 546
                 send.connect();
@@ -600,7 +600,7 @@ public class DCCManager implements ActionListener {
600 600
                         && (!token.equals(send.getToken()))) {
601 601
                     continue;
602 602
                 }
603
-                final Parser parser = ((Server) arguments[0]).getParser();
603
+                final Parser parser = ((Connection) arguments[0]).getParser();
604 604
                 final String nick = ((ClientInfo) arguments[1]).getNickname();
605 605
                 if (ctcpData[0].equalsIgnoreCase("resume")) {
606 606
                     parser.sendCTCP(nick, "DCC", "ACCEPT "+ ((quoted) ? "\""

+ 12
- 11
src/com/dmdirc/addons/dcc/TransferContainer.java 查看文件

@@ -29,6 +29,7 @@ import com.dmdirc.actions.ActionManager;
29 29
 import com.dmdirc.addons.dcc.actions.DCCActions;
30 30
 import com.dmdirc.addons.dcc.io.DCC;
31 31
 import com.dmdirc.addons.dcc.io.DCCTransfer;
32
+import com.dmdirc.interfaces.Connection;
32 33
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
33 34
 import com.dmdirc.parser.interfaces.Parser;
34 35
 import com.dmdirc.parser.interfaces.callbacks.SocketCloseListener;
@@ -73,8 +74,8 @@ public class TransferContainer extends FrameContainer implements
73 74
     /** IRC Parser that caused this send */
74 75
     private Parser parser = null;
75 76
 
76
-    /** Server that caused this send */
77
-    private Server server = null;
77
+    /** Connection the send was initiated on. */
78
+    private Connection connection = null;
78 79
 
79 80
     /** Show open button. */
80 81
     private boolean showOpen = Desktop.isDesktopSupported() &&
@@ -89,20 +90,20 @@ public class TransferContainer extends FrameContainer implements
89 90
      * @param config Config manager
90 91
      * @param title The title of this window
91 92
      * @param targetNick Nickname of target
92
-     * @param server The server that initiated this send
93
+     * @param connection The connection that the send was that initiated on
93 94
      */
94 95
     public TransferContainer(final DCCManager plugin, final DCCTransfer dcc,
95 96
             final AggregateConfigProvider config, final String title,
96
-            final String targetNick, final Server server) {
97
+            final String targetNick, final Connection connection) {
97 98
         super(dcc.getType() == DCCTransfer.TransferType.SEND
98 99
                 ? "dcc-send-inactive" : "dcc-receive-inactive",
99 100
                 title, title, config,
100 101
                 Arrays.asList("com.dmdirc.addons.dcc.ui.TransferPanel"));
101 102
         this.plugin = plugin;
102 103
         this.dcc = dcc;
103
-        this.server = server;
104
+        this.connection = connection;
104 105
         this.config = config;
105
-        parser = server == null ? null : server.getParser();
106
+        parser = connection == null ? null : connection.getParser();
106 107
         myPlugin = plugin;
107 108
 
108 109
         if (parser != null) {
@@ -308,12 +309,12 @@ public class TransferContainer extends FrameContainer implements
308 309
         }
309 310
         dcc.reset();
310 311
 
311
-        if (server != null && server.getState() == ServerState.CONNECTED) {
312
-            final String myNickname = server.getParser().getLocalClient()
312
+        if (connection != null && connection.getState() == ServerState.CONNECTED) {
313
+            final String myNickname = connection.getParser().getLocalClient()
313 314
                     .getNickname();
314 315
             // Check again incase we have changed nickname to the same nickname
315 316
             //that this send is for.
316
-            if (server.getParser().getStringConverter().equalsIgnoreCase(
317
+            if (connection.getParser().getStringConverter().equalsIgnoreCase(
317 318
                     otherNickname, myNickname)) {
318 319
                 final Thread errorThread = new Thread(new Runnable() {
319 320
 
@@ -371,8 +372,8 @@ public class TransferContainer extends FrameContainer implements
371 372
     }
372 373
 
373 374
     public void addSocketCloseCallback(final SocketCloseListener listener) {
374
-        if (server != null && server.getParser() != null) {
375
-            server.getParser().getCallbackManager()
375
+        if (connection != null && connection.getParser() != null) {
376
+            connection.getParser().getCallbackManager()
376 377
                     .addNonCriticalCallback(SocketCloseListener.class,
377 378
                     listener);
378 379
         }

+ 6
- 9
src/com/dmdirc/addons/dcc/actions/DCCEvents.java 查看文件

@@ -22,25 +22,22 @@
22 22
 
23 23
 package com.dmdirc.addons.dcc.actions;
24 24
 
25
-import com.dmdirc.Server;
26
-import com.dmdirc.interfaces.actions.ActionMetaType;
27
-
28 25
 import com.dmdirc.addons.dcc.ChatContainer;
29 26
 import com.dmdirc.addons.dcc.TransferContainer;
27
+import com.dmdirc.interfaces.Connection;
28
+import com.dmdirc.interfaces.actions.ActionMetaType;
30 29
 
31 30
 import java.io.File;
32 31
 
33 32
 /**
34 33
  * Defines DCC-related events.
35
- *
36
- * @author Chris
37 34
  */
38 35
 public enum DCCEvents implements ActionMetaType {
39 36
 
40 37
     /** DCC Chat Request. */
41
-    DCC_CHAT_REQUEST(new String[]{"server", "client"}, Server.class, String.class),
38
+    DCC_CHAT_REQUEST(new String[]{"connection", "client"}, Connection.class, String.class),
42 39
     /** DCC Chat Request Sent. */
43
-    DCC_CHAT_REQUEST_SENT(new String[]{"server", "client"}, Server.class, String.class),
40
+    DCC_CHAT_REQUEST_SENT(new String[]{"connection", "client"}, Connection.class, String.class),
44 41
     /** DCC Message from another person. */
45 42
     DCC_CHAT_MESSAGE(new String[]{"DCCChatWindow", "Nickname", "Message"}, ChatContainer.class, String.class, String.class),
46 43
     /** DCC Message to another person. */
@@ -56,9 +53,9 @@ public enum DCCEvents implements ActionMetaType {
56 53
     /** DCC Send Data Transfered */
57 54
     DCC_SEND_DATATRANSFERED(new String[]{"DCCSendWindow", "Bytes Transfered"}, TransferContainer.class, int.class),
58 55
     /** DCC Send Request. */
59
-    DCC_SEND_REQUEST(new String[]{"server", "client", "file"}, Server.class, String.class, String.class),
56
+    DCC_SEND_REQUEST(new String[]{"connection", "client", "file"}, Connection.class, String.class, String.class),
60 57
     /** DCC Send Request Sent. */
61
-    DCC_SEND_REQUEST_SENT(new String[]{"server", "client", "file"}, Server.class, String.class, File.class);
58
+    DCC_SEND_REQUEST_SENT(new String[]{"connection", "client", "file"}, Connection.class, String.class, File.class);
62 59
 
63 60
     /** The names of the arguments for this meta type. */
64 61
     private String[] argNames;

+ 3
- 3
src/com/dmdirc/addons/debug/commands/ServerInfo.java 查看文件

@@ -23,11 +23,11 @@
23 23
 package com.dmdirc.addons.debug.commands;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.Server;
27 26
 import com.dmdirc.addons.debug.Debug;
28 27
 import com.dmdirc.addons.debug.DebugCommand;
29 28
 import com.dmdirc.commandparser.CommandArguments;
30 29
 import com.dmdirc.commandparser.commands.context.CommandContext;
30
+import com.dmdirc.interfaces.Connection;
31 31
 
32 32
 import javax.inject.Inject;
33 33
 import javax.inject.Provider;
@@ -67,9 +67,9 @@ public class ServerInfo extends DebugCommand {
67 67
             sendLine(origin, args.isSilent(), FORMAT_ERROR,
68 68
                     "This window isn't connected to a server");
69 69
         } else {
70
-            final Server server = origin.getServer();
70
+            final Connection server = origin.getServer();
71 71
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Server name: "
72
-                    + server.getName());
72
+                    + server.getAddress());
73 73
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Actual name: "
74 74
                     + server.getParser().getServerName());
75 75
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Network: "

+ 2
- 2
src/com/dmdirc/addons/debug/commands/ServerState.java 查看文件

@@ -23,11 +23,11 @@
23 23
 package com.dmdirc.addons.debug.commands;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.Server;
27 26
 import com.dmdirc.addons.debug.Debug;
28 27
 import com.dmdirc.addons.debug.DebugCommand;
29 28
 import com.dmdirc.commandparser.CommandArguments;
30 29
 import com.dmdirc.commandparser.commands.context.CommandContext;
30
+import com.dmdirc.interfaces.Connection;
31 31
 
32 32
 import javax.inject.Inject;
33 33
 import javax.inject.Provider;
@@ -67,7 +67,7 @@ public class ServerState extends DebugCommand {
67 67
             sendLine(origin, args.isSilent(), FORMAT_ERROR,
68 68
                     "This window isn't connected to a server");
69 69
         } else {
70
-            final Server server = origin.getServer();
70
+            final Connection server = origin.getServer();
71 71
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
72 72
                     server.getStatus().getTransitionHistory());
73 73
         }

+ 11
- 11
src/com/dmdirc/addons/identd/IdentClient.java 查看文件

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.addons.identd;
24 24
 
25
-import com.dmdirc.Server;
26 25
 import com.dmdirc.ServerManager;
26
+import com.dmdirc.interfaces.Connection;
27 27
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
28 28
 import com.dmdirc.logger.ErrorLevel;
29 29
 import com.dmdirc.logger.Logger;
@@ -133,8 +133,8 @@ public class IdentClient implements Runnable {
133 133
             return String.format("%d , %d : ERROR : INVALID-PORT", myPort, theirPort);
134 134
         }
135 135
 
136
-        final Server server = getServerByPort(myPort);
137
-        if (!config.getOptionBool(myPlugin.getDomain(), "advanced.alwaysOn") && (server == null || config.getOptionBool(myPlugin.getDomain(), "advanced.isNoUser"))) {
136
+        final Connection connection = getConnectionByPort(myPort);
137
+        if (!config.getOptionBool(myPlugin.getDomain(), "advanced.alwaysOn") && (connection == null || config.getOptionBool(myPlugin.getDomain(), "advanced.isNoUser"))) {
138 138
             return String.format("%d , %d : ERROR : NO-USER", myPort, theirPort);
139 139
         }
140 140
 
@@ -175,10 +175,10 @@ public class IdentClient implements Runnable {
175 175
         final String customName = config.getOption(myPlugin.getDomain(), "general.customName");
176 176
         if (config.getOptionBool(myPlugin.getDomain(), "general.useCustomName") && customName != null && customName.length() > 0 && customName.length() < 513) {
177 177
             username = customName;
178
-        } else if (server != null && config.getOptionBool(myPlugin.getDomain(), "general.useNickname")) {
179
-            username = server.getParser().getLocalClient().getNickname();
180
-        } else if (server != null && config.getOptionBool(myPlugin.getDomain(), "general.useUsername")) {
181
-            username = server.getParser().getLocalClient().getUsername();
178
+        } else if (connection != null && config.getOptionBool(myPlugin.getDomain(), "general.useNickname")) {
179
+            username = connection.getParser().getLocalClient().getNickname();
180
+        } else if (connection != null && config.getOptionBool(myPlugin.getDomain(), "general.useUsername")) {
181
+            username = connection.getParser().getLocalClient().getUsername();
182 182
         } else {
183 183
             username = System.getProperty("user.name");
184 184
         }
@@ -226,10 +226,10 @@ public class IdentClient implements Runnable {
226 226
      * @param port Port to check for
227 227
      * @return The server instance listening on the given port
228 228
      */
229
-    protected Server getServerByPort(final int port) {
230
-        for (Server server : serverManager.getServers()) {
231
-            if (server.getParser().getLocalPort() == port) {
232
-                return server;
229
+    protected Connection getConnectionByPort(final int port) {
230
+        for (Connection connection : serverManager.getServers()) {
231
+            if (connection.getParser().getLocalPort() == port) {
232
+                return connection;
233 233
             }
234 234
         }
235 235
         return null;

+ 10
- 10
src/com/dmdirc/addons/identd/IdentdPlugin.java 查看文件

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.identd;
24 24
 
25
-import com.dmdirc.Server;
26 25
 import com.dmdirc.ServerManager;
27 26
 import com.dmdirc.actions.CoreActionType;
28 27
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
@@ -32,6 +31,7 @@ import com.dmdirc.config.prefs.PreferencesSetting;
32 31
 import com.dmdirc.config.prefs.PreferencesType;
33 32
 import com.dmdirc.interfaces.ActionController;
34 33
 import com.dmdirc.interfaces.ActionListener;
34
+import com.dmdirc.interfaces.Connection;
35 35
 import com.dmdirc.interfaces.actions.ActionType;
36 36
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
37 37
 import com.dmdirc.interfaces.config.IdentityController;
@@ -49,8 +49,8 @@ import lombok.Getter;
49 49
  */
50 50
 public class IdentdPlugin extends BasePlugin implements ActionListener {
51 51
 
52
-    /** Array list to store all the servers in that need ident replies. */
53
-    private final List<Server> servers = new ArrayList<>();
52
+    /** List of all the connections that need ident replies. */
53
+    private final List<Connection> connections = new ArrayList<>();
54 54
     /** The IdentdServer that we use. */
55 55
     private IdentdServer myServer;
56 56
     /** This plugin's plugin info. */
@@ -106,7 +106,7 @@ public class IdentdPlugin extends BasePlugin implements ActionListener {
106 106
     @Override
107 107
     public void onUnload() {
108 108
         myServer.stopServer();
109
-        servers.clear();
109
+        connections.clear();
110 110
         actionController.unregisterListener(this);
111 111
     }
112 112
 
@@ -121,18 +121,18 @@ public class IdentdPlugin extends BasePlugin implements ActionListener {
121 121
     public void processEvent(final ActionType type, final StringBuffer format,
122 122
             final Object... arguments) {
123 123
         if (type == CoreActionType.SERVER_CONNECTING) {
124
-            synchronized (servers) {
125
-                if (servers.isEmpty()) {
124
+            synchronized (connections) {
125
+                if (connections.isEmpty()) {
126 126
                     myServer.startServer();
127 127
                 }
128
-                servers.add((Server) arguments[0]);
128
+                connections.add((Connection) arguments[0]);
129 129
             }
130 130
         } else if (type == CoreActionType.SERVER_CONNECTED
131 131
                 || type == CoreActionType.SERVER_CONNECTERROR) {
132
-            synchronized (servers) {
133
-                servers.remove(arguments[0]);
132
+            synchronized (connections) {
133
+                connections.remove(arguments[0]);
134 134
 
135
-                if (servers.isEmpty() && !config.getOptionBool(getDomain(),
135
+                if (connections.isEmpty() && !config.getOptionBool(getDomain(),
136 136
                         "advanced.alwaysOn")) {
137 137
                     myServer.stopServer();
138 138
                 }

+ 25
- 22
src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java 查看文件

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.addons.lagdisplay;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.Server;
27 26
 import com.dmdirc.ServerState;
28 27
 import com.dmdirc.actions.ActionManager;
29 28
 import com.dmdirc.actions.CoreActionType;
@@ -36,6 +35,7 @@ import com.dmdirc.config.prefs.PreferencesDialogModel;
36 35
 import com.dmdirc.config.prefs.PreferencesSetting;
37 36
 import com.dmdirc.config.prefs.PreferencesType;
38 37
 import com.dmdirc.interfaces.ActionListener;
38
+import com.dmdirc.interfaces.Connection;
39 39
 import com.dmdirc.interfaces.actions.ActionType;
40 40
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
41 41
 import com.dmdirc.interfaces.config.ConfigChangeListener;
@@ -57,9 +57,9 @@ public final class LagDisplayPlugin extends BasePlugin implements
57 57
     /** The panel we use in the status bar. */
58 58
     private final LagDisplayPanel panel;
59 59
     /** A cache of ping times. */
60
-    private final Map<Server, String> pings = new WeakHashMap<>();
60
+    private final Map<Connection, String> pings = new WeakHashMap<>();
61 61
     /** Ping history. */
62
-    private final Map<Server, RollingList<Long>> history = new HashMap<>();
62
+    private final Map<Connection, RollingList<Long>> history = new HashMap<>();
63 63
     /** Parent Swing UI. */
64 64
     private final SwingController controller;
65 65
     /** Whether or not to show a graph in the info popup. */
@@ -121,14 +121,14 @@ public final class LagDisplayPlugin extends BasePlugin implements
121 121
      * Retrieves the history of the specified server. If there is no history,
122 122
      * a new list is added to the history map and returned.
123 123
      *
124
-     * @param server The server whose history is being requested
124
+     * @param connection The connection whose history is being requested
125 125
      * @return The history for the specified server
126 126
      */
127
-    protected RollingList<Long> getHistory(final Server server) {
128
-        if (!history.containsKey(server)) {
129
-            history.put(server, new RollingList<Long>(historySize));
127
+    protected RollingList<Long> getHistory(final Connection connection) {
128
+        if (!history.containsKey(connection)) {
129
+            history.put(connection, new RollingList<Long>(historySize));
130 130
         }
131
-        return history.get(server);
131
+        return history.get(connection);
132 132
     }
133 133
 
134 134
     /**
@@ -183,14 +183,17 @@ public final class LagDisplayPlugin extends BasePlugin implements
183 183
         final TextFrame activeFrame = controller.getMainFrame().getActiveFrame();
184 184
         final FrameContainer active = activeFrame == null ? null
185 185
                 : activeFrame.getContainer();
186
+        final boolean isActive = active != null
187
+                && arguments[0] instanceof Connection
188
+                && ((Connection) arguments[0]).equals(active.getServer());
186 189
 
187 190
         if (!useAlternate && type.equals(CoreActionType.SERVER_GOTPING)) {
188 191
             final String value = formatTime(arguments[1]);
189 192
 
190
-            getHistory(((Server) arguments[0])).add((Long) arguments[1]);
191
-            pings.put(((Server) arguments[0]), value);
193
+            getHistory(((Connection) arguments[0])).add((Long) arguments[1]);
194
+            pings.put(((Connection) arguments[0]), value);
192 195
 
193
-            if (((Server) arguments[0]).isChild(active) || arguments[0] == active) {
196
+            if (isActive) {
194 197
                 panel.getComponent().setText(value);
195 198
             }
196 199
 
@@ -198,22 +201,22 @@ public final class LagDisplayPlugin extends BasePlugin implements
198 201
         } else if (!useAlternate && type.equals(CoreActionType.SERVER_NOPING)) {
199 202
             final String value = formatTime(arguments[1]) + "+";
200 203
 
201
-            pings.put(((Server) arguments[0]), value);
204
+            pings.put(((Connection) arguments[0]), value);
202 205
 
203
-            if (((Server) arguments[0]).isChild(active) || arguments[0] == active) {
206
+            if (isActive) {
204 207
                 panel.getComponent().setText(value);
205 208
             }
206 209
 
207 210
             panel.refreshDialog();
208 211
         } else if (type.equals(CoreActionType.SERVER_DISCONNECTED)) {
209
-            if (((Server) arguments[0]).isChild(active) || arguments[0] == active) {
212
+            if (isActive) {
210 213
                 panel.getComponent().setText("Not connected");
211 214
                 pings.remove(arguments[0]);
212 215
             }
213 216
 
214 217
             panel.refreshDialog();
215 218
         } else if (useAlternate && type.equals(CoreActionType.SERVER_PINGSENT)) {
216
-            ((Server) arguments[0]).getParser().sendRawMessage("LAGCHECK_" + new Date().getTime());
219
+            ((Connection) arguments[0]).getParser().sendRawMessage("LAGCHECK_" + new Date().getTime());
217 220
         } else if (useAlternate && type.equals(CoreActionType.SERVER_NUMERIC)
218 221
                 && ((Integer) arguments[1]).intValue() == 421
219 222
                 && ((String[]) arguments[2])[3].startsWith("LAGCHECK_")) {
@@ -222,10 +225,10 @@ public final class LagDisplayPlugin extends BasePlugin implements
222 225
                 final Long duration = Long.valueOf(new Date().getTime() - sent);
223 226
                 final String value = formatTime(duration);
224 227
 
225
-                pings.put((Server) arguments[0], value);
226
-                getHistory(((Server) arguments[0])).add(duration);
228
+                pings.put((Connection) arguments[0], value);
229
+                getHistory(((Connection) arguments[0])).add(duration);
227 230
 
228
-                if (((Server) arguments[0]).isChild(active) || arguments[0] == active) {
231
+                if (isActive) {
229 232
                     panel.getComponent().setText(value);
230 233
                 }
231 234
             } catch (NumberFormatException ex) {
@@ -241,13 +244,13 @@ public final class LagDisplayPlugin extends BasePlugin implements
241 244
     }
242 245
 
243 246
     /**
244
-     * Retrieves the ping time for the specified server.
247
+     * Retrieves the ping time for the specified connection.
245 248
      *
246
-     * @param server The server whose ping time is being requested
249
+     * @param connection The connection whose ping time is being requested
247 250
      * @return A String representation of the current lag, or "Unknown"
248 251
      */
249
-    public String getTime(final Server server) {
250
-        return pings.get(server) == null ? "Unknown" : pings.get(server);
252
+    public String getTime(final Connection connection) {
253
+        return pings.get(connection) == null ? "Unknown" : pings.get(connection);
251 254
     }
252 255
 
253 256
     /**

+ 3
- 2
src/com/dmdirc/addons/logging/LoggingPlugin.java 查看文件

@@ -35,6 +35,7 @@ import com.dmdirc.config.prefs.PreferencesType;
35 35
 import com.dmdirc.interfaces.ActionController;
36 36
 import com.dmdirc.interfaces.ActionListener;
37 37
 import com.dmdirc.interfaces.CommandController;
38
+import com.dmdirc.interfaces.Connection;
38 39
 import com.dmdirc.interfaces.actions.ActionType;
39 40
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
40 41
 import com.dmdirc.interfaces.config.ConfigChangeListener;
@@ -849,8 +850,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
849 850
         } else if (target instanceof Query) {
850 851
             final Parser parser = ((Query) target).getServer().getParser();
851 852
             component = parser.getClient(((Query) target).getHost());
852
-        } else if (target instanceof Server) {
853
-            component = ((Server) target).getParser();
853
+        } else if (target instanceof Connection) {
854
+            component = ((Connection) target).getParser();
854 855
         } else {
855 856
             // Unknown component
856 857
             return false;

+ 3
- 3
src/com/dmdirc/addons/parserdebug/DebugPlugin.java 查看文件

@@ -22,11 +22,11 @@
22 22
 
23 23
 package com.dmdirc.addons.parserdebug;
24 24
 
25
-import com.dmdirc.Server;
26 25
 import com.dmdirc.actions.CoreActionType;
27 26
 import com.dmdirc.interfaces.ActionController;
28 27
 import com.dmdirc.interfaces.ActionListener;
29 28
 import com.dmdirc.interfaces.CommandController;
29
+import com.dmdirc.interfaces.Connection;
30 30
 import com.dmdirc.interfaces.actions.ActionType;
31 31
 import com.dmdirc.parser.interfaces.Parser;
32 32
 import com.dmdirc.parser.interfaces.callbacks.DebugInfoListener;
@@ -106,8 +106,8 @@ public final class DebugPlugin extends BaseCommandPlugin implements
106 106
     @Override
107 107
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
108 108
         if (type == CoreActionType.SERVER_DISCONNECTED) {
109
-            final Server thisServer = (Server) arguments[0];
110
-            final Parser parser = thisServer.getParser();
109
+            final Connection connection = (Connection) arguments[0];
110
+            final Parser parser = connection.getParser();
111 111
             if (registeredParsers.containsKey(parser)) {
112 112
                 try {
113 113
                     final DebugWindow window = registeredParsers.get(parser);

+ 6
- 5
src/com/dmdirc/addons/relaybot/RelayBotPlugin.java 查看文件

@@ -34,6 +34,7 @@ import com.dmdirc.config.prefs.PreferencesDialogModel;
34 34
 import com.dmdirc.config.prefs.PreferencesSetting;
35 35
 import com.dmdirc.config.prefs.PreferencesType;
36 36
 import com.dmdirc.interfaces.ActionListener;
37
+import com.dmdirc.interfaces.Connection;
37 38
 import com.dmdirc.interfaces.config.ConfigChangeListener;
38 39
 import com.dmdirc.interfaces.config.IdentityController;
39 40
 import com.dmdirc.interfaces.actions.ActionType;
@@ -156,20 +157,20 @@ public class RelayBotPlugin extends BasePlugin implements ActionListener, Config
156 157
                 }
157 158
             }
158 159
         } else if (type == CoreActionType.SERVER_CONNECTED) {
159
-            final Server server = (Server) arguments[0];
160
+            final Connection connection = (Connection) arguments[0];
160 161
 
161
-            final Parser parser = server.getParser();
162
+            final Parser parser = connection.getParser();
162 163
             if (parser instanceof IRCParser && !(parser.getCallbackManager() instanceof RelayCallbackManager)) {
163 164
                 new RelayCallbackManager(this, (IRCParser) parser);
164 165
             }
165 166
         } else if (type == CoreActionType.SERVER_DISCONNECTED) {
166
-            final Server server = (Server) arguments[0];
167
+            final Connection connection = (Connection) arguments[0];
167 168
 
168 169
             // RelayCallbackManager will revert itself when this happens.
169 170
 
170 171
             // Unset any listeners for channels of this server
171
-            for (String channel : server.getChannels()) {
172
-                removeHandler(server.getChannel(channel));
172
+            for (String channel : connection.getChannels()) {
173
+                removeHandler(connection.getChannel(channel));
173 174
             }
174 175
         }
175 176
     }

+ 2
- 3
src/com/dmdirc/addons/ui_swing/SwingController.java 查看文件

@@ -121,7 +121,6 @@ public class SwingController extends BaseCommandPlugin implements UIController {
121 121
     @Getter
122 122
     private final ConfigProvider globalIdentity;
123 123
     /** Addon config identity. */
124
-    @Getter
125 124
     private final ConfigProvider addonIdentity;
126 125
     /** Global Swing UI Icon manager. */
127 126
     @Getter
@@ -494,9 +493,9 @@ public class SwingController extends BaseCommandPlugin implements UIController {
494 493
     /** {@inheritDoc} */
495 494
     @Override
496 495
     public void domainUpdated() {
497
-        getAddonIdentity().setOption("ui", "textPaneFontName",
496
+        addonIdentity.setOption("ui", "textPaneFontName",
498 497
                 UIManager.getFont("TextPane.font").getFamily());
499
-        getAddonIdentity().setOption("ui", "textPaneFontSize",
498
+        addonIdentity.setOption("ui", "textPaneFontSize",
500 499
                 UIManager.getFont("TextPane.font").getSize());
501 500
     }
502 501
 

+ 2
- 1
src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java 查看文件

@@ -29,6 +29,7 @@ import com.dmdirc.addons.ui_swing.SwingController;
29 29
 import com.dmdirc.addons.ui_swing.dialogs.serversetting.ServerSettingsDialog;
30 30
 import com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SSLCertificateDialog;
31 31
 import com.dmdirc.commandparser.PopupType;
32
+import com.dmdirc.interfaces.Connection;
32 33
 import com.dmdirc.tls.CertificateManager;
33 34
 import com.dmdirc.tls.CertificateProblemListener;
34 35
 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
@@ -167,7 +168,7 @@ public final class ServerFrame extends InputTextFrame implements
167 168
     /** {@inheritDoc} */
168 169
     @Override
169 170
     public void dispose() {
170
-        ((Server) frameParent).removeCertificateProblemListener(this);
171
+        ((Connection) frameParent).removeCertificateProblemListener(this);
171 172
         super.dispose();
172 173
     }
173 174
 }

+ 5
- 4
src/com/dmdirc/addons/ui_swing/components/statusbar/InviteLabel.java 查看文件

@@ -32,6 +32,7 @@ import com.dmdirc.addons.ui_swing.SwingController;
32 32
 import com.dmdirc.addons.ui_swing.UIUtilities;
33 33
 import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
34 34
 import com.dmdirc.interfaces.ActionListener;
35
+import com.dmdirc.interfaces.Connection;
35 36
 import com.dmdirc.interfaces.InviteListener;
36 37
 import com.dmdirc.interfaces.actions.ActionType;
37 38
 import com.dmdirc.interfaces.ui.StatusBarComponent;
@@ -170,12 +171,12 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
170 171
     public void processEvent(final ActionType type, final StringBuffer format,
171 172
             final Object... arguments) {
172 173
         if (type == CoreActionType.SERVER_CONNECTED) {
173
-            if (arguments[0] instanceof Server) {
174
-                ((Server) arguments[0]).addInviteListener(this);
174
+            if (arguments[0] instanceof Connection) {
175
+                ((Connection) arguments[0]).addInviteListener(this);
175 176
             }
176 177
         } else {
177
-            if (arguments[0] instanceof Server) {
178
-                ((Server) arguments[0]).removeInviteListener(this);
178
+            if (arguments[0] instanceof Connection) {
179
+                ((Connection) arguments[0]).removeInviteListener(this);
179 180
             }
180 181
         }
181 182
     }

+ 8
- 8
src/com/dmdirc/addons/ui_swing/components/statusbar/InvitePopup.java 查看文件

@@ -23,8 +23,8 @@
23 23
 package com.dmdirc.addons.ui_swing.components.statusbar;
24 24
 
25 25
 import com.dmdirc.Invite;
26
-import com.dmdirc.Server;
27 26
 import com.dmdirc.addons.ui_swing.SwingController;
27
+import com.dmdirc.interfaces.Connection;
28 28
 import com.dmdirc.util.DateUtils;
29 29
 
30 30
 import java.awt.Window;
@@ -45,27 +45,27 @@ public class InvitePopup extends StatusbarPopupWindow {
45 45
      * objects being unserialized with the new class).
46 46
      */
47 47
     private static final long serialVersionUID = 1;
48
-    /** The server to show invites for. */
49
-    private final Server server;
48
+    /** The connection to show invites for. */
49
+    private final Connection connection;
50 50
 
51 51
     /**
52
-     * Creates a new InvitePopup for the specified panel and server.
52
+     * Creates a new InvitePopup for the specified panel and connection.
53 53
      *
54 54
      * @param controller Swing controller
55 55
      * @param parent The parent of this popup
56
-     * @param server The server to show invites for
56
+     * @param connection The connection to show invites for
57 57
      * @param parentWindow Parent window
58 58
      */
59 59
     public InvitePopup(final SwingController controller, final JPanel parent,
60
-            final Server server, final Window parentWindow) {
60
+            final Connection connection, final Window parentWindow) {
61 61
         super(controller, parent, parentWindow);
62
-        this.server = server;
62
+        this.connection = connection;
63 63
     }
64 64
 
65 65
     /** {@inheritDoc} */
66 66
     @Override
67 67
     protected void initContent(final JPanel panel) {
68
-        for (final Invite invite : server.getInvites()) {
68
+        for (final Invite invite : connection.getInvites()) {
69 69
             panel.add(new JLabel(invite.getChannel()), "growx, pushx");
70 70
             panel.add(new JLabel(invite.getSource()[0], JLabel.CENTER),
71 71
                     "growx, pushx, al center");

+ 4
- 4
src/com/dmdirc/addons/ui_swing/dialogs/NewServerDialog.java 查看文件

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs;
24 24
 
25
-import com.dmdirc.Server;
26 25
 import com.dmdirc.ServerManager;
27 26
 import com.dmdirc.addons.ui_swing.SwingController;
28 27
 import com.dmdirc.addons.ui_swing.UIUtilities;
@@ -32,6 +31,7 @@ import com.dmdirc.addons.ui_swing.components.vetoable.VetoableChangeEvent;
32 31
 import com.dmdirc.addons.ui_swing.components.vetoable.VetoableComboBoxModel;
33 32
 import com.dmdirc.addons.ui_swing.components.vetoable.VetoableComboBoxSelectionListener;
34 33
 import com.dmdirc.addons.ui_swing.dialogs.profiles.ProfileManagerDialog;
34
+import com.dmdirc.interfaces.Connection;
35 35
 import com.dmdirc.interfaces.config.ConfigProvider;
36 36
 import com.dmdirc.interfaces.config.ConfigProviderListener;
37 37
 import com.dmdirc.interfaces.config.IdentityController;
@@ -263,7 +263,7 @@ public final class NewServerDialog extends StandardDialog implements
263 263
                     }
264 264
                 }.executeInExecutor();
265 265
             } else {
266
-                final Server server = getController().getMainFrame()
266
+                final Connection connection = getController().getMainFrame()
267 267
                         .getActiveFrame().getContainer().getServer();
268 268
 
269 269
                 new LoggingSwingWorker<Void, Void>() {
@@ -271,10 +271,10 @@ public final class NewServerDialog extends StandardDialog implements
271 271
                     /** {@inheritDoc} */
272 272
                     @Override
273 273
                     protected Void doInBackground() {
274
-                        if (server == null) {
274
+                        if (connection == null) {
275 275
                             serverManager.connectToAddress(address, profile);
276 276
                         } else {
277
-                            server.connect(address, profile);
277
+                            connection.connect(address, profile);
278 278
                         }
279 279
                         return null;
280 280
                     }

+ 10
- 10
src/com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListPanel.java 查看文件

@@ -22,11 +22,11 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs.serversetting;
24 24
 
25
-import com.dmdirc.Server;
26 25
 import com.dmdirc.addons.ui_swing.SwingController;
27 26
 import com.dmdirc.addons.ui_swing.UIUtilities;
28 27
 import com.dmdirc.addons.ui_swing.dialogs.StandardInputDialog;
29 28
 import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
29
+import com.dmdirc.interfaces.Connection;
30 30
 import com.dmdirc.parser.common.IgnoreList;
31 31
 import com.dmdirc.util.validators.NotEmptyValidator;
32 32
 import com.dmdirc.util.validators.RegexValidator;
@@ -57,8 +57,8 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
57 57
 
58 58
     /** Serial version UID. */
59 59
     private static final long serialVersionUID = 2;
60
-    /** Parent server. */
61
-    private final Server server;
60
+    /** Parent connection. */
61
+    private final Connection connection;
62 62
     /** Parent window. */
63 63
     private final Window parentWindow;
64 64
     /** Swing controller. */
@@ -82,15 +82,15 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
82 82
      * Creates a new instance of IgnoreList.
83 83
      *
84 84
      * @param controller Swing controller
85
-     * @param server Parent server
85
+     * @param connection The connection whose ignore list should be displayed.
86 86
      * @param parentWindow Parent window
87 87
      */
88 88
     public IgnoreListPanel(final SwingController controller,
89
-            final Server server, final Window parentWindow) {
89
+            final Connection connection, final Window parentWindow) {
90 90
         super();
91 91
 
92 92
         this.controller = controller;
93
-        this.server = server;
93
+        this.connection = connection;
94 94
         this.parentWindow = parentWindow;
95 95
 
96 96
         this.setOpaque(UIUtilities.getTabbedPaneOpaque());
@@ -101,7 +101,7 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
101 101
 
102 102
     /** Initialises the components. */
103 103
     private void initComponents() {
104
-        cachedIgnoreList = new IgnoreList(server.getIgnoreList().getRegexList());
104
+        cachedIgnoreList = new IgnoreList(connection.getIgnoreList().getRegexList());
105 105
 
106 106
         listModel = new IgnoreListModel(cachedIgnoreList);
107 107
         list = new JList(listModel);
@@ -164,9 +164,9 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
164 164
 
165 165
     /** Saves the ignore list. */
166 166
     public void saveList() {
167
-        server.getIgnoreList().clear();
168
-        server.getIgnoreList().addAll(cachedIgnoreList.getRegexList());
169
-        server.saveIgnoreList();
167
+        connection.getIgnoreList().clear();
168
+        connection.getIgnoreList().addAll(cachedIgnoreList.getRegexList());
169
+        connection.saveIgnoreList();
170 170
     }
171 171
 
172 172
     /**

+ 11
- 11
src/com/dmdirc/addons/ui_swing/dialogs/serversetting/PerformTab.java 查看文件

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs.serversetting;
24 24
 
25
-import com.dmdirc.Server;
26 25
 import com.dmdirc.actions.wrappers.PerformType;
27 26
 import com.dmdirc.actions.wrappers.PerformWrapper;
28 27
 import com.dmdirc.actions.wrappers.PerformWrapper.PerformDescription;
@@ -30,6 +29,7 @@ import com.dmdirc.addons.ui_swing.SwingController;
30 29
 import com.dmdirc.addons.ui_swing.UIUtilities;
31 30
 import com.dmdirc.addons.ui_swing.components.performpanel.PerformPanel;
32 31
 import com.dmdirc.addons.ui_swing.components.renderers.PerformRenderer;
32
+import com.dmdirc.interfaces.Connection;
33 33
 
34 34
 import java.awt.event.ActionEvent;
35 35
 import java.awt.event.ActionListener;
@@ -45,12 +45,12 @@ import net.miginfocom.swing.MigLayout;
45 45
 /**
46 46
  * Perform panel.
47 47
  */
48
-public final class PerformTab extends JPanel implements ActionListener {
48
+public class PerformTab extends JPanel implements ActionListener {
49 49
 
50 50
     /** Serial version UID. */
51 51
     private static final long serialVersionUID = 1;
52
-    /** Parent server. */
53
-    private final Server server;
52
+    /** Parent connection. */
53
+    private final Connection connection;
54 54
     /** Swing controller. */
55 55
     private final SwingController controller;
56 56
     /** Perform wrapper to read/write performs to. */
@@ -65,17 +65,17 @@ public final class PerformTab extends JPanel implements ActionListener {
65 65
      *
66 66
      * @param controller Swing controller
67 67
      * @param wrapper Perform wrapper to read/write performs to.
68
-     * @param server Parent server
68
+     * @param connection Connection whose perform should be displayed.
69 69
      */
70 70
     public PerformTab(
71 71
             final SwingController controller,
72 72
             final PerformWrapper wrapper,
73
-            final Server server) {
73
+            final Connection connection) {
74 74
         super();
75 75
 
76 76
         this.controller = controller;
77 77
         this.wrapper = wrapper;
78
-        this.server = server;
78
+        this.connection = connection;
79 79
 
80 80
         setOpaque(UIUtilities.getTabbedPaneOpaque());
81 81
         initComponents();
@@ -94,13 +94,13 @@ public final class PerformTab extends JPanel implements ActionListener {
94 94
         final Collection<PerformDescription> performList = new ArrayList<>();
95 95
 
96 96
         final PerformDescription networkPerform = new PerformDescription(
97
-                PerformType.NETWORK, server.getNetwork());
97
+                PerformType.NETWORK, connection.getNetwork());
98 98
         final PerformDescription networkProfilePerform = new PerformDescription(
99
-                PerformType.NETWORK, server.getNetwork() ,server.getProfile().getName());
99
+                PerformType.NETWORK, connection.getNetwork() ,connection.getProfile().getName());
100 100
         final PerformDescription serverPerform = new PerformDescription(
101
-                PerformType.SERVER, server.getAddress());
101
+                PerformType.SERVER, connection.getAddress());
102 102
         final PerformDescription serverProfilePerform = new PerformDescription(
103
-                PerformType.SERVER, server.getAddress() ,server.getProfile().getName());
103
+                PerformType.SERVER, connection.getAddress() ,connection.getProfile().getName());
104 104
 
105 105
         model.addElement(networkPerform);
106 106
         model.addElement(networkProfilePerform);

+ 4
- 4
src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java 查看文件

@@ -25,7 +25,6 @@ package com.dmdirc.addons.windowstatus;
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Query;
28
-import com.dmdirc.Server;
29 28
 import com.dmdirc.addons.ui_swing.SelectionListener;
30 29
 import com.dmdirc.addons.ui_swing.SwingController;
31 30
 import com.dmdirc.addons.ui_swing.UIUtilities;
@@ -35,13 +34,14 @@ import com.dmdirc.config.prefs.PreferencesCategory;
35 34
 import com.dmdirc.config.prefs.PreferencesDialogModel;
36 35
 import com.dmdirc.config.prefs.PreferencesSetting;
37 36
 import com.dmdirc.config.prefs.PreferencesType;
37
+import com.dmdirc.interfaces.Connection;
38 38
 import com.dmdirc.interfaces.config.ConfigChangeListener;
39 39
 import com.dmdirc.interfaces.config.IdentityController;
40 40
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
41 41
 import com.dmdirc.parser.interfaces.ChannelInfo;
42 42
 import com.dmdirc.parser.interfaces.ClientInfo;
43
-import com.dmdirc.plugins.implementations.BasePlugin;
44 43
 import com.dmdirc.plugins.PluginInfo;
44
+import com.dmdirc.plugins.implementations.BasePlugin;
45 45
 
46 46
 import java.util.HashMap;
47 47
 import java.util.Map;
@@ -150,8 +150,8 @@ public final class WindowStatusPlugin extends BasePlugin
150 150
         }
151 151
         final StringBuffer textString = new StringBuffer();
152 152
 
153
-        if (current instanceof Server) {
154
-            textString.append(((Server) current).getName());
153
+        if (current instanceof Connection) {
154
+            textString.append(((Connection) current).getAddress());
155 155
         } else if (current instanceof Channel) {
156 156
             final ChannelInfo chan = ((Channel) current).getChannelInfo();
157 157
             final Map<Integer, String> names = new HashMap<>();

正在加载...
取消
保存