jdbreport.model
Class ReportCell

java.lang.Object
  extended by jdbreport.model.ReportCell
All Implemented Interfaces:
Serializable, Cloneable, Cell
Direct Known Subclasses:
TemplateReportCell

public class ReportCell
extends Object
implements Cell, Serializable, Cloneable

Version:
2.0 07.06.2011
Author:
Andrey Kholmanskih
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jdbreport.model.Cell
Cell.Type
 
Field Summary
static HashMap<Class<?>,CellValueInfo> defaultValuesByClass
           
 
Fields inherited from interface jdbreport.model.Cell
EMPTY_STRING, TEXT_HTML, TEXT_PLAIN
 
Constructor Summary
ReportCell()
          Creates a new instance of ReportCell
ReportCell(Object value)
           
 
Method Summary
 void clear()
          Sets all properties by default
 Object clone()
           
 int getColSpan()
          Returns a number of spanned columns for the cell
 String getContentType()
           
 int getExtFlags()
           
 Icon getIcon()
          Deprecated. use getPricture()
 String getImageFormat()
           
 Cell getOwner()
          Returns the owner of the cell, can be null
 Picture getPicture()
          Returns the picture of the cell
 int getRowSpan()
          Returns a number of spanned rows for the cell
 Object getStyleId()
          Key of the CellStyle in the map of the CellStyles
 String getText()
           
 Object getValue()
          Returns the value for the cell
 Cell.Type getValueType()
           
 boolean isChild()
          Returns true if the cell has an owner
 boolean isEditable()
          Default true
 boolean isNotPrint()
          Returns true if the cell is not printed
 boolean isNull()
          Determines if the cell is null
 boolean isScaleIcon()
          Determines whether the icons are scaled
 boolean isSpan()
           
 void setColSpan(int value)
          Sets a number of spanned columns for the cell
