author | never |
Mon, 12 Jul 2010 22:27:18 -0700 | |
changeset 5926 | a36f90d986b6 |
parent 5506 | 202f599c92aa |
permissions | -rw-r--r-- |
2472
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
1 |
/* |
5506 | 2 |
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. |
2472
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
4 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2472
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2472
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
10 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
15 |
* accompanied this code). |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
16 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
20 |
* |
5506 | 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. |
|
2472
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
24 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
25 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
26 |
package com.sun.awt; |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
27 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
28 |
import java.awt.*; |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
29 |
import java.awt.geom.*; |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
30 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
31 |
import sun.awt.AWTAccessor; |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
32 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
33 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
34 |
/** |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
35 |
* Security Warning control interface. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
36 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
37 |
* This class provides a couple of methods that help a developer relocate |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
38 |
* the AWT security warning to an appropriate position relative to the current |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
39 |
* window size. A "top-level window" is an instance of the {@code Window} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
40 |
* class (or its descendant, such as {@code JFrame}). The security warning |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
41 |
* is applied to all windows created by an untrusted code. All such windows |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
42 |
* have a non-null "warning string" (see {@link Window#getWarningString()}). |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
43 |
* <p> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
44 |
* <b>WARNING</b>: This class is an implementation detail and only meant |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
45 |
* for limited use outside of the core platform. This API may change |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
46 |
* drastically between update release, and it may even be |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
47 |
* removed or be moved to some other packages or classes. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
48 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
49 |
public final class SecurityWarning { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
50 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
51 |
/** |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
52 |
* The SecurityWarning class should not be instantiated |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
53 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
54 |
private SecurityWarning() { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
55 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
56 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
57 |
/** |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
58 |
* Gets the size of the security warning. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
59 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
60 |
* The returned value is not valid until the peer has been created. Before |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
61 |
* invoking this method a developer must call the {@link Window#pack()}, |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
62 |
* {@link Window#setVisible()}, or some other method that creates the peer. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
63 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
64 |
* @param window the window to get the security warning size for |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
65 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
66 |
* @throws NullPointerException if the window argument is null |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
67 |
* @throws IllegalArgumentException if the window is trusted (i.e. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
68 |
* the {@code getWarningString()} returns null) |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
69 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
70 |
public static Dimension getSize(Window window) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
71 |
if (window == null) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
72 |
throw new NullPointerException( |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
73 |
"The window argument should not be null."); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
74 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
75 |
if (window.getWarningString() == null) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
76 |
throw new IllegalArgumentException( |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
77 |
"The window must have a non-null warning string."); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
78 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
79 |
// We don't check for a non-null peer since it may be destroyed |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
80 |
// after assigning a valid value to the security warning size. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
81 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
82 |
return AWTAccessor.getWindowAccessor().getSecurityWarningSize(window); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
83 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
84 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
85 |
/** |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
86 |
* Sets the position of the security warning. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
87 |
* <p> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
88 |
* The {@code alignmentX} and {@code alignmentY} arguments specify the |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
89 |
* origin of the coordinate system used to calculate the position of the |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
90 |
* security warning. The values must be in the range [0.0f...1.0f]. The |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
91 |
* {@code 0.0f} value represents the left (top) edge of the rectangular |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
92 |
* bounds of the window. The {@code 1.0f} value represents the right |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
93 |
* (bottom) edge of the bounds. Whenever the size of the window changes, |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
94 |
* the origin of the coordinate system gets relocated accordingly. For |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
95 |
* convenience a developer may use the {@code Component.*_ALIGNMENT} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
96 |
* constants to pass predefined values for these arguments. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
97 |
* <p> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
98 |
* The {@code point} argument specifies the location of the security |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
99 |
* warning in the coordinate system described above. If both {@code x} and |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
100 |
* {@code y} coordinates of the point are equal to zero, the warning will |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
101 |
* be located right in the origin of the coordinate system. On the other |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
102 |
* hand, if both {@code alignmentX} and {@code alignmentY} are equal to |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
103 |
* zero (i.e. the origin of the coordinate system is placed at the top-left |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
104 |
* corner of the window), then the {@code point} argument represents the |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
105 |
* absolute location of the security warning relative to the location of |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
106 |
* the window. The "absolute" in this case means that the position of the |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
107 |
* security warning is not effected by resizing of the window. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
108 |
* <p> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
109 |
* Note that the security warning managment code guarantees that: |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
110 |
* <ul> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
111 |
* <li>The security warning cannot be located farther than two pixels from |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
112 |
* the rectangular bounds of the window (see {@link Window#getBounds}), and |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
113 |
* <li>The security warning is always visible on the screen. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
114 |
* </ul> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
115 |
* If either of the conditions is violated, the calculated position of the |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
116 |
* security warning is adjusted by the system to meet both these |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
117 |
* conditions. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
118 |
* <p> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
119 |
* The default position of the security warning is in the upper-right |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
120 |
* corner of the window, two pixels to the right from the right edge. This |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
121 |
* corresponds to the following arguments passed to this method: |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
122 |
* <ul> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
123 |
* <li>{@code alignmentX = Component.RIGHT_ALIGNMENT} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
124 |
* <li>{@code alignmentY = Component.TOP_ALIGNMENT} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
125 |
* <li>{@code point = (2, 0)} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
126 |
* </ul> |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
127 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
128 |
* @param window the window to set the position of the security warning for |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
129 |
* @param alignmentX the horizontal origin of the coordinate system |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
130 |
* @param alignmentY the vertical origin of the coordinate system |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
131 |
* @param point the position of the security warning in the specified |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
132 |
* coordinate system |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
133 |
* |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
134 |
* @throws NullPointerException if the window argument is null |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
135 |
* @throws NullPointerException if the point argument is null |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
136 |
* @throws IllegalArgumentException if the window is trusted (i.e. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
137 |
* the {@code getWarningString()} returns null |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
138 |
* @throws IllegalArgumentException if the alignmentX or alignmentY |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
139 |
* arguments are not within the range [0.0f ... 1.0f] |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
140 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
141 |
public static void setPosition(Window window, Point2D point, |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
142 |
float alignmentX, float alignmentY) |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
143 |
{ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
144 |
if (window == null) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
145 |
throw new NullPointerException( |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
146 |
"The window argument should not be null."); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
147 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
148 |
if (window.getWarningString() == null) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
149 |
throw new IllegalArgumentException( |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
150 |
"The window must have a non-null warning string."); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
151 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
152 |
if (point == null) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
153 |
throw new NullPointerException( |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
154 |
"The point argument must not be null"); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
155 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
156 |
if (alignmentX < 0.0f || alignmentX > 1.0f) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
157 |
throw new IllegalArgumentException( |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
158 |
"alignmentX must be in the range [0.0f ... 1.0f]."); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
159 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
160 |
if (alignmentY < 0.0f || alignmentY > 1.0f) { |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
161 |
throw new IllegalArgumentException( |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
162 |
"alignmentY must be in the range [0.0f ... 1.0f]."); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
163 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
164 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
165 |
AWTAccessor.getWindowAccessor().setSecurityWarningPosition(window, |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
166 |
point, alignmentX, alignmentY); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
167 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
168 |
} |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
diff
changeset
|
169 |