/
DummyToolkit.java
423 lines (351 loc) · 13.8 KB
/
DummyToolkit.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
/*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javafx.tk;
import javafx.geometry.Dimension2D;
import javafx.scene.image.Image;
import javafx.scene.input.Dragboard;
import javafx.scene.input.InputMethodRequests;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.TransferMode;
import javafx.scene.paint.Color;
import javafx.scene.paint.ImagePattern;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.RadialGradient;
import javafx.scene.shape.PathElement;
import javafx.scene.shape.SVGPath;
import javafx.scene.shape.StrokeLineCap;
import javafx.scene.shape.StrokeLineJoin;
import javafx.scene.shape.StrokeType;
import javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.Window;
import java.io.File;
import java.io.InputStream;
import java.security.AccessControlContext;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
import com.sun.glass.ui.CommonDialogs.FileChooserResult;
import com.sun.glass.ui.GlassRobot;
import com.sun.javafx.embed.HostInterface;
import com.sun.javafx.geom.Path2D;
import com.sun.javafx.geom.Shape;
import com.sun.javafx.geom.transform.BaseTransform;
import com.sun.javafx.perf.PerformanceTracker;
import com.sun.javafx.runtime.async.AsyncOperation;
import com.sun.javafx.runtime.async.AsyncOperationListener;
import com.sun.javafx.scene.text.TextLayoutFactory;
import com.sun.scenario.DelayedRunnable;
import com.sun.scenario.animation.AbstractPrimaryTimer;
import com.sun.scenario.effect.FilterContext;
import com.sun.scenario.effect.Filterable;
import java.util.Optional;
/**
* A stubbed out Toolkit that provides no useful implementation. This is used
* by the build to run the CSS to binary converter. The parser uses
* PlatformLogger which requires a Toolkit.
*
*/
final public class DummyToolkit extends Toolkit {
@Override
public boolean init() {
return true;
}
@Override
public boolean canStartNestedEventLoop() {
return false;
}
@Override
public Object enterNestedEventLoop(Object key) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void exitNestedEventLoop(Object key, Object rval) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void exitAllNestedEventLoops() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public TKStage createTKStage(Window peerWindow, boolean securityDialog, StageStyle stageStyle, boolean primary, Modality modality, TKStage owner, boolean rtl, AccessControlContext acc) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public TKStage createTKPopupStage(Window peerWindow, StageStyle popupStyle, TKStage owner, AccessControlContext acc) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public TKStage createTKEmbeddedStage(HostInterface host, AccessControlContext acc) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public AppletWindow createAppletWindow(long parent, String serverName) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void closeAppletWindow() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public TKSystemMenu getSystemMenu() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ImageLoader loadImage(String url, double width, double height, boolean preserveRatio, boolean smooth) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ImageLoader loadImage(InputStream stream, double width, double height, boolean preserveRatio, boolean smooth) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public AsyncOperation loadImageAsync(AsyncOperationListener<? extends ImageLoader> listener, String url, double width, double height, boolean preserveRatio, boolean smooth) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ImageLoader loadPlatformImage(Object platformImage) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public PlatformImage createPlatformImage(int w, int h) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void startup(Runnable runnable) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void defer(Runnable runnable) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Future addRenderJob(RenderJob rj) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Map<Object, Object> getContextMap() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int getRefreshRate() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void setAnimationRunnable(DelayedRunnable animationRunnable) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public PerformanceTracker getPerformanceTracker() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override public PerformanceTracker createPerformanceTracker() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void waitFor(Task t) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected Object createColorPaint(Color paint) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected Object createLinearGradientPaint(LinearGradient paint) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected Object createRadialGradientPaint(RadialGradient paint) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected Object createImagePatternPaint(ImagePattern paint) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void accumulateStrokeBounds(Shape shape, float[] bbox, StrokeType type, double strokewidth, StrokeLineCap cap, StrokeLineJoin join, float miterLimit, BaseTransform tx) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean strokeContains(Shape shape, double x, double y, StrokeType type, double strokewidth, StrokeLineCap cap, StrokeLineJoin join, float miterLimit) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Shape createStrokedShape(Shape shape, StrokeType pgtype, double strokewidth, StrokeLineCap pgcap, StrokeLineJoin pgjoin, float miterLimit, float[] dashArray, float dashOffset) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int getKeyCodeForChar(String character) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Dimension2D getBestCursorSize(int preferredWidth, int preferredHeight) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int getMaximumCursorColors() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public PathElement[] convertShapeToFXPath(Object shape) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Filterable toFilterable(Image img) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public FilterContext getFilterContext(Object config) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean isForwardTraversalKey(KeyEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean isBackwardTraversalKey(KeyEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean isNestedLoopRunning() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public AbstractPrimaryTimer getPrimaryTimer() {
return null;
}
@Override
public FontLoader getFontLoader() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public TextLayoutFactory getTextLayoutFactory() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Object createSVGPathObject(SVGPath svgpath) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Path2D createSVGPath2D(SVGPath svgpath) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean imageContains(Object image, float x, float y) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public com.sun.javafx.tk.TKClipboard getSystemClipboard() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public TKClipboard getNamedClipboard(String name) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ScreenConfigurationAccessor setScreenConfigurationListener(TKScreenConfigurationListener listener) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Object getPrimaryScreen() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<?> getScreens() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ScreenConfigurationAccessor getScreenConfigurationAccessor() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void registerDragGestureListener(TKScene s, Set<TransferMode> tms, TKDragGestureListener l) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void startDrag(TKScene scene, Set<TransferMode> tms, TKDragSourceListener l, Dragboard dragboard) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void enableDrop(TKScene s, TKDropTargetListener l) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void installInputMethodRequests(TKScene scene, InputMethodRequests requests) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Object renderToImage(ImageRenderingContext context) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public KeyCode getPlatformShortcutKey() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Optional<Boolean> isKeyLocked(KeyCode keyCode) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public FileChooserResult showFileChooser(TKStage ownerWindow,
String title,
File initialDirectory,
String initialFileName,
FileChooserType fileChooserType,
List<ExtensionFilter> extensionFilters,
ExtensionFilter selectedFilter) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public File showDirectoryChooser(TKStage ownerWindow,
String title,
File initialDirectory) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public long getMultiClickTime() {
return 0L;
}
@Override
public int getMultiClickMaxX() {
return 0;
}
@Override
public int getMultiClickMaxY() {
return 0;
}
@Override
public void requestNextPulse() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public GlassRobot createRobot() {
throw new UnsupportedOperationException("not implemented");
}
}