use of javax.swing.text.SimpleAttributeSet in project JMRI by JMRI.
the class JTextPaneAppender method createAttributes.
private void createAttributes() {
String[] prio = new String[6];
prio[0] = Level.FATAL.toString();
prio[1] = Level.ERROR.toString();
prio[2] = Level.WARN.toString();
prio[3] = Level.INFO.toString();
prio[4] = Level.DEBUG.toString();
prio[5] = Level.TRACE.toString();
myAttributeSet = new Hashtable<String, MutableAttributeSet>();
for (int i = 0; i < prio.length; i++) {
MutableAttributeSet att = new SimpleAttributeSet();
myAttributeSet.put(prio[i], att);
StyleConstants.setFontSize(att, 14);
}
StyleConstants.setForeground(myAttributeSet.get(Level.FATAL.toString()), Color.red);
StyleConstants.setForeground(myAttributeSet.get(Level.ERROR.toString()), Color.red);
StyleConstants.setForeground(myAttributeSet.get(Level.WARN.toString()), Color.orange);
StyleConstants.setForeground(myAttributeSet.get(Level.INFO.toString()), Color.black);
StyleConstants.setForeground(myAttributeSet.get(Level.DEBUG.toString()), Color.black);
StyleConstants.setForeground(myAttributeSet.get(Level.TRACE.toString()), Color.black);
}
use of javax.swing.text.SimpleAttributeSet in project antlrworks by antlr.
the class DBInputProcessorToken method createTextAttributes.
public void createTextAttributes() {
attributeNonConsumed = new SimpleAttributeSet();
StyleConstants.setForeground(attributeNonConsumed, AWPrefs.getNonConsumedTokenColor());
attributeConsume = new SimpleAttributeSet();
StyleConstants.setForeground(attributeConsume, AWPrefs.getConsumedTokenColor());
attributeConsumeHidden = new SimpleAttributeSet();
StyleConstants.setForeground(attributeConsumeHidden, AWPrefs.getHiddenTokenColor());
attributeConsumeDead = new SimpleAttributeSet();
StyleConstants.setForeground(attributeConsumeDead, AWPrefs.getDeadTokenColor());
attributeLookahead = new SimpleAttributeSet();
StyleConstants.setForeground(attributeLookahead, AWPrefs.getLookaheadTokenColor());
StyleConstants.setItalic(attributeLookahead, true);
}
use of javax.swing.text.SimpleAttributeSet 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.SimpleAttributeSet 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();
}
use of javax.swing.text.SimpleAttributeSet in project Botnak by Gocnak.
the class ChatPane method insertIcon.
public void insertIcon(MessageWrapper m, IconEnum type, String channel) {
SimpleAttributeSet attrs = new SimpleAttributeSet();
Icons.BotnakIcon icon = Icons.getIcon(type, channel);
StyleConstants.setIcon(attrs, icon.getImage());
try {
print(m, " ", null);
print(m, icon.getType().type, attrs);
} catch (Exception e) {
GUIMain.log("Exception in insertIcon: ");
GUIMain.log(e);
}
}
Aggregations