*
* The MIT License (MIT)
*
- * Copyright (C) 2017 Kevin Lamonte
+ * Copyright (C) 2019 Kevin Lamonte
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
public class Document {
+ // ------------------------------------------------------------------------
+ // Variables --------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
/**
* The list of lines.
*/
*/
private Highlighter highlighter = new Highlighter();
+ // ------------------------------------------------------------------------
+ // Constructors -----------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Construct a new Document from an existing text string.
+ *
+ * @param str the text string
+ * @param defaultColor the color for unhighlighted text
+ */
+ public Document(final String str, final CellAttributes defaultColor) {
+ this.defaultColor = defaultColor;
+
+ // TODO: set different colors based on file extension
+ highlighter.setJavaColors();
+
+ String [] rawLines = str.split("\n");
+ for (int i = 0; i < rawLines.length; i++) {
+ lines.add(new Line(rawLines[i], this.defaultColor, highlighter));
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Document ---------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
/**
* Get the overwrite flag.
*
}
}
- /**
- * Construct a new Document from an existing text string.
- *
- * @param str the text string
- * @param defaultColor the color for unhighlighted text
- */
- public Document(final String str, final CellAttributes defaultColor) {
- this.defaultColor = defaultColor;
-
- // TODO: set different colors based on file extension
- highlighter.setJavaColors();
-
- String [] rawLines = str.split("\n");
- for (int i = 0; i < rawLines.length; i++) {
- lines.add(new Line(rawLines[i], this.defaultColor, highlighter));
- }
- }
-
/**
* Increment the line number by one. If at the last line, do nothing.
*