Esempio n. 1
0
 public double[] toArray() {
   JSObject boundsOpaque = BoundsImpl.toArray(getJSObject());
   JDoubleArray bounds = JDoubleArray.narrowToJDoubleArray(boundsOpaque);
   int boundsLength = bounds.length();
   double[] boundsCoordinates = new double[4];
   if (boundsLength == 4) {
     for (int i = 0; i < boundsLength; i++) {
       boundsCoordinates[i] = bounds.get(i);
     }
   }
   return boundsCoordinates;
 }
Esempio n. 2
0
 /**
  * APIMethod: containsLonLat
  *
  * <p>Parameters: ll - {<OpenLayers.LonLat>} inclusive - {Boolean} Whether or not to include the
  * border. Default is true.
  *
  * <p>Returns: {Boolean} The passed-in lonlat is within this bounds.
  */
 public boolean containsLonLat(LonLat ll, boolean inclusive) {
   return BoundsImpl.containsLonLat(getJSObject(), ll.getJSObject(), inclusive);
 }
Esempio n. 3
0
 /**
  * Scales the bounds around a LonLat.
  *
  * @param ratio
  * @param origin default is center
  * @return a new bounds that is scaled by ratio from origin
  */
 public Bounds scale(float ratio, LonLat origin) {
   JSObject originJsObj = (origin == null) ? null : origin.getJSObject();
   return Bounds.narrowToBounds(BoundsImpl.scale(this.getJSObject(), ratio, originJsObj));
 }
Esempio n. 4
0
 /**
  * @param x
  * @param y
  * @return A new bounds whose coordinates are the same as this, but shifted by the passed-in x and
  *     y values.
  */
 public Bounds add(float x, float y) {
   return Bounds.narrowToBounds(BoundsImpl.add(this.getJSObject(), x, y));
 }
Esempio n. 5
0
 /**
  * @param significantDigits - Number of significant digits in the bbox coordinates, pass null to
  *     use the default of 6.
  * @return String - simple string representation of a Bounds object. For example: "5,42,10,45"
  */
 public String toBBox(Integer significantDigits) {
   return BoundsImpl.toBBox(getJSObject(), significantDigits);
 }
Esempio n. 6
0
 public float getWidth() {
   return BoundsImpl.getWidth(getJSObject());
 }
Esempio n. 7
0
 /** @return double - lower left y-coordinate of bounds */
 public double getLowerLeftY() {
   return BoundsImpl.getMinY(getJSObject());
 }
Esempio n. 8
0
 /** Create an empty Bounds object with coordinates set to null */
 public Bounds() {
   this(BoundsImpl.create());
 }
Esempio n. 9
0
 public void extend(LonLat lonLat) {
   BoundsImpl.extend(this.getJSObject(), lonLat.getJSObject());
 }
Esempio n. 10
0
 public boolean containsBounds(Bounds bounds, boolean partial, boolean contains) {
   return BoundsImpl.containsBounds(getJSObject(), bounds.getJSObject(), partial, contains);
 }
Esempio n. 11
0
 public Geometry toGeometry() {
   return Geometry.narrowToGeometry(BoundsImpl.toGeometry(this.getJSObject()));
 }
Esempio n. 12
0
 /** @return the center of the bounds in pixel space */
 public Pixel getCenterPixel() {
   return Pixel.narrowToPixel(BoundsImpl.getCenterPixel(this.getJSObject()));
 }
Esempio n. 13
0
 /** @return the center of the bounds in map space */
 public LonLat getCenterLonLat() {
   return LonLat.narrowToLonLat(BoundsImpl.getCenterLonLat(this.getJSObject()));
 }
Esempio n. 14
0
 public String toString() {
   return BoundsImpl.toString(getJSObject());
 }
Esempio n. 15
0
 /**
  * Determine whether the target bounds intersects this bounds. Bounds are considered intersecting
  * if any of their edges intersect or if one bounds contains the other.
  *
  * @param bounds the target bounds
  * @return whether the passed-in bounds object intersects this bounds
  */
 public boolean intersectsBounds(Bounds bounds) {
   return BoundsImpl.intersectsBounds(this.getJSObject(), bounds.getJSObject());
 }
Esempio n. 16
0
 /**
  * Create a bounding box by specifying its lower left coordinates, and its upper right
  * coordinates.
  *
  * <p>The units of the bounding box will depend on the CRS and or projection used.
  *
  * <p>For example, a bounds object that represents the world-wide bounds in EPSG:4392 is specified
  * as: new Bounds(-180,-90,180,90);
  *
  * @param lowerLeftX = west = minx
  * @param lowerLeftY = south = miny
  * @param upperRightX = east = maxx
  * @param upperRightY = north = maxy
  */
 public Bounds(double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY) {
   this(BoundsImpl.create(lowerLeftX, lowerLeftY, upperRightX, upperRightY));
 }
Esempio n. 17
0
 public void extend(Point point) {
   BoundsImpl.extend(this.getJSObject(), point.getJSObject());
 }
Esempio n. 18
0
 public void extend(Bounds bounds) {
   BoundsImpl.extend(this.getJSObject(), bounds.getJSObject());
 }
Esempio n. 19
0
 public Bounds transform(Projection source, Projection dest) {
   return Bounds.narrowToBounds(
       BoundsImpl.transform(getJSObject(), source.getJSObject(), dest.getJSObject()));
 }
Esempio n. 20
0
 /** @return double - upper right y-coordinate of bounds */
 public double getUpperRightY() {
   return BoundsImpl.getMaxY(getJSObject());
 }
Esempio n. 21
0
 /**
  * Scales the bounds.
  *
  * @param ratio
  * @return a new bounds that is scaled by ratio
  */
 public Bounds scale(float ratio) {
   return Bounds.narrowToBounds(BoundsImpl.scale(this.getJSObject(), ratio, null));
 }
Esempio n. 22
0
 public float getHeight() {
   return BoundsImpl.getHeight(getJSObject());
 }
Esempio n. 23
0
 /** @return the size of the box */
 public Size getSize() {
   return Size.narrowToSize(BoundsImpl.getSize(getJSObject()));
 }