|
||||||||||
| 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.text.JTextComponent
javax.swing.JEditorPane
javax.swing.JTextPane
gate.swing.XJTextPane
gate.gui.LogArea
public class LogArea
This class is used to log all messages from GATE. When an object of this
class is created, it redirects the output of Out &
Err.
The output from Err is written with red and the
one from Out is written in black.
| Nested Class Summary | |
|---|---|
protected class |
LogArea.ClearAllAction
Inner class that defines the behaviour of clear all action. |
protected class |
LogArea.CopyAction
Inner class that defines the behaviour of copy action. |
(package private) class |
LogArea.LogAreaOutputStream
Inner class that defines the behaviour of an OutputStream that writes to the LogArea. |
protected class |
LogArea.SelectAllAction
Inner class that defines the behaviour of SelectAll action. |
protected class |
LogArea.SwingWriter
A runnable that adds a bit of text to the area; needed so we can write from the Swing thread. |
static class |
LogArea.UTF8PrintStream
A print writer that uses UTF-8 to convert from char[] to byte[] |
static class |
LogArea.UTF8PrintWriter
A print writer that uses UTF-8 to convert from char[] to byte[] |
| Nested classes/interfaces inherited from class javax.swing.JEditorPane |
|---|
JEditorPane.AccessibleJEditorPane, JEditorPane.AccessibleJEditorPaneHTML, JEditorPane.JEditorPaneAccessibleHypertextSupport |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
| 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 LogArea.ClearAllAction |
clearAllAction
This fields defines the clear all behaviour |
protected LogArea.CopyAction |
copyAction
This fields defines the copy behaviour |
protected Position |
endPos
End position from the document. |
protected PrintStream |
originalErr
The original printstream on System.err |
protected PrintStream |
originalOut
The original printstream on System.out |
protected JPopupMenu |
popup
The popup menu with various actions |
protected LogArea.SelectAllAction |
selectAllAction
This fields defines the Select all behaviour |
protected Position |
startPos
Start position from the document. |
protected LogArea |
thisLogArea
Field needed in inner classes |
| Fields inherited from class javax.swing.JEditorPane |
|---|
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| 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 | |
|---|---|
LogArea()
Constructs a LogArea object and captures the output from Err and Out. |
|
| Method Summary | |
|---|---|
PrintStream |
getOriginalErr()
Returns the original printstream on System.err |
PrintStream |
getOriginalOut()
Returns the original printstream on System.out |
private void |
handleBadLocationException(BadLocationException e,
String textToInsert,
Style style)
Try and recover from a BadLocationException thrown when inserting a string into the log area. |
void |
initListeners()
Init all listeners for this object |
void |
setDocument(Document d)
Overriddent to fetch new start and end Positions when the document is changed. |
void |
setStyledDocument(StyledDocument d)
|
| Methods inherited from class gate.swing.XJTextPane |
|---|
updateStyle |
| Methods inherited from class javax.swing.JTextPane |
|---|
addStyle, createDefaultEditorKit, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getStyledEditorKit, getUIClassID, insertComponent, insertIcon, paramString, removeStyle, replaceSelection, setCharacterAttributes, setEditorKit, setLogicalStyle, setParagraphAttributes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected LogArea thisLogArea
protected JPopupMenu popup
protected Position startPos
protected Position endPos
protected PrintStream originalOut
protected PrintStream originalErr
protected LogArea.SelectAllAction selectAllAction
protected LogArea.CopyAction copyAction
protected LogArea.ClearAllAction clearAllAction
| Constructor Detail |
|---|
public LogArea()
| Method Detail |
|---|
public void setDocument(Document d)
setDocument in class JTextPanepublic void setStyledDocument(StyledDocument d)
setStyledDocument in class JTextPanepublic void initListeners()
initListeners in class XJTextPanepublic PrintStream getOriginalErr()
public PrintStream getOriginalOut()
private void handleBadLocationException(BadLocationException e,
String textToInsert,
Style style)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||