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