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