paintNormalBorders(g, x, y, width, height);
paintDottedBorders(g, x, y, width, height);
+ paintDashedBorders(g, x, y, width, height);
+
g.setColor(oldColor);
int thickness = getThickness(eastBorderType);
+ if (eastBorderType == HSSFCellStyle.BORDER_HAIR)
+ thickness++;
+
g.setColor(eastColor);
for (int k=0; k < thickness; k++) {
int thickness = getThickness(southBorderType);
+ if (southBorderType == HSSFCellStyle.BORDER_HAIR)
+ thickness++;
+
g.setColor(southColor);
for (int k=0; k < thickness; k++) {
g.drawLine(x,height - k,width,height - k);
}
}
+
+ private void paintDashedBorders(Graphics g, int x, int y, int width,
+ int height) {
+ if (northBorder &&
+ northBorderType == HSSFCellStyle.BORDER_DASHED) {
+ int thickness = getThickness(northBorderType);
+
+ g.setColor(northColor);
+
+ for (int k=0; k < thickness; k++) {
+ for (int xc = x; xc < width; xc=xc+5) {
+ g.drawLine(xc,y+k,xc+2,y+k);
+ }
+ }
+ }
+
+ if (eastBorder &&
+ eastBorderType == HSSFCellStyle.BORDER_DASHED
+ ) {
+
+ int thickness = getThickness(eastBorderType);
+ thickness++; //need for dotted borders to show up east
+
+ g.setColor(eastColor);
+
+ for (int k=0; k < thickness; k++) {
+ for (int yc=y;yc < height; yc=yc+5) {
+ g.drawLine(width-k,yc,width-k,yc+2);
+ }
+ }
+ }
+
+ if (southBorder &&
+ southBorderType == HSSFCellStyle.BORDER_DASHED
+ ) {
+
+ int thickness = getThickness(southBorderType);
+ thickness++;
+ g.setColor(southColor);
+ for (int k=0; k < thickness; k++) {
+ for (int xc = x; xc < width; xc=xc+5) {
+ g.drawLine(xc,height-k,xc+2,height-k);
+ }
+ }
+ }
+
+ if (westBorder &&
+ westBorderType == HSSFCellStyle.BORDER_DASHED
+ ) {
+
+ int thickness = getThickness(westBorderType);
+// thickness++;
+
+ g.setColor(westColor);
+
+ for (int k=0; k < thickness; k++) {
+ for (int yc=y;yc < height; yc=yc+5) {
+ g.drawLine(x+k,yc,x+k,yc+2);
+ }
+ }
+ }
+ }
+
private int getThickness(int thickness) {
int retval=1;
switch (thickness) {