]> source.dussan.org Git - poi.git/commitdiff
double border
authorAndrew C. Oliver <acoliver@apache.org>
Thu, 4 Jul 2002 14:47:36 +0000 (14:47 +0000)
committerAndrew C. Oliver <acoliver@apache.org>
Thu, 4 Jul 2002 14:47:36 +0000 (14:47 +0000)
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

src/contrib/src/org/apache/poi/hssf/contrib/view/SVBorder.java

index edec319ef66a30acd279b376a2819e6c44e3bd54..c786f5a86d508ec68a6449cb9c3707d60155cd11 100644 (file)
@@ -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) {