org.havi.ui
Class HScreenRectangle

java.lang.Object
  extended by org.havi.ui.HScreenRectangle

public class HScreenRectangle
extends java.lang.Object

HScreenRectangle denotes a screen area expressed as a relative value of the screen dimensions. Note that since these are relative dimensions they are effectively independent of any particular screen's physical dimensions, or aspect ratio.

Note that the x and y offset coordinates of the top, left corner of the area are not constrained - they may be negative, or have values greater than one - and hence, may denote an offset location that is not "on-screen". The width and height of the area should be positive (including zero), but are otherwise unconstrained - and hence may denote areas greater in size than the entire screen.

Hence,

Note that in practice, particularly in the case of television, the precise location may vary slightly due to effects of overscan, etc.

Note that systems using HScreenRectangles directly should consider the effects of rounding errors, etc.


The parameters to the constructors are as follows, in cases where parameters are not used, then the constructor should use the default values.

Default parameter values exposed in the constructors

ParameterDescriptionDefault value Set methodGet method
x The horizontal position of the top left corner no default constructor exists setLocation ---
y The vertical position of the top left corner no default constructor exists setLocation ---
width The width of the rectangle no default constructor exists setSize ---
height The height of the rectangle no default constructor exists setSize ---

Default parameter values not exposed in the constructors

DescriptionDefault valueSet method Get method
None.

See Also:
HScreenPoint

Field Summary
 float height
           
 float width
           
 float x
           
 float y
           
 
Constructor Summary
HScreenRectangle(float x, float y, float width, float height)
          Creates an HScreenRectangle object.
 
Method Summary
 void setLocation(float x, float y)
          Set the location of the top left corner of the HScreenRectangle.
 void setSize(float width, float height)
          Set the size of the HScreenRectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

width

public float width

height

public float height
Constructor Detail

HScreenRectangle

public HScreenRectangle(float x,
                        float y,
                        float width,
                        float height)
Creates an HScreenRectangle object. See the class description for details of constructor parameters and default values.

Method Detail

setLocation

public void setLocation(float x,
                        float y)
Set the location of the top left corner of the HScreenRectangle.

Parameters:
x - the horizontal position of the top left corner
y - the vertical position of the top left corner

setSize

public void setSize(float width,
                    float height)
Set the size of the HScreenRectangle.

Parameters:
width - the width of the HScreenRectangle
height - the height of the HScreenRectangle