com.sibvisions.util.type
Class ScreenUtil

java.lang.Object
  extended by com.sibvisions.util.type.ScreenUtil

public final class ScreenUtil
extends Object

The ScreenUtil contains utility methods which solves common screen problems.


Method Summary
static void center(Component pComponent)
          Centers a component on the screen.
static void center(Component pComponent, Component pOtherComponent)
          Centers a component over another component.
static Point getObjectCenterLocation(Component pComponent, Component pOtherComponent)
          Gets the coordinates for a component to center it over another component.
static Point getScreenCenterLocation(Dimension pDimension)
          Gets the screen centered coordinates for the given component size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getScreenCenterLocation

public static Point getScreenCenterLocation(Dimension pDimension)
Gets the screen centered coordinates for the given component size.

Parameters:
pDimension - a component dimension
Returns:
Point the center point

center

public static void center(Component pComponent)
Centers a component on the screen.

Parameters:
pComponent - the component

getObjectCenterLocation

public static Point getObjectCenterLocation(Component pComponent,
                                            Component pOtherComponent)
Gets the coordinates for a component to center it over another component.

Parameters:
pComponent - the component that should be centered
pOtherComponent - the reference component
Returns:
the center point

center

public static void center(Component pComponent,
                          Component pOtherComponent)
Centers a component over another component.

Parameters:
pComponent - the component that should be centered
pOtherComponent - the reference component


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.