From d561e7b60ac0b1d939e654c49722f9dc92d0663e Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 21 Feb 2008 10:49:25 +0000 Subject: [PATCH] Use the right way to figure out how many rows on a sheet, so we display the row number for all of them on the left hand side. Also, tidy up some imports git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@629742 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hssf/contrib/view/SVRowHeader.java | 7 +++---- .../apache/poi/hssf/contrib/view/SVTableCellEditor.java | 2 -- .../apache/poi/hssf/contrib/view/SVTableCellRenderer.java | 5 ----- .../src/org/apache/poi/hssf/contrib/view/SViewer.java | 3 --- .../src/org/apache/poi/hssf/contrib/view/SViewerPanel.java | 1 - 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVRowHeader.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVRowHeader.java index fa76b1e434..fe63dfcc8a 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVRowHeader.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVRowHeader.java @@ -21,11 +21,8 @@ package org.apache.poi.hssf.contrib.view; import java.awt.*; -import java.awt.event.*; -import java.io.*; import javax.swing.*; import javax.swing.table.*; -import javax.swing.event.*; import org.apache.poi.hssf.usermodel.*; @@ -47,7 +44,9 @@ public class SVRowHeader extends JList { this.sheet = sheet; } - public int getSize() { return sheet.getPhysicalNumberOfRows(); } + public int getSize() { + return sheet.getLastRowNum() + 1; + } public Object getElementAt(int index) { return Integer.toString(index+1); } diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java index a433a7a11c..8b421ceaf1 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java @@ -20,11 +20,9 @@ package org.apache.poi.hssf.contrib.view; import java.awt.*; import java.awt.event.*; -import java.text.*; import java.util.*; import javax.swing.*; -import javax.swing.border.*; import javax.swing.table.*; import org.apache.poi.hssf.usermodel.*; diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java index 99333874ed..0e4873b5de 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java @@ -19,8 +19,6 @@ package org.apache.poi.hssf.contrib.view; -import java.util.Hashtable; - import javax.swing.*; import javax.swing.table.TableCellRenderer; import javax.swing.border.*; @@ -28,14 +26,11 @@ import javax.swing.border.*; import java.awt.Component; import java.awt.Color; import java.awt.Rectangle; -import java.awt.Font; import java.io.Serializable; import java.text.*; import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.hssf.util.HSSFColor; - /** diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java index a3756ce652..a3668f6490 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java @@ -23,13 +23,10 @@ package org.apache.poi.hssf.contrib.view; import java.awt.*; import java.awt.event.*; import java.net.*; -import java.applet.*; import java.io.*; import javax.swing.*; import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.hssf.usermodel.HSSFSheet; -import org.apache.poi.hssf.usermodel.HSSFCell; /** * Sheet Viewer - Views XLS files via HSSF. Can be used as an applet with diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java index c400d4fe48..c134ffd546 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewerPanel.java @@ -25,7 +25,6 @@ import java.awt.event.*; import java.io.*; import javax.swing.*; import javax.swing.table.*; -import javax.swing.event.*; import org.apache.poi.hssf.usermodel.*; -- 2.39.5