juife
v0.1a

net.sf.juife
Class JuifeUtils

java.lang.Object
  extended by net.sf.juife.JuifeUtils

public class JuifeUtils
extends java.lang.Object

A collection of utility methods.


Method Summary
static java.awt.Point centerLocation(java.awt.Component component, java.awt.Component parent)
          Calculates the location that can be used to center component related to parent.
static java.awt.Dimension getUnionSize(java.awt.Component c1, java.awt.Component c2)
          Gets the union size of the specified components.
static java.awt.Dimension getUnionSize(java.awt.Component c1, java.awt.Dimension d2)
          Gets the union size of the specified component and dimension using the component's preferred size.
static java.awt.Dimension getUnionSize(java.awt.Dimension d1, java.awt.Dimension d2)
          Gets the union size of the specified dimensions.
static java.awt.Window getWindow(java.awt.Component c)
          Gets the toplevel window of the specified component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

centerLocation

public static java.awt.Point centerLocation(java.awt.Component component,
                                            java.awt.Component parent)
Calculates the location that can be used to center component related to parent.

Returns:
The location of the top-left corner that can be used to center component related to parent.
See Also:
Component.setLocation(Point p)

getUnionSize

public static java.awt.Dimension getUnionSize(java.awt.Component c1,
                                              java.awt.Component c2)
Gets the union size of the specified components. The union size is calculated by getUnionSize(Dimension d1, Dimension d2) method using the components' preferred size.

Returns:
The union size of the specified components.

getUnionSize

public static java.awt.Dimension getUnionSize(java.awt.Component c1,
                                              java.awt.Dimension d2)
Gets the union size of the specified component and dimension using the component's preferred size.

Returns:
The union size of the specified component and dimension.

getUnionSize

public static java.awt.Dimension getUnionSize(java.awt.Dimension d1,
                                              java.awt.Dimension d2)
Gets the union size of the specified dimensions.

Returns:
The union size of the specified dimensions.

getWindow

public static java.awt.Window getWindow(java.awt.Component c)
Gets the toplevel window of the specified component.

Parameters:
c - The component whose toplevel window should be obtained.
Returns:
The toplevel window of the specified component or null.

juife
v0.1a

Copyright © 2005 Grigor Iliev. All rights reserved. SourceForge.net Logo