|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgui.multisource.MultisourceViewer
public class MultisourceViewer
A MultisourceViewer displays multisource text and displays the sources of lines of text as color codes on the left of the text. A multisource viewer has a special source identified as MultisourceDocument.USER that represents the user of the program. The last line of the viewer can be freely edited by the user. It is committed automatically when the user enters a linefeed (return) character. When committed, the line is forwared to a text consumer that is attached to the viewer and it color code is set to the color code for USER.
Constructor Summary | |
---|---|
MultisourceViewer()
new MultisourceViewer() returns a new MultisourceViewer with a do-nothing text consumer. |
|
MultisourceViewer(TextConsumer tc)
new MultisourceViewer(tc) returns a new MultisourceViewer with text consumer tc. |
Method Summary | |
---|---|
void |
addText(java.lang.String s,
java.lang.Object src)
mv.addText(s, src) adds s at the start-new-text point of mv and advances the start-new-text point past the added text. |
void |
clear()
mv.clear() removes all text from mv. |
javax.swing.JTextPane |
getViewComponent()
mv.getViewComponent() returns the text pane for mv. |
void |
setEditable(boolean ed)
mv.setEditable(ed) sets the editability of mv to ed. |
void |
setFontSize(int sz)
mv.setFontSize(sz) sets the font size of mv to sz. |
void |
setSourceColor(java.lang.Object src,
java.awt.Color c)
mv.setSourceColor(src, c) sets the source color of source identified by src in mv to c. |
void |
setTextConsumer(TextConsumer tc)
mv.setTextConsumer(tc) sets tc as the text consumer for mv. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultisourceViewer()
public MultisourceViewer(TextConsumer tc)
Method Detail |
---|
public javax.swing.JTextPane getViewComponent()
getViewComponent
in interface Viewable
public void setFontSize(int sz)
public void setSourceColor(java.lang.Object src, java.awt.Color c)
public void setTextConsumer(TextConsumer tc)
public void setEditable(boolean ed)
public void addText(java.lang.String s, java.lang.Object src)
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |