소스 검색

Removes some uses of deprecated methods

Change-Id: I22de49ab4ce11af7647d2cdaadb894ac7a0291ef
Reviewed-on: http://gerrit.dmdirc.com/1196
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.4
Greboid 14 년 전
부모
커밋
75f2a661e2

+ 1
- 1
src/com/dmdirc/addons/tabcompletion_bash/BashStyle.java 파일 보기

92
             
92
             
93
             final String sub = res.getBestSubstring();
93
             final String sub = res.getBestSubstring();
94
             if (sub.equalsIgnoreCase(word) && tabCount >= 2) {
94
             if (sub.equalsIgnoreCase(word) && tabCount >= 2) {
95
-                window.addLine("tabCompletion", res.toString());
95
+                window.getContainer().addLine("tabCompletion", res.toString());
96
                 
96
                 
97
                 return null;
97
                 return null;
98
             } else {
98
             } else {

+ 35
- 10
src/com/dmdirc/addons/ui_dummy/DummyController.java 파일 보기

72
         return new DummyStatusBar();
72
         return new DummyStatusBar();
73
     }
73
     }
74
        
74
        
75
-    /** {@inheritDoc} */
76
-    @Override
75
+    /**
76
+     * {@inheritDoc}
77
+     *
78
+     * @deprecated Controllers should listen for window events using a
79
+     * {@link FrameListener} and create windows as needed.
80
+     */
81
+    @Override  @Deprecated
77
     public ChannelWindow getChannel(final Channel channel) {
82
     public ChannelWindow getChannel(final Channel channel) {
78
         return new DummyChannelWindow(channel);
83
         return new DummyChannelWindow(channel);
79
     }
84
     }
80
     
85
     
81
-    /** {@inheritDoc} */
82
-    @Override
86
+    /**
87
+     * {@inheritDoc}
88
+     *
89
+     * @deprecated Controllers should listen for window events using a
90
+     * {@link FrameListener} and create windows as needed.
91
+     */
92
+    @Override  @Deprecated
83
     public ServerWindow getServer(final Server server) {
93
     public ServerWindow getServer(final Server server) {
84
         return new DummyServerWindow(server);
94
         return new DummyServerWindow(server);
85
     }
95
     }
86
     
96
     
87
-    /** {@inheritDoc} */
88
-    @Override
97
+    /**
98
+     * {@inheritDoc}
99
+     *
100
+     * @deprecated Controllers should listen for window events using a
101
+     * {@link FrameListener} and create windows as needed.
102
+     */
103
+    @Override  @Deprecated
89
     public QueryWindow getQuery(final Query query) {
104
     public QueryWindow getQuery(final Query query) {
90
         return new DummyQueryWindow(query);
105
         return new DummyQueryWindow(query);
91
     }
106
     }
92
     
107
     
93
-    /** {@inheritDoc} */
94
-    @Override
108
+    /**
109
+     * {@inheritDoc}
110
+     *
111
+     * @deprecated Controllers should listen for window events using a
112
+     * {@link FrameListener} and create windows as needed.
113
+     */
114
+    @Override  @Deprecated
95
     public Window getWindow(final FrameContainer<?> owner) {
115
     public Window getWindow(final FrameContainer<?> owner) {
96
         throw new UnsupportedOperationException("Not supported yet.");
116
         throw new UnsupportedOperationException("Not supported yet.");
97
     }
117
     }
98
     
118
     
99
-    /** {@inheritDoc} */
100
-    @Override
119
+    /**
120
+     * {@inheritDoc}
121
+     *
122
+     * @deprecated Controllers should listen for window events using a
123
+     * {@link FrameListener} and create windows as needed.
124
+     */
125
+    @Override  @Deprecated
101
     public InputWindow getInputWindow(final WritableFrameContainer<?> owner) {
126
     public InputWindow getInputWindow(final WritableFrameContainer<?> owner) {
102
         return new DummyInputWindow(owner, owner.getCommandParser());
127
         return new DummyInputWindow(owner, owner.getCommandParser());
103
     }
128
     }

