|
@@ -25,6 +25,7 @@ package com.dmdirc.addons.ui_swing.framemanager.tree;
|
25
|
25
|
import com.dmdirc.FrameContainer;
|
26
|
26
|
import com.dmdirc.addons.ui_swing.SwingController;
|
27
|
27
|
import com.dmdirc.addons.ui_swing.UIUtilities;
|
|
28
|
+import com.dmdirc.addons.ui_swing.components.TreeScroller;
|
28
|
29
|
import com.dmdirc.addons.ui_swing.framemanager.FrameManager;
|
29
|
30
|
import com.dmdirc.config.IdentityManager;
|
30
|
31
|
import com.dmdirc.interfaces.ConfigChangeListener;
|
|
@@ -78,6 +79,8 @@ public final class TreeFrameManager implements FrameManager,
|
78
|
79
|
private final Map<FrameContainer<?>, TreeViewNode> nodes;
|
79
|
80
|
/** UI Controller. */
|
80
|
81
|
private SwingController controller;
|
|
82
|
+ /** Tree scroller. */
|
|
83
|
+ private TreeScroller scroller;
|
81
|
84
|
|
82
|
85
|
/** creates a new instance of the TreeFrameManager. */
|
83
|
86
|
public TreeFrameManager() {
|
|
@@ -119,10 +122,6 @@ public final class TreeFrameManager implements FrameManager,
|
119
|
122
|
setColours();
|
120
|
123
|
|
121
|
124
|
redoTreeView();
|
122
|
|
- if (controller.getMainFrame().getActiveFrame() != null) {
|
123
|
|
- selectionChanged(controller.getMainFrame().getActiveFrame().
|
124
|
|
- getContainer());
|
125
|
|
- }
|
126
|
125
|
}
|
127
|
126
|
});
|
128
|
127
|
}
|
|
@@ -208,9 +207,9 @@ public final class TreeFrameManager implements FrameManager,
|
208
|
207
|
});
|
209
|
208
|
}
|
210
|
209
|
|
211
|
|
- /**
|
|
210
|
+ /**
|
212
|
211
|
* Adds a window to the frame container.
|
213
|
|
- *
|
|
212
|
+ *
|
214
|
213
|
* @param parent Parent node
|
215
|
214
|
* @param window Window to add
|
216
|
215
|
*/
|
|
@@ -260,8 +259,8 @@ public final class TreeFrameManager implements FrameManager,
|
260
|
259
|
|
261
|
260
|
/**
|
262
|
261
|
* Checks for and sets a rollover node.
|
263
|
|
- *
|
264
|
|
- * @param event event to check
|
|
262
|
+ *
|
|
263
|
+ * @param event event to check
|
265
|
264
|
*/
|
266
|
265
|
protected void checkRollover(final MouseEvent event) {
|
267
|
266
|
NodeLabel node = null;
|
|
@@ -313,16 +312,24 @@ public final class TreeFrameManager implements FrameManager,
|
313
|
312
|
((DefaultTreeModel) tree.getModel()).setRoot(null);
|
314
|
313
|
((DefaultTreeModel) tree.getModel()).setRoot(new TreeViewNode(
|
315
|
314
|
null, null));
|
316
|
|
- new TreeTreeScroller(tree);
|
|
315
|
+ if (scroller != null) {
|
|
316
|
+ scroller.unregister();
|
|
317
|
+ }
|
|
318
|
+ scroller = new TreeTreeScroller(tree);
|
317
|
319
|
|
318
|
|
- for (FrameContainer<?> window : WindowManager.getRootWindows()) {
|
|
320
|
+ for (FrameContainer<?> window
|
|
321
|
+ : WindowManager.getRootWindows()) {
|
319
|
322
|
addWindow(null, window);
|
320
|
|
- final Collection<FrameContainer<?>> childWindows = window.
|
321
|
|
- getChildren();
|
|
323
|
+ final Collection<FrameContainer<?>> childWindows = window
|
|
324
|
+ .getChildren();
|
322
|
325
|
for (FrameContainer childWindow : childWindows) {
|
323
|
326
|
addWindow(nodes.get(window), childWindow);
|
324
|
327
|
}
|
325
|
328
|
}
|
|
329
|
+ if (controller.getMainFrame().getActiveFrame() != null) {
|
|
330
|
+ selectionChanged(controller.getMainFrame().getActiveFrame()
|
|
331
|
+ .getContainer());
|
|
332
|
+ }
|
326
|
333
|
}
|
327
|
334
|
});
|
328
|
335
|
}
|