From 3f8631ea1ad028b4b5f38f16fbcfb7b1be61aef1 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Thu, 12 Feb 2009 20:32:59 +0000 Subject: [PATCH] Uses less indentation, shortens code, corrects a typo, formats the affected code with the official Eclipse formatter in r4986. --- .../communicator/impl/gui/main/MainFrame.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java index 2b738dab3..1279eb6fb 100755 --- a/src/net/java/sip/communicator/impl/gui/main/MainFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/MainFrame.java @@ -10,6 +10,7 @@ import java.awt.event.*; import java.awt.image.*; import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.util.*; import java.util.List; @@ -1506,27 +1507,22 @@ public void mousePressed(MouseEvent e) glassPane = new ActionMenuGlassPane(); glassPane.add(new ActionMenuPanel()); KeyboardFocusManager.getCurrentKeyboardFocusManager() - .addPropertyChangeListener( - new java.beans.PropertyChangeListener() - { - public void propertyChange(java.beans.PropertyChangeEvent e) + .addPropertyChangeListener(new PropertyChangeListener() { - String prop = e.getPropertyName(); - if ("focusOwner".equals(prop)) + public void propertyChange(PropertyChangeEvent e) { - if (!glassPane.isVisible()) - return; - Object newValue = e.getNewValue(); - - // we dont want the glasspane staying on top - // ot certains components - if (newValue == rootPane) + if ("focusOwner".equals(e.getPropertyName()) + && glassPane.isVisible()) { - glassPane.setVisible(false); + // we don't want the glasspane staying on top + // of certain components + if (e.getNewValue() == rootPane) + { + glassPane.setVisible(false); + } } } - } - }); + }); rootPane.setGlassPane(glassPane); glassPane.setVisible(true);