+ 15
- 12
src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java 파일 보기

207
      * @return This frame's container.
207
      * @return This frame's container.
208
      */
208
      */
209
     @Override
209
     @Override
210
+    @SuppressWarnings("unchecked")
210
     public WritableFrameContainer<? extends InputWindow> getContainer() {
211
     public WritableFrameContainer<? extends InputWindow> getContainer() {
211
         return (WritableFrameContainer<? extends InputWindow>) super.getContainer();
212
         return (WritableFrameContainer<? extends InputWindow>) super.getContainer();
212
     }
213
     }
263
      * Sets the away indicator on or off.
264
      * Sets the away indicator on or off.
264
      *
265
      *
265
      * @param awayState away state
266
      * @param awayState away state
267
+     *
268
+     * @deprecated Use {@link AwayStateListener}s to listen for changes instead
266
      */
269
      */
267
     @Override
270
     @Override
268
     @Deprecated
271
     @Deprecated
400
             final String text = inputFieldText.substring(0, caretPosition)
403
             final String text = inputFieldText.substring(0, caretPosition)
401
                     + clipboard + inputFieldText.substring(caretPosition);
404
                     + clipboard + inputFieldText.substring(caretPosition);
402
             //check the limit
405
             //check the limit
403
-            final Integer pasteTrigger = getConfigManager().getOptionInt("ui",
404
-                    "pasteProtectionLimit");
406
+            final Integer pasteTrigger = getContainer().getConfigManager()
407
+                    .getOptionInt("ui", "pasteProtectionLimit");
405
             //check whether the number of lines is over the limit
408
             //check whether the number of lines is over the limit
