jdk/src/java.desktop/share/classes/java/awt/peer/WindowPeer.java
author serb
Mon, 31 Aug 2015 16:56:09 +0300
changeset 32493 31bd2a308840
parent 25859 3317bb8137f4
permissions -rw-r--r--
8076178: [macosx] Few open swing and awt reg-tests fail after their update to avoid SunToolkit.realSync Reviewed-by: azvegint, yan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
22635
da42d49ea2d5 8033181: Fix doclint missing issues in java.awt.{peer, im[.spi]}
darcy
parents: 22260
diff changeset
     2
 * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.awt.peer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    31
 * The peer interface for {@link Window}.
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    32
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * The peer interfaces are intended only for use in porting
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * the AWT. They are not intended for use by application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * developers, and developers should not implement peers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * nor invoke any of the peer methods directly on the peer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * instances.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
public interface WindowPeer extends ContainerPeer {
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    40
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    41
    /**
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    42
     * Makes this window the topmost window on the desktop.
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    43
     *
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    44
     * @see Window#toFront()
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    45
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    void toFront();
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    47
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    48
    /**
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    49
     * Makes this window the bottommost window on the desktop.
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    50
     *
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    51
     * @see Window#toBack()
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    52
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    void toBack();
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    54
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    55
    /**
16892
24a521782b42 8006790: Improve checking for windows
malenkov
parents: 15983
diff changeset
    56
     * Updates the window's always-on-top state.
24a521782b42 8006790: Improve checking for windows
malenkov
parents: 15983
diff changeset
    57
     * Sets if the window should always stay
24a521782b42 8006790: Improve checking for windows
malenkov
parents: 15983
diff changeset
    58
     * on top of all other windows or not.
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    59
     *
22260
c9185e010e03 8031082: Fix non-missing doclint problems in client libraries
darcy
parents: 16892
diff changeset
    60
     * @see Window#isAlwaysOnTop()
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    61
     * @see Window#setAlwaysOnTop(boolean)
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    62
     */
16892
24a521782b42 8006790: Improve checking for windows
malenkov
parents: 15983
diff changeset
    63
    void updateAlwaysOnTopState();
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    64
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    65
    /**
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    66
     * Updates the window's focusable state.
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    67
     *
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    68
     * @see Window#setFocusableWindowState(boolean)
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    69
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    void updateFocusableWindowState();
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    71
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    72
    /**
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    73
     * Sets if this window is blocked by a modal dialog or not.
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    74
     *
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    75
     * @param blocker the blocking modal dialog
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    76
     * @param blocked {@code true} to block the window, {@code false}
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    77
     *        to unblock it
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    78
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    void setModalBlocked(Dialog blocker, boolean blocked);
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    80
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    81
    /**
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    82
     * Updates the minimum size on the peer.
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    83
     *
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    84
     * @see Window#setMinimumSize(Dimension)
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    85
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    void updateMinimumSize();
1975
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    87
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    88
    /**
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    89
     * Updates the icons for the window.
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    90
     *
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    91
     * @see Window#setIconImages(java.util.List)
b8dae32335f2 6792515: Specify awt peer's API
rkennke
parents: 1964
diff changeset
    92
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    void updateIconImages();
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
    94
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
    95
    /**
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
    96
     * Sets the level of opacity for the window.
22635
da42d49ea2d5 8033181: Fix doclint missing issues in java.awt.{peer, im[.spi]}
darcy
parents: 22260
diff changeset
    97
     * @param opacity the level of opacity
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
    98
     * @see Window#setOpacity(float)
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
    99
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   100
    void setOpacity(float opacity);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   101
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   102
    /**
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   103
     * Enables the per-pixel alpha support for the window.
22635
da42d49ea2d5 8033181: Fix doclint missing issues in java.awt.{peer, im[.spi]}
darcy
parents: 22260
diff changeset
   104
     * @param isOpaque whether or not per-pixel alpha support is
da42d49ea2d5 8033181: Fix doclint missing issues in java.awt.{peer, im[.spi]}
darcy
parents: 22260
diff changeset
   105
     * enabled
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   106
     * @see Window#setBackground(Color)
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   107
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   108
    void setOpaque(boolean isOpaque);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   109
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   110
    /**
2808
a139a919f645 6794764: Translucent windows are completely repainted on every paint event, on Windows
art
parents: 2472
diff changeset
   111
     * Updates the native part of non-opaque window.
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   112
     *
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   113
     * @see Window#setBackground(Color)
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1975
diff changeset
   114
     */
2808
a139a919f645 6794764: Translucent windows are completely repainted on every paint event, on Windows
art
parents: 2472
diff changeset
   115
    void updateWindow();
2472
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2451
diff changeset
   116
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2451
diff changeset
   117
    /**
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2451
diff changeset
   118
     * Instructs the peer to update the position of the security warning.
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2451
diff changeset
   119
     */
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2451
diff changeset
   120
    void repositionSecurityWarning();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
}