poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1748074 - in /poi/branches/ss_border_property_template/src: examples/src/org/apache/poi/ss/examples/DrawingBorders.java java/org/apache/poi/ss/util/BorderPropertyTemplate.java testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
Date Mon, 13 Jun 2016 01:00:51 GMT
Author: onealj
Date: Mon Jun 13 01:00:51 2016
New Revision: 1748074

URL: http://svn.apache.org/viewvc?rev=1748074&view=rev
Log:
rename drawBorders(..., short color, ...) to drawColoredBorders to make it obvious that method
changes border line style and color

Modified:
    poi/branches/ss_border_property_template/src/examples/src/org/apache/poi/ss/examples/DrawingBorders.java
    poi/branches/ss_border_property_template/src/java/org/apache/poi/ss/util/BorderPropertyTemplate.java
    poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java

Modified: poi/branches/ss_border_property_template/src/examples/src/org/apache/poi/ss/examples/DrawingBorders.java
URL: http://svn.apache.org/viewvc/poi/branches/ss_border_property_template/src/examples/src/org/apache/poi/ss/examples/DrawingBorders.java?rev=1748074&r1=1748073&r2=1748074&view=diff
==============================================================================
--- poi/branches/ss_border_property_template/src/examples/src/org/apache/poi/ss/examples/DrawingBorders.java
(original)
+++ poi/branches/ss_border_property_template/src/examples/src/org/apache/poi/ss/examples/DrawingBorders.java
Mon Jun 13 01:00:51 2016
@@ -86,10 +86,10 @@ public class DrawingBorders {
         // #3) these cells will all be medium weight with different colors for the
         //     outside, inside horizontal, and inside vertical borders. The center
         //     cell will have no borders.
-        pt.drawBorders(b10d12, BorderStyle.MEDIUM, red, BorderExtent.OUTSIDE);
-        pt.drawBorders(b10d12, BorderStyle.MEDIUM, blue, BorderExtent.INSIDE_VERTICAL);
-        pt.drawBorders(b10d12, BorderStyle.MEDIUM, green, BorderExtent.INSIDE_HORIZONTAL);
-        pt.drawBorders(c11,    BorderStyle.NONE, BorderExtent.ALL);
+        pt.drawColoredBorders(b10d12, BorderStyle.MEDIUM, red, BorderExtent.OUTSIDE);
+        pt.drawColoredBorders(b10d12, BorderStyle.MEDIUM, blue, BorderExtent.INSIDE_VERTICAL);
+        pt.drawColoredBorders(b10d12, BorderStyle.MEDIUM, green, BorderExtent.INSIDE_HORIZONTAL);
+        pt.drawBorders(c11, BorderStyle.NONE, BorderExtent.ALL);
 
         // apply borders to sheet
         pt.applyBorders(sh1);

Modified: poi/branches/ss_border_property_template/src/java/org/apache/poi/ss/util/BorderPropertyTemplate.java
URL: http://svn.apache.org/viewvc/poi/branches/ss_border_property_template/src/java/org/apache/poi/ss/util/BorderPropertyTemplate.java?rev=1748074&r1=1748073&r2=1748074&view=diff
==============================================================================
--- poi/branches/ss_border_property_template/src/java/org/apache/poi/ss/util/BorderPropertyTemplate.java
(original)
+++ poi/branches/ss_border_property_template/src/java/org/apache/poi/ss/util/BorderPropertyTemplate.java
Mon Jun 13 01:00:51 2016
@@ -293,7 +293,7 @@ public final class BorderPropertyTemplat
      * @param extent  BorderExtent of the borders to be applied.
      * @since 3.15 beta 2
      */
-    public void drawBorders(CellRangeAddress range, BorderStyle borderType, short color,
BorderExtent extent) {
+    public void drawColoredBorders(CellRangeAddress range, BorderStyle borderType, short
color, BorderExtent extent) {
         drawBorders(range, borderType, extent);
         if (borderType != BorderStyle.NONE) {
             drawBorderColors(range, color, extent);
@@ -518,8 +518,8 @@ public final class BorderPropertyTemplat
 
     /**
      * Applies the drawn borders to a Sheet. The borders that are applied are
-     * the ones that have been drawn by the {@link #drawBorders} and
-     * {@link #drawBorderColors} methods.
+     * the ones that have been drawn by {@link #drawColoredBorders}, {@link #drawBorders}
and
+     * {@link #drawBorderColors}.
      * The same border property template can be applied to multiple sheets
      * from the same or different workbooks.
      *

Modified: poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
URL: http://svn.apache.org/viewvc/poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java?rev=1748074&r1=1748073&r2=1748074&view=diff
==============================================================================
--- poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
(original)
+++ poi/branches/ss_border_property_template/src/testcases/org/apache/poi/ss/util/TestBorderPropertyTemplate.java
Mon Jun 13 01:00:51 2016
@@ -40,7 +40,6 @@ import org.junit.Test;
  */
 public final class TestBorderPropertyTemplate {
     private static final short RED = IndexedColors.RED.getIndex();
-    private static final short GREEN = IndexedColors.GREEN.getIndex();
     private static final short BLUE = IndexedColors.BLUE.getIndex();
     private static final short AUTOMATIC = IndexedColors.AUTOMATIC.getIndex();
 
@@ -50,7 +49,7 @@ public final class TestBorderPropertyTem
         CellAddress a1 = new CellAddress(0, 0); //A1
 
         BorderPropertyTemplate pt1 = new BorderPropertyTemplate();
-        pt1.drawBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.TOP);
+        pt1.drawColoredBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.TOP);
 
         // check to make sure borders were copied
         BorderPropertyTemplate pt2 = new BorderPropertyTemplate(pt1);
@@ -60,14 +59,14 @@ public final class TestBorderPropertyTem
 
         // Changes to original template should not affect copied template.
         assertEquals(1, pt2.getNumBorders(a1));
-        pt1.drawBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.LEFT);
+        pt1.drawColoredBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.LEFT);
         assertEquals(1, pt2.getNumBorders(a1));
         assertNull(pt2.getTemplateProperty(a1, CellUtil.BORDER_LEFT));
         assertNull(pt2.getTemplateProperty(a1, CellUtil.LEFT_BORDER_COLOR));
 
         // Changes to copied template should not affect original template
         assertEquals(2, pt1.getNumBorders(a1));
-        pt2.drawBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.RIGHT);
+        pt2.drawColoredBorders(a1a1, BorderStyle.THIN, RED, BorderExtent.RIGHT);
         assertEquals(2, pt1.getNumBorders(a1));
         assertNull(pt1.getTemplateProperty(a1, CellUtil.BORDER_RIGHT));
         assertNull(pt1.getTemplateProperty(a1, CellUtil.RIGHT_BORDER_COLOR));
