FreeHEP API
Version current

org.freehep.swing.print.table
Class DefaultCellPrinter

java.lang.Object
  extended byorg.freehep.swing.print.table.DefaultCellPrinter
All Implemented Interfaces:
CellPrinter
Direct Known Subclasses:
NumberCellPrinter

public class DefaultCellPrinter
extends Object
implements CellPrinter

A default implementation of CellPrinter

Source Code:
DefaultCellPrinter.java

Field Summary
static int ALIGN_CENTER
           
static int ALIGN_LEFT
           
static int ALIGN_RIGHT
           
protected  String value
           
 
Method Summary
protected  String format(Object o)
           
 float getHeight(FontRenderContext frc)
          The height of one column
 float getWidth(FontRenderContext frc)
          Gets the width of the current current value.
 void print(Graphics g, Rectangle2D.Float r)
          Print this cell
 void setFont(Font font)
          Sets the font to be used
 void setValue(Object o)
          Sets the value of the cell to print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN_LEFT

public static final int ALIGN_LEFT
See Also:
Constant Field Values

ALIGN_CENTER

public static final int ALIGN_CENTER
See Also:
Constant Field Values

ALIGN_RIGHT

public static final int ALIGN_RIGHT
See Also:
Constant Field Values

value

protected String value
Method Detail

setFont

public void setFont(Font font)
Description copied from interface: CellPrinter
Sets the font to be used

Specified by:
setFont in interface CellPrinter
Parameters:
font - The font to be used

getHeight

public float getHeight(FontRenderContext frc)
Description copied from interface: CellPrinter
The height of one column

Specified by:
getHeight in interface CellPrinter
Parameters:
frc - The font render context to be used for calculating font sizes.
Returns:
The hieght of each column of the table

setValue

public void setValue(Object o)
Description copied from interface: CellPrinter
Sets the value of the cell to print

Specified by:
setValue in interface CellPrinter
Parameters:
o - The object to be printed

getWidth

public float getWidth(FontRenderContext frc)
Description copied from interface: CellPrinter
Gets the width of the current current value.

Specified by:
getWidth in interface CellPrinter
Parameters:
frc - The font render context to be used.
Returns:
The width needed to print the current value.

print

public void print(Graphics g,
                  Rectangle2D.Float r)
Description copied from interface: CellPrinter
Print this cell

Specified by:
print in interface CellPrinter
Parameters:
g - The graphics into which to print
r -

format

protected String format(Object o)

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.