Browse Source

Fix some deprecated methods

Change-Id: Ie169d4727694407e9c2fda813c1be55cd11fc703
Reviewed-on: http://gerrit.dmdirc.com/1123
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4
Chris Smith 14 years ago
parent
commit
b9a405db16

+ 3
- 3
src/com/dmdirc/addons/dcc/DCCChatWindow.java View File

@@ -81,11 +81,11 @@ public class DCCChatWindow extends DCCFrame implements DCCChatHandler {
81 81
         if (dcc.isWriteable()) {
82 82
             final StringBuffer buff = new StringBuffer("DCCChatSelfMessage");
83 83
             ActionManager.processEvent(DCCActions.DCC_CHAT_SELFMESSAGE, buff, this, line);
84
-            addLine(buff, nickname, myWindow.getTranscoder().encode(line));
84
+            addLine(buff, nickname, getTranscoder().encode(line));
85 85
             dcc.sendLine(line);
86 86
         } else {
87 87
             final StringBuffer buff = new StringBuffer("DCCChatError");
88
-            addLine(buff, "Socket is closed.", myWindow.getTranscoder().encode(line));
88
+            addLine(buff, "Socket is closed.", getTranscoder().encode(line));
89 89
         }
90 90
     }
91 91
 
@@ -95,7 +95,7 @@ public class DCCChatWindow extends DCCFrame implements DCCChatHandler {
95 95
         final StringBuffer buff = new StringBuffer("DCCChatMessage");
96 96
         ActionManager.processEvent(DCCActions.DCC_CHAT_MESSAGE, buff, this,
97 97
                 otherNickname, message);
98
-        addLine(buff, otherNickname, myWindow.getTranscoder().encode(message));
98
+        addLine(buff, otherNickname, getTranscoder().encode(message));
99 99
     }
100 100
 
101 101
     /** {@inheritDoc} */

+ 3
- 4
src/com/dmdirc/addons/dcc/DCCPlugin.java View File

@@ -435,7 +435,7 @@ public final class DCCPlugin extends Plugin implements ActionListener {
435 435
         final TextLabel label = new TextLabel("This is a placeholder window to group DCCs together.");
436 436
         label.setText(label.getText() + "\n\nClosing this window will close all the active DCCs");
437 437
         ((TextFrame) container.getFrame()).getContentPane().add(label);
438
-        WindowManager.addWindow(container.getFrame());
438
+        WindowManager.addWindow(container);
439 439
         container.getFrame().open();
440 440
     }
441 441
 
@@ -452,7 +452,7 @@ public final class DCCPlugin extends Plugin implements ActionListener {
452 452
             createContainer();
453 453
         }
454 454
 
455
-        WindowManager.addWindow(container.getFrame(), window.getFrame());
455
+        WindowManager.addWindow(container, window);
456 456
         childFrames.add(window);
457 457
         window.getFrame().open();
458 458
     }
@@ -638,9 +638,8 @@ class PlaceholderDCCFrame extends DCCFrame {
638 638
 
639 639
     @Override
640 640
     public void close() {
641
-        final FrameContainer[] windows = WindowManager.getChildren(this);
642 641
         int dccs = 0;
643
-        for (FrameContainer window : windows) {
642
+        for (FrameContainer window : getChildren()) {
644 643
             if (window instanceof DCCTransferWindow) {
645 644
                 if (((DCCTransferWindow) window).getDCC().isActive()) {
646 645
                     dccs++;

+ 1
- 1
src/com/dmdirc/addons/logging/HistoryWindow.java View File

@@ -83,7 +83,7 @@ public class HistoryWindow extends FrameContainer {
83 83
         // 5: Inform any parents that the window is closing
84 84
 
85 85
         // 6: Remove the window from the window manager
86
-        WindowManager.removeWindow(window);
86
+        WindowManager.removeWindow(this);
87 87
     }
88 88
 
89 89
     /** {@inheritDoc} */

+ 1
- 2
src/com/dmdirc/addons/ui_web/Client.java View File

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_web;
24 24
 
25
-import com.dmdirc.ui.WindowManager;
26 25
 import com.dmdirc.ui.interfaces.Window;
27 26
 import com.dmdirc.addons.ui_web.uicomponents.WebWindow;
28 27
 import java.util.LinkedList;
@@ -53,7 +52,7 @@ public class Client {
53 52
 
54 53
         while (!queued.isEmpty()) {
55 54
             final Window window = queued.remove(0);
56
-            final Window parent = WindowManager.getParent(window.getContainer()).getFrame();
55
+            final Window parent = window.getContainer().getParent().getFrame();
57 56
             
58 57
             if (parent == null) {
59 58
                 events.add(new Event("newwindow", window));

+ 3
- 0
src/com/dmdirc/addons/ui_web/uicomponents/WebWindow.java View File

@@ -119,6 +119,7 @@ public class WebWindow implements Window {
119 119
 
120 120
     /** {@inheritDoc} */
121 121
     @Override
122
+    @Deprecated
122 123
     public void clear() {
123 124
         // Do nothing
124 125
     }
@@ -169,6 +170,7 @@ public class WebWindow implements Window {
169 170
 
170 171
     /** {@inheritDoc} */
171 172
     @Override
173
+    @Deprecated
172 174
     public void setTitle(String title) {
173 175
         this.title = title;
174 176
     }
@@ -181,6 +183,7 @@ public class WebWindow implements Window {
181 183
 
182 184
     /** {@inheritDoc} */
183 185
     @Override
186
+    @Deprecated
184 187
     public StringTranscoder getTranscoder() {
185 188
         return new StringTranscoder(Charset.defaultCharset());
186 189
     }

Loading…
Cancel
Save