org.oddjob.arooa.design.view
Class ScreenPresence

java.lang.Object
  extended by org.oddjob.arooa.design.view.ScreenPresence
All Implemented Interfaces:
Serializable

public class ScreenPresence
extends Object
implements Serializable

Represent location and size information for a screen component.

See Also:
Serialized Form
Author:
rob

Constructor Summary
ScreenPresence(Component component)
           
ScreenPresence(Point position, Dimension size)
           
 
Method Summary
 void fit(Component component)
          Fit a component to the location and size of this screen presence.
 Point getLocation()
           
 Dimension getSize()
           
 Point locationToCenter(Dimension size)
          Return the location relative to this screen area that would centre something of the given size within this screen area..
 ScreenPresence smaller(double factor)
          Create ScreenPresence a factor the size of this.
 String toString()
           
static ScreenPresence wholeScreen()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScreenPresence

public ScreenPresence(Point position,
                      Dimension size)

ScreenPresence

public ScreenPresence(Component component)
Method Detail

fit

public void fit(Component component)
Fit a component to the location and size of this screen presence.

Parameters:
component -

getLocation

public Point getLocation()

getSize

public Dimension getSize()

locationToCenter

public Point locationToCenter(Dimension size)
Return the location relative to this screen area that would centre something of the given size within this screen area..

Parameters:
size -
Returns:

smaller

public ScreenPresence smaller(double factor)
Create ScreenPresence a factor the size of this. The location will be adjusted so that it is offset equally in both x and y direction from this ScreenPresence.

Parameters:
factor - The factor to size the new ScreenPresence by.
Returns:

wholeScreen

public static ScreenPresence wholeScreen()

toString

public String toString()
Overrides:
toString in class Object