233 * This may be useful if, for example, you want to replace the splash
234 * screen with your window at the same location.
235 * <p>
236 * You cannot control the size or position of the splash screen.
237 * The splash screen size is adjusted automatically when the image changes.
238 * <p>
239 * The image may contain transparent areas, and thus the reported bounds may
240 * be larger than the visible splash screen image on the screen.
241 *
242 * @return a {@code Rectangle} containing the splash screen bounds
243 * @throws IllegalStateException if the splash screen has already been closed
244 */
245 public Rectangle getBounds() throws IllegalStateException {
246 synchronized (SplashScreen.class) {
247 checkVisible();
248 float scale = _getScaleFactor(splashPtr);
249 Rectangle bounds = _getBounds(splashPtr);
250 assert scale > 0;
251 if (scale > 0 && scale != 1) {
252 bounds.setSize((int) (bounds.getWidth() / scale),
253 (int) (bounds.getWidth() / scale));
254 }
255 return bounds;
256 }
257 }
258
259 /**
260 * Returns the size of the splash screen window as a {@link Dimension}.
261 * This may be useful if, for example,
262 * you want to draw on the splash screen overlay surface.
263 * <p>
264 * You cannot control the size or position of the splash screen.
265 * The splash screen size is adjusted automatically when the image changes.
266 * <p>
267 * The image may contain transparent areas, and thus the reported size may
268 * be larger than the visible splash screen image on the screen.
269 *
270 * @return a {@link Dimension} object indicating the splash screen size
271 * @throws IllegalStateException if the splash screen has already been closed
272 */
273 public Dimension getSize() throws IllegalStateException {
|
233 * This may be useful if, for example, you want to replace the splash
234 * screen with your window at the same location.
235 * <p>
236 * You cannot control the size or position of the splash screen.
237 * The splash screen size is adjusted automatically when the image changes.
238 * <p>
239 * The image may contain transparent areas, and thus the reported bounds may
240 * be larger than the visible splash screen image on the screen.
241 *
242 * @return a {@code Rectangle} containing the splash screen bounds
243 * @throws IllegalStateException if the splash screen has already been closed
244 */
245 public Rectangle getBounds() throws IllegalStateException {
246 synchronized (SplashScreen.class) {
247 checkVisible();
248 float scale = _getScaleFactor(splashPtr);
249 Rectangle bounds = _getBounds(splashPtr);
250 assert scale > 0;
251 if (scale > 0 && scale != 1) {
252 bounds.setSize((int) (bounds.getWidth() / scale),
253 (int) (bounds.getHeight() / scale));
254 }
255 return bounds;
256 }
257 }
258
259 /**
260 * Returns the size of the splash screen window as a {@link Dimension}.
261 * This may be useful if, for example,
262 * you want to draw on the splash screen overlay surface.
263 * <p>
264 * You cannot control the size or position of the splash screen.
265 * The splash screen size is adjusted automatically when the image changes.
266 * <p>
267 * The image may contain transparent areas, and thus the reported size may
268 * be larger than the visible splash screen image on the screen.
269 *
270 * @return a {@link Dimension} object indicating the splash screen size
271 * @throws IllegalStateException if the splash screen has already been closed
272 */
273 public Dimension getSize() throws IllegalStateException {
|