com.bugvm.apple.mapkit.MKMapRect Maven / Gradle / Ivy
The newest version!
/*
* Copyright (C) 2013-2015 RoboVM AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.bugvm.apple.mapkit;
/**/
import java.io.*;
import java.nio.*;
import java.util.*;
import com.bugvm.objc.*;
import com.bugvm.objc.annotation.*;
import com.bugvm.objc.block.*;
import com.bugvm.rt.*;
import com.bugvm.rt.annotation.*;
import com.bugvm.rt.bro.*;
import com.bugvm.rt.bro.annotation.*;
import com.bugvm.rt.bro.ptr.*;
import com.bugvm.apple.foundation.*;
import com.bugvm.apple.coregraphics.*;
import com.bugvm.apple.corelocation.*;
import com.bugvm.apple.uikit.*;
import com.bugvm.apple.dispatch.*;
/* */
/**/
/* */
/**/@Library("MapKit")/* */
/**/public/* */ class /**/MKMapRect/* */
extends /**/Struct/* */
/**//* */ {
/**/public static class MKMapRectPtr extends Ptr {}/* */
/**/static { Bro.bind(MKMapRect.class); }/* */
/**//* */
/**/
public MKMapRect() {}
public MKMapRect(MKMapPoint origin, MKMapSize size) {
this.setOrigin(origin);
this.setSize(size);
}
/* */
public MKMapRect(double x, double y, double width, double height) {
this.setOrigin(new MKMapPoint(x, y));
this.setSize(new MKMapSize(width, height));
}
/**//* */
/**/
@StructMember(0) public native @ByVal MKMapPoint getOrigin();
@StructMember(0) public native MKMapRect setOrigin(@ByVal MKMapPoint origin);
@StructMember(1) public native @ByVal MKMapSize getSize();
@StructMember(1) public native MKMapRect setSize(@ByVal MKMapSize size);
/* */
public double getMinX() {
return getOrigin().getX();
}
public double getMinY() {
return getOrigin().getY();
}
public double getMidX() {
return getOrigin().getX() + getSize().getWidth() / 2.0;
}
public double getMidY() {
return getOrigin().getY() + getSize().getHeight() / 2.0;
}
public double getMaxX() {
return getOrigin().getX() + getSize().getWidth();
}
public double getMaxY() {
return getOrigin().getY() + getSize().getHeight();
}
public double getWidth() {
return getSize().getWidth();
}
public double getHeight() {
return getSize().getHeight();
}
public boolean equalsTo(MKMapRect other) {
return getOrigin().equalsTo(other.getOrigin()) && getSize().equalsTo(other.getSize());
}
public boolean equals(Object obj) {
return obj instanceof MKMapRect && equalsTo((MKMapRect)obj);
}
public boolean isNull() {
return getOrigin().equalsTo(MKMapRect.Null().getOrigin());
}
public boolean isEmpty() {
return isNull() || (getSize().getWidth() == 0.0 && getSize().getHeight() == 0.0);
}
public String toString() {
return String.format("{%s, %s}", getOrigin().toString(), getSize().toString());
}
/**/
/**
* @since Available in iOS 4.0 and later.
*/
@GlobalValue(symbol="MKMapRectWorld", optional=true)
public static native @ByVal MKMapRect World();
/**
* @since Available in iOS 4.0 and later.
*/
@GlobalValue(symbol="MKMapRectNull", optional=true)
public static native @ByVal MKMapRect Null();
/**
* @since Available in iOS 4.0 and later.
*/
public MKMapRect union(MKMapRect rect2) { return union(this, rect2); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectUnion", optional=true)
private static native @ByVal MKMapRect union(@ByVal MKMapRect rect1, @ByVal MKMapRect rect2);
/**
* @since Available in iOS 4.0 and later.
*/
public MKMapRect intersection(MKMapRect rect2) { return intersection(this, rect2); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectIntersection", optional=true)
private static native @ByVal MKMapRect intersection(@ByVal MKMapRect rect1, @ByVal MKMapRect rect2);
/**
* @since Available in iOS 4.0 and later.
*/
public MKMapRect inset(double dx, double dy) { return inset(this, dx, dy); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectInset", optional=true)
private static native @ByVal MKMapRect inset(@ByVal MKMapRect rect, double dx, double dy);
/**
* @since Available in iOS 4.0 and later.
*/
public MKMapRect offset(double dx, double dy) { return offset(this, dx, dy); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectOffset", optional=true)
private static native @ByVal MKMapRect offset(@ByVal MKMapRect rect, double dx, double dy);
/**
* @since Available in iOS 4.0 and later.
*/
public void divide(MKMapRect slice, MKMapRect remainder, double amount, CGRectEdge edge) { divide(this, slice, remainder, amount, edge); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectDivide", optional=true)
private static native void divide(@ByVal MKMapRect rect, MKMapRect slice, MKMapRect remainder, double amount, CGRectEdge edge);
/**
* @since Available in iOS 4.0 and later.
*/
public boolean contains(MKMapPoint point) { return contains(this, point); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectContainsPoint", optional=true)
private static native boolean contains(@ByVal MKMapRect rect, @ByVal MKMapPoint point);
/**
* @since Available in iOS 4.0 and later.
*/
public boolean contains(MKMapRect rect2) { return contains(this, rect2); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectContainsRect", optional=true)
private static native boolean contains(@ByVal MKMapRect rect1, @ByVal MKMapRect rect2);
/**
* @since Available in iOS 4.0 and later.
*/
public boolean intersects(MKMapRect rect2) { return intersects(this, rect2); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectIntersectsRect", optional=true)
private static native boolean intersects(@ByVal MKMapRect rect1, @ByVal MKMapRect rect2);
/**
* @since Available in iOS 4.0 and later.
*/
public boolean isSpanning180thMeridian() { return isSpanning180thMeridian(this); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectSpans180thMeridian", optional=true)
private static native boolean isSpanning180thMeridian(@ByVal MKMapRect rect);
/**
* @since Available in iOS 4.0 and later.
*/
public MKMapRect remainder() { return remainder(this); }
/**
* @since Available in iOS 4.0 and later.
*/
@Bridge(symbol="MKMapRectRemainder", optional=true)
private static native @ByVal MKMapRect remainder(@ByVal MKMapRect rect);
/* */
}