HScreenRectangle

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.havi.ui
Class HScreenRectangle

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

    public class HScreenRectangle

extends 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,

- (0.0, 0.0, 1.0, 1.0) denotes the whole of the screen.
- (0.0, 0.0, 0.5, 0.5) denotes the top, left hand quarter of the screen.
- (0.5, 0.0, 0.5, 0.5) denotes the top, right hand quarter of the screen.
- (0.25, 0.25, 0.5, 0.5) denotes a centered quarter-screen area of the screen.
- (0.0, 0.5, 0.5, 0.5) denotes the bottom, left hand quarter of the screen.
- (0.5, 0.5, 0.5, 0.5) denotes the bottom, right hand quarter of the screen.

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

Parameter | Description | Default value | Set method | Get 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

Description | Default value | Set 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
`equals, 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD