|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
fang.ErrorConsole
public class ErrorConsole
Displays runtime errors in a meaningful way.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JDialog |
|---|
JDialog.AccessibleJDialog |
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
Dialog.AccessibleAWTDialog |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JDialog |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
advances to the next error and makes this gui invisible when there are no more errors |
static void |
addError(String diagnosis,
String fix,
Throwable e)
sets the content of the window displaying the error screen. |
static void |
addUnknownError(Throwable e)
call this method for errors which should not occur. |
static String |
fixedWidth(String text)
makes the text monospaced in html |
static String |
fixHTML(String text)
replaces the symbols less than, greater than, quotes, new lines, spaces, and tabs with the corresponding html to display these properly. |
static StackTraceElement |
getErrorElement(Throwable t)
iterates through the execution stack to find the first element which is outside of the FANG Engine |
static String |
getErrorFile(Throwable t)
gets the name of the source file where the error occurred |
static String |
getErrorLine(Throwable t)
gets the text of the line where the error occurred |
static int |
getErrorLineNumber(Throwable t)
gets the line number where the error occurred |
static String |
getErrorMethod(Throwable t)
gets the name of the method where the error occurred |
static String |
getLine(String fileName,
int lineNumber)
gets the line of the file where the error is. |
static String |
getLocationSection(Throwable e)
gets the text for displaying the error's location |
static String |
heading(String text)
makes the text large |
static String |
indent(String text)
indents the given text 40 pixels |
static void |
registerExceptionHandler()
this catches uncaught exceptions when the game runs as an application. |
static String |
subHeading(String text)
makes the text slightly smaller than the heading |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerActionListener.actionPerformed(java.awt.event.ActionEvent)
public static String getLine(String fileName,
int lineNumber)
fileName - the name of the file to read fromlineNumber - the line to return the contents of
public static String fixHTML(String text)
text - the text to convert, usually Java code
public static String fixedWidth(String text)
text - the text to make monospaced, typically file names and code
public static String indent(String text)
text - the string to indent
public static String heading(String text)
text - the heading
public static String subHeading(String text)
text - the subheading
public static String getLocationSection(Throwable e)
e - the exception that generated the error
public static String getErrorLine(Throwable t)
public static int getErrorLineNumber(Throwable t)
public static String getErrorMethod(Throwable t)
public static String getErrorFile(Throwable t)
public static StackTraceElement getErrorElement(Throwable t)
public static void addError(String diagnosis,
String fix,
Throwable e)
title - the title of the JDialog boxcontent - the content of the helppublic static void addUnknownError(Throwable e)
e - the unexpected exceptionpublic static void registerExceptionHandler()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||