JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class JCCellStyle

java.lang.Object
  |
  +--com.klg.jclass.table.JCCellStyle
All Implemented Interfaces:
CellStyleModel, Cloneable, Serializable
Direct Known Subclasses:
JCLiveCellStyle

public class JCCellStyle
extends Object
implements Serializable, CellStyleModel

The JCCellStyle class provides a default implementation of the CellStyleModel interface.

See Also:
Serialized Form

Field Summary
protected  Color background
           
protected  com.klg.jclass.table.CellBorderModel border
           
protected  int border_sides
           
protected  boolean border_sides_set
           
protected  Color cell_border_color
           
protected  int cell_border_color_mode
           
protected  boolean cell_border_color_mode_set
           
protected  com.klg.jclass.table.CellStyleChangeSupport changeSupport
           
protected  int clip_hints
           
protected  boolean clip_hints_set
           
protected  Class data_type
           
protected  boolean data_type_set
           
protected  boolean editable
           
protected  boolean editable_set
           
protected  com.klg.jclass.cell.JCCellEditor editor
           
protected  boolean editor_set
           
protected  Font font
           
protected  Color foreground
           
protected  int horizontal_alignment
           
protected  boolean horizontal_alignment_set
           
protected  com.klg.jclass.table.CellStyleModel parent_style
           
protected  com.klg.jclass.cell.JCCellRenderer renderer
           
protected  boolean renderer_set
           
protected  int repeat_background
           
protected  Color[] repeat_background_colors
           
protected  boolean repeat_background_set
           
protected  int repeat_foreground
           
protected  Color[] repeat_foreground_colors
           
protected  boolean repeat_foreground_set
           
protected  boolean traversable
           
protected  boolean traversable_set
           
protected  int vertical_alignment
           
protected  boolean vertical_alignment_set
           
 
Fields inherited from interface com.klg.jclass.table.CellStyleModel
BOTTOM, CENTER, LEFT, RIGHT, SHOW_ALL, SHOW_HORIZONTAL, SHOW_NONE, SHOW_VERTICAL, TOP
 
Constructor Summary
JCCellStyle()
          Creates a new JCCellStyle instance and sets default values for all properties.
JCCellStyle(com.klg.jclass.table.CellStyleModel style)
          Creates a new JCCellStyle instance with the given style as a parent.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds a PropertyChangeListener for CellStyle property changes.
 Object clone()
          Returns a copy of the style object.
 void copyInto(com.klg.jclass.table.JCCellStyle style)
           
 Color getBackground()
          Returns the background color of the cell.
 com.klg.jclass.table.CellBorderModel getCellBorder()
          Returns the CellBorderModel object for the cell.
 Color getCellBorderColor()
          Returns the CellBorder color for the cell.
 int getCellBorderColorMode()
          Returns the mode used to determine how the cell border color is chosen.
 int getCellBorderSides()
          Returns the border sides value for the cell.
 com.klg.jclass.cell.JCCellEditor getCellEditor()
          Gets the cell's editor.
 com.klg.jclass.cell.JCCellRenderer getCellRenderer()
          Gets the cell's renderer.
 int getClipHints()
          Determines whether the renderer should draw some indication if the entire contents of the cell cannot be rendered within the given area.
 Class getDataType()
          Returns the cell's associated data type.
 Font getFont()
          Returns the font of the cell.
 Color getForeground()
          Returns the foreground color of the cell.
 int getHorizontalAlignment()
          Returns the horizontal alignment for the cell.
 com.klg.jclass.table.CellStyleModel getParentStyle()
          Returns the parent style.
 int getRepeatBackground()
          Returns the background repeat flag.
 Color[] getRepeatBackgroundColors()
          Gets the table's RepeatBackgroundColors value.
 int getRepeatForeground()
          Returns the foreground repeat flag.
 Color[] getRepeatForegroundColors()
          Gets the table's RepeatForegroundColors value.
 int getVerticalAlignment()
          Returns the vertical alignment for the cell.
 boolean isEditable()
          Returns true if the cell is editable.
 boolean isTraversable()
          Returns true if the cell is traversable.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes a PropertyChangeListener for CellStyle property changes.
 void setBackground(Color value)
          Sets the background color of the cell.
 void setCellBorder(com.klg.jclass.table.CellBorderModel value)
          Sets the CellBorder object for the cell.
 void setCellBorderColor(Color value)
          Sets the CellBorder color for the cell.
 void setCellBorderColorMode(int value)
          Sets the mode used to determine cell border colors.
 void setCellBorderSides(int value)
          Sets the border sides for the cell.
 void setCellEditor(com.klg.jclass.cell.JCCellEditor editor)
          Sets the editor for a cell.
 void setCellRenderer(com.klg.jclass.cell.JCCellRenderer renderer)
          Sets the renderer for a cell.
 void setClipHints(int value)
          Sets whether the renderer should draw some indication if the entire contents of the cell cannot be rendered within the given area.
 void setDataType(Class value)
          Sets the cell's associated data type.
 void setEditable(boolean value)
          Sets whether the cell is editable.
 void setFont(Font value)
          Sets the font used for drawing text within the cell.
 void setForeground(Color value)
          Sets the foreground color of the cell.
 void setHorizontalAlignment(int value)
          Sets the horizontal alignment for the cell.
 void setParentStyle(com.klg.jclass.table.CellStyleModel parent)
          Sets the parent style.
 void setRepeatBackground(int value)
          Sets whether the background color uses the BackgroundRepeatColors for rows or columns.
 void setRepeatBackgroundColors(Color[] values)
          Sets an array of colors to be used when Background value is JCTableEnum.REPEAT_ROW or JCTableEnum.REPEAT_COLUMN.
 void setRepeatForeground(int value)
          Sets whether the foreground color uses the ForegroundRepeatColors for rows or columns.
 void setRepeatForegroundColors(Color[] values)
          Sets an array of colors to be used when Foreground value is JCTableEnum.REPEAT_ROW or JCTableEnum.REPEAT_COLUMN.
 void setTraversable(boolean value)
          Sets whether the cell is traversable.
 void setVerticalAlignment(int value)
          Sets the vertical alignment for the cell.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent_style

