From: Andrew C. Oliver Date: Sat, 22 Jun 2002 20:54:14 +0000 (+0000) Subject: A little more work to improve suckyviewer X-Git-Tag: REL_1_10~294 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6d66d9e26a96eb50821c1020be3394bd9a9f2276;p=poi.git A little more work to improve suckyviewer PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352715 13f79535-47bb-0310-9956-ffa450edef68 --- 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 e1cddc1e2b..0c45069305 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 @@ -142,7 +142,7 @@ public class SVTableCellRenderer extends JLabel Font font = new Font(f.getFontName(),fontstyle,f.getFontHeightInPoints()); setFont(font); - + HSSFColor clr = null; if (s.getFillPattern() == HSSFCellStyle.SOLID_FOREGROUND) { @@ -155,6 +155,11 @@ public class SVTableCellRenderer extends JLabel setBackground(awtcolor); + clr = (HSSFColor)colors.get(new Integer(f.getColor())); + if (clr == null) clr = new HSSFColor.BLACK(); + rgb = clr.getTriplet(); + awtcolor = new Color(rgb[0],rgb[1],rgb[2]); + setForeground(awtcolor); } diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java index 6cbce80007..ada60a8400 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java @@ -91,7 +91,7 @@ public class SVTableModel extends AbstractTableModel { public int getColumnCount() { - return this.maxcol; + return this.maxcol+1; } public Object getValueAt(int row, int col) { HSSFRow r = st.getRow(row); @@ -110,4 +110,4 @@ public class SVTableModel extends AbstractTableModel { } -} \ No newline at end of file +} 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 157d7f5320..ba38f5ea60 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 @@ -109,6 +109,8 @@ public class SViewer extends Applet { boolean isurl = false; if (filename == null) filename = getParameter("filename"); + System.out.println("filename="+filename); + System.out.println("start="+filename.substring(0,7)); if (filename == null || filename.substring(0,7).equals("http://")) { isurl = true; if (filename == null) filename = getParameter("url");