|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.util.Console
public final class Console
Console is an class defining a "System console" window.
This console is used by default for showing trace messages.
Closing the Console window will cause the system to terminate.
The Console class has a large number of
| Nested Class Summary | |
|---|---|
static interface |
Console.ConsoleListener
Listener interface for Console actions, like print. |
(package private) static class |
Console.ConsoleOutputStream
OutputStream that writes to the Console |
static class |
Console.Counter
Counters keep the values for a print counter |
| Field Summary | |
|---|---|
static int |
BUTTONHEIGHT
|
private static int |
BUTTONHEIGHTFACTOR1
|
private static float |
BUTTONHEIGHTFACTOR2
|
static int |
BUTTONWIDTH
|
private static int |
BUTTONWIDTHFACTOR1
|
private static int |
BUTTONWIDTHFACTOR2
|
static int |
CHECKBOXWIDTH
|
private static boolean |
classTerminated
|
private static Button |
clearButton
|
private static Button |
closeButton
|
private static Console.ConsoleListener |
consoleListener
|
private static Map<String,Console.Counter> |
counters
|
static int |
DEFAULT_HEIGHT
|
static int |
DEFAULT_PRINT_LIMIT
|
static String |
DEFAULT_TITLE
|
static int |
DEFAULT_WIDTH
|
static int |
DEFAULT_XOFF
|
static int |
DEFAULT_YOFF
|
private static boolean |
enabled
|
private static Checkbox |
enabledBox
|
static int |
EXITDELAY
|
private static Frame |
frame
|
private static boolean |
frameEnabled
|
private static boolean |
frameFocusable
|
private static int |
height
|
static int |
NONE
|
private static PrintStream |
out
|
private static int |
printCounter
|
private static int |
printLimit
|
private static Button |
quitButton
|
static int |
SHOWMESSAGEDELAY
|
static int |
SYSTEMERR
|
static int |
SYSTEMOUT
|
private static ArrayList<Terminator> |
terminatorList
|
private static TextArea |
text
|
private static String |
timeFormat
|
private static boolean |
timestampsEnabled
|
private static String |
title
|
private static int |
width
|
static int |
WINDOW
|
static int |
XLEFTMARGIN
|
private static int |
xoff
|
static int |
XRIGHTMARGIN
|
static int |
YBOTTOMMARGIN
|
private static int |
yoff
|
static int |
YTOPMARGIN
|
| Constructor Summary | |
|---|---|
private |
Console()
|
| Method Summary | |
|---|---|
static void |
addTerminator(Terminator t)
sets the Terminator. |
static void |
captureError()
|
static void |
captureOut()
|
private static boolean |
checkFrame()
|
static void |
clear()
clears the Console window. |
static void |
close()
static method for closing the Console window. |
static void |
close(boolean reset)
static method for closing the Console window. |
private static void |
closeFrame()
|
private static void |
createFrame()
|
static boolean |
cycleCounter(String counterName)
|
static void |
delay(long d)
"Utility" method for executing a delay of "d" milliseconds. |
static void |
exit()
First calls "terminateClass(), and thereafter exits the Java Virtual Machine. |
static void |
exit(int exitCode)
First calls "terminateClass(), and thereafter exits the Java Virtual Machine. |
static Console.Counter |
getCounter(String counterName)
returns the counter with name as specified, possibly null |
static Console.Counter |
getCounter(String counterName,
int limit,
int cycle)
returns the counter with name as specified. |
static Frame |
getFrame()
|
static int |
getPrintLimit()
returns the number of lines that can still be printed, without reaching the print limit |
static void |
main(String[] arg)
|
static void |
print(String s)
appends s to the text in the Console window. |
private static boolean |
printLimitReached()
|
static void |
println()
appends a newline to the text in the Console window. |
static void |
println(boolean test,
String s)
like println, but only prints when test is true. |
static void |
println(boolean test,
String strue,
String sfalse)
like println, but prints strue when test is true, else prints sfalse. |
static void |
println(String s)
appends s to the text in the Console window. |
static void |
println(String counterName,
int limit,
int cycle,
String s)
Executes println(s), but prints only when the cyclic counter resets to zero. |
static void |
println(String counterName,
String s)
Executes println(s), but prints only when the cyclic counter resets to zero. |
static void |
reset()
resets title, size, and location to default values. |
static void |
setBackground(Color c)
sets the background color of the console frame. |
static void |
setBounds(int x,
int y,
int w,
int h)
sets the size and location of the console window. |
static void |
setConsoleListener(Console.ConsoleListener cl)
|
static void |
setCounterLimit(String counterName,
int limit)
sets the print limit for a named print counter |
static void |
setEnabled(boolean mode)
determines whether the Console is enabled or disabled. |
static void |
setFocusable(boolean focusable)
|
static void |
setFrameEnabled(boolean mode)
determines whether the Console Window is enabled or disabled. |
static void |
setLocation(int x,
int y)
sets the location of the console window. |
static void |
setPrintLimit(int limit)
sets the max number of lines that will be printed on the Console; if limit is negative, the printLimit is set to Integer.MAX_VALUE (2^31-1), so effectively no limit. |
static void |
setPrintStream(PrintStream s)
Sets the PrintStream that is used when the Console Frame is not enabled. |
static void |
setSize(int w,
int h)
sets the size of the console window. |
static void |
setText(String s)
replaces the current text in the Console window by a new text. |
static void |
setTextColor(Color c)
sets the text color of the console frame. |
static void |
setTimeFormat(String format)
specifies the format to be used for timestamps. |
static void |
setTimestampsEnabled(boolean enabled)
enables or disables printing of timestamps |
static void |
setTitle(String s)
sets the title of the console window. |
static void |
setVisible(boolean visible)
determines whether the Console window is visible or not. |
static boolean |
terminateClass()
The first "terminateClass" call executes the Terminator, if it is set. |
static void |
toBack()
moves the Console window "to the back". |
static void |
toChannels(int channel)
|
static void |
toConsoleWindow()
disables the printstream output, and enables the Console |
static void |
toFront()
moves the Console window "to the front". |
static void |
toSystemErr()
disables (and if necessary disposes) the Console window, thereafter, Console output is redirected to System.err |
static void |
toSystemOut()
disables (and if necessary disposes) the Console window, thereafter, Console output is redirected to System.out |
protected static void |
windowClose()
|
protected static void |
windowResize()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final int DEFAULT_XOFF
public static final int DEFAULT_YOFF
public static final int XLEFTMARGIN
public static final int XRIGHTMARGIN
public static final int YTOPMARGIN
public static final int YBOTTOMMARGIN
public static final int BUTTONWIDTH
public static final int BUTTONHEIGHT
public static final int CHECKBOXWIDTH
public static final String DEFAULT_TITLE
public static final int DEFAULT_PRINT_LIMIT
private static int width
private static int height
private static int xoff
private static int yoff
private static String title
private static ArrayList<Terminator> terminatorList
private static boolean classTerminated
private static TextArea text
private static Button clearButton
private static Button closeButton
private static Button quitButton
private static Checkbox enabledBox
private static Frame frame
private static boolean enabled
private static boolean frameEnabled
private static Console.ConsoleListener consoleListener
private static PrintStream out
private static int printLimit
private static int printCounter
private static String timeFormat
private static boolean timestampsEnabled
private static Map<String,Console.Counter> counters
public static final int SHOWMESSAGEDELAY
public static final int EXITDELAY
private static boolean frameFocusable
private static final int BUTTONHEIGHTFACTOR1
private static final float BUTTONHEIGHTFACTOR2
private static final int BUTTONWIDTHFACTOR1
private static final int BUTTONWIDTHFACTOR2
public static final int SYSTEMOUT
public static final int SYSTEMERR
public static final int WINDOW
public static final int NONE
| Constructor Detail |
|---|
private Console()
| Method Detail |
|---|
public static void setCounterLimit(String counterName,
int limit)
public static boolean cycleCounter(String counterName)
public static Console.Counter getCounter(String counterName)
public static Console.Counter getCounter(String counterName,
int limit,
int cycle)
public static void setTimeFormat(String format)
public static void setTimestampsEnabled(boolean enabled)
public static void setPrintLimit(int limit)
public static int getPrintLimit()
private static boolean printLimitReached()
public static void close(boolean reset)
public static void close()
public static void reset()
public static boolean terminateClass()
public static void exit(int exitCode)
public static void exit()
public static Frame getFrame()
public static void setFocusable(boolean focusable)
private static void createFrame()
private static boolean checkFrame()
protected static void windowClose()
private static void closeFrame()
protected static void windowResize()
public static void setBounds(int x,
int y,
int w,
int h)
public static void setLocation(int x,
int y)
public static void setSize(int w,
int h)
public static void setTitle(String s)
public static void setVisible(boolean visible)
public static void clear()
public static void setText(String s)
public static void print(String s)
public static void println()
public static void println(String s)
public static void println(boolean test,
String strue,
String sfalse)
public static void println(boolean test,
String s)
public static void println(String counterName,
String s)
public static void println(String counterName,
int limit,
int cycle,
String s)
public static void toBack()
public static void toFront()
public static void delay(long d)
public static void setBackground(Color c)
public static void setTextColor(Color c)
public static void addTerminator(Terminator t)
public static void setEnabled(boolean mode)
public static void setFrameEnabled(boolean mode)
public static void setPrintStream(PrintStream s)
public static void toChannels(int channel)
public static void toSystemOut()
public static void toSystemErr()
public static void toConsoleWindow()
public static void setConsoleListener(Console.ConsoleListener cl)
public static void main(String[] arg)
public static void captureError()
public static void captureOut()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||