PamView
Class ScreenSize

java.lang.Object
  extended by PamView.ScreenSize

public class ScreenSize
extends java.lang.Object

Class to launch a thread which will get the screen size (inlcuding the bounds of multiple monitors)

The process of getting the dimensions is launched in a different thread and can be going on while other PAMGAURD startup processes are initialising.

Author:
Doug

Nested Class Summary
 class ScreenSize.GetBounds
          Thread to obtain the screen bounds.
 
Field Summary
private static boolean hasRun
           
private static java.awt.Rectangle screenDimension
           
 
Constructor Summary
private ScreenSize()
           
 
Method Summary
static java.awt.Rectangle getScreenBounds()
          Gets the screen bounds.
static java.awt.Rectangle getScreenBounds(int maxWaitMillis)
          Gets the virtual screen size.
 boolean haveScreenBounds()
           
static void startScreenSizeProcess()
          Only needs to be called once to start the background process which gets the virtual screen size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

screenDimension

private static volatile java.awt.Rectangle screenDimension

hasRun

private static volatile boolean hasRun
Constructor Detail

ScreenSize

private ScreenSize()
Method Detail

startScreenSizeProcess

public static void startScreenSizeProcess()
Only needs to be called once to start the background process which gets the virtual screen size.

Is called from PAMGUARD Main to get it going asap.


getScreenBounds

public static java.awt.Rectangle getScreenBounds()
Gets the screen bounds. Returns null if they have not yet been set in the background thread.

Returns:
Virtual screen size, or null.

getScreenBounds

public static java.awt.Rectangle getScreenBounds(int maxWaitMillis)
Gets the virtual screen size. Will wait for them to be extracted from the background thread up to some set timeout

Parameters:
maxWaitMillis - Max time to wait.
Returns:
virtual screen dimension, or null if unavailable after the set wait period.

haveScreenBounds

public boolean haveScreenBounds()
Returns:
true if screen bounds are available.