@@ -442,7 +441,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
                 CellAddress addr = new CellAddress(i, j);
@@ -466,7 +465,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.BOTTOM);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -482,7 +481,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.LEFT);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -498,7 +497,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.RIGHT);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -514,7 +513,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.HORIZONTAL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -526,7 +525,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.INSIDE_HORIZONTAL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -548,7 +547,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.OUTSIDE_HORIZONTAL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -568,7 +567,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.VERTICAL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -580,7 +579,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.INSIDE_VERTICAL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -602,7 +601,7 @@ public final class TestBorderPropertyTem
             }
         }
         
-        pt.drawBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, AUTOMATIC, BorderExtent.NONE);
         pt.drawBorderColors(a1c3, BLUE, BorderExtent.OUTSIDE_VERTICAL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
@@ -628,7 +627,7 @@ public final class TestBorderPropertyTem
         CellRangeAddress a1c3 = new CellRangeAddress(0, 2, 0, 2);
         BorderPropertyTemplate pt = new BorderPropertyTemplate();
         
-        pt.drawBorders(a1c3, BorderStyle.MEDIUM, RED, BorderExtent.ALL);
+        pt.drawColoredBorders(a1c3, BorderStyle.MEDIUM, RED, BorderExtent.ALL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
                 CellAddress addr = new CellAddress(i, j);
@@ -646,7 +645,7 @@ public final class TestBorderPropertyTem
         }
         
         pt.drawBorders(a1c3, BorderStyle.NONE, BorderExtent.NONE);
-        pt.drawBorders(a1c3, BorderStyle.NONE, RED, BorderExtent.ALL);
+        pt.drawColoredBorders(a1c3, BorderStyle.NONE, RED, BorderExtent.ALL);
         for (int i = 0; i <= 2; i++) {
             for (int j = 0; j <= 2; j++) {
                 CellAddress addr = new CellAddress(i, j);
@@ -668,7 +667,7 @@ public final class TestBorderPropertyTem
         Workbook wb = new HSSFWorkbook();
         Sheet sheet = wb.createSheet();
         
-        pt.drawBorders(a1c3, BorderStyle.THIN, RED, BorderExtent.ALL);
+        pt.drawColoredBorders(a1c3, BorderStyle.THIN, RED, BorderExtent.ALL);
         pt.applyBorders(sheet);
         
         for (Row row: sheet) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message