@@ -116,37 +116,6 @@ public static Optional<AutoScaleMethod> forString(String s) {
116
116
autoScaleMethod = AUTO_SCALE_METHOD_SETTING != AutoScaleMethod .AUTO ? AUTO_SCALE_METHOD_SETTING : AutoScaleMethod .NEAREST ;
117
117
}
118
118
119
- /**
120
- * Auto-scale down ImageData
121
- */
122
- public static ImageData autoScaleDown (Device device , final ImageData imageData ) {
123
- if (deviceZoom == 100 || imageData == null || (device != null && !device .isAutoScalable ())) return imageData ;
124
- float scaleFactor = 1.0f / getScalingFactor (deviceZoom );
125
- return autoScaleImageData (device , imageData , scaleFactor );
126
- }
127
-
128
- public static int [] autoScaleDown (int [] pointArray ) {
129
- if (deviceZoom == 100 || pointArray == null ) return pointArray ;
130
- float scaleFactor = getScalingFactor (deviceZoom );
131
- int [] returnArray = new int [pointArray .length ];
132
- for (int i = 0 ; i < pointArray .length ; i ++) {
133
- returnArray [i ] = Math .round (pointArray [i ] / scaleFactor );
134
- }
135
- return returnArray ;
136
- }
137
-
138
- public static int [] autoScaleDown (Drawable drawable , int [] pointArray ) {
139
- if (drawable != null && !drawable .isAutoScalable ()) return pointArray ;
140
- return autoScaleDown (pointArray );
141
- }
142
-
143
- /**
144
- * Auto-scale down float array dimensions.
145
- */
146
- public static float [] autoScaleDown (float size []) {
147
- return scaleDown (size , deviceZoom );
148
- }
149
-
150
119
public static float [] scaleDown (float size [], int zoom ) {
151
120
if (zoom == 100 || size == null ) return size ;
152
121
float scaleFactor = getScalingFactor (zoom );
@@ -157,75 +126,33 @@ public static float[] scaleDown(float size[], int zoom) {
157
126
return scaledSize ;
158
127
}
159
128
160
- /**
161
- * Auto-scale down float array dimensions if enabled for Drawable class.
162
- */
163
- public static float [] autoScaleDown (Drawable drawable , float size []) {
164
- return scaleDown (drawable , size , deviceZoom );
165
- }
166
-
167
129
public static float [] scaleDown (Drawable drawable , float size [], int zoom ) {
168
130
if (drawable != null && !drawable .isAutoScalable ()) return size ;
169
131
return scaleDown (size , zoom );
170
132
}
171
133
172
- /**
173
- * Auto-scale down int dimensions.
174
- */
175
- public static int autoScaleDown (int size ) {
176
- return scaleDown (size , deviceZoom );
177
- }
178
-
179
134
public static int scaleDown (int size , int zoom ) {
180
135
if (zoom == 100 || size == SWT .DEFAULT ) return size ;
181
136
float scaleFactor = getScalingFactor (zoom );
182
137
return Math .round (size / scaleFactor );
183
138
}
184
139
185
- /**
186
- * Auto-scale down int dimensions if enabled for Drawable class.
187
- */
188
- public static int autoScaleDown (Drawable drawable , int size ) {
189
- return scaleDown (drawable , size , deviceZoom );
190
- }
191
-
192
140
public static int scaleDown (Drawable drawable , int size , int zoom ) {
193
141
if (drawable != null && !drawable .isAutoScalable ()) return size ;
194
142
return scaleDown (size , zoom );
195
143
}
196
144
197
- /**
198
- * Auto-scale down float dimensions.
199
- */
200
- public static float autoScaleDown (float size ) {
201
- return scaleDown (size , deviceZoom );
202
- }
203
-
204
145
public static float scaleDown (float size , int zoom ) {
205
146
if (zoom == 100 || size == SWT .DEFAULT ) return size ;
206
147
float scaleFactor = getScalingFactor (zoom );
207
148
return (size / scaleFactor );
208
149
}
209
150
210
- /**
211
- * Auto-scale down float dimensions if enabled for Drawable class.
212
- */
213
- public static float autoScaleDown (Drawable drawable , float size ) {
214
- return scaleDown (drawable , size , deviceZoom );
215
- }
216
-
217
151
public static float scaleDown (Drawable drawable , float size , int zoom ) {
218
152
if (drawable != null && !drawable .isAutoScalable ()) return size ;
219
153
return scaleDown (size , zoom );
220
154
}
221
155
222
- /**
223
- * Returns a new scaled down Point.
224
- */
225
- public static Point autoScaleDown (Point point ) {
226
- return scaleDown (point , deviceZoom );
227
- }
228
-
229
156
public static Point scaleDown (Point point , int zoom ) {
230
157
if (zoom == 100 || point == null ) return point ;
231
158
Point .OfFloat fPoint = FloatAwareGeometryFactory .createFrom (point );
@@ -235,35 +162,14 @@ public static Point scaleDown(Point point, int zoom) {
235
162
return new Point .OfFloat (scaledX , scaledY );
236
163
}
237
164
238
- /**
239
- * Returns a new scaled down Point if enabled for Drawable class.
240
- */
241
- public static Point autoScaleDown (Drawable drawable , Point point ) {
242
- return scaleDown (drawable , point , deviceZoom );
243
- }
244
-
245
165
public static Point scaleDown (Drawable drawable , Point point , int zoom ) {
246
166
if (drawable != null && !drawable .isAutoScalable ()) return point ;
247
167
return scaleDown (point , zoom );
248
168
}
249
169
250
- /**
251
- * Returns a new scaled down Rectangle.
252
- */
253
- public static Rectangle autoScaleDown (Rectangle rect ) {
254
- return scaleDown (rect , deviceZoom );
255
- }
256
-
257
170
public static Rectangle scaleDown (Rectangle rect , int zoom ) {
258
171
return scaleBounds (rect , 100 , zoom );
259
172
}
260
- /**
261
- * Returns a new scaled down Rectangle if enabled for Drawable class.
262
- */
263
- public static Rectangle autoScaleDown (Drawable drawable , Rectangle rect ) {
264
- if (drawable != null && !drawable .isAutoScalable ()) return rect ;
265
- return scaleDown (rect , deviceZoom );
266
- }
267
173
268
174
public static Rectangle scaleDown (Drawable drawable , Rectangle rect , int zoom ) {
269
175
if (drawable != null && !drawable .isAutoScalable ()) return rect ;
@@ -342,17 +248,6 @@ public static ImageData autoScaleImageData (Device device, final ImageData image
342
248
return autoScaleImageData (device , imageData , scaleFactor );
343
249
}
344
250
345
- /**
346
- * Auto-scale up ImageData to device zoom that is at 100%.
347
- */
348
- public static ImageData autoScaleUp (Device device , final ImageData imageData ) {
349
- return autoScaleImageData (device , imageData , 100 );
350
- }
351
-
352
- public static int [] autoScaleUp (int [] pointArray ) {
353
- return scaleUp (pointArray , deviceZoom );
354
- }
355
-
356
251
public static int [] scaleUp (int [] pointArray , int zoom ) {
357
252
if (zoom == 100 || pointArray == null ) return pointArray ;
358
253
float scaleFactor = getScalingFactor (zoom );
@@ -363,20 +258,10 @@ public static int[] scaleUp(int[] pointArray, int zoom) {
363
258
return returnArray ;
364
259
}
365
260
366
- public static int [] autoScaleUp (Drawable drawable , int [] pointArray ) {
367
- return scaleUp (drawable , pointArray , deviceZoom );
368
- }
369
-
370
261
public static int [] scaleUp (Drawable drawable , int [] pointArray , int zoom ) {
371
262
if (drawable != null && !drawable .isAutoScalable ()) return pointArray ;
372
263
return scaleUp (pointArray , zoom );
373
264
}
374
- /**
375
- * Auto-scale up int dimensions.
376
- */
377
- public static int autoScaleUp (int size ) {
378
- return scaleUp (size , deviceZoom );
379
- }
380
265
381
266
/**
382
267
* Auto-scale up int dimensions to match the given zoom level
@@ -387,44 +272,22 @@ public static int scaleUp(int size, int zoom) {
387
272
return Math .round (size * scaleFactor );
388
273
}
389
274
390
- /**
391
- * Auto-scale up int dimensions if enabled for Drawable class.
392
- */
393
- public static int autoScaleUp (Drawable drawable , int size ) {
394
- return scaleUp (drawable , size , deviceZoom );
395
- }
396
-
397
275
public static int scaleUp (Drawable drawable , int size , int zoom ) {
398
276
if (drawable != null && !drawable .isAutoScalable ()) return size ;
399
277
return scaleUp (size , zoom );
400
278
}
401
279
402
- public static float autoScaleUp (float size ) {
403
- return scaleUp (size , deviceZoom );
404
- }
405
-
406
280
public static float scaleUp (float size , int zoom ) {
407
281
if (zoom == 100 || size == SWT .DEFAULT ) return size ;
408
282
float scaleFactor = getScalingFactor (zoom );
409
283
return (size * scaleFactor );
410
284
}
411
285
412
- public static float autoScaleUp (Drawable drawable , float size ) {
413
- return scaleUp (drawable , size , deviceZoom );
414
- }
415
-
416
286
public static float scaleUp (Drawable drawable , float size , int zoom ) {
417
287
if (drawable != null && !drawable .isAutoScalable ()) return size ;
418
288
return scaleUp (size , zoom );
419
289
}
420
290
421
- /**
422
- * Returns a new scaled up Point.
423
- */
424
- public static Point autoScaleUp (Point point ) {
425
- return scaleUp (point , deviceZoom );
426
- }
427
-
428
291
public static Point scaleUp (Point point , int zoom ) {
429
292
if (zoom == 100 || point == null ) return point ;
430
293
Point .OfFloat fPoint = FloatAwareGeometryFactory .createFrom (point );
@@ -434,36 +297,15 @@ public static Point scaleUp(Point point, int zoom) {
434
297
return new Point .OfFloat (scaledX , scaledY );
435
298
}
436
299
437
- /**
438
- * Returns a new scaled up Point if enabled for Drawable class.
439
- */
440
- public static Point autoScaleUp (Drawable drawable , Point point ) {
441
- return scaleUp (drawable , point , deviceZoom );
442
- }
443
-
444
300
public static Point scaleUp (Drawable drawable , Point point , int zoom ) {
445
301
if (drawable != null && !drawable .isAutoScalable ()) return point ;
446
302
return scaleUp (point , zoom );
447
303
}
448
304
449
- /**
450
- * Returns a new scaled up Rectangle.
451
- */
452
- public static Rectangle autoScaleUp (Rectangle rect ) {
453
- return scaleUp (rect , deviceZoom );
454
- }
455
-
456
305
public static Rectangle scaleUp (Rectangle rect , int zoom ) {
457
306
return scaleBounds (rect , zoom , 100 );
458
307
}
459
308
460
- /**
461
- * Returns a new scaled up Rectangle if enabled for Drawable class.
462
- */
463
- public static Rectangle autoScaleUp (Drawable drawable , Rectangle rect ) {
464
- return scaleUp (drawable , rect , deviceZoom );
465
- }
466
-
467
309
public static Rectangle scaleUp (Drawable drawable , Rectangle rect , int zoom ) {
468
310
if (drawable != null && !drawable .isAutoScalable ()) return rect ;
469
311
return scaleUp (rect , zoom );
0 commit comments