From bcf0c1921c8fac5f806aa7df14cbd096f8c03219 Mon Sep 17 00:00:00 2001 From: "Andrew C. Oliver" Date: Thu, 4 Jul 2002 14:47:36 +0000 Subject: [PATCH] double border PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352754 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/contrib/view/SVBorder.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVBorder.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVBorder.java index edec319ef6..c786f5a86d 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVBorder.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVBorder.java @@ -56,6 +56,7 @@ public class SVBorder extends AbstractBorder { paintNormalBorders(g, x, y, width, height); paintDottedBorders(g, x, y, width, height); paintDashedBorders(g, x, y, width, height); + paintDoubleBorders(g, x, y, width, height); @@ -281,6 +282,56 @@ public class SVBorder extends AbstractBorder { } } + + private void paintDoubleBorders(Graphics g, int x, int y, int width, + int height) { + if (northBorder && + northBorderType == HSSFCellStyle.BORDER_DOUBLE) { + + g.setColor(northColor); + + g.drawLine(x,y,width,y); + g.drawLine(x+3,y+2,width-3,y+2); + } + + if (eastBorder && + eastBorderType == HSSFCellStyle.BORDER_DOUBLE + ) { + + int thickness = getThickness(eastBorderType); + thickness++; //need for dotted borders to show up east + + g.setColor(eastColor); + + g.drawLine(width-1,y,width-1,height); + g.drawLine(width-3,y+3,width-3,height-3); + } + + if (southBorder && + southBorderType == HSSFCellStyle.BORDER_DOUBLE + ) { + + g.setColor(southColor); + + + g.drawLine(x,height - 1,width,height - 1); + g.drawLine(x+3,height - 3,width-3,height - 3); + } + + if (westBorder && + westBorderType == HSSFCellStyle.BORDER_DOUBLE + ) { + + int thickness = getThickness(westBorderType); +// thickness++; + + g.setColor(westColor); + + g.drawLine(x,y,x,height); + g.drawLine(x+2,y+2,x+2,height-3); + } + } + private int getThickness(int thickness) { int retval=1; switch (thickness) {