|
@@ -140,6 +140,7 @@ public final class ButtonBar implements FrameManager, ActionListener,
|
140
|
140
|
buttonPanel = new ButtonPanel(new MigLayout("ins rel, fill, flowy"),
|
141
|
141
|
this);
|
142
|
142
|
}
|
|
143
|
+ scrollPane.getViewport().addMouseWheelListener(buttonPanel);
|
143
|
144
|
scrollPane.getViewport().add(buttonPanel);
|
144
|
145
|
}
|
145
|
146
|
|
|
@@ -154,6 +155,15 @@ public final class ButtonBar implements FrameManager, ActionListener,
|
154
|
155
|
return buttonHeight;
|
155
|
156
|
}
|
156
|
157
|
|
|
158
|
+ /**
|
|
159
|
+ * Returns the button object of the current selected window
|
|
160
|
+ *
|
|
161
|
+ * @return Button object for the current selected window
|
|
162
|
+ */
|
|
163
|
+ public FrameToggleButton getSelectedButton() {
|
|
164
|
+ return getButton(selected);
|
|
165
|
+ }
|
|
166
|
+
|
157
|
167
|
/** {@inheritDoc} */
|
158
|
168
|
@Override
|
159
|
169
|
public void setParent(final JComponent parent) {
|
|
@@ -163,10 +173,8 @@ public final class ButtonBar implements FrameManager, ActionListener,
|
163
|
173
|
@Override
|
164
|
174
|
public void run() {
|
165
|
175
|
ButtonBar.this.parent = parent;
|
166
|
|
- scrollPane.setSize(parent.getWidth(), parent.getHeight());
|
167
|
|
-
|
168
|
|
- parent.setLayout(new MigLayout("ins 0"));
|
169
|
|
- parent.add(scrollPane);
|
|
176
|
+ parent.setLayout(new MigLayout("ins 0, fill"));
|
|
177
|
+ parent.add(scrollPane, "top, left");
|
170
|
178
|
parent.addComponentListener(ButtonBar.this);
|
171
|
179
|
}
|
172
|
180
|
});
|
|
@@ -219,8 +227,8 @@ public final class ButtonBar implements FrameManager, ActionListener,
|
219
|
227
|
buttonWidth, buttonHeight));
|
220
|
228
|
buttonPanel.add(button);
|
221
|
229
|
if (!window.getChildren().isEmpty()) {
|
222
|
|
- final ArrayList childList = new ArrayList<FrameContainer<?>>(
|
223
|
|
- window.getChildren());
|
|
230
|
+ final ArrayList<FrameContainer<?>> childList = new ArrayList
|
|
231
|
+ <FrameContainer<?>>(window.getChildren());
|
224
|
232
|
if (sortChildWindows) {
|
225
|
233
|
Collections.sort(childList, new FrameContainerComparator());
|
226
|
234
|
}
|
|
@@ -237,8 +245,8 @@ public final class ButtonBar implements FrameManager, ActionListener,
|
237
|
245
|
buttonPanel.setVisible(false);
|
238
|
246
|
buttonPanel.removeAll();
|
239
|
247
|
|
240
|
|
- final ArrayList windowList = new ArrayList<FrameContainer<?>>(
|
241
|
|
- WindowManager.getRootWindows());
|
|
248
|
+ final ArrayList<FrameContainer<?>> windowList = new
|
|
249
|
+ ArrayList<FrameContainer<?>>(WindowManager.getRootWindows());
|
242
|
250
|
if (sortRootWindows) {
|
243
|
251
|
Collections.sort(windowList, new FrameContainerComparator());
|
244
|
252
|
}
|
|
@@ -419,6 +427,7 @@ public final class ButtonBar implements FrameManager, ActionListener,
|
419
|
427
|
selected = window;
|
420
|
428
|
button = getButton(window);
|
421
|
429
|
if (button != null) {
|
|
430
|
+ scrollPane.getViewport().scrollRectToVisible(button.getBounds());
|
422
|
431
|
button.setSelected(true);
|
423
|
432
|
}
|
424
|
433
|
}
|
|
@@ -534,6 +543,7 @@ public final class ButtonBar implements FrameManager, ActionListener,
|
534
|
543
|
//Do nothing
|
535
|
544
|
}
|
536
|
545
|
|
|
546
|
+ /** {@inheritDoc} */
|
537
|
547
|
@Override
|
538
|
548
|
public void configChanged(String domain, String key) {
|
539
|
549
|
if ("sortrootwindows".equals(key)) {
|