Diamond Control Suite 3.0

diamondedge.swing
Interface DsCellProperties

All Superinterfaces:
DsConstants, SwingConstants
All Known Subinterfaces:
DsCell
All Known Implementing Classes:
DsListCell, DsTableCell

public interface DsCellProperties
extends DsConstants

Properties used to render cells in grids and tables.


Field Summary
static int ALIGN_DEFAULT
           
static int ROTATE_0
           
static int ROTATE_270
           
static int ROTATE_90
           
static int ROTATE_DEFAULT
           
 
Fields inherited from interface diamondedge.swing.DsConstants
ACCOUNTING, ALL, ASCENDING, ASCENDING_CASE, BORDER_BOTTOM, BORDER_LEFT, BORDER_NONE, BORDER_OUTLINE, BORDER_RIGHT, BORDER_TOP, CROSS_LINES, DASH, DASH_DOT, DASH_DOT_DOT, DEFAULT, DESCENDING, DESCENDING_CASE, DIAGONAL_CROSS_LINES, DOT, DOUBLE, DOUBLE_LINE, DOWNWARD_DIAGONAL_LINES, ETCHED, ETCHED_RAISED, FALSE, FIND_ALL, FIND_EQUALS, FIND_GT, FIND_GTE, FIND_LT, FIND_LTE, FIND_NE, FIND_PREFIX, FIND_REGEX, FIND_STRING, FIRST, FLAT, GRID_DASH, GRID_DASH_DOT, GRID_DASH_DOT_DOT, GRID_DOT, GRID_LINE, HIGHLIGHT_SELECTION_ALWAYS, HIGHLIGHT_SELECTION_NEVER, HIGHLIGHT_SELECTION_WITH_FOCUS, HORIZONTAL_LINES, LOWERED, LOWERED_LIGHT, NONE, RAISED, RAISED_LIGHT, SELECT_CELL, SELECT_NONE, SELECT_ROW, SINGLE, SINGLE_LINE, SOLID, STRETCH, TILE, TRANSPARENT, TRUE, UPWARD_DIAGONAL_LINES, VERTICAL_LINES
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Method Summary
 Paint getBackground()
          Returns a value which determines the background color behind the text.
 Border getBorder()
          Returns the border that will be painted on the outside.
 Paint getBorderLineColor()
          Returns a value which determines the color that line borders are drawn in.
 int getBorderLines()
          Returns a value that determines which border lines that are drawn around the cell.
 int getBorderLineWidth()
          Returns a value that determines the width of the lines that are drawn around the cell.
 int getBorderStyle()
          Returns a value that determines how the border for the cell is drawn.
 Font getFont()
          Returns the Font used to display the text of the cell.
 String getFontName()
          Returns the name of the font used to display the text for the cell.
 int getFontSize()
          Returns the size of the font used to display the text for the cell.
 int getFontUnderline()
          Returns a value that determines how the text for the cell is underlined.
 Paint getForeground()
          Returns a value which determines the color of the text.
 Object getFormat()
          Returns a Format/Formatter object that determines how the text for the cell is formatted.
 int getHorizontalAlignment()
          Returns a value that determines how the text for the cell is aligned horizontally.
 int getHorizontalTextPosition()
          Returns the horizontal position of the text in relation to the icon
 Icon getIcon()
          Returns the graphic image (glyph, icon) that the label displays.
 int getRotation()
          Returns a value that determines the rotation of the text and icon.
 int getTextStyle()
          Returns a value that determines how the text for the cell is drawn.
 int getVerticalAlignment()
          Returns a value that determines how the text for the cell is aligned horizontally.
 int getVerticalTextPosition()
          Returns the vertical position of the text in relation to the icon
 boolean isEditable()
          Returns a value that determines whether the value for the cell can be edited by the user at run-time.
 boolean isFontBold()
          Returns a value that determines whether the text for the cell is displayed with a bold font.
 boolean isFontItalic()
          Returns a value that determines whether the text for the cell is displayed with an italic style.
 boolean isFontStrikeThrough()
          Returns a value that determines whether the text for the cell is displayed with a line through the text.
 boolean isNegativeNumberRed()
          Returns a value that determines whether negative numbers are displayed in a red color.
 boolean isOpaque()
          Returns a value that determines whether the background for the cell is painted.
 boolean isWordWrap()
          Returns a value that determines whether the text for the cell is wrapped onto the line below if it doesn't fit.
 void reset()
          Resets all style information back to the default values.
 void setBackground(Paint c)
          Sets a value which determines the background color behind the text.
 void setBorder(Border b)
          Sets a border that will be painted around the cell.
 void setBorder(int borderLineWidth, int borderStyle, Paint borderLineColor)
          Creates a border around the cell.
 void setBorder(int borderLineWidth, int borderStyle, Paint borderLineColor, int borderLines)
          Creates a border around the cell.
 void setBorderLineColor(Paint c)
          Sets a value which determines the color that line borders are drawn in.
 void setBorderLines(int val)
          Sets a value that determines which border lines that are drawn around the cell.
 void setBorderLineWidth(int val)
          Sets a value that determines the width of the lines that are drawn around the cell.
 void setBorderStyle(int val)
          Sets a value that determines how the border for the cell is drawn.
 void setEditable(boolean val)
          Determines whether the value for the cell can be edited by the user at run-time.
 void setFont(Font f)
          Sets the Font used to display the text of the cell.
 void setFontBold(boolean val)
          Sets a value that determines whether the text for the cell is displayed with a bold font.
 void setFontItalic(boolean italic)
          Sets a value that determines whether the text for the cell is displayed with an italic style.
 void setFontName(String name)
          Sets the name of the font used to display the text for the cell.
 void setFontSize(int size)
          Sets the size of the font used to display the text for the cell.
 void setFontStrikeThrough(boolean val)
          Sets a value that determines whether the text for the cell is displayed with a line through the text.
 void setFontUnderline(int val)
          Sets a value that determines how the text for the cell is underlined.
 void setForeground(Paint c)
          Sets a value which determines the color of the text.
 void setFormat(Object val)
          Sets a value that determines how the text for the cell is formatted.
 void setHorizontalAlignment(int val)
          Sets the horizontal alignment of the text.
 void setHorizontalTextPosition(int textPosition)
          Sets the horizontal position of the text in relation to the icon.
 void setIcon(Icon icon)
          Defines the icon this component will display.
 void setIcon(Image image)
           
 void setNegativeNumberRed(boolean val)
          Sets a value that determines whether negative numbers are displayed in a red color.
 void setOpaque(boolean val)
          Sets a value that determines whether the background for the cell is painted.
 void setRotation(int val)
          Sets a value that determines the rotation of the text and icon.
 void setTextStyle(int val)
          Sets a value that determines how the text for the cell is drawn.
 void setVerticalAlignment(int val)
          Sets the vertical alignment of the text.
 void setVerticalTextPosition(int textPosition)
          Sets the vertical position of the text in relation to the icon.
 void setWordWrap(boolean val)
          Sets a value that determines whether the text for the cell is wrapped onto the line below if it doesn't fit.
 

