1 /*
   2  * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   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 com.sun.javafx.tk;
  27 
  28 import javafx.stage.Stage;
  29 import java.util.Map;
  30 
  31 /**
  32  * Applets must run within a parent window, so this interface will allow the
  33  * plugin access to the underlying parent window that all Stages will be created
  34  * in.
  35  */
  36 public interface AppletWindow {
  37     /*
  38      * topStage must be a primary stage and it's backing window a child window
  39      * of this AppletWindow or this method will have no effect.
  40      * The window will do what it can to make sure the given stage is on top of
  41      * the other primary applet stages. In the future we will allow specifying
  42      * Z order but that requires low level changes to Glass to do properly.
  43      */
  44     public void setStageOnTop(Stage topStage);
  45 
  46     public void setBackgroundColor(int color); // RGB triplet: 0xRRGGBB
  47     public void setForegroundColor(int color);
  48 
  49     public void setVisible(boolean state);
  50 
  51     public void setSize(int width, int height);
  52     public int getWidth();
  53     public int getHeight();
  54 
  55     public void setPosition(int x, int y);
  56     public int getPositionX();
  57     public int getPositionY();
  58 
  59     public float getUIScale();
  60 
  61     // returns CARemoteLayer id (only used on Mac)
  62     public int getRemoteLayerId();
  63     // dispatchEvent (only used on Mac)
  64     public void dispatchEvent(Map eventInfo);
  65 }