}
}
}
private void addDisplayWindowLines(List<String> lineBuffer, List<Line> lines) {
Line firstLine = null;
Line lastLine = null;
int a = 0;
int b = 0;
int displayWindow = props.getDisplayProperties().getDisplayWindow();
if (lineBuffer == null || lines == null) {
throw new IllegalArgumentException("One ore more parameters are null!");
}
if (displayWindow == 0 || lines.size() == 0) {
return;
}
firstLine = lines.get(0);
lastLine = lines.get(lines.size() - 1);
a = Math.max(0, firstLine.getLineNumber() - 1 - displayWindow);
b = firstLine.getLineNumber() - 1;
for (int i = b - 1; i >= a; i--) {
lines.add(0, new Line(lineBuffer.get(i), i + 1));
}
a = lastLine.getLineNumber() - 1;
b = Math.min(lineBuffer.size() - 1, lastLine.getLineNumber() - 1 + displayWindow);
for (int i = a + 1; i <= b; i++) {
lines.add(new Line(lineBuffer.get(i), i + 1));
}
}