protected com.klg.jclass.table.CellStyleModel parent_style

background

protected Color background

border

protected com.klg.jclass.table.CellBorderModel border

border_sides

protected int border_sides

cell_border_color

protected Color cell_border_color

cell_border_color_mode

protected int cell_border_color_mode

clip_hints

protected int clip_hints

data_type

protected Class data_type

editable

protected boolean editable

editor

protected com.klg.jclass.cell.JCCellEditor editor

foreground

protected Color foreground

font

protected Font font

horizontal_alignment

protected int horizontal_alignment

renderer

protected com.klg.jclass.cell.JCCellRenderer renderer

repeat_background

protected int repeat_background

repeat_background_colors

protected Color[] repeat_background_colors

repeat_foreground

protected int repeat_foreground

repeat_foreground_colors

protected Color[] repeat_foreground_colors

traversable

protected boolean traversable

vertical_alignment

protected int vertical_alignment

border_sides_set

protected boolean border_sides_set

cell_border_color_mode_set

protected boolean cell_border_color_mode_set

clip_hints_set

protected boolean clip_hints_set

data_type_set

protected boolean data_type_set

editable_set

protected boolean editable_set

editor_set

protected boolean editor_set

horizontal_alignment_set

protected boolean horizontal_alignment_set

renderer_set

protected boolean renderer_set

repeat_background_set

protected boolean repeat_background_set

repeat_foreground_set

protected boolean repeat_foreground_set

traversable_set

protected boolean traversable_set

vertical_alignment_set

protected boolean vertical_alignment_set

changeSupport

protected com.klg.jclass.table.CellStyleChangeSupport changeSupport
Constructor Detail

JCCellStyle

public JCCellStyle()
Creates a new JCCellStyle instance and sets default values for all properties.


JCCellStyle

public JCCellStyle(com.klg.jclass.table.CellStyleModel style)
Creates a new JCCellStyle instance with the given style as a parent. All requests for property values will be forwarded to the parent unless overriden in this style.

Parameters:
style -
Method Detail

getParentStyle

public com.klg.jclass.table.CellStyleModel getParentStyle()
Returns the parent style.

Specified by:
getParentStyle in interface CellStyleModel
Returns:
parent style

setParentStyle

public void setParentStyle(com.klg.jclass.table.CellStyleModel parent)
Sets the parent style.

Specified by:
setParentStyle in interface CellStyleModel
Parameters:
parent -

getBackground

public Color getBackground()
Returns the background color of the cell.

Specified by:
getBackground in interface CellStyleModel
Returns:
background color of the cell

setBackground

public void setBackground(Color value)
Sets the background color of the cell.

Specified by:
setBackground in interface CellStyleModel
Parameters:
value -

getCellBorder

public com.klg.jclass.table.CellBorderModel getCellBorder()
Returns the CellBorderModel object for the cell.

Specified by:
getCellBorder in interface CellStyleModel
Returns:
CellBorderModel object for the cell

setCellBorder

public void setCellBorder(com.klg.jclass.table.CellBorderModel value)
Sets the CellBorder object for the cell.

Specified by:
setCellBorder in interface CellStyleModel
Parameters:
value -

getCellBorderColor

public Color getCellBorderColor()
Returns the CellBorder color for the cell.

Specified by:
getCellBorderColor in interface CellStyleModel
Returns:
CellBorder color for the cell

setCellBorderColor

public void setCellBorderColor(Color value)
Sets the CellBorder color for the cell.

Specified by:
setCellBorderColor in interface CellStyleModel
Parameters:
value -

getCellBorderColorMode

public int getCellBorderColorMode()
Returns the mode used to determine how the cell border color is chosen.

Specified by:
getCellBorderColorMode in interface CellStyleModel
Returns:
mode used to determine how the cell border color is chosen

setCellBorderColorMode

public void setCellBorderColorMode(int value)
Sets the mode used to determine cell border colors.

Specified by:
setCellBorderColorMode in interface CellStyleModel
Parameters:
value -

getCellBorderSides

public int getCellBorderSides()
Returns the border sides value for the cell.

Specified by:
getCellBorderSides in interface CellStyleModel
Returns:
border sides value for the cell

setCellBorderSides

public void setCellBorderSides(int value)
Sets the border sides for the cell. Valid values are BORDERSIDE_NONE, BORDERSIDE_ALL, and combinations of BORDERSIDE_LEFT, BORDERSIDE_RIGHT, BORDERSIDE_TOP, and BORDERSIDE_BOTTOM.

Specified by:
setCellBorderSides in interface CellStyleModel
Parameters:
value -

getCellEditor

public com.klg.jclass.cell.JCCellEditor getCellEditor()
Gets the cell's editor. If null, JClass LiveTable maps the editor based on the type of data.

Specified by:
getCellEditor in interface CellStyleModel
Returns:

setCellEditor

public void setCellEditor(com.klg.jclass.cell.JCCellEditor editor)
Sets the editor for a cell. If null, JClass LiveTable maps the editor based on the type of data.

Specified by:
setCellEditor in interface CellStyleModel
Parameters:
editor -

getCellRenderer

public com.klg.jclass.cell.JCCellRenderer getCellRenderer()
Gets the cell's renderer. If null, JClass LiveTable maps the renderer based on the type of data.

Specified by:
getCellRenderer in interface CellStyleModel
Returns:

setCellRenderer

public void setCellRenderer(com.klg.jclass.cell.JCCellRenderer renderer)
Sets the renderer for a cell. If null, JClass LiveTable maps the renderer based on the type of data.

Specified by:
setCellRenderer in interface CellStyleModel
Parameters:
renderer -

getClipHints

public int getClipHints()
Determines whether the renderer should draw some indication if the entire contents of the cell cannot be rendered within the given area.

Specified by:
getClipHints in interface CellStyleModel
Returns:

setClipHints

public void setClipHints(int value)
Sets whether the renderer should draw some indication if the entire contents of the cell cannot be rendered within the given area. Valid values are SHOW_NONE, SHOW_HORIZONTAL, SHOW_VERTICAL, and SHOW_ALL

Specified by:
setClipHints in interface CellStyleModel
Parameters:
value -

getDataType

public Class getDataType()
Returns the cell's associated data type.

Specified by:
getDataType in interface CellStyleModel
Returns:
cell's associated data type
See Also:
setDataType(java.lang.Class)

setDataType

public void setDataType(Class value)
Sets the cell's associated data type. The data type is used to determine the renderer/editor in the case where the data source returns a null value.

Specified by:
setDataType in interface CellStyleModel
Parameters:
value -

isEditable

public boolean isEditable()
Returns true if the cell is editable.

Specified by:
isEditable in interface CellStyleModel
Returns:
true if cell is editable

setEditable

public void setEditable(boolean value)
Sets whether the cell is editable.

Specified by:
setEditable in interface CellStyleModel
Parameters:
value -

getFont

public Font getFont()
Returns the font of the cell.

Specified by:
getFont in interface CellStyleModel
Returns:
font of the cell

setFont

public void setFont(Font value)
Sets the font used for drawing text within the cell.

Specified by:
setFont in interface CellStyleModel
Parameters:
value -

getForeground

public Color getForeground()
Returns the foreground color of the cell.

Specified by:
getForeground in interface CellStyleModel
Returns:
foreground color of the cell

setForeground

public void setForeground(Color value)
Sets the foreground color of the cell.

Specified by:
setForeground in interface CellStyleModel
Parameters:
value -

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment for the cell. Valid return values are LEFT, CENTER, and RIGHT.

Specified by:
getHorizontalAlignment in interface CellStyleModel
Returns:
horizontal alignment for the cell

setHorizontalAlignment

public void setHorizontalAlignment(int value)
Sets the horizontal alignment for the cell.

Specified by:
setHorizontalAlignment in interface CellStyleModel
Parameters:
value -

getRepeatBackground

public int getRepeatBackground()
Returns the background repeat flag.

Specified by:
getRepeatBackground in interface CellStyleModel
Returns:
background repreat flag

setRepeatBackground

public void setRepeatBackground(int value)
Sets whether the background color uses the BackgroundRepeatColors for rows or columns. Valid values are JCTableEnum.REPEAT_NONE, JCTableEnum.REPEAT_ROW, or JCTableEnum.REPEAT_COLUMN.

Specified by:
setRepeatBackground in interface CellStyleModel
Parameters:
value -

getRepeatBackgroundColors

public Color[] getRepeatBackgroundColors()
Gets the table's RepeatBackgroundColors value.

Specified by:
getRepeatBackgroundColors in interface CellStyleModel
Returns:
See Also:
setRepeatBackgroundColors(java.awt.Color[])

setRepeatBackgroundColors

public void setRepeatBackgroundColors(Color[] values)
Sets an array of colors to be used when Background value is JCTableEnum.REPEAT_ROW or JCTableEnum.REPEAT_COLUMN.

Specified by:
setRepeatBackgroundColors in interface CellStyleModel
Parameters:
values -

getRepeatForeground

public int getRepeatForeground()
Returns the foreground repeat flag.

Specified by:
getRepeatForeground in interface CellStyleModel
Returns:
foreground repeat flag

setRepeatForeground

public void setRepeatForeground(int value)
Sets whether the foreground color uses the ForegroundRepeatColors for rows or columns. Valid values are JCTableEnum.REPEAT_NONE, JCTableEnum.REPEAT_ROW, or JCTableEnum.REPEAT_COLUMN.

Specified by:
setRepeatForeground in interface CellStyleModel
Parameters:
value - The new repeatForeground value

getRepeatForegroundColors

public Color[] getRepeatForegroundColors()
Gets the table's RepeatForegroundColors value.

Specified by:
getRepeatForegroundColors in interface CellStyleModel
Returns:
See Also:
setRepeatForegroundColors(java.awt.Color[])

setRepeatForegroundColors

public void setRepeatForegroundColors(Color[] values)
Sets an array of colors to be used when Foreground value is JCTableEnum.REPEAT_ROW or JCTableEnum.REPEAT_COLUMN.

Specified by:
setRepeatForegroundColors in interface CellStyleModel
Parameters:
values -

isTraversable

public boolean isTraversable()
Returns true if the cell is traversable.

Specified by:
isTraversable in interface CellStyleModel
Returns:
true if cell is traversable

setTraversable

public void setTraversable(boolean value)
Sets whether the cell is traversable.

Specified by:
setTraversable in interface CellStyleModel
Parameters:
value -

getVerticalAlignment

public int getVerticalAlignment()
Returns the vertical alignment for the cell. Valid return values are TOP, CENTER, and BOTTOM.

Specified by:
getVerticalAlignment in interface CellStyleModel
Returns:
vertical alignment for the cell; one of TOP, CENTER, or BOTTOM

setVerticalAlignment

public void setVerticalAlignment(int value)
Sets the vertical alignment for the cell.

Specified by:
setVerticalAlignment in interface CellStyleModel
Parameters:
value -

clone

public Object clone()
Description copied from interface: CellStyleModel
Returns a copy of the style object.

Specified by:
clone in interface CellStyleModel
Overrides:
clone in class Object

copyInto

public void copyInto(com.klg.jclass.table.JCCellStyle style)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener for CellStyle property changes. CellStyleChangeSupport is a utility class that can be used to manage listeners and fire PropertyChange events.

Specified by:
addPropertyChangeListener in interface CellStyleModel
Parameters:
l - The property change listener to add

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener for CellStyle property changes.

Specified by:
removePropertyChangeListener in interface CellStyleModel
Parameters:
l - The property change listener to remove

Copyright © 2004 Quest Software Inc..
All rights reserved.