+ // Draw vertical borders.
+ if (leftBorder == Border.SINGLE) {
+ vLineXY((showRowLabels ? ROW_LABEL_WIDTH : 0), 0,
+ getHeight(), '\u2502', borderColor);
+ }
+ for (int i = left; i < columns.size(); i++) {
+ if (columns.get(i).get(top).isVisible() == false) {
+ break;
+ }
+ if (columns.get(i).rightBorder == Border.SINGLE) {
+ vLineXY(columns.get(i).getX() + columns.get(i).width,
+ (topBorder == Border.NONE ? 0 : 1),
+ getHeight(), '\u2502', borderColor);
+ }
+ }
+
+ // Draw horizontal borders.
+ if (topBorder == Border.SINGLE) {
+ hLineXY((showRowLabels ? ROW_LABEL_WIDTH : 0), 0,
+ getWidth(), '\u2500', borderColor);
+ }
+ for (int i = top; i < rows.size(); i++) {
+ if (rows.get(i).get(left).isVisible() == false) {
+ break;
+ }
+ if (rows.get(i).bottomBorder == Border.SINGLE) {
+ hLineXY((leftBorder == Border.NONE ? 0 : 1) +
+ (showRowLabels ? ROW_LABEL_WIDTH : 0),
+ rows.get(i).getY() + rows.get(i).height - 1,
+ getWidth(), '\u2500', borderColor);
+ } else if (rows.get(i).bottomBorder == Border.DOUBLE) {
+ hLineXY((leftBorder == Border.NONE ? 0 : 1) +
+ (showRowLabels ? ROW_LABEL_WIDTH : 0),
+ rows.get(i).getY() + rows.get(i).height - 1,
+ getWidth(), '\u2550', borderColor);
+ } else if (rows.get(i).bottomBorder == Border.THICK) {
+ hLineXY((leftBorder == Border.NONE ? 0 : 1) +
+ (showRowLabels ? ROW_LABEL_WIDTH : 0),
+ rows.get(i).getY() + rows.get(i).height - 1,
+ getWidth(), '\u2580', borderColor);
+ }
+ }
+ // Top-left corner if needed
+ if ((topBorder == Border.SINGLE) && (leftBorder == Border.SINGLE)) {
+ putCharXY((showRowLabels ? ROW_LABEL_WIDTH : 0), 0,
+ '\u250c', borderColor);
+ }
+
+ // TODO: draw the correct corners between rows and columns
+