|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
de.mospace.swing.IOPane
public class IOPane
An IOPane consists of an input text field and a scrollable output text area. The input text field is equipped with a history, i. e. you can access previously entered items using the cursor keys. The output text area is automatically scrolled to the bottom when new text is appended. By default text that is entered in the input field is echoed in the output area and no other action is taken.
ProcessIOPane,
Serialized Form| Nested Class Summary | |
|---|---|
static interface |
IOPane.History
Minimum requirements for a command line history for the input field of an IOPane. |
static class |
IOPane.VectorHistory
Default implementation of the IOPane.History interface. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected ActionListener |
echoAL
The action listener that echoes input in the output field |
protected boolean |
prependPrompt
whether to prepend a prompt sign to the echoed input |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
IOPane(int rows,
int cols)
Creates a new IOPane with no initial text. |
|
| Method Summary | |
|---|---|
void |
addActionListener(ActionListener a)
Adds the specified action listener to receive action events from the input textfield. |
void |
append(String s)
Appends the given text to the end of the document of the output area. |
ActionListener[] |
getActionListeners()
Returns an array of all the ActionListeners added to this IOPane with addActionListener(java.awt.event.ActionListener). |
Document |
getDocument()
Fetches the model associated with the output area. |
IOPane.History |
getHistory()
Fetches the command history of the input field. |
protected JTextField |
getInput()
Returns the input text field of this IOPane. |
int |
getMaxLines()
Returns the size limit of the output area of this IOPane. |
protected JTextArea |
getOutputArea()
Returns the output area of this IOPane. |
protected JLabel |
getPrompt()
Returns the Label preceding the input field of this IOPane. |
protected JScrollPane |
getScrollPane()
Returns the ScrollPane containing the output area of this IOPane. |
void |
removeActionListener(ActionListener a)
Removes the specified action listener so that it no longer receives action events from the input textfield. |
void |
setBackground(Color c)
Sets the background color of this IOPane, its output area and its input field. |
void |
setMaxLines(int lines)
Sets the maximum number of lines in the output area. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean prependPrompt
protected final ActionListener echoAL
| Constructor Detail |
|---|
public IOPane(int rows,
int cols)
rows - number of text rows >= 0cols - number of text columns >= 0 in a row
IllegalArgumentException - if the rows or columns arguments are negative.| Method Detail |
|---|
public ActionListener[] getActionListeners()
addActionListener(java.awt.event.ActionListener).
public final void setBackground(Color c)
setBackground in class JComponentc - the desired background Colorpublic Document getDocument()
public IOPane.History getHistory()
public void setMaxLines(int lines)
lines - the line limit, if lines is negative the number of
lines is unlimitedgetMaxLines()public int getMaxLines()
setMaxLines(int)public void addActionListener(ActionListener a)
a - the action listener to be addedpublic void append(String s)
s - the text to appendJTextArea.append(java.lang.String)public void removeActionListener(ActionListener a)
a - the action listener to be removedprotected JTextField getInput()
protected JTextArea getOutputArea()
protected JLabel getPrompt()
protected JScrollPane getScrollPane()
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||