renamed to SheetViewer in honor of Jason Height's fine work to make it not

suck anymore!  Thanks Jason!
Also added JAvadoc and remove template javadoc comments on overridden
methods so that they'll bleed through on javadoc generation.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew C. Oliver 2002-07-21 12:51:13 +00:00
parent 862c09d871
commit 2a62650d46
5 changed files with 39 additions and 43 deletions

View File

@ -7,8 +7,12 @@ import javax.swing.border.AbstractBorder;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
/**
* This is an attempt to implement Excel style borders for the SuckyViewer
*
* This is an attempt to implement Excel style borders for the SheetViewer.
* Mostly just overrides stuff so the javadoc won't appear here but will
* appear in the generated stuff.
*
* @author Andrew C. Oliver (acoliver at apache dot org)
* @author Jason Height
*/
public class SVBorder extends AbstractBorder {
private Color northColor = null;
@ -60,6 +64,11 @@ public class SVBorder extends AbstractBorder {
g.setColor(oldColor);
}
/**
* Called by paintBorder to paint the border of a selected cell.
* The paramaters are the Graphics object, location and dimensions of the
* cell.
*/
private void paintSelectedBorder(Graphics g, int x, int y, int width,
int height) {
if (selected) {
@ -74,6 +83,10 @@ public class SVBorder extends AbstractBorder {
}
/**
* Called by paintBorder to paint the various versions of normal line
* borders for a cell.
*/
private void paintNormalBorders(Graphics g, int x, int y, int width,
int height) {
@ -141,6 +154,10 @@ public class SVBorder extends AbstractBorder {
}
}
/**
* Called by paintBorder to paint the dotted line
* borders for a cell.
*/
private void paintDottedBorders(Graphics g, int x, int y, int width,
int height) {
if (northBorder &&
@ -203,7 +220,10 @@ public class SVBorder extends AbstractBorder {
}
}
/**
* Called by paintBorder to paint the various versions of dotted line
* borders for a cell.
*/
private void paintDashedBorders(Graphics g, int x, int y, int width,
int height) {
if (northBorder &&
@ -293,7 +313,10 @@ public class SVBorder extends AbstractBorder {
}
}
/**
* Called by paintBorder to paint the double line
* borders for a cell.
*/
private void paintDoubleBorders(Graphics g, int x, int y, int width,
int height) {
if (northBorder &&
@ -381,7 +404,10 @@ public class SVBorder extends AbstractBorder {
}
}
/**
* Called by paintBorder to paint the various versions of dash dot dot line
* borders for a cell.
*/
private void paintDashDotDotBorders(Graphics g, int x, int y, int width,
int height) {
if (northBorder &&
@ -483,6 +509,9 @@ public class SVBorder extends AbstractBorder {
return 18;
}
/**
* @returns the line thickness for a border based on border type
*/
private int getThickness(int thickness) {
int retval=1;
switch (thickness) {

View File

@ -67,7 +67,7 @@ import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
/**
* Sucky Viewer Table Cell Editor -- not commented via javadoc as it
* Sheet Viewer Table Cell Editor -- not commented via javadoc as it
* nearly completely consists of overridden methods.
*
* @author Jason Height
@ -85,11 +85,6 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd
private HSSFCell editorValue;
/**
*Constructor for the SVTableCellEditor object
*
* @param wb Description of the Parameter
*/
public SVTableCellEditor(HSSFWorkbook wb) {
this.wb = wb;
this.editor = new JTextField();
@ -99,7 +94,6 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd
/**
* Gets the cellEditable attribute of the SVTableCellEditor object
*
* @param e Description of the Parameter
* @return The cellEditable value
*/
public boolean isCellEditable(java.util.EventObject e) {
@ -110,34 +104,17 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd
}
/**
* Description of the Method
*
* @param anEvent Description of the Parameter
* @return Description of the Return Value
*/
public boolean shouldSelectCell(EventObject anEvent) {
return true;
}
/**
* Description of the Method
*
* @param anEvent Description of the Parameter
* @return Description of the Return Value
*/
public boolean startCellEditing(EventObject anEvent) {
System.out.println("Start Cell Editing");
return true;
}
/**
* Description of the Method
*
* @return Description of the Return Value
*/
public boolean stopCellEditing() {
System.out.println("Stop Cell Editing");
fireEditingStopped();
@ -145,18 +122,12 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd
}
/** Description of the Method */
public void cancelCellEditing() {
System.out.println("Cancel Cell Editing");
fireEditingCanceled();
}
/**
* Description of the Method
*
* @param e Description of the Parameter
*/
public void actionPerformed(ActionEvent e) {
System.out.println("Action performed");
stopCellEditing();
@ -178,11 +149,6 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd
/**
* Gets the tableCellEditorComponent attribute of the SVTableCellEditor object
*
* @param table Description of the Parameter
* @param value Description of the Parameter
* @param isSelected Description of the Parameter
* @param row Description of the Parameter
* @param column Description of the Parameter
* @return The tableCellEditorComponent value
*/
public Component getTableCellEditorComponent(JTable table, Object value,

View File

@ -75,7 +75,7 @@ import org.apache.poi.hssf.util.HSSFColor;
/**
* Sucky Viewer Table Cell Render -- not commented via javadoc as it
* Sheet Viewer Table Cell Render -- not commented via javadoc as it
* nearly completely consists of overridden methods.
*
* @author Andrew C. Oliver

View File

@ -64,7 +64,7 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFCell;
/**
* Sucky Viewer Table Model - The model for the Sucky Viewer just overrides things.
* Sheet Viewer Table Model - The model for the Sheet Viewer just overrides things.
* @author Andrew C. Oliver
*/

View File

@ -68,13 +68,14 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFCell;
/**
* Sucky Viewer - Views XLS files via HSSF. Can be used as an applet with
* Sheet Viewer - Views XLS files via HSSF. Can be used as an applet with
* filename="" or as a applications (pass the filename as the first parameter).
* Or you can pass it a URL in a "url" parameter when run as an applet or just
* that first parameter must start with http:// and it will guess its a url. I
* only tested it as an applet though, so it probably won't work...you fix it.
*
* @author Andrew C. Oliver
* @author Jason Height
*/
public class SViewer extends JApplet {
private SViewerPanel panel;