1 /*
   2  * Copyright (c) 1995, 2009, 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 java.awt.peer;
  27 
  28 import java.awt.*;
  29 
  30 import java.awt.image.BufferedImage;
  31 
  32 /**
  33  * The peer interface for {@link Window}.
  34  *
  35  * The peer interfaces are intended only for use in porting
  36  * the AWT. They are not intended for use by application
  37  * developers, and developers should not implement peers
  38  * nor invoke any of the peer methods directly on the peer
  39  * instances.
  40  */
  41 public interface WindowPeer extends ContainerPeer {
  42 
  43     /**
  44      * Makes this window the topmost window on the desktop.
  45      *
  46      * @see Window#toFront()
  47      */
  48     void toFront();
  49 
  50     /**
  51      * Makes this window the bottommost window on the desktop.
  52      *
  53      * @see Window#toBack()
  54      */
  55     void toBack();
  56 
  57     /**
  58      * Sets if the window should always stay on top of all other windows or
  59      * not.
  60      *
  61      * @param alwaysOnTop if the window should always stay on top of all other
  62      *        windows or not
  63      *
  64      * @see Window#setAlwaysOnTop(boolean)
  65      */
  66     void setAlwaysOnTop(boolean alwaysOnTop);
  67 
  68     /**
  69      * Updates the window's focusable state.
  70      *
  71      * @see Window#setFocusableWindowState(boolean)
  72      */
  73     void updateFocusableWindowState();
  74 
  75     /**
  76      * Sets if this window is blocked by a modal dialog or not.
  77      *
  78      * @param blocker the blocking modal dialog
  79      * @param blocked {@code true} to block the window, {@code false}
  80      *        to unblock it
  81      */
  82     void setModalBlocked(Dialog blocker, boolean blocked);
  83 
  84     /**
  85      * Updates the minimum size on the peer.
  86      *
  87      * @see Window#setMinimumSize(Dimension)
  88      */
  89     void updateMinimumSize();
  90 
  91     /**
  92      * Updates the icons for the window.
  93      *
  94      * @see Window#setIconImages(java.util.List)
  95      */
  96     void updateIconImages();
  97 
  98     /**
  99      * Sets the level of opacity for the window.
 100      *
 101      * @see Window#setOpacity(float)
 102      */
 103     void setOpacity(float opacity);
 104 
 105     /**
 106      * Enables the per-pixel alpha support for the window.
 107      *
 108      * @see Window#setBackground(Color)
 109      */
 110     void setOpaque(boolean isOpaque);
 111 
 112     /**
 113      * Updates the native part of non-opaque window.
 114      *
 115      * @see Window#setBackground(Color)
 116      */
 117     void updateWindow();
 118 
 119     /**
 120      * Instructs the peer to update the position of the security warning.
 121      */
 122     void repositionSecurityWarning();
 123 }