406
             if (pasteTrigger != null && getContainer().getNumLines(text)
409
             if (pasteTrigger != null && getContainer().getNumLines(text)
407
                     > pasteTrigger) {
410
                     > pasteTrigger) {
436
     public void configChanged(final String domain, final String key) {
439
     public void configChanged(final String domain, final String key) {
437
         super.configChanged(domain, key);
440
         super.configChanged(domain, key);
438
 
441
 
439
-        if ("ui".equals(domain) && getConfigManager() != null) {
442
+        if ("ui".equals(domain) && getContainer().getConfigManager() != null) {
440
             if (getInputField() != null) {
443
             if (getInputField() != null) {
441
                 if ("inputbackgroundcolour".equals(key) || "backgroundcolour".
444
                 if ("inputbackgroundcolour".equals(key) || "backgroundcolour".
442
                         equals(key)) {
445
                         equals(key)) {
443
-                    getInputField().setBackground(getConfigManager().
444
-                            getOptionColour(
446
+                    getInputField().setBackground(getContainer()
447
+                            .getConfigManager().getOptionColour(
445
                             "ui", "inputbackgroundcolour",
448
                             "ui", "inputbackgroundcolour",
446
                             "ui", "backgroundcolour"));
449
                             "ui", "backgroundcolour"));
447
                 } else if ("inputforegroundcolour".equals(key) || "foregroundcolour".
450
                 } else if ("inputforegroundcolour".equals(key) || "foregroundcolour".
448
                         equals(key)) {
451
                         equals(key)) {
449
-                    getInputField().setForeground(getConfigManager().
450
-                            getOptionColour(
452
+                    getInputField().setForeground(getContainer()
453
+                            .getConfigManager().getOptionColour(
451
                             "ui", "inputforegroundcolour",
454
                             "ui", "inputforegroundcolour",
452
                             "ui", "foregroundcolour"));
455
                             "ui", "foregroundcolour"));
453
-                    getInputField().setCaretColor(getConfigManager().
454
-                            getOptionColour(
456
+                    getInputField().setCaretColor(getContainer()
457
+                            .getConfigManager().getOptionColour(
455
                             "ui", "inputforegroundcolour",
458
                             "ui", "inputforegroundcolour",
456
                             "ui", "foregroundcolour"));
459
                             "ui", "foregroundcolour"));
457
                 }
460
                 }
458
             }
461
             }
459
             if ("awayindicator".equals(key)) {
462
             if ("awayindicator".equals(key)) {
460
-                useAwayIndicator = getConfigManager().getOptionBool("ui",
461
-                        "awayindicator");
463
+                useAwayIndicator = getContainer().getConfigManager()
464
+                        .getOptionBool("ui", "awayindicator");
462
             }
465
             }
463
         }
466
         }
464
     }
467
     }
470
      */
473
      */
471
     protected final void popuplateNicklistPopup(final String nickname) {
474
     protected final void popuplateNicklistPopup(final String nickname) {
472
         final PopupMenu popups = PopupManager.getMenu(PopupType.CHAN_NICK,
475
         final PopupMenu popups = PopupManager.getMenu(PopupType.CHAN_NICK,
473
-                getConfigManager());
476
+                getContainer().getConfigManager());
474
 
477
 
475
         nickPopup = (JPopupMenu) populatePopupMenu(new JPopupMenu(), popups,
478
         nickPopup = (JPopupMenu) populatePopupMenu(new JPopupMenu(), popups,
476
                 nickname);
479
                 nickname);

+ 25
- 22
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java 파일 보기

146
         final ConfigManager config = owner.getConfigManager();
146
         final ConfigManager config = owner.getConfigManager();
147
 
147
 
148
         setFrameIcon(IconManager.getIconManager().getIcon(owner.getIcon()));
148
         setFrameIcon(IconManager.getIconManager().getIcon(owner.getIcon()));
149
-        setTitle(frameParent.getTitle());
149
+        getContainer().setTitle(frameParent.getTitle());
150
 
150
 
151
         owner.addFrameInfoListener(this);
151
         owner.addFrameInfoListener(this);
152
 
152
 
164
         inputWindow = this;
164
         inputWindow = this;
165
         while (!(inputWindow instanceof InputWindow) && inputWindow != null
165
         while (!(inputWindow instanceof InputWindow) && inputWindow != null
166
                 && inputWindow.getContainer().getParent() != null) {
166
                 && inputWindow.getContainer().getParent() != null) {
167
-            inputWindow = inputWindow.getContainer().getParent().getFrame();
167
+            inputWindow = controller.getWindowFactory().getSwingWindow(
168
+                    inputWindow.getContainer().getParent());
168
         }
169
         }
169
 
170
 
170
         initComponents();
171
         initComponents();
202
         return panel;
203
         return panel;
203
     }
204
     }
204
 
205
 
205
-    /** {@inheritDoc} */
206
+    /**
207
+     * {@inheritDoc}
208
+     * 
209
+     * @deprecated Should use {@link FrameContainer#setTitle(java.lang.String)}
210
+     */
206
     @Override
211
     @Override
207
     @Deprecated
212
     @Deprecated
208
     public void setTitle(final String title) {
213
     public void setTitle(final String title) {
216
         });
221
         });
217
     }
222
     }
218
 
223
 
224
+    /**
225
+     * {@inheritDoc}
226
+     * 
227
+     * @deprecated Use {@link FrameContainer#getTitle()} instead
228
+     */
229
+    @Override
230
+    @Deprecated
231
+    public String getTitle() {
232
+        return super.getTitle();
233
+    }
234
+
219
     /** {@inheritDoc} */
235
     /** {@inheritDoc} */
220
     @Override
236
     @Override
221
     public void setVisible(final boolean isVisible) {
237
     public void setVisible(final boolean isVisible) {
617
      */
633
      */
618
     @Override
634
     @Override
619
     public void internalFrameOpened(final InternalFrameEvent event) {
635
     public void internalFrameOpened(final InternalFrameEvent event) {
620
-        new LoggingSwingWorker() {
621
-
622
-            /** {@inheritDoc} */
623
-            @Override
624
-            protected Object doInBackground() throws Exception {
625
-                frameParent.windowOpened();
626
-                return null;
627
-            }
628
-        }.execute();
636
+        //Ignore
629
     }
637
     }
630
 
638
 
631
     /**
639
     /**
717
         if (maximiseRestoreInProgress.get()) {
725
         if (maximiseRestoreInProgress.get()) {
718
             return;
726
             return;
719
         }
727
         }
720
-        new LoggingSwingWorker() {
721
-
722
-            /** {@inheritDoc} */
723
-            @Override
724
-            protected Object doInBackground() throws Exception {
725
-                frameParent.windowDeactivated();
726
-                return null;
727
-            }
728
-        }.execute();
729
     }