Field Detail

ALIGN_DEFAULT

static final int ALIGN_DEFAULT
See Also:
Constant Field Values

ROTATE_DEFAULT

static final int ROTATE_DEFAULT
See Also:
Constant Field Values

ROTATE_0

static final int ROTATE_0
See Also:
Constant Field Values

ROTATE_90

static final int ROTATE_90
See Also:
Constant Field Values

ROTATE_270

static final int ROTATE_270
See Also:
Constant Field Values
Method Detail

reset

void reset()
Resets all style information back to the default values. This does not affect the value of the cell.


getForeground

Paint getForeground()
Returns a value which determines the color of the text.


setForeground

void setForeground(Paint c)
Sets a value which determines the color of the text.


getBackground

Paint getBackground()
Returns a value which determines the background color behind the text.


setBackground

void setBackground(Paint c)
Sets a value which determines the background color behind the text.


getFont

Font getFont()
Returns the Font used to display the text of the cell.


setFont

void setFont(Font f)
Sets the Font used to display the text of the cell.


getFontName

String getFontName()
Returns the name of the font used to display the text for the cell.


setFontName

void setFontName(String name)
Sets the name of the font used to display the text for the cell. If the name is the same as the name for GraphicUtil.defaultFont then the default value for the column is used.


getFontSize

int getFontSize()
Returns the size of the font used to display the text for the cell.


setFontSize

void setFontSize(int size)
Sets the size of the font used to display the text for the cell. If the size is the same as the size for GraphicUtil.defaultFont then the default value for the column is used.


isFontBold

boolean isFontBold()
Returns a value that determines whether the text for the cell is displayed with a bold font.


setFontBold

void setFontBold(boolean val)
Sets a value that determines whether the text for the cell is displayed with a bold font.


isFontItalic

boolean isFontItalic()
Returns a value that determines whether the text for the cell is displayed with an italic style.


setFontItalic

void setFontItalic(boolean italic)
Sets a value that determines whether the text for the cell is displayed with an italic style. If set to false then the default value for the column is used which is typically false.


isFontStrikeThrough

boolean isFontStrikeThrough()
Returns a value that determines whether the text for the cell is displayed with a line through the text.


setFontStrikeThrough

void setFontStrikeThrough(boolean val)
Sets a value that determines whether the text for the cell is displayed with a line through the text.


getFontUnderline

int getFontUnderline()
Returns a value that determines how the text for the cell is underlined.


setFontUnderline

void setFontUnderline(int val)
Sets a value that determines how the text for the cell is underlined. Valid values are:


isNegativeNumberRed

boolean isNegativeNumberRed()
Returns a value that determines whether negative numbers are displayed in a red color. The value in the cell must be an instance of the Number class.


setNegativeNumberRed

void setNegativeNumberRed(boolean val)
Sets a value that determines whether negative numbers are displayed in a red color. The value in the cell must be an instance of the Number class.


isOpaque

boolean isOpaque()
Returns a value that determines whether the background for the cell is painted.


setOpaque

void setOpaque(boolean val)
Sets a value that determines whether the background for the cell is painted.


isWordWrap

boolean isWordWrap()
Returns a value that determines whether the text for the cell is wrapped onto the line below if it doesn't fit.


setWordWrap

void setWordWrap(boolean val)
Sets a value that determines whether the text for the cell is wrapped onto the line below if it doesn't fit.


isEditable

boolean isEditable()
Returns a value that determines whether the value for the cell can be edited by the user at run-time.


setEditable

void setEditable(boolean val)
Determines whether the value for the cell can be edited by the user at run-time.


getHorizontalAlignment

int getHorizontalAlignment()
Returns a value that determines how the text for the cell is aligned horizontally.


setHorizontalAlignment

void setHorizontalAlignment(int val)
Sets the horizontal alignment of the text. Valid values are:


getVerticalAlignment

int getVerticalAlignment()
Returns a value that determines how the text for the cell is aligned horizontally.


setVerticalAlignment

void setVerticalAlignment(int val)
Sets the vertical alignment of the text. Valid values are:


getTextStyle

int getTextStyle()
Returns a value that determines how the text for the cell is drawn.


setTextStyle

void setTextStyle(int val)
Sets a value that determines how the text for the cell is drawn. Valid values are:

RAISED and LOWERED look good with larger or bold fonts. For smaller fonts use RAISED_LIGHT and LOWERED_LIGHT


getRotation

int getRotation()
Returns a value that determines the rotation of the text and icon.


setRotation

void setRotation(int val)
Sets a value that determines the rotation of the text and icon. Valid values are:


setBorder

void setBorder(int borderLineWidth,
               int borderStyle,
               Paint borderLineColor)
Creates a border around the cell. This is a convenience method which sets all the properties necessary to display a border in one method call. The borderLines is defaulted to BORDER_OUTLINE.

See Also:
setBorderLineWidth(int), setBorderStyle(int), setBorderLineColor(java.awt.Paint), setBorderLines(int)

setBorder

void setBorder(int borderLineWidth,
               int borderStyle,
               Paint borderLineColor,
               int borderLines)
Creates a border around the cell. This is a convenience method which sets all the properties necessary to display a border in one method call.

See Also:
setBorderLineWidth(int), setBorderStyle(int), setBorderLineColor(java.awt.Paint), setBorderLines(int)

getBorderStyle

int getBorderStyle()
Returns a value that determines how the border for the cell is drawn.


setBorderStyle

void setBorderStyle(int val)
Sets a value that determines how the border for the cell is drawn. Valid values are: The RAISED, LOWERED, and ETCHED styles ignores the BorderLineWidth, BorderLineColor, and BorderLines properties. The GRID_XXX styles ignores the BorderLineWidth property.

For best results in using GRID_XXX styles you should turn off painting of grid lines by calling grid.setShowGrid( false ). If the BorderLineColor is not specified then the grid.getGridColor() will be used for GRID_XXX styles and black for the the other line styles.


getBorderLines

int getBorderLines()
Returns a value that determines which border lines that are drawn around the cell.


setBorderLines

void setBorderLines(int val)
Sets a value that determines which border lines that are drawn around the cell. Valid values are:


getBorderLineWidth

int getBorderLineWidth()
Returns a value that determines the width of the lines that are drawn around the cell.


setBorderLineWidth

void setBorderLineWidth(int val)
Sets a value that determines the width of the lines that are drawn around the cell. Maximum line width is 7. Default value is 0.


getBorderLineColor

Paint getBorderLineColor()
Returns a value which determines the color that line borders are drawn in.


setBorderLineColor

void setBorderLineColor(Paint c)
Sets a value which determines the color that line borders are drawn in. If null, then black will be used.


getBorder

Border getBorder()
Returns the border that will be painted on the outside.


setBorder

void setBorder(Border b)
Sets a border that will be painted around the cell. Any border specified in the BorderStyle property will be drawn on the outside of this border.


getIcon

Icon getIcon()
Returns the graphic image (glyph, icon) that the label displays.


setIcon

void setIcon(Icon icon)
Defines the icon this component will display. If the value of icon is null, nothing is displayed.

See Also:
setVerticalTextPosition(int), setHorizontalTextPosition(int)

setIcon

void setIcon(Image image)

getHorizontalTextPosition

int getHorizontalTextPosition()
Returns the horizontal position of the text in relation to the icon


setHorizontalTextPosition

void setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the text in relation to the icon. One of:
 LEFT    - text is on the left side of the icon.
 CENTER  - text and icon are centered horizontally.
 RIGHT   - text is on the right side of the icon. (Default)


getVerticalTextPosition

int getVerticalTextPosition()
Returns the vertical position of the text in relation to the icon


setVerticalTextPosition

void setVerticalTextPosition(int textPosition)
Sets the vertical position of the text in relation to the icon. One of:
 TOP     - text is on the top of the icon.
 CENTER  - text and icon are centered vertically. (Default)
 BOTTOM  - text is on the bottom of the icon.


getFormat

Object getFormat()
Returns a Format/Formatter object that determines how the text for the cell is formatted.


setFormat

void setFormat(Object val)
Sets a value that determines how the text for the cell is formatted. Should be an instance of Format, ListFormat or DefaultFormatter If a DefaultFormatter is set then a JFormattedTextField will be used as the cell editor. If a ListFormat is set then a ComboBox will be used as the cell editor which will display all entries added to the ListFormat.


Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.