Kaynağa Gözat

More of the same

git-svn-id: http://svn.dmdirc.com/trunk@1751 00569f92-eb28-0410-84fd-f71c24880f
tags/0.5
Chris Smith 17 yıl önce
ebeveyn
işleme
f0fd8fabf4

+ 3
- 3
src/com/dmdirc/actions/Action.java Dosyayı Görüntüle

@@ -22,13 +22,13 @@
22 22
 
23 23
 package com.dmdirc.actions;
24 24
 
25
+import com.dmdirc.Main;
25 26
 import com.dmdirc.ServerManager;
26 27
 import com.dmdirc.WritableFrameContainer;
27 28
 import com.dmdirc.commandparser.CommandParser;
28 29
 import com.dmdirc.commandparser.GlobalCommandParser;
29 30
 import com.dmdirc.logger.ErrorLevel;
30 31
 import com.dmdirc.logger.Logger;
31
-import com.dmdirc.ui.MainFrame;
32 32
 import com.dmdirc.ui.interfaces.InputWindow;
33 33
 import com.dmdirc.ui.interfaces.Window;
34 34
 
@@ -476,14 +476,14 @@ public class Action implements Serializable {
476 476
             }
477 477
         }
478 478
         
479
-        final Window active = MainFrame.getMainFrame().getActiveFrame();
479
+        final Window active = Main.getUI().getMainWindow().getActiveFrame();
480 480
         InputWindow cw;
481 481
         CommandParser cp = null;
482 482
         
