net.rim.device.api.ui
Class XYDimension

java.lang.Object
  extended by net.rim.device.api.ui.XYDimension

public final class XYDimension
extends Object

Represents a dimension on a two dimensional, cartesian plane.

Typically, these objects are used to represent drawing positions or corners of drawing fields. In these cases, it's handy to remember that the point (0,0) represents the top, left-hand corner of a graphics extent, with increasing positive values describing the plane downwards and to the right.

See Also:
XYRect
Since:
BlackBerry API 4.0.0

Field Summary
 int height
          Distance of point along vertical axis.
 int width
          Distance of point along horizontal axis.
 
Constructor Summary
XYDimension()
          Creates a new XYDimension instance, but does not initialize it.
XYDimension(int width, int height)
          Creates a new XYDimension instance with provided width and height.
XYDimension(XYDimension dimension)
          Creates a new XYDemension based on an existing dimension object.
 
Method Summary
 void set(int width, int height)
          Sets width and height for this dimension object.
 void set(XYDimension dimension)
          Sets new data for this dimension object from provided dimension object.
 String toString()
          Retrieves string version of this object's dimensions.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 



Field Detail

width

public int width
Distance of point along horizontal axis.

Since:
BlackBerry API 4.0.0

height

public int height
Distance of point along vertical axis.

Since:
BlackBerry API 4.0.0


Constructor Detail

XYDimension

public XYDimension()
Creates a new XYDimension instance, but does not initialize it.

Since:
BlackBerry API 4.0.0

XYDimension

public XYDimension(int width,
                   int height)
Creates a new XYDimension instance with provided width and height.

Parameters:
width - Width for this new dimension object.
height - Height for this new dimension object.
Since:
BlackBerry API 4.0.0

XYDimension

public XYDimension(XYDimension dimension)
Creates a new XYDemension based on an existing dimension object.

Parameters:
width - Width for this new dimension object.
height - Height for this new dimension object.
Since:
BlackBerry API 4.0.0


Method Detail

set

public void set(int width,
                int height)
Sets width and height for this dimension object.

Parameters:
width - New width for this dimension object.
height - New height for this dimension object.
Since:
BlackBerry API 4.0.0

set

public void set(XYDimension dimension)
Sets new data for this dimension object from provided dimension object.

Parameters:
dimension - Dimension object from which to clone width and height.
Since:
BlackBerry API 4.0.0

toString

public String toString()
Retrieves string version of this object's dimensions.

Use this method to retrieve a string of this form:

   +(width,height)
 

Overrides:
toString in class Object
Returns:
a string representation of the object.
Since:
BlackBerry API 4.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.