2
2
3
3
import com .arrayfire .Graphics .ColorMap ;
4
4
import com .arrayfire .Graphics .MarkerType ;
5
- import com .sun .tools .jdeps .Graph ;
6
-
7
- import jdk .jfr .Unsigned ;
8
5
9
6
public class Window implements AutoCloseable {
10
7
@@ -13,41 +10,41 @@ public class Window implements AutoCloseable {
13
10
private int c ;
14
11
private ColorMap cmap ;
15
12
16
- public Window () {
13
+ public Window () throws Exception {
17
14
ref = 0 ;
18
15
r = c = -1 ;
19
16
cmap = ColorMap .DEFAULT ;
20
17
initWindow (1280 , 720 , "ArrayFire" );
21
18
}
22
19
23
- public Window (String title ) {
20
+ public Window (String title ) throws Exception {
24
21
ref = 0 ;
25
22
r = c = -1 ;
26
23
cmap = ColorMap .DEFAULT ;
27
24
initWindow (1280 , 720 , title );
28
25
}
29
26
30
- public Window (int width , int height , String title ) {
27
+ public Window (int width , int height , String title ) throws Exception {
31
28
ref = 0 ;
32
29
r = c = -1 ;
33
30
cmap = ColorMap .DEFAULT ;
34
31
initWindow (width , height , title );
35
32
}
36
33
37
- public Window (int width , int height ) {
34
+ public Window (int width , int height ) throws Exception {
38
35
ref = 0 ;
39
36
r = c = -1 ;
40
37
cmap = ColorMap .DEFAULT ;
41
38
initWindow (width , height , "ArrayFire" );
42
39
}
43
40
44
- public Window (long ref ) {
41
+ public Window (long ref ) throws Exception {
45
42
this .ref = ref ;
46
43
r = c = -1 ;
47
44
cmap = ColorMap .DEFAULT ;
48
45
}
49
46
50
- private void initWindow (int width , int height , String title ) {
47
+ private void initWindow (int width , int height , String title ) throws Exception {
51
48
ref = Graphics .afInitWindow (width , height , title );
52
49
}
53
50
@@ -58,15 +55,15 @@ protected void set(long ref) {
58
55
this .ref = ref ;
59
56
}
60
57
61
- public void setPos (@ Unsigned int x , @ Unsigned int y ) {
58
+ public void setPos (int x , int y ) {
62
59
Graphics .afSetPos (ref , x , y );
63
60
}
64
61
65
62
public void setTitle (String title ) {
66
63
Graphics .afSetTitle (ref , title );
67
64
}
68
65
69
- public void setSize (@ Unsigned int w , @ Unsigned int h ) {
66
+ public void setSize (int w , int h ) {
70
67
Graphics .afSetSize (ref , w , h );
71
68
}
72
69
@@ -107,22 +104,27 @@ public void hist(final Array in, double min, double max, String title) {
107
104
}
108
105
109
106
public void surface (final Array xVals , final Array yVals , final Array s , String title ) {
110
- Graphics .afDrawSurface (ref , s .ref , x .ref , y .ref , r , c , title );
107
+ Graphics .afDrawSurface (ref , s .ref , xVals .ref , yVals .ref , r , c , title );
111
108
}
112
109
113
110
public void vectorField (final Array points , final Array directions , String title ) {
114
111
Graphics .afDrawVectorFieldnd (ref , points .ref , directions .ref , r , c , title );
115
112
}
116
113
117
- public void vectorField (final Array xPoints , final Array yPoints , final Array xDirections , final Array yDirections ,
114
+ public void vectorField (final Array xPoints , final Array yPoints ,
115
+ final Array xDirections , final Array yDirections ,
118
116
String title ) {
119
- Graphics .afDrawVectorField2d (ref , xPoints .ref , yPoints .ref , xDirections .ref , yDirections .ref , r , c , title );
117
+ Graphics .afDrawVectorField2d (ref , xPoints .ref , yPoints .ref ,
118
+ xDirections .ref , yDirections .ref , r , c , title );
120
119
}
121
120
122
- public void vectorField (final Array xPoints , final Array yPoints , final Array zPoints , final Array xDirections ,
123
- final Array yDirections , final Array zDirections , String title ) {
124
- Graphics .afDrawVectorField3d (ref , xPoints .ref , yPoints .ref , zPoints .ref , xDirections .ref , yDirections .ref ,
125
- zDirections .ref , r , c , title );
121
+ public void vectorField (final Array xPoints , final Array yPoints ,
122
+ final Array zPoints , final Array xDirections ,
123
+ final Array yDirections , final Array zDirections ,
124
+ String title ) {
125
+ Graphics .afDrawVectorField3d (ref , xPoints .ref , yPoints .ref , zPoints .ref ,
126
+ xDirections .ref , yDirections .ref ,
127
+ zDirections .ref , r , c , title );
126
128
}
127
129
128
130
public void grid (int rows , int cols ) {
@@ -133,16 +135,20 @@ public void setAxesLimits(final Array x, final Array y, boolean isExact) {
133
135
Graphics .afSetAxesLimitsCompute (ref , x .ref , y .ref , 0 , isExact , r , c );
134
136
}
135
137
136
- public void setAxesLimits (final Array x , final Array y , final Array z , boolean isExact ) {
138
+ public void setAxesLimits (final Array x , final Array y , final Array z ,
139
+ boolean isExact ) {
137
140
Graphics .afSetAxesLimitsCompute (ref , x .ref , y .ref , z .ref , isExact , r , c );
138
141
}
139
142
140
- public void setAxesLimits (float xMin , float xMax , float yMin , float yMax , boolean isExact ) {
143
+ public void setAxesLimits (float xMin , float xMax , float yMin , float yMax ,
144
+ boolean isExact ) {
141
145
Graphics .afSetAxesLimits2d (ref , xMin , xMax , yMin , yMax , isExact , r , c );
142
146
}
143
147
144
- public void setAxesLimits (float xMin , float xMax , float yMin , float yMax , float zMin , float zMax , boolean isExact ) {
145
- Graphics .afSetAxesLimits3d (ref , xMin , xMax , yMin , yMax , zMin , zMax , isExact , r , c );
148
+ public void setAxesLimits (float xMin , float xMax , float yMin , float yMax ,
149
+ float zMin , float zMax , boolean isExact ) {
150
+ Graphics .afSetAxesLimits3d (ref , xMin , xMax , yMin , yMax , zMin , zMax , isExact ,
151
+ r , c );
146
152
}
147
153
148
154
public void setAxesTitles (String xTitle , String yTitle , String zTitle ) {
0 commit comments