@@ -0,0 +1,1526 @@
+/**%0A * Appcelerator Titanium Mobile%0A * Copyright (c) 2012 by Appcelerator, Inc. All Rights Reserved.%0A * Licensed under the terms of the Apache Public License%0A * Please see the LICENSE included with this distribution for details.%0A */%0Apackage org.appcelerator.titanium;%0A%0Aimport java.util.HashMap;%0A%0Aimport org.appcelerator.titanium.util.TiConvert;%0A%0Apublic class TiPoint %7B%0A%09private TiDimension x, y;%0A%0A%09/*%0A%09 * Create a new point with the 'x' and 'y'%0A%09 * coordinates in pixel units.%0A%09 */%0A%09public TiPoint(double x, double y) %7B%0A%09%09this.x = new TiDimension(x, TiDimension.TYPE_WIDTH);%0A%09%09this.y = new TiDimension(y, TiDimension.TYPE_HEIGHT);%0A%09%7D%0A%0A%09/*%0A%09 * Create a new point from an object%0A%09 * with 'x' and 'y' properties. If any of these%0A%09 * properties is missing, a default value of zero will be used.%0A%09 */%0A%09public TiPoint(HashMap object) %7B%0A%09%09this(object, 0, 0);%0A%09%7D%0A%0A%09/*%0A%09 * Create a new point from an object%0A%09 * with 'x' and 'y' properties. If any of these%0A%09 * properties is missing, the default values will be used.%0A%09 */%0A%09public TiPoint(HashMap object, double defaultValueX, double defaultValueY) %7B%0A%09%09x = TiConvert.toTiDimension(object.get(TiC.PROPERTY_X), TiDimension.TYPE_WIDTH);%0A%09%09if (x == null) %7B%0A%09%09%09x = new TiDimension(defaultValueX, TiDimension.TYPE_WIDTH);%0A%09%09%7D%0A%0A%09%09y = TiConvert.toTiDimension(object.get(TiC.PROPERTY_Y), TiDimension.TYPE_HEIGHT);%0A%09%09if (y == null) %7B%0A%09%09%09y = new TiDimension(defaultValueY, TiDimension.TYPE_HEIGHT);%0A%09%09%7D%0A%09%7D%0A%0A%09public TiDimension getX() %7B%0A%09%09return x;%0A%09%7D%0A%0A%09public TiDimension getY() %7B%0A%09%09return y;%0A%09%7D%0A%7D%0A

Implement TiPoint