use of javax.swing.text.Document in project android-classyshark by google.
the class DisplayArea method displayError.
@Override
public void displayError() {
displayDataState = DisplayDataState.ERROR;
clearText();
style = jTextPane.addStyle("STYLE", null);
Document doc = jTextPane.getStyledDocument();
try {
StyleConstants.setForeground(style, theme.getDefaultColor());
StyleConstants.setFontSize(style, 13);
StyleConstants.setFontFamily(style, "Menlo");
doc.insertString(doc.getLength(), "\n\n\n\t\t\t There was a problem loading the class ", style);
doc.insertString(doc.getLength(), Doodle.get(), style);
} catch (BadLocationException e) {
e.printStackTrace();
}
jTextPane.setDocument(doc);
}
use of javax.swing.text.Document in project processing by processing.
the class DetailPanel method setSelectionStyle.
static void setSelectionStyle(JTextPane textPane, boolean selected) {
Document doc = textPane.getDocument();
if (doc instanceof HTMLDocument) {
HTMLDocument html = (HTMLDocument) doc;
StyleSheet styleSheet = html.getStyleSheet();
if (selected) {
styleSheet.addRule("a { text-decoration:underline } ");
} else {
styleSheet.addRule("a { text-decoration:none }");
}
}
}
use of javax.swing.text.Document in project enclojure by EricThorsen.
the class ClojureFoldManager method initFolds.
public void initFolds(FoldHierarchyTransaction tran) {
Document doc = getOperation().getHierarchy().getComponent().getDocument();
if (doc instanceof BaseDocument) {
this.document = (BaseDocument) doc;
}
updateFolds(document, tran);
}
use of javax.swing.text.Document in project LogisticsPipes by RS485.
the class LogWindow method newLine.
public void newLine(String data) {
SimpleAttributeSet attr = new SimpleAttributeSet();
StyleConstants.setFontFamily(attr, "SansSerif");
StyleConstants.setFontSize(attr, 12);
// StyleConstants.setForeground(attr, color);
Document document = logArea.getDocument();
if (document != null) {
try {
document.insertString(document.getLength(), data + "\n", attr);
} catch (BadLocationException badlocationexception) {
}
}
validate();
}
use of javax.swing.text.Document in project LogisticsPipes by RS485.
the class DebugWindow method showInfo.
public void showInfo(String data, Color color) {
SimpleAttributeSet attr = new SimpleAttributeSet();
StyleConstants.setFontFamily(attr, "SansSerif");
StyleConstants.setFontSize(attr, 12);
StyleConstants.setForeground(attr, color);
Document document = textArea.getDocument();
if (document != null) {
try {
document.insertString(document.getLength(), data, attr);
} catch (BadLocationException badlocationexception) {
}
}
getContentPane().validate();
}
Aggregations