File tree 8 files changed +34
-35
lines changed
main/java/com/github/timeu/gwtlibs/ldviewer/client
test/java/com/github/timeu/gwtlibs/ldviewer/client
src/main/java/sample/client
8 files changed +34
-35
lines changed Original file line number Diff line number Diff line change 48
48
<dependency >
49
49
<groupId >com.google.gwt</groupId >
50
50
<artifactId >gwt-dev</artifactId >
51
- <scope >provided</scope >
52
51
</dependency >
53
52
<dependency >
54
53
<groupId >com.github.timeu.gwt-libs.ldviewer</groupId >
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ private void zoom(boolean isZoomIn) {
160
160
}
161
161
162
162
private String getMsgFromDataPoint (LDDataPoint data ) {
163
- return "x:" + data .getPosX () + ", y:" + data .getPosY () + ",r2:" + data .getR2 () ;
163
+ return "x:" + data .posX + ", y:" + data .posY + ",r2:" + data .r2 ;
164
164
}
165
165
166
166
private void sinkEvents () {
Original file line number Diff line number Diff line change 1
1
package com .github .timeu .gwtlibs .ldviewer .client ;
2
2
3
3
4
- import com .google .gwt .core .client .js .JsProperty ;
5
- import com .google .gwt .core .client .js .JsType ;
4
+ import jsinterop .annotations .JsPackage ;
5
+ import jsinterop .annotations .JsProperty ;
6
+ import jsinterop .annotations .JsType ;
6
7
7
- @ JsType
8
+ @ JsType ( isNative = true , namespace = JsPackage . GLOBAL , name = "Object" )
8
9
public interface LDData {
9
10
10
- @ JsProperty int [] getPositions ();
11
+ @ JsProperty
12
+ int [] getPositions ();
11
13
@ JsProperty float [][] getR2 ();
12
14
@ JsProperty int getStart ();
13
15
@ JsProperty int getEnd ();
Original file line number Diff line number Diff line change 1
1
package com .github .timeu .gwtlibs .ldviewer .client ;
2
2
3
3
4
- import com .google .gwt .core .client .js .JsProperty ;
5
- import com .google .gwt .core .client .js .JsType ;
4
+ import jsinterop .annotations .JsOverlay ;
5
+ import jsinterop .annotations .JsPackage ;
6
+ import jsinterop .annotations .JsProperty ;
7
+ import jsinterop .annotations .JsType ;
6
8
7
- @ JsType
8
- public interface LDDataPoint {
9
+ @ JsType ( isNative = true , namespace = JsPackage . GLOBAL , name = "Object" )
10
+ public class LDDataPoint {
9
11
12
+ public double r2 ;
10
13
11
- @ JsProperty double getR2 () ;
14
+ public int posX ;
12
15
13
- @ JsProperty void setR2 (double r2 );
14
-
15
- @ JsProperty void setPosX (int posX );
16
-
17
- @ JsProperty int getPosX ();
16
+ public int posY ;
18
17
19
- @ JsProperty int getPosY ();
20
-
21
- @ JsProperty void setPosY (int posY );
22
-
23
- int getR2Color (double threshold ,int maxColor );
24
-
18
+ @ JsOverlay
19
+ public final int getR2Color (double threshold ,int maxColor ) {
20
+ return (int )Math .round ((1 - (r2 - threshold )/(1 -threshold ))*maxColor );
21
+ }
25
22
}
Original file line number Diff line number Diff line change 5
5
import com .google .gwt .core .client .JsArray ;
6
6
import com .google .gwt .core .client .JsArrayInteger ;
7
7
import com .google .gwt .core .client .JsArrayNumber ;
8
- import com . google . gwt . core . client . js .JsType ;
8
+ import jsinterop . annotations .JsType ;
9
9
10
10
import java .util .List ;
11
11
12
12
/**
13
13
* Created by uemit.seren on 8/12/15.
14
14
*/
15
- @ JsType
15
+ @ JsType ( isNative = true )
16
16
interface LDViewerInstance extends ProcessingInstance {
17
17
18
18
void api_setSize (int width , boolean isDraw );
Original file line number Diff line number Diff line change 1
1
package com .github .timeu .gwtlibs .ldviewer .client .event ;
2
2
3
- import com .google .gwt .core .client .js .JsFunction ;
3
+
4
+ import jsinterop .annotations .JsFunction ;
4
5
5
6
/**
6
7
* Created by uemit.seren on 8/11/15.
Original file line number Diff line number Diff line change @@ -223,11 +223,11 @@ public void testAddUnHighlightHandler() {
223
223
224
224
private LDDataPoint [] getFakeHighlightedPoints () {
225
225
LDDataPoint [] points = new LDDataPoint [1 ];
226
- LDDataPoint point1 = mock ( LDDataPoint . class );
227
- given ( point1 .getPosX ()). willReturn ( 1 ) ;
228
- given ( point1 .getPosY ()). willReturn ( 2 ) ;
229
- given ( point1 .getR2 ()). willReturn ( 0.5 ) ;
230
- given ( point1 . getR2Color ( anyDouble (), anyInt ())). willReturn ( 1 ) ;
226
+ LDDataPoint point1 = new LDDataPoint ( );
227
+ point1 .posX = 1 ;
228
+ point1 .posY = 2 ;
229
+ point1 .r2 = 0.5 ;
230
+ points [ 0 ] = point1 ;
231
231
return points ;
232
232
}
233
233
Original file line number Diff line number Diff line change 116
116
<plugin >
117
117
<groupId >net.ltgt.gwt.maven</groupId >
118
118
<artifactId >gwt-maven-plugin</artifactId >
119
- <version >1.0-rc-2 </version >
119
+ <version >1.0-rc-4 </version >
120
120
<extensions >true</extensions >
121
121
<configuration >
122
122
<devMode >false</devMode >
125
125
<arg >-runStyle</arg >
126
126
<arg >Manual:1</arg >
127
127
<arg >-XjsInteropMode</arg >
128
- <arg >JS </arg >
128
+ <arg >JS_RC </arg >
129
129
</testArgs >
130
130
<startupUrls >
131
131
<startupUrl >ldviewersample/index.html</startupUrl >
132
132
</startupUrls >
133
133
<compilerArgs >
134
134
<compilerArg >-XjsInteropMode</compilerArg >
135
- <compilerArg >JS </compilerArg >
135
+ <compilerArg >JS_RC </compilerArg >
136
136
</compilerArgs >
137
137
<devmodeArgs >
138
138
<arg >-XjsInteropMode</arg >
139
- <arg >JS </arg >
139
+ <arg >JS_RC </arg >
140
140
<devmodeArg >-incremental</devmodeArg >
141
141
</devmodeArgs >
142
142
<codeserverArgs >
143
143
<arg >-XjsInteropMode</arg >
144
- <arg >JS </arg >
144
+ <arg >JS_RC </arg >
145
145
<arg >-incremental</arg >
146
146
</codeserverArgs >
147
147
<moduleName >${gwt.module} </moduleName >
You can’t perform that action at this time.
0 commit comments