22
33import com .arrayfire .Graphics .ColorMap ;
44import com .arrayfire .Graphics .MarkerType ;
5- import com .sun .tools .jdeps .Graph ;
6-
7- import jdk .jfr .Unsigned ;
85
96public class Window implements AutoCloseable {
107
@@ -13,41 +10,41 @@ public class Window implements AutoCloseable {
1310 private int c ;
1411 private ColorMap cmap ;
1512
16- public Window () {
13+ public Window () throws Exception {
1714 ref = 0 ;
1815 r = c = -1 ;
1916 cmap = ColorMap .DEFAULT ;
2017 initWindow (1280 , 720 , "ArrayFire" );
2118 }
2219
23- public Window (String title ) {
20+ public Window (String title ) throws Exception {
2421 ref = 0 ;
2522 r = c = -1 ;
2623 cmap = ColorMap .DEFAULT ;
2724 initWindow (1280 , 720 , title );
2825 }
2926
30- public Window (int width , int height , String title ) {
27+ public Window (int width , int height , String title ) throws Exception {
3128 ref = 0 ;
3229 r = c = -1 ;
3330 cmap = ColorMap .DEFAULT ;
3431 initWindow (width , height , title );
3532 }
3633
37- public Window (int width , int height ) {
34+ public Window (int width , int height ) throws Exception {
3835 ref = 0 ;
3936 r = c = -1 ;
4037 cmap = ColorMap .DEFAULT ;
4138 initWindow (width , height , "ArrayFire" );
4239 }
4340
44- public Window (long ref ) {
41+ public Window (long ref ) throws Exception {
4542 this .ref = ref ;
4643 r = c = -1 ;
4744 cmap = ColorMap .DEFAULT ;
4845 }
4946
50- private void initWindow (int width , int height , String title ) {
47+ private void initWindow (int width , int height , String title ) throws Exception {
5148 ref = Graphics .afInitWindow (width , height , title );
5249 }
5350
@@ -58,15 +55,15 @@ protected void set(long ref) {
5855 this .ref = ref ;
5956 }
6057
61- public void setPos (@ Unsigned int x , @ Unsigned int y ) {
58+ public void setPos (int x , int y ) {
6259 Graphics .afSetPos (ref , x , y );
6360 }
6461
6562 public void setTitle (String title ) {
6663 Graphics .afSetTitle (ref , title );
6764 }
6865
69- public void setSize (@ Unsigned int w , @ Unsigned int h ) {
66+ public void setSize (int w , int h ) {
7067 Graphics .afSetSize (ref , w , h );
7168 }
7269
@@ -107,22 +104,27 @@ public void hist(final Array in, double min, double max, String title) {
107104 }
108105
109106 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 );
111108 }
112109
113110 public void vectorField (final Array points , final Array directions , String title ) {
114111 Graphics .afDrawVectorFieldnd (ref , points .ref , directions .ref , r , c , title );
115112 }
116113
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 ,
118116 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 );
120119 }
121120
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 );
126128 }
127129
128130 public void grid (int rows , int cols ) {
@@ -133,16 +135,20 @@ public void setAxesLimits(final Array x, final Array y, boolean isExact) {
133135 Graphics .afSetAxesLimitsCompute (ref , x .ref , y .ref , 0 , isExact , r , c );
134136 }
135137
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 ) {
137140 Graphics .afSetAxesLimitsCompute (ref , x .ref , y .ref , z .ref , isExact , r , c );
138141 }
139142
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 ) {
141145 Graphics .afSetAxesLimits2d (ref , xMin , xMax , yMin , yMax , isExact , r , c );
142146 }
143147
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 );
146152 }
147153
148154 public void setAxesTitles (String xTitle , String yTitle , String zTitle ) {
0 commit comments