This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incendium.gui: added warning, modified error. Added java.lang, and ja…
…vax.swing packages. Opting for JOptionPane over Ignition's own errorBox and warningBox.
- Loading branch information
1 parent
00de387
commit ff1c03e
Showing
5 changed files
with
224 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (C) 2018 | ||
# Author: Cesar Roman | ||
# Contact: thecesrom@gmail.com | ||
|
||
"""Java package.""" | ||
|
||
__all__ = [ | ||
'lang' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (C) 2018 | ||
# Author: Cesar Roman | ||
# Contact: thecesrom@gmail.com | ||
|
||
"""Provides classes that are fundamental to the design of the Java | ||
programming language.""" | ||
|
||
__all__ = [ | ||
'Exception' | ||
] | ||
|
||
|
||
class Exception(object): | ||
"""The class Exception and its subclasses are a form of Throwable | ||
that indicates conditions that a reasonable application might want | ||
to catch. | ||
The class Exception and any subclasses that are not also subclasses | ||
of RuntimeException are checked exceptions. Checked exceptions need | ||
to be declared in a method or constructor's throws clause if they | ||
can be thrown by the execution of the method or constructor and | ||
propagate outside the method or constructor boundary. | ||
""" | ||
|
||
# Static elements | ||
cause = '' | ||
|
||
def getCause(self): | ||
"""Returns the cause of this throwable or null if the cause is | ||
nonexistent or unknown. (The cause is the throwable that caused | ||
this throwable to get thrown.) | ||
Returns: | ||
str: The cause of this throwable or null if the cause is | ||
nonexistent or unknown. | ||
""" | ||
return self.cause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (C) 2018 | ||
# Author: Cesar Roman | ||
# Contact: thecesrom@gmail.com | ||
|
||
"""Package of standard Java extensions.""" | ||
|
||
__all__ = [ | ||
'swing' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Copyright (C) 2018 | ||
# Author: Cesar Roman | ||
# Contact: thecesrom@gmail.com | ||
|
||
"""Provides a set of "lightweight" (all-Java language) components | ||
that, to the maximum degree possible, work the same on all platforms.""" | ||
|
||
__all__ = [ | ||
'JOptionPane' | ||
] | ||
|
||
|
||
class JOptionPane(object): | ||
"""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. | ||
While the JOptionPane class may appear complex because of the large | ||
number of methods, almost all uses of this class are one-line calls | ||
to one of the static showXxxDialog methods shown below: | ||
""" | ||
# messageType. | ||
ERROR_MESSAGE = 0 | ||
INFORMATION_MESSAGE = 1 | ||
WARNING_MESSAGE = 2 | ||
QUESTION_MESSAGE = 3 | ||
PLAIN_MESSAGE = -1 | ||
|
||
# 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: | ||
YES_OPTION = 0 | ||
NO_OPTION = 1 | ||
CANCEL_OPTION = 2 | ||
OK_OPTION = 0 | ||
CLOSED_OPTION = -1 | ||
|
||
@staticmethod | ||
def showConfirmDialog(parentComponent, message, title=None, | ||
optionType=None, messageType=None, icon=None): | ||
"""Asks a confirming question, like yes/no/cancel. | ||
Args: | ||
parentComponent (Component): determines the Frame in which | ||
the dialog is displayed; if None, or if the | ||
parentComponent has no Frame, a default Frame is used. | ||
message (object): The object to display. | ||
title (str): The title string for the dialog. Optional. | ||
optionType (int): An int designating the options available | ||
on the dialog: YES_NO_OPTION, YES_NO_CANCEL_OPTION, | ||
or OK_CANCEL_OPTION. Optional. | ||
messageType (int): An integer designating the kind of | ||
message this is; primarily used to determine the icon | ||
from the pluggable Look and Feel: ERROR_MESSAGE, | ||
INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, | ||
or PLAIN_MESSAGE. Optional. | ||
icon (Icon): The icon to display in the dialog. Optional. | ||
Returns: | ||
int: An integer indicating the option selected by the user. | ||
""" | ||
pass | ||
|
||
@staticmethod | ||
def showInputDialog(parentComponent, message, title=None, | ||
messageType=None, icon=None, selectionValues=None, | ||
initialSelectionValue=None): | ||
"""Prompt for some input. | ||
Args: | ||
parentComponent (Component): determines the Frame in which | ||
the dialog is displayed; if None, or if the | ||
parentComponent has no Frame, a default Frame is used. | ||
message (object): The object to display. | ||
title (str): The title string for the dialog. Optional. | ||
messageType (int): The type of message to be displayed: | ||
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, | ||
QUESTION_MESSAGE, or PLAIN_MESSAGE. Optional. | ||
icon (Icon): The icon to display in the dialog. Optional. | ||
selectionValues (list): An array of Objects that gives the | ||
possible selections. Optional. | ||
initialSelectionValue (object): The value used to | ||
initialize the input field. Optional. | ||
Returns: | ||
object: An integer indicating the option selected by the | ||
user. | ||
""" | ||
pass | ||
|
||
@staticmethod | ||
def showMessageDialog(parentComponent, message, title=None, | ||
messageType=None, icon=None): | ||
"""Tell the user about something that has happened. | ||
Args: | ||
parentComponent (Component): determines the Frame in which | ||
the dialog is displayed; if None, or if the | ||
parentComponent has no Frame, a default Frame is used. | ||
message (object): The object to display. | ||
title (str): The title string for the dialog. Optional. | ||
messageType (int): The type of message to be displayed: | ||
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, | ||
QUESTION_MESSAGE, or PLAIN_MESSAGE. Optional. | ||
icon (Icon): The icon to display in the dialog. Optional. | ||
""" | ||
pass | ||
|
||
@staticmethod | ||
def showOptionDialog(parentComponent, message, title=None, | ||
optionType=None, messageType=None, icon=None, | ||
options=None, initialValue=None): | ||
"""The Grand Unification of the above three. | ||
Args: | ||
parentComponent (Component): determines the Frame in which | ||
the dialog is displayed; if None, or if the | ||
parentComponent has no Frame, a default Frame is used. | ||
message (object): The object to display. | ||
title (str): The title string for the dialog. Optional. | ||
optionType (int): An integer designating the options | ||
available on the dialog: DEFAULT_OPTION, YES_NO_OPTION, | ||
YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION. Optional. | ||
messageType (int): An integer designating the kind of | ||
message this is; primarily used to determine the icon | ||
from the pluggable Look and Feel: ERROR_MESSAGE, | ||
INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, | ||
or PLAIN_MESSAGE. Optional. | ||
icon (Icon): The icon to display in the dialog. Optional. | ||
options (list): An array of objects indicating the possible | ||
choices the user can make; if the objects are | ||
components, they are rendered properly; non-String | ||
objects are rendered using their toString methods; if | ||
this parameter is null, the options are determined by | ||
the Look and Feel. Optional. | ||
initialValue (object): The object that represents the | ||
default selection for the dialog; only meaningful if | ||
options is used; can be null. Optional. | ||
Returns: | ||
int: An integer indicating the option chosen by the user, | ||
or CLOSED_OPTION if the user closed the dialog. | ||
""" | ||
pass |