728
     }
730
 
729
 
731
     /** {@inheritDoc} */
730
     /** {@inheritDoc} */
734
         return frameParent;
733
         return frameParent;
735
     }
734
     }
736
 
735
 
737
-    /** {@inheritDoc} */
736
+    /**
737
+     * {@inheritDoc}
738
+     * 
739
+     * @deprecated Use {@link FrameContainer#getConfigManager()}
740
+     */
738
     @Deprecated
741
     @Deprecated
739
     @Override
742
     @Override
740
     public ConfigManager getConfigManager() {
743
     public ConfigManager getConfigManager() {

+ 6
- 0
src/com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonPanel.java 파일 보기

38
  */
38
  */
39
 public class ButtonPanel extends JPanel implements Scrollable {
39
 public class ButtonPanel extends JPanel implements Scrollable {
40
 
40
 
41
+    /**
42
+     * A version number for this class. It should be changed whenever the class
43
+     * structure is changed (or anything else that would prevent serialized
44
+     * objects being unserialized with the new class).
45
+     */
46
+    private static final long serialVersionUID = 1;
41
     /** The ButtonBar that created this Panel. */
47
     /** The ButtonBar that created this Panel. */
42
     private ButtonBar buttonBar;
48
     private ButtonBar buttonBar;
43
 
49
 

+ 6
- 0
src/com/dmdirc/addons/ui_swing/framemanager/buttonbar/FrameToggleButton.java 파일 보기

35
  */
35
  */
36
 public class FrameToggleButton extends JToggleButton {
36
 public class FrameToggleButton extends JToggleButton {
37
 
37
 
38
+    /**
39
+     * A version number for this class. It should be changed whenever the class
40
+     * structure is changed (or anything else that would prevent serialized
41
+     * objects being unserialized with the new class).
42
+     */
43
+    private static final long serialVersionUID = 1;
38
     /** Contains the window associated with this button. */
44
     /** Contains the window associated with this button. */
39
     private final Window window;
45
     private final Window window;
40
 
46
 

+ 3
- 2
src/com/dmdirc/addons/ui_web/DynamicRequestHandler.java 파일 보기

273
 
273
 
274
         nickEvents.add(new Event("clearnicklist", false));
274
         nickEvents.add(new Event("clearnicklist", false));
275
 
275
 
276
-        for (ChannelClientInfo cci : ((WebChannelWindow) WebInterfaceUI.active)
277
-                .getChannel().getChannelInfo().getChannelClients()) {
276
+        for (ChannelClientInfo cci : ((Channel) ((WebChannelWindow)
277
+                WebInterfaceUI.active).getContainer()).getChannelInfo()
278
+                .getChannelClients()) {
278
             nickEvents.add(new Event("addnicklist",
279
             nickEvents.add(new Event("addnicklist",
279
                     cci.getClient().getNickname()));
280
                     cci.getClient().getNickname()));
280
         }
281
         }

+ 45
- 12
src/com/dmdirc/addons/ui_web/WebInterfaceUI.java 파일 보기

134
         return new WebStatusBar();
134
         return new WebStatusBar();
135
     }
135
     }
136
 
136
 
137
-    /** {@inheritDoc} */
138
-    @Override
137
+    /**
138
+     * {@inheritDoc}
139
+     *
140
+     * @deprecated Controllers should listen for window events using a
141
+     * {@link FrameListener} and create windows as needed.
142
+     */
143
+    @Override @Deprecated
139
     public ChannelWindow getChannel(final Channel channel) {
144
     public ChannelWindow getChannel(final Channel channel) {
140
         return new WebChannelWindow(channel);
145
         return new WebChannelWindow(channel);
141
     }
146
     }
142
 
147
 
143
-    /** {@inheritDoc} */
144
-    @Override
148
+    /**
149
+     * {@inheritDoc}
150
+     *
151
+     * @deprecated Controllers should listen for window events using a
152
+     * {@link FrameListener} and create windows as needed.
153
+     */
154
+    @Override @Deprecated
145
     public ServerWindow getServer(final Server server) {
155
     public ServerWindow getServer(final Server server) {
146
         return new WebServerWindow(server);
156
         return new WebServerWindow(server);
147
     }
157
     }
148
 
158
 
149
-    /** {@inheritDoc} */
150
-    @Override
159
+    /**
160
+     * {@inheritDoc}
161
+     *
162
+     * @deprecated Controllers should listen for window events using a
163
+     * {@link FrameListener} and create windows as needed.
164
+     */
165
+    @Override @Deprecated
151
     public QueryWindow getQuery(final Query query) {
166
     public QueryWindow getQuery(final Query query) {
152
         return new WebQueryWindow(query);
167
         return new WebQueryWindow(query);
153
     }
168
     }
154
 
169
 
155
-    /** {@inheritDoc} */
156
-    @Override
170
+    /**
171
+     * {@inheritDoc}
172
+     *
173
+     * @deprecated Controllers should listen for window events using a
174
+     * {@link FrameListener} and create windows as needed.
175
+     */
176
+    @Override @Deprecated
157
     public Window getWindow(final FrameContainer<?> owner) {
177
     public Window getWindow(final FrameContainer<?> owner) {
158
         return new WebWindow(owner);
178
         return new WebWindow(owner);
159
     }
179
     }
160
 
180
 
161
-    /** {@inheritDoc} */
162
-    @Override
181
+    /**
182
+     * {@inheritDoc}
183
+     *
184
+     * @deprecated Controllers should listen for window events using a
185
+     * {@link FrameListener} and create windows as needed.
186
+     */
187
+    @Override @Deprecated
163
     public InputWindow getInputWindow(final WritableFrameContainer<?> owner) {
188
     public InputWindow getInputWindow(final WritableFrameContainer<?> owner) {
164
         return new WebInputWindow(owner, owner.getCommandParser());
189
         return new WebInputWindow(owner, owner.getCommandParser());
165
     }
190
     }
205
         // Do nothing
230
         // Do nothing
206
     }
231
     }
207
 
232
 
208
-    /** {@inheritDoc} */
233
+    /**
234
+     * {@inheritDoc}
235
+     * 
236
+     * @deprecated Use {@link WindowManager#getActiveWindow()} instead
237
+     */
209
     @Override @Deprecated
238
     @Override @Deprecated
210
     public Window getActiveWindow() {
239
     public Window getActiveWindow() {
211
         return active;
240
         return active;
212
     }
241
     }
213
 
242
 
214
-    /** {@inheritDoc} */
243
+    /**
244
+     * {@inheritDoc}
245
+     * 
246
+     * @deprecated Use {@link WindowManager#getActiveWindow()} instead
247
+     */
215
     @Override @Deprecated
248
     @Override @Deprecated
216
     public Server getActiveServer() {
249
     public Server getActiveServer() {
217
         //TODO FIXME
250
         //TODO FIXME

+ 6
- 1
src/com/dmdirc/addons/ui_web/uicomponents/WebChannelWindow.java 파일 보기

70
         }
70
         }
71
     }
71
     }
72
 
72
 
73
-    /** {@inheritDoc} */
73
+    /**
74
+     * {@inheritDoc}
75
+     *
76
+     * @deprecated Use {@link #getContainer()}
77
+     */
74
     @Override
78
     @Override
79
+    @Deprecated
75
     public Channel getChannel() {
80
     public Channel getChannel() {
76
         return channel;
81
         return channel;
77
     }
82
     }

Loading…
취소
저장