You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainFrame.java 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /*
  2. * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. package com.dmdirc.addons.ui_swing;
  23. import com.dmdirc.FrameContainer;
  24. import com.dmdirc.Main;
  25. import com.dmdirc.ServerManager;
  26. import com.dmdirc.actions.ActionManager;
  27. import com.dmdirc.actions.CoreActionType;
  28. import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
  29. import com.dmdirc.addons.ui_swing.components.SplitPane;
  30. import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
  31. import com.dmdirc.addons.ui_swing.components.menubar.MenuBar;
  32. import com.dmdirc.addons.ui_swing.components.statusbar.SwingStatusBar;
  33. import com.dmdirc.addons.ui_swing.dialogs.ConfirmQuitDialog;
  34. import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
  35. import com.dmdirc.addons.ui_swing.framemanager.FrameManager;
  36. import com.dmdirc.addons.ui_swing.framemanager.FramemanagerPosition;
  37. import com.dmdirc.addons.ui_swing.framemanager.ctrltab.CtrlTabWindowManager;
  38. import com.dmdirc.addons.ui_swing.framemanager.tree.TreeFrameManager;
  39. import com.dmdirc.config.IdentityManager;
  40. import com.dmdirc.interfaces.ConfigChangeListener;
  41. import com.dmdirc.interfaces.FrameInfoListener;
  42. import com.dmdirc.interfaces.SelectionListener;
  43. import com.dmdirc.logger.ErrorLevel;
  44. import com.dmdirc.logger.Logger;
  45. import com.dmdirc.ui.CoreUIUtils;
  46. import com.dmdirc.ui.IconManager;
  47. import com.dmdirc.ui.WindowManager;
  48. import com.dmdirc.ui.interfaces.MainWindow;
  49. import com.dmdirc.ui.interfaces.Window;
  50. import com.dmdirc.util.QueuedLinkedHashSet;
  51. import com.dmdirc.util.ReturnableThread;
  52. import java.awt.Dimension;
  53. import java.awt.event.WindowEvent;
  54. import java.awt.event.WindowFocusListener;
  55. import java.awt.event.WindowListener;
  56. import java.lang.reflect.InvocationTargetException;
  57. import javax.swing.ImageIcon;
  58. import javax.swing.JFrame;
  59. import javax.swing.JPanel;
  60. import javax.swing.JSplitPane;
  61. import javax.swing.MenuSelectionManager;
  62. import javax.swing.SwingUtilities;
  63. import javax.swing.WindowConstants;
  64. import net.miginfocom.swing.MigLayout;
  65. /**
  66. * The main application frame.
  67. */
  68. public final class MainFrame extends JFrame implements WindowListener,
  69. MainWindow, ConfigChangeListener, SelectionListener,
  70. SwingWindowListener, FrameInfoListener {
  71. /**
  72. * A version number for this class. It should be changed whenever the class
  73. * structure is changed (or anything else that would prevent serialized
  74. * objects being unserialized with the new class).
  75. */
  76. private static final long serialVersionUID = 9;
  77. /** Focus queue. */
  78. private final QueuedLinkedHashSet<TextFrame> focusOrder;
  79. /** The main application icon. */
  80. private ImageIcon imageIcon;
  81. /** The frame manager that's being used. */
  82. private FrameManager mainFrameManager;
  83. /** Active frame. */
  84. private TextFrame activeFrame;
  85. /** Panel holding frame. */
  86. private JPanel framePanel;
  87. /** Main panel. */
  88. private JPanel frameManagerPanel;
  89. /** Frame manager position. */
  90. private FramemanagerPosition position;
  91. /** Show version? */
  92. private boolean showVersion;
  93. /** Exit code. */
  94. private int exitCode = 0;
  95. /** Swing Controller. */
  96. private final SwingController controller;
  97. /** Status bar. */
  98. private SwingStatusBar statusBar;
  99. /** Client Version. */
  100. private final String version;
  101. /** Main split pane. */
  102. private SplitPane mainSplitPane;
  103. /** Frame manager used for ctrl tab frame switching. */
  104. private final CtrlTabWindowManager frameManager;
  105. /**
  106. * Creates new form MainFrame.
  107. *
  108. * @param controller Swing controller
  109. */
  110. public MainFrame(final SwingController controller) {
  111. super();
  112. this.controller = controller;
  113. focusOrder = new QueuedLinkedHashSet<TextFrame>();
  114. initComponents();
  115. imageIcon = new ImageIcon(IconManager.getIconManager()
  116. .getImage("icon"));
  117. setIconImage(imageIcon.getImage());
  118. CoreUIUtils.centreWindow(this);
  119. addWindowListener(this);
  120. showVersion = IdentityManager.getGlobalConfig().getOptionBool("ui",
  121. "showversion");
  122. version = IdentityManager.getGlobalConfig().getOption("version",
  123. "version");
  124. IdentityManager.getGlobalConfig().addChangeListener("ui", "lookandfeel",
  125. this);
  126. IdentityManager.getGlobalConfig().addChangeListener("ui", "showversion",
  127. this);
  128. IdentityManager.getGlobalConfig().addChangeListener("ui",
  129. "framemanager", this);
  130. IdentityManager.getGlobalConfig().addChangeListener("ui",
  131. "framemanagerPosition", this);
  132. IdentityManager.getGlobalConfig().addChangeListener("icon", "icon",
  133. this);
  134. addWindowFocusListener(new WindowFocusListener() {
  135. /** {@inheritDoc} */
  136. @Override
  137. public void windowGainedFocus(final WindowEvent e) {
  138. ActionManager.processEvent(CoreActionType.CLIENT_FOCUS_GAINED,
  139. null);
  140. }
  141. /** {@inheritDoc} */
  142. @Override
  143. public void windowLostFocus(final WindowEvent e) {
  144. ActionManager.processEvent(CoreActionType.CLIENT_FOCUS_LOST,
  145. null);
  146. //TODO: Remove me when we switch to java7
  147. MenuSelectionManager.defaultManager().clearSelectedPath();
  148. }
  149. });
  150. WindowManager.addSelectionListener(this);
  151. controller.getWindowFactory().addWindowListener(this);
  152. setTitle(getTitlePrefix());
  153. frameManager = new CtrlTabWindowManager(controller, rootPane);
  154. }
  155. /**
  156. * Returns the status bar for this frame.
  157. *
  158. * @return Status bar
  159. */
  160. public SwingStatusBar getStatusBar() {
  161. return statusBar;
  162. }
  163. /**
  164. * Returns the size of the frame manager.
  165. *
  166. * @return Frame manager size.
  167. */
  168. public int getFrameManagerSize() {
  169. return UIUtilities.invokeAndWait(new ReturnableThread<Integer>() {
  170. /** {@inheritDoc} */
  171. @Override
  172. public void run() {
  173. if (position == FramemanagerPosition.LEFT || position
  174. == FramemanagerPosition.RIGHT) {
  175. setObject(frameManagerPanel.getWidth());
  176. } else {
  177. setObject(frameManagerPanel.getHeight());
  178. }
  179. }
  180. });
  181. }
  182. /** {@inheritDoc}. */
  183. @Override
  184. public ImageIcon getIcon() {
  185. return UIUtilities.invokeAndWait(new ReturnableThread<ImageIcon>() {
  186. /** {@inheritDoc} */
  187. @Override
  188. public void run() {
  189. setObject(imageIcon);
  190. }
  191. });
  192. }
  193. /**
  194. * Returns the window that is currently active.
  195. *
  196. * @return The active window
  197. */
  198. public Window getActiveFrame() {
  199. return UIUtilities.invokeAndWait(new ReturnableThread<Window>() {
  200. /** {@inheritDoc} */
  201. @Override
  202. public void run() {
  203. setObject(activeFrame);
  204. }
  205. });
  206. }
  207. /** {@inheritDoc} */
  208. @Override
  209. public MenuBar getJMenuBar() {
  210. return (MenuBar) super.getJMenuBar();
  211. }
  212. /** {@inheritDoc}. */
  213. @Override
  214. public void setMaximised(final boolean max) {
  215. //Ignore
  216. }
  217. /** {@inheritDoc}. */
  218. @Override
  219. public void setTitle(final String title) {
  220. if (title != null && getActiveFrame() != null) {
  221. super.setTitle(getTitlePrefix() + " - " + title);
  222. } else {
  223. super.setTitle(getTitlePrefix());
  224. }
  225. }
  226. /** {@inheritDoc}. */
  227. @Override
  228. public String getTitlePrefix() {
  229. return "DMDirc" + (showVersion ? " " + version : "");
  230. }
  231. /**
  232. * {@inheritDoc}
  233. *
  234. * @deprecated MDI is no longer implemented
  235. */
  236. @Deprecated
  237. @Override
  238. public boolean getMaximised() {
  239. return true;
  240. }
  241. /**
  242. * {@inheritDoc}.
  243. *
  244. * @param windowEvent Window event
  245. */
  246. @Override
  247. public void windowOpened(final WindowEvent windowEvent) {
  248. //ignore
  249. }
  250. /**
  251. * {@inheritDoc}.
  252. *
  253. * @param windowEvent Window event
  254. */
  255. @Override
  256. public void windowClosing(final WindowEvent windowEvent) {
  257. quit(exitCode);
  258. }
  259. /**
  260. * {@inheritDoc}.
  261. *
  262. * @param windowEvent Window event
  263. */
  264. @Override
  265. public void windowClosed(final WindowEvent windowEvent) {
  266. new Thread(new Runnable() {
  267. /** {@inheritDoc} */
  268. @Override
  269. public void run() {
  270. Main.quit(exitCode);
  271. }
  272. }, "Quit thread").start();
  273. }
  274. /**
  275. * {@inheritDoc}.
  276. *
  277. * @param windowEvent Window event
  278. */
  279. @Override
  280. public void windowIconified(final WindowEvent windowEvent) {
  281. ActionManager.processEvent(CoreActionType.CLIENT_MINIMISED, null);
  282. }
  283. /**
  284. * {@inheritDoc}.
  285. *
  286. * @param windowEvent Window event
  287. */
  288. @Override
  289. public void windowDeiconified(final WindowEvent windowEvent) {
  290. ActionManager.processEvent(CoreActionType.CLIENT_UNMINIMISED, null);
  291. }
  292. /**
  293. * {@inheritDoc}.
  294. *
  295. * @param windowEvent Window event
  296. */
  297. @Override
  298. public void windowActivated(final WindowEvent windowEvent) {
  299. //ignore
  300. }
  301. /**
  302. * {@inheritDoc}.
  303. *
  304. * @param windowEvent Window event
  305. */
  306. @Override
  307. public void windowDeactivated(final WindowEvent windowEvent) {
  308. //ignore
  309. }
  310. /** Initialiases the frame managers. */
  311. private void initFrameManagers() {
  312. UIUtilities.invokeAndWait(new Runnable() {
  313. /** {@inheritDoc} */
  314. @Override
  315. public void run() {
  316. frameManagerPanel.removeAll();
  317. final String manager = IdentityManager.getGlobalConfig().
  318. getOption("ui", "framemanager");
  319. try {
  320. mainFrameManager = (FrameManager) Class.forName(manager).
  321. getConstructor().newInstance();
  322. } catch (InvocationTargetException ex) {
  323. Logger.appError(ErrorLevel.MEDIUM, "Unable to load frame "
  324. + "manager, falling back to default.", ex);
  325. } catch (InstantiationException ex) {
  326. Logger.userError(ErrorLevel.MEDIUM, "Unable to load frame "
  327. + "manager, falling back to default.", ex);
  328. } catch (NoSuchMethodException ex) {
  329. Logger.userError(ErrorLevel.MEDIUM, "Unable to load frame "
  330. + "manager, falling back to default.", ex);
  331. } catch (SecurityException ex) {
  332. Logger.userError(ErrorLevel.MEDIUM, "Unable to load frame "
  333. + "manager, falling back to default.", ex);
  334. } catch (IllegalAccessException ex) {
  335. Logger.userError(ErrorLevel.MEDIUM, "Unable to load frame "
  336. + "manager, falling back to default.", ex);
  337. } catch (IllegalArgumentException ex) {
  338. Logger.userError(ErrorLevel.MEDIUM, "Unable to load frame "
  339. + "manager, falling back to default.", ex);
  340. } catch (ClassNotFoundException ex) {
  341. Logger.userError(ErrorLevel.MEDIUM, "Unable to load frame "
  342. + "manager, falling back to default.", ex);
  343. } catch (LinkageError ex) {
  344. Logger.userError(ErrorLevel.MEDIUM, "Unable to load frame "
  345. + "manager, falling back to default.", ex);
  346. } finally {
  347. if (mainFrameManager == null) {
  348. mainFrameManager = new TreeFrameManager();
  349. }
  350. }
  351. mainFrameManager.setController(controller);
  352. mainFrameManager.setParent(frameManagerPanel);
  353. controller.getWindowFactory().addWindowListener(
  354. mainFrameManager);
  355. }
  356. });
  357. }
  358. /**
  359. * Initialises the components for this frame.
  360. */
  361. private void initComponents() {
  362. statusBar = new SwingStatusBar(controller, this);
  363. frameManagerPanel = new JPanel();
  364. activeFrame = null;
  365. framePanel = new JPanel(new MigLayout("fill, ins 0"));
  366. mainSplitPane = new SplitPane(SplitPane.Orientation.HORIZONTAL);
  367. initFrameManagers();
  368. final MenuBar menu = new MenuBar(controller, this);
  369. Apple.getApple().setMenuBar(menu);
  370. setJMenuBar(menu);
  371. setPreferredSize(new Dimension(800, 600));
  372. getContentPane().setLayout(new MigLayout(
  373. "fill, ins rel, wrap 1, hidemode 2"));
  374. getContentPane().add(initSplitPane(mainSplitPane), "grow, push");
  375. getContentPane().add(statusBar,
  376. "hmax 20, wmax 100%-2*rel, wmin 100%-2*rel");
  377. setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  378. pack();
  379. }
  380. /**
  381. * Initialises the split pane.
  382. *
  383. * @param mainSplitPane Split pane to initialise
  384. *
  385. * @return Returns the initialised split pane
  386. */
  387. private JSplitPane initSplitPane(final SplitPane mainSplitPane) {
  388. position = FramemanagerPosition.getPosition(IdentityManager.
  389. getGlobalConfig().getOption("ui", "framemanagerPosition"));
  390. if (position == FramemanagerPosition.UNKNOWN) {
  391. position = FramemanagerPosition.LEFT;
  392. }
  393. if (!mainFrameManager.canPositionVertically() && (position
  394. == FramemanagerPosition.LEFT || position
  395. == FramemanagerPosition.RIGHT)) {
  396. position = FramemanagerPosition.BOTTOM;
  397. }
  398. if (!mainFrameManager.canPositionHorizontally() && (position
  399. == FramemanagerPosition.TOP || position
  400. == FramemanagerPosition.BOTTOM)) {
  401. position = FramemanagerPosition.LEFT;
  402. }
  403. switch (position) {
  404. case TOP:
  405. mainSplitPane.setTopComponent(frameManagerPanel);
  406. mainSplitPane.setBottomComponent(framePanel);
  407. mainSplitPane.setResizeWeight(0.0);
  408. mainSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
  409. frameManagerPanel.setPreferredSize(new Dimension(
  410. Integer.MAX_VALUE, IdentityManager.getGlobalConfig().
  411. getOptionInt("ui", "frameManagerSize")));
  412. break;
  413. case LEFT:
  414. mainSplitPane.setLeftComponent(frameManagerPanel);
  415. mainSplitPane.setRightComponent(framePanel);
  416. mainSplitPane.setResizeWeight(0.0);
  417. mainSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
  418. frameManagerPanel.setPreferredSize(new Dimension(
  419. IdentityManager.getGlobalConfig().getOptionInt("ui",
  420. "frameManagerSize"), Integer.MAX_VALUE));
  421. break;
  422. case BOTTOM:
  423. mainSplitPane.setTopComponent(framePanel);
  424. mainSplitPane.setBottomComponent(frameManagerPanel);
  425. mainSplitPane.setResizeWeight(1.0);
  426. mainSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
  427. frameManagerPanel.setPreferredSize(new Dimension(
  428. Integer.MAX_VALUE, IdentityManager.getGlobalConfig().
  429. getOptionInt("ui", "frameManagerSize")));
  430. break;
  431. case RIGHT:
  432. mainSplitPane.setLeftComponent(framePanel);
  433. mainSplitPane.setRightComponent(frameManagerPanel);
  434. mainSplitPane.setResizeWeight(1.0);
  435. mainSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
  436. frameManagerPanel.setPreferredSize(new Dimension(
  437. IdentityManager.getGlobalConfig().getOptionInt("ui",
  438. "frameManagerSize"), Integer.MAX_VALUE));
  439. break;
  440. default:
  441. break;
  442. }
  443. return mainSplitPane;
  444. }
  445. /** {@inheritDoc}. */
  446. @Override
  447. public void quit() {
  448. quit(0);
  449. }
  450. /**
  451. * Exit code call to quit.
  452. *
  453. * @param exitCode Exit code
  454. */
  455. public void quit(final int exitCode) {
  456. if (exitCode == 0 && IdentityManager.getGlobalConfig().getOptionBool(
  457. "ui", "confirmQuit")) {
  458. final StandardQuestionDialog dialog = new ConfirmQuitDialog(this) {
  459. /**
  460. * A version number for this class. It should be changed
  461. * whenever the class structure is changed (or anything else
  462. * that would prevent serialized objects being unserialized
  463. * with the new class).
  464. */
  465. private static final long serialVersionUID = 9;
  466. /** {@inheritDoc} */
  467. @Override
  468. protected void handleQuit() {
  469. doQuit(exitCode);
  470. }
  471. };
  472. dialog.display();
  473. return;
  474. }
  475. doQuit(exitCode);
  476. }
  477. /**
  478. * Exit code call to quit.
  479. *
  480. * @param exitCode Exit code
  481. */
  482. public void doQuit(final int exitCode) {
  483. this.exitCode = exitCode;
  484. new LoggingSwingWorker() {
  485. /** {@inheritDoc} */
  486. @Override
  487. protected Object doInBackground() {
  488. ActionManager.processEvent(CoreActionType.CLIENT_CLOSING, null);
  489. ServerManager.getServerManager().closeAll(IdentityManager.
  490. getGlobalConfig().getOption("general", "closemessage"));
  491. IdentityManager.getConfigIdentity().setOption("ui",
  492. "frameManagerSize",
  493. String.valueOf(getFrameManagerSize()));
  494. return null;
  495. }
  496. /** {@inheritDoc} */
  497. @Override
  498. protected void done() {
  499. super.done();
  500. dispose();
  501. }
  502. }.executeInExecutor();
  503. }
  504. /** {@inheritDoc} */
  505. @Override
  506. public void configChanged(final String domain, final String key) {
  507. if ("ui".equals(domain)) {
  508. if ("lookandfeel".equals(key)) {
  509. controller.updateLookAndFeel();
  510. } else if ("framemanager".equals(key)
  511. || "framemanagerPosition".equals(key)) {
  512. UIUtilities.invokeLater(new Runnable() {
  513. /** {@inheritDoc} */
  514. @Override
  515. public void run() {
  516. initFrameManagers();
  517. initSplitPane(mainSplitPane);
  518. frameManagerPanel.repaint();
  519. }
  520. });
  521. } else {
  522. showVersion = IdentityManager.getGlobalConfig().getOptionBool(
  523. "ui", "showversion");
  524. }
  525. } else {
  526. imageIcon = new ImageIcon(IconManager.getIconManager().getImage(
  527. "icon"));
  528. UIUtilities.invokeLater(new Runnable() {
  529. /** {@inheritDoc} */
  530. @Override
  531. public void run() {
  532. setIconImage(imageIcon.getImage());
  533. }
  534. });
  535. }
  536. }
  537. /** {@inheritDoc} */
  538. @Override
  539. public void selectionChanged(final FrameContainer<?> window) {
  540. activeFrame = (TextFrame) controller.getWindowFactory()
  541. .getSwingWindow(window);
  542. focusOrder.offerAndMove(activeFrame);
  543. framePanel.setVisible(false);
  544. framePanel.removeAll();
  545. if (activeFrame == null) {
  546. framePanel.add(new JPanel(), "grow");
  547. setTitle(null);
  548. } else {
  549. framePanel.add(activeFrame, "grow");
  550. setTitle(window.getTitle());
  551. }
  552. framePanel.setVisible(true);
  553. }
  554. /** {@inheritDoc} */
  555. @Override
  556. public void windowAdded(final Window parent, final Window window) {
  557. if (activeFrame == null) {
  558. window.getContainer().activateFrame();
  559. }
  560. }
  561. /** {@inheritDoc} */
  562. @Override
  563. public void windowDeleted(final Window parent, final Window window) {
  564. focusOrder.remove((TextFrame) window);
  565. if (activeFrame.equals(window)) {
  566. activeFrame = null;
  567. framePanel.setVisible(false);
  568. framePanel.removeAll();
  569. framePanel.setVisible(true);
  570. if (focusOrder.peek() == null) {
  571. SwingUtilities.invokeLater(new Runnable() {
  572. /** {@inheritDoc} */
  573. @Override
  574. public void run() {
  575. frameManager.scrollUp();
  576. }
  577. });
  578. } else {
  579. focusOrder.peek().getContainer().activateFrame();
  580. }
  581. }
  582. }
  583. /** {@inheritDoc} */
  584. @Override
  585. public void iconChanged(final FrameContainer<?> window, final String icon) {
  586. //Ignore
  587. }
  588. /** {@inheritDoc} */
  589. @Override
  590. public void nameChanged(final FrameContainer<?> window, final String name) {
  591. //Ignore
  592. }
  593. @Override
  594. public void titleChanged(final FrameContainer<?> window,
  595. final String title) {
  596. setTitle(title);
  597. }
  598. }