public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: JTable.getCellRect() - additional checks
@ 2006-09-22 13:45 David Gilbert
  0 siblings, 0 replies; only message in thread
From: David Gilbert @ 2006-09-22 13:45 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

This patch (committed) adds some new checks to the existing test:

2006-09-22  David Gilbert  <david.gilbert@object-refinery.com>

	* gnu/testlet/javax/swing/JTable/getCellRect.java
	(test): Added new checks.

Regards,

Dave

[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 2185 bytes --]

Index: gnu/testlet/javax/swing/JTable/getCellRect.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/JTable/getCellRect.java,v
retrieving revision 1.3
diff -u -r1.3 getCellRect.java
--- gnu/testlet/javax/swing/JTable/getCellRect.java	21 Sep 2006 17:10:12 -0000	1.3
+++ gnu/testlet/javax/swing/JTable/getCellRect.java	22 Sep 2006 13:25:16 -0000
@@ -90,6 +90,43 @@
     harness.check(rectangle.y, 16);
     harness.check(rectangle.width, 75);
     harness.check(rectangle.height, 16);
+    
+    // try varying the row heights
+    table = new JTable(2, 3);
+    table.setRowHeight(0, 11);
+    table.setRowHeight(1, 12);
+    harness.check(table.getCellRect(0, 2, false), 
+            new Rectangle(150, 0, 74, 10));
+    harness.check(table.getCellRect(1, 2, false), 
+            new Rectangle(150, 11, 74, 11));
+    
+    // try varying the column widths
+    table = new JTable(2, 3);
+    table.getColumnModel().getColumn(0).setWidth(11);
+    table.getColumnModel().getColumn(1).setWidth(15);
+    table.getColumnModel().getColumn(2).setWidth(17);
+    harness.check(table.getCellRect(0, 0, false), new Rectangle(0, 0, 14, 15));
+    harness.check(table.getCellRect(1, 1, false), 
+            new Rectangle(15, 16, 14, 15));
+    harness.check(table.getCellRect(0, 2, false), new Rectangle(30, 0, 16, 15));
+    harness.check(table.getCellRect(1, 0, false), new Rectangle(0, 16, 14, 15));
+    harness.check(table.getCellRect(0, 1, false), new Rectangle(15, 0, 14, 15));
+    harness.check(table.getCellRect(1, 2, false), 
+            new Rectangle(30, 16, 16, 15));
+    
+    // try negative row
+    table = new JTable(2, 3);
+    harness.check(table.getCellRect(-1, 0, true), new Rectangle(0, 0, 75, 0));
+    
+    // try row index too large
+    table = new JTable(2, 3);
+    harness.check(table.getCellRect(99, 0, true), new Rectangle(0, 0, 75, 0));
+    
+    // try negative column
+    harness.check(table.getCellRect(0, -1, true), new Rectangle(0, 0, 0, 16));
+    
+    // try column index too large
+    harness.check(table.getCellRect(0, 99, true), new Rectangle(0, 0, 0, 16));
   }
 
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-22 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-22 13:45 FYI: JTable.getCellRect() - additional checks David Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).