3876N/A * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A // Fix for 6317038: as EmbeddedFrame is instance of Frame, it is blocked 0N/A // by modal dialogs, but in the case of TrayIcon it shouldn't. So we 0N/A // set ModalExclusion property on it. 0N/A // It's executed under AWTLock. 1696N/A ctrLog.
fine(
"ConfigureNotify on parent of {0}: {1}x{2}+{3}+{4} (old: {5}+{6})",
0N/A // On Metacity the EmbeddedFrame's parent window bounds are larger 0N/A // than TrayIcon size required (that is we need a square but a rectangle 0N/A // is provided by the Panel Notification Area). The parent's background color 0N/A // differs from the Panel's one. To hide the background we resize parent 0N/A // window so that it fits the EmbeddedFrame. 0N/A // However due to resizing the parent window it loses centering in the Panel. 0N/A // We center it when discovering that some of its side is of size greater 0N/A // than the fixed value. Centering is being done by "X" (when the parent's width 0N/A // is greater) and by "Y" (when the parent's height is greater). 0N/A // Actually we need this workaround until we could detect taskbar color. 0N/A // If both the height and the width differ from the fixed size then WM 0N/A // must level at least one side to the fixed size. For some reason it may take 0N/A // a few hops (even after reparenting) and we have to skip the intermediate ones. 1696N/A ctrLog.
fine(
"ConfigureNotify on parent of {0}. Skipping as intermediate resizing.",
0N/A // If moving by both "X" and "Y". 0N/A // When some tray icon gets removed from the tray, a Java icon may be repositioned. 0N/A // In this case the parent window also lose centering. We have to restore it. 1696N/A ctrLog.
fine(
"ConfigureNotify on parent of {0}. Move detected. Centering by \"Y\".",
1696N/A ctrLog.
fine(
"ConfigureNotify on parent of {0}. Move detected. Centering by \"X\".",
0N/A // It's executed under AWTLock. 0N/A // Wait till the EmbeddedFrame is reparented 0N/A // This is unlikely to happen. 0N/A // All actions that is to be synchronized with disposal 0N/A // should be executed either under AWTLock, or on EDT. 0N/A // isDisposed value must be checked. 0N/A // Check if the tray icon is in the bounds of a screen. 0N/A // It's synchronized with disposal by EDT. 0N/A // ****************************************************************** 0N/A // ****************************************************************** 0N/A // Private method for testing purposes. 0N/A //prevent DRAG events from being posted with TrayIcon source(CR 6565779) 0N/A // Event handling is synchronized with disposal by EDT. 0N/A // This is a hack in order to set non-Component source to MouseEvent 0N/A // In some cases this could lead to unpredictable result (e.g. when 0N/A // other class tries to cast source field to Component). 0N/A // We already filter DRAG events out (CR 6565779). 0N/A // *************************************** 0N/A // Special embedded frame for tray icon 0N/A // *************************************** 0N/A // embedded frame for tray icon shouldn't be disposed by anyone except tray icon 0N/A // *************************************** 0N/A // Classes for painting an image on canvas 0N/A // ***************************************