mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
working on integration of new text editor with coloring
This commit is contained in:
@@ -781,9 +781,32 @@ public class PdeBase implements ActionListener {
|
||||
Integer.parseInt(st.nextToken()));
|
||||
}
|
||||
|
||||
//static public boolean isMacintosh() {
|
||||
//return System.getProperty("os.name").toLowerCase().indexOf("mac") != -1;
|
||||
//}
|
||||
static public SimpleAttributeSet getStyle(String what,
|
||||
SimpleAttributeSet otherwise) {
|
||||
String str = get("editor.program." + which + ".style");
|
||||
if (str == null) return otherwise; // ENABLE LATER
|
||||
StringTokenizer st = new StringTokenizer(str, ",");
|
||||
|
||||
SimpleAttributeSet style = new SimpleAttributeSet();
|
||||
|
||||
StyleConstants.setFontFamily(style, st.nextToken());
|
||||
|
||||
String s = st.nextToken();
|
||||
StyleConstants.setBold(style, s.indexOf("bold") != -1);
|
||||
StyleConstants.setItalic(style, s.indexOf("italic") != -1);
|
||||
|
||||
StyleConstants.setSize(style, Integer.parseInt(st.nextToken()));
|
||||
|
||||
s = st.nextToken();
|
||||
if (s.indexOf("#") == 0) s = s.substring(1);
|
||||
StyleConstants.setForeground(style, new Color(Integer.parseInt(s, 16)));
|
||||
|
||||
s = st.nextToken();
|
||||
if (s.indexOf("#") == 0) s = s.substring(1);
|
||||
StyleConstants.setBackground(style, new Color(Integer.parseInt(s, 16)));
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
|
||||
// used by PdeEditorButtons, but probably more later
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,23 @@
|
||||
#editor.program.columns = 60
|
||||
#editor.program.font = Monospaced,plain,12
|
||||
|
||||
#editor.program.body.style = Monospaced,plain,12,#000000,#ffffff
|
||||
editor.program.tag.style = Monospaced,plain,12,#800000,#ffffff
|
||||
#editor.program.reference.style = Monospaced,plain,12,#000000,#ffffff
|
||||
editor.program.name.style = Monospaced,plain,12,#b03060,#ffffff
|
||||
editor.program.value.style = Monospaced,plain,12,#b03060,#ffffff
|
||||
#editor.program.text.style = Monospaced,plain,12,#000000,#ffffff
|
||||
editor.program.reserved_word.style = Monospaced,plain,12,#800000,#ffffff
|
||||
#editor.program.identifier.style = Monospaced,plain,12,#000000,#ffffff
|
||||
editor.program.literal.style = Monospaced,plain,12,#b03060,#ffffff
|
||||
editor.program.separator.style = Monospaced,plain,12,#000080,#ffffff
|
||||
#editor.program.operator.style = Monospaced,plain,12,#000000,#ffffff
|
||||
editor.program.comment.style = Monospaced,plain,12,#000080,#ffffff
|
||||
editor.program.preprocessor.style = Monospaced,plain,12,#a020f0,#ffffff
|
||||
#editor.program.whitespace.style = Monospaced,plain,12,#000000,#ffffff
|
||||
editor.program.error.style = Monospaced,plain,12,#800000,#ffffff
|
||||
editor.program.unknown.style = Monospaced,plain,12,#804000,#ffffff
|
||||
|
||||
#editor.header.bgcolor = #333333
|
||||
#editor.header.fgcolor.primary = #ffffff
|
||||
#editor.header.fgcolor.secondary = #cccccc
|
||||
|
||||
Reference in New Issue
Block a user