-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed events objects to JSNI to correct ClassCastException
- Loading branch information
Showing
16 changed files
with
565 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/com/gwidgets/api/leaflet/elemental/Document.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.gwidgets.api.leaflet.elemental; | ||
|
||
import static jsinterop.annotations.JsPackage.GLOBAL; | ||
|
||
import jsinterop.annotations.JsType; | ||
|
||
@JsType(isNative=true, name = "document", namespace = GLOBAL) | ||
public class Document extends Node { | ||
|
||
private Document(){} | ||
|
||
public static native HTMLElement getElementById(String id); | ||
|
||
} |
12 changes: 4 additions & 8 deletions
12
src/main/java/com/gwidgets/api/leaflet/elemental/Element.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
package com.gwidgets.api.leaflet.elemental; | ||
|
||
import jsinterop.annotations.JsMethod; | ||
import jsinterop.annotations.JsProperty; | ||
import jsinterop.annotations.JsType; | ||
|
||
@JsType(isNative=true) | ||
public class Element { | ||
|
||
@JsMethod | ||
public native String getInnerHTML(); | ||
@JsMethod | ||
public native void setInnerHTML(String s); | ||
|
||
|
||
|
||
@JsProperty | ||
public String innerHTML; | ||
|
||
} |
7 changes: 3 additions & 4 deletions
7
src/main/java/com/gwidgets/api/leaflet/elemental/Function.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
package com.gwidgets.api.leaflet.elemental; | ||
|
||
import com.google.gwt.core.client.JavaScriptObject; | ||
import com.gwidgets.api.leaflet.events.Event; | ||
|
||
import com.google.gwt.core.client.JavaScriptObject; | ||
import jsinterop.annotations.JsFunction; | ||
|
||
|
||
@JsFunction | ||
public interface Function { | ||
public interface Function{ | ||
|
||
public JavaScriptObject call(Event event, JavaScriptObject...args); | ||
public JavaScriptObject call(JavaScriptObject event); | ||
|
||
} |
105 changes: 60 additions & 45 deletions
105
src/main/java/com/gwidgets/api/leaflet/events/ErrorEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,70 @@ | ||
package com.gwidgets.api.leaflet.events; | ||
|
||
import jsinterop.annotations.JsProperty; | ||
import jsinterop.annotations.JsType; | ||
|
||
import com.google.gwt.core.client.JavaScriptObject; | ||
import com.gwidgets.api.leaflet.LatLng; | ||
import com.gwidgets.api.leaflet.LatLngBounds; | ||
import com.gwidgets.api.leaflet.Point; | ||
import com.gwidgets.api.leaflet.elemental.DOMMouseEvent; | ||
|
||
@JsType(isNative = true) | ||
public class ErrorEvent extends Event { | ||
|
||
|
||
@JsProperty | ||
public Point layerPoint; | ||
|
||
@JsProperty | ||
public Point containerPoint; | ||
|
||
@JsProperty | ||
public DOMMouseEvent originalEvent; | ||
|
||
@JsProperty | ||
public LatLng latlng; | ||
|
||
@JsProperty | ||
public LatLngBounds bounds; | ||
|
||
@JsProperty | ||
public Number accuracy; | ||
|
||
@JsProperty | ||
public Number altitude; | ||
|
||
@JsProperty | ||
public Number altitudeAccuracy; | ||
|
||
@JsProperty | ||
public Number heading; | ||
|
||
@JsProperty | ||
public Number speed; | ||
|
||
@JsProperty | ||
public Number timestamp; | ||
|
||
@JsProperty | ||
public String message; | ||
import jsinterop.annotations.JsType; | ||
|
||
@JsProperty | ||
public Number code; | ||
@JsType | ||
public class ErrorEvent extends Event { | ||
|
||
protected ErrorEvent(){ | ||
|
||
|
||
} | ||
|
||
public final native Point getLayerPoint() /*-{ | ||
return this.layerPoint; | ||
}-*/; | ||
|
||
public final native Point getContainerPoint() /*-{ | ||
return this.containerPoint; | ||
}-*/; | ||
|
||
public final native DOMMouseEvent getOriginalEvent() /*-{ | ||
return this.originalEvent; | ||
}-*/; | ||
|
||
public final native LatLng getLatlng() /*-{ | ||
return this.latlng; | ||
}-*/; | ||
|
||
public final native LatLngBounds getBounds() /*-{ | ||
return this.bounds; | ||
}-*/; | ||
|
||
public final native Number getAccuracy() /*-{ | ||
return this.accuracy; | ||
}-*/; | ||
|
||
public final native Number getAltitude() /*-{ | ||
return this.altitude; | ||
}-*/; | ||
|
||
public final native Number getAltitudeAccuracy() /*-{ | ||
return this.altitudeAccuracy; | ||
}-*/; | ||
|
||
public final native Number getHeading() /*-{ | ||
return this.heading; | ||
}-*/; | ||
|
||
public final native Number getSpeed() /*-{ | ||
return this.speed; | ||
}-*/; | ||
|
||
public final native Number getTimestamp() /*-{ | ||
return this.timestamp; | ||
}-*/; | ||
|
||
public final native String getMessage() /*-{ | ||
return this.message; | ||
}-*/; | ||
|
||
public final native Number getCode() /*-{ | ||
return this.code; | ||
}-*/; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
package com.gwidgets.api.leaflet.events; | ||
|
||
import com.google.gwt.core.client.JavaScriptObject; | ||
import com.gwidgets.api.leaflet.elemental.HTMLElement; | ||
|
||
import jsinterop.annotations.JsProperty; | ||
import jsinterop.annotations.JsType; | ||
|
||
@JsType(isNative = true) | ||
public class Event { | ||
@JsType | ||
public class Event extends JavaScriptObject { | ||
|
||
protected Event(){ | ||
|
||
|
||
} | ||
|
||
public final native String getType() /*-{ | ||
return this.target; | ||
}-*/; | ||
|
||
@JsProperty | ||
public String type; | ||
public final native HTMLElement getTarget() /*-{ | ||
return this.target; | ||
}-*/; | ||
|
||
@JsProperty | ||
public JavaScriptObject target; | ||
|
||
|
||
|
||
} |
Oops, something went wrong.