483 483
         if (arguments.length > 0 && arguments[0] instanceof WritableFrameContainer) {
484 484
             cw = ((WritableFrameContainer) arguments[0]).getFrame();
485 485
         } else if (active != null && active instanceof InputWindow) {
486
-            cw = (InputWindow) MainFrame.getMainFrame().getActiveFrame();
486
+            cw = (InputWindow) Main.getUI().getMainWindow().getActiveFrame();
487 487
         } else if (ServerManager.getServerManager().numServers() > 0) {
488 488
             cw = ServerManager.getServerManager().getServers().get(0).getFrame();
489 489
         } else {

+ 5
- 5
src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java Dosyayı Görüntüle

@@ -23,12 +23,12 @@
23 23
 package com.dmdirc.addons.lagdisplay;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.Main;
26 27
 import com.dmdirc.Server;
27 28
 import com.dmdirc.actions.ActionType;
28 29
 import com.dmdirc.actions.CoreActionType;
29 30
 import com.dmdirc.plugins.EventPlugin;
30 31
 import com.dmdirc.plugins.Plugin;
31
-import com.dmdirc.ui.MainFrame;
32 32
 import com.dmdirc.ui.interfaces.Window;
33 33
 
34 34
 import java.awt.BorderLayout;
@@ -72,12 +72,12 @@ public final class LagDisplayPlugin extends Plugin implements EventPlugin {
72 72
     
73 73
     /** {@inheritDoc} */
74 74
     public void onActivate() {
75
-        MainFrame.getMainFrame().getStatusBar().addComponent(panel);
75
+        Main.getUI().getMainWindow().getStatusBar().addComponent(panel);
76 76
     }
77 77
     
78 78
     /** {@inheritDoc} */
79 79
     public void onDeactivate() {
80
-        MainFrame.getMainFrame().getStatusBar().removeComponent(panel);
80
+        Main.getUI().getMainWindow().getStatusBar().removeComponent(panel);
81 81
     }
82 82
     
83 83
     /** {@inheritDoc} */
@@ -112,12 +112,12 @@ public final class LagDisplayPlugin extends Plugin implements EventPlugin {
112 112
     /** {@inheritDoc} */
113 113
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
114 114
         if (type.equals(CoreActionType.SERVER_GOTPING)) {
115
-            final Window active = MainFrame.getMainFrame().getActiveFrame();
115
+            final Window active = Main.getUI().getMainWindow().getActiveFrame();
116 116
             if (((Server) arguments[0]).ownsFrame(active)) {
117 117
                 label.setText(formatTime(arguments[1]));
118 118
             }
119 119
         } else if (type.equals(CoreActionType.SERVER_NOPING)) {
120
-            final Window active = MainFrame.getMainFrame().getActiveFrame();
120
+            final Window active = Main.getUI().getMainWindow().getActiveFrame();
121 121
             if (((Server) arguments[0]).ownsFrame(active)) {
122 122
                 label.setText(formatTime(arguments[1]) + "+");
123 123
             }

+ 4
- 4
src/com/dmdirc/addons/logging/LoggingPlugin.java Dosyayı Görüntüle

@@ -50,9 +50,9 @@ import com.dmdirc.parser.ClientInfo;
50 50
 import com.dmdirc.parser.IRCParser;
51 51
 import com.dmdirc.plugins.Plugin;
52 52
 import com.dmdirc.plugins.EventPlugin;
53
-import com.dmdirc.ui.components.Frame;
54 53
 import com.dmdirc.ui.components.PreferencesInterface;
55 54
 import com.dmdirc.ui.components.PreferencesPanel;
55
+import com.dmdirc.ui.interfaces.Window;
56 56
 import com.dmdirc.ui.messages.Styliser;
57 57
 
58 58
 /**
@@ -351,7 +351,7 @@ public final class LoggingPlugin extends Plugin implements EventPlugin, Preferen
351 351
 					
352 352
 					// Backbuffer Display goes here!
353 353
 					if (Config.getOptionBool(MY_DOMAIN, "backbuffer.autobackbuffer")) {
354
-						showBackBuffer((Frame)query.getFrame(), getLogFile(client));
354
+						showBackBuffer(query.getFrame(), getLogFile(client));
355 355
 					}
356 356
 					
357 357
 					appendLine(getLogFile(client), "*** Query opened at: " + openedAtFormat.format(new Date()));
@@ -364,7 +364,7 @@ public final class LoggingPlugin extends Plugin implements EventPlugin, Preferen
364 364
 					
365 365
 					// Backbuffer Display goes here!
366 366
 					if (Config.getOptionBool(MY_DOMAIN, "backbuffer.autobackbuffer")) {
367
-						showBackBuffer((Frame)(((Channel)arguments[0]).getFrame()), getLogFile(channel));
367
+						showBackBuffer(((Channel)arguments[0]).getFrame(), getLogFile(channel));
368 368
 					}
369 369
 					
370 370
 					appendLine(getLogFile(channel), "*** Channel opened at: " + openedAtFormat.format(new Date()));
@@ -495,7 +495,7 @@ public final class LoggingPlugin extends Plugin implements EventPlugin, Preferen
495 495
 	 * @param frame The frame to add the backbuffer lines to
496 496
 	 * @param filename File to get backbuffer from
497 497
 	 */
498
-	private void showBackBuffer(final Frame frame, final String filename) {
498
+	private void showBackBuffer(final Window frame, final String filename) {
499 499
 		final int numLines = Config.getOptionInt(MY_DOMAIN, "backbuffer.lines", 0);
500 500
 		final String colour = Config.getOption(MY_DOMAIN, "backbuffer.colour");
501 501
 		final boolean showTimestamp = Config.getOptionBool(MY_DOMAIN, "backbuffer.timestamp");

+ 1
- 1
src/com/dmdirc/addons/nickcolours/NickColourPanel.java Dosyayı Görüntüle

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.nickcolours;
24 24
 
25 25
 import com.dmdirc.ui.UIUtilities;
26
+
26 27
 import java.awt.BorderLayout;
27 28
 import java.awt.Color;
28 29
 import java.awt.Dimension;
@@ -33,7 +34,6 @@ import javax.swing.JPanel;
33 34
 import javax.swing.JScrollPane;
34 35
 import javax.swing.JTable;
35 36
 import javax.swing.table.TableCellRenderer;
36
-import javax.swing.text.StyleContext.SmallAttributeSet;
37 37
 
38 38
 /**
39 39
  * Panel used for the custom nick colour settings component in the plugin's

+ 1
- 0
src/com/dmdirc/addons/nowplaying/dcop/DcopMediaSourcePlugin.java Dosyayı Görüntüle

@@ -25,6 +25,7 @@ package com.dmdirc.addons.nowplaying.dcop;
25 25
 import com.dmdirc.addons.nowplaying.MediaSource;
26 26
 import com.dmdirc.addons.nowplaying.MediaSourceManager;
27 27
 import com.dmdirc.plugins.Plugin;
28
+
28 29
 import java.util.ArrayList;
29 30
 import java.util.List;
30 31
 

+ 2
- 2
src/com/dmdirc/addons/osdplugin/OsdWindow.java Dosyayı Görüntüle

@@ -23,7 +23,7 @@
23 23
 package com.dmdirc.addons.osdplugin;
24 24
 
25 25
 import com.dmdirc.Config;
26
-import com.dmdirc.ui.MainFrame;
26
+import com.dmdirc.Main;
27 27
 import static com.dmdirc.ui.UIUtilities.LARGE_BORDER;
28 28
 
29 29
 import java.awt.BorderLayout;
@@ -64,7 +64,7 @@ public final class OsdWindow extends JDialog implements MouseListener,
64 64
      * allow itself to be moved)
65 65
      */
66 66
     public OsdWindow(final String text, final boolean config) {
67
-        super(MainFrame.getMainFrame(), false);
67
+        super(Main.getUI().getMainWindow(), false);
68 68
         
69 69
         setFocusableWindowState(false);
70 70
         setAlwaysOnTop(true);

+ 6
- 7
src/com/dmdirc/addons/systray/SystrayPlugin.java Dosyayı Görüntüle

@@ -25,7 +25,6 @@ package com.dmdirc.addons.systray;
25 25
 import com.dmdirc.IconManager;
26 26
 import com.dmdirc.Main;
27 27
 import com.dmdirc.plugins.Plugin;
28
-import com.dmdirc.ui.MainFrame;
29 28
     
30 29
 import java.awt.AWTException;
31 30
 import java.awt.MenuItem;
@@ -91,7 +90,7 @@ public final class SystrayPlugin  extends Plugin implements ActionListener, Mous
91 90
     /** {@inheritDoc} */
92 91
     public void actionPerformed(final ActionEvent e) {
93 92
         if (e.getActionCommand().equals("Show/hide")) {
94
-            MainFrame.getMainFrame().setVisible(!MainFrame.getMainFrame().isVisible());
93
+            Main.getUI().getMainWindow().setVisible(!Main.getUI().getMainWindow().isVisible());
95 94
         } else if (e.getActionCommand().equals("Quit")) {
96 95
             Main.quit();
97 96
         }
@@ -145,17 +144,17 @@ public final class SystrayPlugin  extends Plugin implements ActionListener, Mous
145 144
     /** {@inheritDoc} */
146 145
     public void mouseClicked(final MouseEvent e) {
147 146
         if (e.getButton() == MouseEvent.BUTTON1) {
148
-            if (MainFrame.getMainFrame().isVisible()) {
147
+            if (Main.getUI().getMainWindow().isVisible()) {
149 148
                 // TODO: Uncomment the code below, with an appropriate replacement
150 149
                 //       for requestFocus() that does something more than flash.
151 150
                 
152
-                //if (MainFrame.getMainFrame().isActive()) {
153
-                MainFrame.getMainFrame().setVisible(false);
151
+                //if (Main.getUI().getMainWindow().isActive()) {
152
+                Main.getUI().getMainWindow().setVisible(false);
154 153
                 //} else {
155
-                //    MainFrame.getMainFrame().requestFocus();
154
+                //    Main.getUI().getMainWindow().requestFocus();
156 155
                 //}
157 156
             } else {
158
-                MainFrame.getMainFrame().setVisible(true);
157
+                Main.getUI().getMainWindow().setVisible(true);
159 158
             }
160 159
         }
161 160
     }

+ 4
- 4
src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java Dosyayı Görüntüle

@@ -34,6 +34,7 @@ import javax.swing.SwingConstants;
34 34
 import com.dmdirc.Channel;
35 35
 import com.dmdirc.Config;
36 36
 import com.dmdirc.FrameContainer;
37
+import com.dmdirc.Main;
37 38
 import com.dmdirc.Query;
38 39
 import com.dmdirc.Server;
39 40
 import com.dmdirc.actions.ActionType;
@@ -44,7 +45,6 @@ import com.dmdirc.parser.ClientInfo;
44 45
 import com.dmdirc.plugins.Plugin;
45 46
 import com.dmdirc.plugins.EventPlugin;
46 47
 import com.dmdirc.ui.interfaces.InputWindow;
47
-import com.dmdirc.ui.MainFrame;
48 48
 import com.dmdirc.ui.components.PreferencesInterface;
49 49
 import com.dmdirc.ui.components.PreferencesPanel;
50 50
 import com.dmdirc.ui.interfaces.Window;
@@ -96,7 +96,7 @@ public final class WindowStatusPlugin extends Plugin implements EventPlugin, Pre
96 96
 	 * Called when this plugin is Activated.
97 97
 	 */
98 98
 	public void onActivate() {
99
-		MainFrame.getMainFrame().getStatusBar().addComponent(panel);
99
+		Main.getUI().getMainWindow().getStatusBar().addComponent(panel);
100 100
 		updateStatus();
101 101
 	}
102 102
 	
@@ -104,7 +104,7 @@ public final class WindowStatusPlugin extends Plugin implements EventPlugin, Pre
104 104
 	 * Called when this plugin is deactivated.
105 105
 	 */
106 106
 	public void onDeactivate() {
107
-		MainFrame.getMainFrame().getStatusBar().removeComponent(panel);
107
+		Main.getUI().getMainWindow().getStatusBar().removeComponent(panel);
108 108
 	}
109 109
 	
110 110
 	/**
@@ -159,7 +159,7 @@ public final class WindowStatusPlugin extends Plugin implements EventPlugin, Pre
159 159
 	 * Update the window status using the current active window.
160 160
 	 */
161 161
 	public void updateStatus() {
162
-		Window active = MainFrame.getMainFrame().getActiveFrame();
162
+		Window active = Main.getUI().getMainWindow().getActiveFrame();
163 163
 
164 164
 		if (active != null) {
165 165
 			FrameContainer activeFrame = ((InputWindow) active).getContainer();

Loading…
İptal
Kaydet