-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
483 lines (380 loc) · 12 KB
/
__init__.py
File metadata and controls
483 lines (380 loc) · 12 KB
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
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
from __future__ import print_function
__all__ = [
"DesktopManager",
"Icon",
"JComponent",
"JDesktopPane",
"JFrame",
"JInternalFrame",
"JLabel",
"JLayeredPane",
"JOptionPane",
"JPanel",
"JPasswordField",
"JPopupMenu",
"JRootPane",
"JTextField",
"JToolTip",
"RootPaneContainer",
]
import array
import warnings
from typing import Any, List, Optional, Union
from java.awt import Component, Container, Frame, Graphics
from java.util import Locale
from javax.swing.event import AncestorListener
from javax.swing.plaf import DesktopPaneUI
from javax.swing.text import JTextComponent
class DesktopManager(object):
def activateFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def beginDragginFrame(self, f):
# type: (JComponent) -> None
raise NotImplementedError
def beginResizingFrame(self, f, direction):
# type: (JComponent, int) -> None
raise NotImplementedError
def closeFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def deactivateFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def deiconifyFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def dragFrame(self, f, newX, newY):
# type: (JComponent, int, int) -> None
raise NotImplementedError
def endDraggingFrame(self, f):
# type: (JComponent) -> None
raise NotImplementedError
def endResizing(self, f):
# type: (JComponent) -> None
raise NotImplementedError
def iconifyFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def maximizeFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def minimizeFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def openFrame(self, f):
# type: (JInternalFrame) -> None
raise NotImplementedError
def resizeFrame(self, f, newX, newY, newWidth, newHeight):
# type: (JComponent, int, int, int, int) -> None
raise NotImplementedError
def setBoundsForFrame(self, f, newX, newY, newWidth, newHeight):
# type: (JComponent, int, int, int, int) -> None
raise NotImplementedError
class Icon(object):
def getIconHeight(self):
# type: () -> int
raise NotImplementedError
def getIconWidth(self):
# type: () -> int
raise NotImplementedError
def paintIcon(self, c, g, x, y):
# type: (Component, Graphics, int, int) -> None
raise NotImplementedError
class RootPaneContainer(object):
def getContentPane(self):
# type: () -> Container
raise NotImplementedError
def getGlassPane(self):
# type: () -> Component
raise NotImplementedError
def getLayeredPane(self):
# type: () -> JLayeredPane
raise NotImplementedError
def getRootPane(self):
# type: () -> JRootPane
raise NotImplementedError
def setContentPane(self, contentPane):
# type: (Container) -> None
raise NotImplementedError
def setGlassPane(self, glassPane):
# type: (Component) -> None
raise NotImplementedError
def setLayeredPane(self, rootPane):
# type: (JLayeredPane) -> None
raise NotImplementedError
class JComponent(Container):
TOOL_TIP_TEXT_KEY = None # type: Union[str, unicode]
UNDEFINED_CONDITION = None # type: int
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT = None # type: int
WHEN_FOCUSED = None # type: int
WHEN_IN_FOCUSED_WINDOW = None # type: int
def __init__(self):
# type: () -> None
super(JComponent, self).__init__()
def addAncestorListener(self, listener):
# type: (AncestorListener) -> None
pass
def addNotify(self):
# type: () -> None
pass
def createToolTip(self):
# type: () -> JToolTip
pass
@staticmethod
def getDefaultLocale():
# type: () -> Locale
pass
@staticmethod
def isLightweightComponent(c):
# type: (Component) -> bool
return True
@staticmethod
def setDefaultLocale(l):
# type: (Locale) -> None
pass
class JFrame(Frame):
def __init__(self, *args):
# type: (*Any) -> None
super(JFrame, self).__init__(*args)
class JInternalFrame(JComponent):
def __init__(
self,
title=None, # type: Union[str, unicode, None]
resizable=None, # type: Optional[bool]
closable=None, # type: Optional[bool]
maximizable=None, # type: Optional[bool]
iconifiable=None, # type: Optional[bool]
):
# type: (...) -> None
super(JInternalFrame, self).__init__()
print(title, resizable, closable, maximizable, iconifiable)
class JLabel(JComponent):
"""A display area for a short text string or an image, or both."""
def __init__(self, *args):
# type: (*Any) -> None
super(JLabel, self).__init__()
print(args)
class JLayeredPane(JComponent):
DEFAULT_LAYER = 0
DRAG_LAYER = 400
FRAME_CONTENT_LAYER = -30000
LAYER_PROPERTY = "layeredContainerLayer"
MODAL_LAYER = 200
PALETTE_LAYER = 100
POPUP_LAYER = 300
def __init__(self):
# type: () -> None
super(JLayeredPane, self).__init__()
def getComponentCountInLayer(self, layer):
# type: (int) -> int
pass
def getLayer(self, c):
# type: (Component) -> int
pass
def highestLayer(self):
# type: () -> int
pass
def lowestLayer(self):
# type: () -> int
pass
def setPosition(self, c, position):
# type: (Component, int) -> None
pass
class JDesktopPane(JLayeredPane):
LIVE_DRAG_MODE = None # type: int
OUTLINE_DRAG_MODE = None # type: int
def __init__(self):
# type: () -> None
super(JDesktopPane, self).__init__()
def getAllFrames(self):
# type: () -> List[JInternalFrame]
pass
def getAllFramesInLayer(self, layer):
# type: (int) -> List[JInternalFrame]
pass
def getDesktopManager(self):
# type: () -> DesktopManager
pass
def getDragMode(self):
# type: () -> int
pass
def getSelectedFrame(self):
# type: () -> JInternalFrame
pass
def getUI(self):
# type: () -> DesktopPaneUI
pass
def getUIClassID(self):
# type: () -> Union[str, unicode]
pass
def updateUI(self):
# type: () -> None
pass
class JOptionPane(JComponent):
"""JOptionPane makes it easy to pop up a standard dialog box that
prompts users for a value or informs them of something.
For information about using JOptionPane, see How to Make Dialogs, a
section in The Java Tutorial.
"""
# messageType.
PLAIN_MESSAGE = -1
ERROR_MESSAGE = 0
INFORMATION_MESSAGE = 1
WARNING_MESSAGE = 2
QUESTION_MESSAGE = 3
# optionType.
DEFAULT_OPTION = -1
YES_NO_OPTION = 0
YES_NO_CANCEL_OPTION = 1
OK_CANCEL_OPTION = 2
# When one of the showXxxDialog methods returns an integer, the
# possible values are:
CLOSED_OPTION = -1
OK_OPTION = 0
YES_OPTION = 0
NO_OPTION = 1
CANCEL_OPTION = 2
@staticmethod
def showConfirmDialog(
parentComponent, # type: Optional[Any]
message, # type: Any
title=None, # type: Union[str, unicode, None]
optionType=None, # type: Optional[int]
messageType=None, # type: Optional[int]
icon=None, # type: Optional[Icon]
):
# type: (...) -> int
print(parentComponent, message, title, optionType, messageType, icon)
return JOptionPane.YES_OPTION
@staticmethod
def showInputDialog(
parentComponent, # type: Optional[Any]
message, # type: Any
title=None, # type: Union[str, unicode, None]
messageType=None, # type: Optional[int]
icon=None, # type: Optional[Icon]
selectionValues=None, # type: Optional[List[Any]]
initialSelectionValue=None, # type: Optional[Any]
):
# type: (...) -> Union[str, unicode]
print(
parentComponent,
message,
title,
messageType,
icon,
selectionValues,
initialSelectionValue,
)
return "Input"
@staticmethod
def showMessageDialog(
parentComponent, # type: Optional[Any]
message, # type: Any
title=None, # type: Union[str, unicode, None]
messageType=None, # type: Optional[int]
icon=None, # type: Optional[Icon]
):
# type: (...) -> None
print(parentComponent, message, title, messageType, icon)
@staticmethod
def showOptionDialog(
parentComponent, # type: Optional[Any]
message, # type: Any
title=None, # type: Union[str, unicode, None]
optionType=None, # type: Optional[int]
messageType=None, # type: Optional[int]
icon=None, # type: Optional[Icon]
options=None, # type: Optional[List[Any]]
initialValue=None, # type: Optional[Any]
):
# type: (...) -> int
print(
parentComponent,
message,
title,
optionType,
messageType,
icon,
options,
initialValue,
)
return JOptionPane.YES_OPTION
class JPanel(JComponent):
def __init__(self, *args):
# type: (*Any) -> None
super(JPanel, self).__init__()
print(args)
class JToolTip(JComponent):
def __init__(self):
# type: () -> None
super(JToolTip, self).__init__()
def getComponent(self):
# type: () -> JComponent
pass
def getTipText(self):
# type: () -> Union[str, unicode]
pass
class JPopupMenu(JComponent):
"""An implementation of a popup menu -- a small window that pops up
and displays a series of choices.
A JPopupMenu is used for the menu that appears when the user selects
an item on the menu bar. It is also used for "pull-right" menu that
appears when the selects a menu item that activates it. Finally, a
JPopupMenu can also be used anywhere else you want a menu to appear.
For example, when the user right-clicks in a specified area.
"""
def __init__(self, label=None):
# type: (Union[str, unicode, None]) -> None
super(JPopupMenu, self).__init__()
print(label)
class JRootPane(JComponent):
"""A lightweight container used behind the scenes by JFrame,
JDialog, JWindow, JApplet, and JInternalFrame.
"""
def __init__(self):
# type: () -> None
super(JRootPane, self).__init__()
class JTextField(JTextComponent):
"""JTextField is a lightweight component that allows the editing of
a single line of text.
"""
def __init__(self, *args):
# type: (*Any) -> None
super(JTextField, self).__init__()
class JPasswordField(JTextField):
def __init__(self, *args):
# type: (*Any) -> None
super(JPasswordField, self).__init__(*args)
def copy(self):
# type: () -> None
pass
def cut(self):
# type: () -> None
pass
def echoCharIsSet(self):
# type: () -> bool
return True
def getEchoChar(self):
# type: () -> Union[str, unicode]
pass
def getPassword(self):
# type: () -> Any
return array.array("c", "password")
def getText(self, *args):
# type: (*int) -> unicode
warnings.warn(
"As of Java 2 platform v1.2, replaced by getPassword.",
DeprecationWarning,
)
return unicode("password")
def getUIClassID(self):
# type: () -> Union[str, unicode]
pass
def setEchoChar(self, c):
# type: (Union[str, unicode]) -> None
pass
def updateUI(self):
# type: () -> None
pass