static void setDefaultCellValueClass(Class<?> valueClass, Class<?> cellValueClass, String rendererClass, String editorClass)
          Adds or removes default cell values
 void setEditable(boolean b)
          Sets the editable property, which must be false to disable edit of the cells
 void setExtFlags(int i)
           
 void setIcon(Icon icon)
          Sets an icon to the cell
 void setImage(Image image)
          Sets an icon to the cell
 void setImageFormat(String format)
           
 void setNotPrint(boolean b)
          Sets the notPrint property, which must be true to disable printing of the cells
 void setOwner(Cell newOwner)
          Sets the owner of the cell
 void setPicture(Picture picture)
          Sets an picture to the cell
 void setRowSpan(int value)
          Sets a number of spanned rows for the cell
 void setScaleIcon(boolean scale)
          Sets a scale of the icon.
 void setStyleId(Object index)
          Sets the CellStyle's id for the cell
 void setValue(Object value)
           
 void setValueType(Cell.Type valueType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultValuesByClass

public static HashMap<Class<?>,CellValueInfo> defaultValuesByClass
Constructor Detail

ReportCell

public ReportCell()
Creates a new instance of ReportCell


ReportCell

public ReportCell(Object value)
Method Detail

setDefaultCellValueClass

public static void setDefaultCellValueClass(Class<?> valueClass,
                                            Class<?> cellValueClass,
                                            String rendererClass,
                                            String editorClass)
Adds or removes default cell values

Parameters:
valueClass -
cellValueClass -
editorClass -
rendererClass -

toString

public String toString()
Overrides:
toString in class Object

getValue

public Object getValue()
Description copied from interface: Cell
Returns the value for the cell

Specified by:
getValue in interface Cell
Returns:
the value Object at the cell

setValue

public void setValue(Object value)
Specified by:
setValue in interface Cell
Parameters:
value - to assign to cell

getColSpan

public int getColSpan()
Description copied from interface: Cell
Returns a number of spanned columns for the cell

Specified by:
getColSpan in interface Cell
Returns:
colSpan of the cell

setColSpan

public void setColSpan(int value)
Description copied from interface: Cell
Sets a number of spanned columns for the cell

Specified by:
setColSpan in interface Cell
Parameters:
value - a number of spanned columns

getRowSpan

public int getRowSpan()
Description copied from interface: Cell
Returns a number of spanned rows for the cell

Specified by:
getRowSpan in interface Cell
Returns:
rowSpan of the cell

setRowSpan

public void setRowSpan(int value)
Description copied from interface: Cell
Sets a number of spanned rows for the cell

Specified by:
setRowSpan in interface Cell
Parameters:
value - a number of spanned rows

getOwner

public Cell getOwner()
Description copied from interface: Cell
Returns the owner of the cell, can be null

Specified by:
getOwner in interface Cell
Returns:
owner of the cell

setOwner

public void setOwner(Cell newOwner)
Description copied from interface: Cell
Sets the owner of the cell

Specified by:
setOwner in interface Cell
Parameters:
newOwner - the owner of the cell, can be null

isChild

public boolean isChild()
Description copied from interface: Cell
Returns true if the cell has an owner

Specified by:
isChild in interface Cell
Returns:
true if the cell has an owner

isSpan

public boolean isSpan()
Specified by:
isSpan in interface Cell
Returns:
true if the rowSpan or the columnSpan is more than zero

isNull

public boolean isNull()
Description copied from interface: Cell
Determines if the cell is null

Specified by:
isNull in interface Cell
Returns:
true if the cell is null

getStyleId

public Object getStyleId()
Description copied from interface: Cell
Key of the CellStyle in the map of the CellStyles

Specified by:
getStyleId in interface Cell
Returns:
the CellStyle's id

setStyleId

public void setStyleId(Object index)
Description copied from interface: Cell
Sets the CellStyle's id for the cell

Specified by:
setStyleId in interface Cell
Parameters:
index - the CellStyle's id

getExtFlags

public int getExtFlags()
Specified by:
getExtFlags in interface Cell
Returns:
extFlags property

setExtFlags

public void setExtFlags(int i)
Specified by:
setExtFlags in interface Cell

isNotPrint

public boolean isNotPrint()
Description copied from interface: Cell
Returns true if the cell is not printed

Specified by:
isNotPrint in interface Cell
Returns:
true if the cell is not printed

setNotPrint

public void setNotPrint(boolean b)
Description copied from interface: Cell
Sets the notPrint property, which must be true to disable printing of the cells

Specified by:
setNotPrint in interface Cell
Parameters:
b - if true the cell is not printed

clone

public Object clone()
Specified by:
clone in interface Cell
Overrides:
clone in class Object

getText

public String getText()
Specified by:
getText in interface Cell
Returns:
the string value of the cell

setIcon

public void setIcon(Icon icon)
Description copied from interface: Cell
Sets an icon to the cell

Specified by:
setIcon in interface Cell
Parameters:
icon - the cell icon

setImage

public void setImage(Image image)
Description copied from interface: Cell
Sets an icon to the cell

Specified by:
setImage in interface Cell
Parameters:
image - the cell image

getIcon

public Icon getIcon()
Deprecated. use getPricture()

(non-Javadoc)

Specified by:
getIcon in interface Cell
Returns:
the icon of the cell
See Also:
Cell.getIcon()

getPicture

public Picture getPicture()
Description copied from interface: Cell
Returns the picture of the cell

Specified by:
getPicture in interface Cell
Returns:
the picture of the cell

setPicture

public void setPicture(Picture picture)
Description copied from interface: Cell
Sets an picture to the cell

Specified by:
setPicture in interface Cell
Parameters:
picture - the cell picture

isScaleIcon

public boolean isScaleIcon()
Description copied from interface: Cell
Determines whether the icons are scaled

Specified by:
isScaleIcon in interface Cell
Returns:
true if the icon is scaled

setScaleIcon

public void setScaleIcon(boolean scale)
Description copied from interface: Cell
Sets a scale of the icon. If true, the icon's sizes are set like the cell's sizes

Specified by:
setScaleIcon in interface Cell
Parameters:
scale - scaleIcon property

setImageFormat

public void setImageFormat(String format)
Specified by:
setImageFormat in interface Cell
Parameters:
format - the image's format e.g. "bmp", "png", "jpg"

getImageFormat

public String getImageFormat()
Specified by:
getImageFormat in interface Cell
Returns:
the image's format e.g. "bmp", "png", "jpg"

getContentType

public String getContentType()
Specified by:
getContentType in interface Cell
Returns:
the cell's content e.g. "text/plain" or "text/html"

clear

public void clear()
Description copied from interface: Cell
Sets all properties by default

Specified by:
clear in interface Cell

getValueType

public Cell.Type getValueType()
Specified by:
getValueType in interface Cell
Returns:
the type of the cell's value

setValueType

public void setValueType(Cell.Type valueType)
Specified by:
setValueType in interface Cell
Parameters:
valueType - new type of the cell's value

isEditable

public boolean isEditable()
Description copied from interface: Cell
Default true

Specified by:
isEditable in interface Cell
Returns:
editable

setEditable

public void setEditable(boolean b)
Description copied from interface: Cell
Sets the editable property, which must be false to disable edit of the cells

Specified by:
setEditable in interface Cell
Parameters:
b - if true the cell is editable