com.jgoodies.uif.util
Class ScreenUtils

java.lang.Object
  extended by com.jgoodies.uif.util.ScreenUtils

public final class ScreenUtils
extends Object

This class consists only of static convenience behavior for screen handling.

Version:
$Revision: 1.9 $
Author:
Karsten Lentzsch

Method Summary
static String encodedScreenConfiguration()
          Looks up and returns the screen configuration encoded as a String.
static boolean has1024x768Screen()
          Returns if the screen dimension is equal or larger than 1024x768 pixel.
static boolean has800x600Screen()
          Returns if the screen dimension is equal or larger than 800x600 pixel.
static void locateOnOpticalScreenCenter(Component component)
          Locates the given component on the optical screen center.
static void locateOnScreenCenter(Component component)
          Locates the given component on the screen's center.
static void locateOnScreenEast(Component component)
          Locates the given component on the screen's east.
static void locateOnScreenNorthEast(Component component)
          Locates the given component on the screen's north-east.
static void locateOnScreenWest(Component component)
          Locates the given component on the screen's west.
static Preferences screenConfigurationNode(Preferences prefs)
          Looks up and returns a preferences child node for the given preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

locateOnScreenCenter

public static void locateOnScreenCenter(Component component)
Locates the given component on the screen's center.

Parameters:
component - the component to be centered
See Also:
locateOnOpticalScreenCenter(Component)

locateOnOpticalScreenCenter

public static void locateOnOpticalScreenCenter(Component component)
Locates the given component on the optical screen center. "Centering" means to bias vertical placement slightly towards the top of the screen, instead of placing exactly in the middle. This is done because the user's eye is naturally biased towards the top of the screen.

Parameters:
component - the component to be optically centered
Since:
1.6

locateOnScreenNorthEast

public static void locateOnScreenNorthEast(Component component)
Locates the given component on the screen's north-east.

Parameters:
component - the component to be located

locateOnScreenWest

public static void locateOnScreenWest(Component component)
Locates the given component on the screen's west.

Parameters:
component - the component to be located

locateOnScreenEast

public static void locateOnScreenEast(Component component)
Locates the given component on the screen's east.

Parameters:
component - the component to be located

has1024x768Screen

public static boolean has1024x768Screen()
Returns if the screen dimension is equal or larger than 1024x768 pixel.

Returns:
true if the screen is at least 1024x768 pixel

has800x600Screen

public static boolean has800x600Screen()
Returns if the screen dimension is equal or larger than 800x600 pixel.

Returns:
true if the screen is at least 800x600 pixel

encodedScreenConfiguration

public static String encodedScreenConfiguration()
Looks up and returns the screen configuration encoded as a String. Examples: "[0,0,1024,768]" for a single 1024x768 screen, "[0,0,1024,768][1024,0,1024,768]" for a dual-screen configuration sitting side-by-side where each screen has 1024x768 pixels.

This String can be used to identify a configuration when storing and restoring screen state such as bounds, table column width, etc. If the screen size, the number of available screens, or their position changes, the encoded configuration changes.

Returns:
the screen configuration encoded as a string

screenConfigurationNode

public static Preferences screenConfigurationNode(Preferences prefs)
Looks up and returns a preferences child node for the given preferences.

Parameters:
prefs - the preferences parent node
Returns:
a preferences child node for the screen configuration.
See Also:
encodedScreenConfiguration()


Copyright © 2000-2008 JGoodies Karsten Lentzsch. All Rights Reserved.