< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.lwawt.macosx;
  27 
  28 import java.awt.*;
  29 import sun.awt.CausedFocusEvent;

  30 import sun.java2d.SurfaceData;
  31 import sun.java2d.opengl.CGLLayer;
  32 import sun.lwawt.LWWindowPeer;
  33 import sun.lwawt.LWWindowPeer.PeerType;
  34 import sun.lwawt.PlatformWindow;
  35 import sun.util.logging.PlatformLogger;
  36 
  37 /*
  38  * Provides a lightweight implementation of the EmbeddedFrame.
  39  */
  40 public class CPlatformEmbeddedFrame implements PlatformWindow {
  41 
  42     private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformEmbeddedFrame");
  43 
  44     private CGLLayer windowLayer;
  45     private LWWindowPeer peer;
  46     private CEmbeddedFrame target;
  47 
  48     private volatile int screenX = 0;
  49     private volatile int screenY = 0;


 116     public Insets getInsets() {
 117         return new Insets(0, 0, 0, 0);
 118     }
 119 
 120     @Override
 121     public void toFront() {}
 122 
 123     @Override
 124     public void toBack() {}
 125 
 126     @Override
 127     public void setMenuBar(MenuBar mb) {}
 128 
 129     @Override
 130     public void setAlwaysOnTop(boolean value) {}
 131 
 132     @Override
 133     public void updateFocusableWindowState() {}
 134 
 135     @Override
 136     public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {
 137         // Cross-app activation requests are not allowed.
 138         if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
 139             !target.isParentWindowActive())
 140         {
 141             focusLogger.fine("the embedder is inactive, so the request is rejected");
 142             return true;
 143         }
 144         return false;
 145     }
 146 
 147     @Override
 148     public boolean requestWindowFocus() {
 149         return true;
 150     }
 151 
 152     @Override
 153     public boolean isActive() {
 154         return true;
 155     }
 156 
 157     @Override
 158     public void setResizable(boolean resizable) {}




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.lwawt.macosx;
  27 
  28 import java.awt.*;
  29 import java.awt.event.FocusEvent;
  30 
  31 import sun.java2d.SurfaceData;
  32 import sun.java2d.opengl.CGLLayer;
  33 import sun.lwawt.LWWindowPeer;
  34 import sun.lwawt.LWWindowPeer.PeerType;
  35 import sun.lwawt.PlatformWindow;
  36 import sun.util.logging.PlatformLogger;
  37 
  38 /*
  39  * Provides a lightweight implementation of the EmbeddedFrame.
  40  */
  41 public class CPlatformEmbeddedFrame implements PlatformWindow {
  42 
  43     private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformEmbeddedFrame");
  44 
  45     private CGLLayer windowLayer;
  46     private LWWindowPeer peer;
  47     private CEmbeddedFrame target;
  48 
  49     private volatile int screenX = 0;
  50     private volatile int screenY = 0;


 117     public Insets getInsets() {
 118         return new Insets(0, 0, 0, 0);
 119     }
 120 
 121     @Override
 122     public void toFront() {}
 123 
 124     @Override
 125     public void toBack() {}
 126 
 127     @Override
 128     public void setMenuBar(MenuBar mb) {}
 129 
 130     @Override
 131     public void setAlwaysOnTop(boolean value) {}
 132 
 133     @Override
 134     public void updateFocusableWindowState() {}
 135 
 136     @Override
 137     public boolean rejectFocusRequest(FocusEvent.Cause cause) {
 138         // Cross-app activation requests are not allowed.
 139         if (cause != FocusEvent.Cause.MOUSE_EVENT &&
 140             !target.isParentWindowActive())
 141         {
 142             focusLogger.fine("the embedder is inactive, so the request is rejected");
 143             return true;
 144         }
 145         return false;
 146     }
 147 
 148     @Override
 149     public boolean requestWindowFocus() {
 150         return true;
 151     }
 152 
 153     @Override
 154     public boolean isActive() {
 155         return true;
 156     }
 157 
 158     @Override
 159     public void setResizable(boolean resizable) {}


< prev index next >