|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--de.jaetzold.util.TextOutput
TextOutput should be an interface later. For now it is everything what deals with user-interaction, also the Input. The Interface "TextOutput" should provide the ability to: "append" Strings; "clear" the output, or "set" it to ""; maybe: "get" everything which is shown at the moment;
Inner classes inherited from class java.awt.Panel |
Panel.AccessibleAWTPanel |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
Field Summary | |
protected StringBuffer |
content
This is our own buffer of the output. |
protected static int |
FONTSIZE
It is the size of all fonts. |
protected int |
histindex
Thats where we are when we scroll through our history. |
protected static int |
HISTLENGTH
Maximum number of Command Strings in the History. |
protected String[] |
history
The Array where the Commands for the history are stored. |
protected static boolean |
HISTSQUEEZE
If this is true, successive equal Commands are only stored once. |
protected int |
histtop
The last index in History which contains a Command. |
protected TextField |
input
This is where we get the Input-Events/Commands from. |
protected TextArea |
output
Main output. |
protected Label |
prompt
This is where we present the prompt. |
protected static int |
PROMPTLENGTH
Every prompt longer than PROMPTLENGTH will be cut on the left side. |
protected static int |
SCROLLBACKMAX
The Buffer is truncated to SCROLLBACKMIN if it exeeds SCROLLBACKMAX. |
protected static int |
SCROLLBACKMIN
A greater difference between min and max increases the time to the next call of setText() to the TextArea which always results in some flickering. |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TextOutput(int rows,
int cols)
Constructs a new TextOutput whith default parameters. |
Method Summary | |
void |
addCommandLineListener(CommandLineListener l)
This sets the CommandLineListener. |
void |
append(Object obj)
In Windows95 the TextArea cant contain an unlimited amount of text, so I try to limit it somehow. |
String |
getPrompt()
|
void |
setPrompt(String str)
Set str as prompt. |
Methods inherited from class java.awt.Panel |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected TextArea output
protected TextField input
protected Label prompt
protected StringBuffer content
protected String[] history
protected int histindex
protected int histtop
protected static final int FONTSIZE
protected static final int PROMPTLENGTH
protected static final int SCROLLBACKMAX
protected static final int SCROLLBACKMIN
protected static final int HISTLENGTH
protected static final boolean HISTSQUEEZE
Constructor Detail |
public TextOutput(int rows, int cols)
Method Detail |
public void append(Object obj)
public void setPrompt(String str)
setPrompt
in interface CommandLine
public String getPrompt()
getPrompt
in interface CommandLine
public void addCommandLineListener(CommandLineListener l)
addCommandLineListener
in interface CommandLine
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |