anecho.gui
Class PosTools

java.lang.Object
  extended by anecho.gui.PosTools

public class PosTools
extends java.lang.Object

A set of tools to help ease finding the centre and corner points of existing objects and/or the screen.


Constructor Summary
PosTools()
           
 
Method Summary
static java.awt.Point findCenter()
          Without arguements, we will return the centre of the 'desktop'
static java.awt.Point findCenter(java.awt.Component comp)
          Find the centre of the object that we have been passed
static java.awt.Point findCenter(java.awt.Component parent, java.awt.Component child)
          return the point to centre the child component on the parent component
static java.awt.Point findCenter(java.awt.Component comp, int corner)
          Returns the specified corner of the object which we have been passed
static java.awt.Point findCentre()
          Deprecated. use findCenter() instead. English spelling confuses people
static java.awt.Point findCentre(java.awt.Component comp)
          Deprecated. use findCenter(Component c) instead
static java.awt.Point findCentre(java.awt.Component parent, java.awt.Component child)
          Deprecated. use findCenter(Component parent, Component child)
static java.awt.Point findCentre(java.awt.Component comp, int corner)
          Deprecated. use findCenter(Component c, int corner) instead
static java.awt.Point findCentre(java.awt.Component parent, int corner, java.awt.Component child)
          return the Point to centre the child component over the given axis of the parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PosTools

public PosTools()
Method Detail

findCentre

public static java.awt.Point findCentre()
Deprecated. use findCenter() instead. English spelling confuses people

Without arguements, we will return the centre of the 'desktop'

Returns:
Returns a point indicating the centre of the user's "desktop"

findCenter

public static java.awt.Point findCenter()
Without arguements, we will return the centre of the 'desktop'

Returns:
Return a point indicating the centre of the 'desktop'

findCenter

public static java.awt.Point findCenter(java.awt.Component comp)
Find the centre of the object that we have been passed

Parameters:
comp - The component that we are to find the centre of.
Returns:
A Point containing the relative coordinates of the centre of our component.

findCentre

public static java.awt.Point findCentre(java.awt.Component comp)
Deprecated. use findCenter(Component c) instead

Find the centre of the object that we have been passed

Parameters:
comp - The component that we are to find the centre of.
Returns:
A point representing the centre of the given component.

findCentre

public static java.awt.Point findCentre(java.awt.Component comp,
                                        int corner)
Deprecated. use findCenter(Component c, int corner) instead

Returns the specified corner of the object which we have been passed

Parameters:
comp - The component that we are to find the centre of.
corner -
Returns:
A point representing the centre of the given component.

findCenter

public static java.awt.Point findCenter(java.awt.Component comp,
                                        int corner)
Returns the specified corner of the object which we have been passed

Parameters:
comp - The component that we are to find the centre of.
corner - The name of the component's corner-coordinates that we want returned
Returns:
A point representing the centre of the given component.

findCentre

public static java.awt.Point findCentre(java.awt.Component parent,
                                        java.awt.Component child)
Deprecated. use findCenter(Component parent, Component child)

return the point to centre the child component on the parent component

Parameters:
parent - The parent component that will be used to centre the child
child -
Returns:
A point representing the centre of the given component.

findCenter

public static java.awt.Point findCenter(java.awt.Component parent,
                                        java.awt.Component child)
return the point to centre the child component on the parent component

Parameters:
parent - The parent component that will be used to centre the child
child - The child component to be centred on the parent
Returns:
A point representing the centre of the given component.

findCentre

public static java.awt.Point findCentre(java.awt.Component parent,
                                        int corner,
                                        java.awt.Component child)
return the Point to centre the child component over the given axis of the parent

Parameters:
parent - The parent component that will be used to centre the child
corner -
child -
Returns:
A point representing the centre of the given component.