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,
Note that systems using HScreenRectangles directly should consider the effects of rounding
errors, etc.
| 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 |
--- |
| Description | Default value | Set method | Get method |
|---|---|---|---|
| None. | |||
HScreenPoint| Modifier and Type | Field and Description |
|---|---|
float |
height |
float |
width |
float |
x |
float |
y |
| Constructor and Description |
|---|
HScreenRectangle(float x,
float y,
float width,
float height)
Creates an
HScreenRectangle object. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public HScreenRectangle(float x,
float y,
float width,
float height)
HScreenRectangle object. See the class description for
details of constructor parameters and default values.public void setLocation(float x,
float y)
x - the horizontal position of the top left cornery - the vertical position of the top left cornerpublic void setSize(float width,
float height)
width - the width of the HScreenRectangleheight - the height of the HScreenRectangleCopyright © 2012 code4tv.com. All Rights Reserved.