|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object diamondedge.swing.grid.DsCellRange
public class DsCellRange
A class which allows properties to be set accross a range of cells.
Warning: all methods except fillRows and fillColumns will re-order the values of the first row and column in the range. Most will re-order to go from top-left corner to the bottom-right corner.
Field Summary | |
---|---|
static int |
SERIES_DAY
all cells will be filled with a Date object whose day value increases by the given increment. |
static int |
SERIES_DOUBLE
all cells will be filled with an Integer object that increases by the given increment. |
static int |
SERIES_INTEGER
all cells will be filled with an Integer object that increases by the given increment. |
static int |
SERIES_LONG
all cells will be filled with an Integer object that increases by the given increment. |
static int |
SERIES_MONTH
all cells will be filled with a Date object whose month value increases by the given increment. |
static int |
SERIES_SAME
all cells will be filled with the same value. |
static int |
SERIES_YEAR
all cells will be filled with a Date object whose year value increases by the given increment. |
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 | |
---|---|
void |
clear(boolean clearStyleOnly)
Deletes all style properties in a DsCell and optionally the value for each cell in the range. |
boolean |
contains(int row,
int col)
|
void |
convertToGeneral()
Attempts to convert the value of each cell into a Number, Boolean, Date in that order. |
void |
convertToNumber()
Converts the value of each cell to a Number object. |
void |
fillColumns(int seriesType,
double increment,
boolean copyCellStyles)
Sets the values and/or styles for the range of cells using values/styles in the firstRow and propagating them through their respective columns so that all values in the same column will have the value specified by the seriesType. |
void |
fillDown()
Sets the values and styles for the range of cells using values/styles in the top-most row and propagating them through their respective columns so that all values in the same column will have the same value and style. |
void |
fillLeft()
Sets the values and styles for the range of cells using values/styles in the left-most column and propagating them through their respective rows so that all values in the same row will have the same value and style. |
void |
fillRight()
Sets the values and styles for the range of cells using values/styles in the left-most column and propagating them through their respective rows so that all values in the same row will have the same value and style. |
void |
fillRows(int seriesType,
double increment,
boolean copyCellStyles)
Sets the values and/or styles for the range of cells using values/styles in the firstColumn and propagating them through their respective rows so that all values in the same row will have the value specified by the seriesType. |
void |
fillUp()
Sets the values and styles for the range of cells using values/styles in the bottom-most row and propagating them through their respective columns so that all values in the same column will have the same value and style. |
DsCellRange |
find(Object searchFor,
int matchType,
int action)
Finds a value in a cell or multiple cells. |
DsCellRange |
find(Object searchFor,
int matchType,
int action,
int startRow,
int startCol)
Finds a value in a cell or multiple cells. |
String |
getClipString()
Returns the cells formated into a tab delimited string. |
void |
justifyOrder()
if firstRow > lastRow or firstColumn > lastColumn then their values are switched so the range is properly ordered from top-left corner to the bottom-right corner. |
void |
outline(Color color,
int lineStyle,
int lineWidth)
Creates a line border around the entire perimeter of the range of cells with the given line width, style and color. |
void |
outline(Color color,
int lineStyle,
int lineWidth,
int borderLines)
Creates a line border around the perimeter of the range of cells with the given line width, style and color for each of the specified sides of the perimeter. |
void |
removeSpans()
Removes all spans that are contained in or intersect with the cell range. |
void |
reOrder(boolean rowsTopToBottom,
boolean columnsLeftToRight)
if firstRow > lastRow or firstColumn > lastColumn then their values are switched so the range is properly ordered from top-left corner to the bottom-right corner. |
DsCellRange |
replace(Object searchFor,
int matchType,
Object replaceWith)
Finds values in a cell or multiple cells and replaces the entire value with the value specified. |
void |
setBackground(Color c)
Sets the background color for the range of cells. |
void |
setBorder(Border b)
Sets a border that will be painted on the outside of each cell in the range. |
void |
setBorderLineColor(Color 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 each cell in the range. |
void |
setBorderStyle(int val)
Sets a value that determines how the border is drawn for the range of cells. |
void |
setData(Object val)
Sets a user defined object to be stored with each cell. |
void |
setEditable(boolean val)
Determines whether the value for the range of cells can be edited by the user at run-time. |
void |
setFont(Font f)
Sets the Font used to display the text for the range of cells. |
void |
setFontBold(boolean val)
Sets the font for the range of cells to be a bold font. |
void |
setFontItalic(boolean val)
Sets the font for the range of cells to be a Italic font. |
void |
setFontName(String val)
Sets the font name for the range of cells. |
void |
setFontSize(int val)
Sets the font size for the range of cells. |
void |
setFontStrikeThrough(boolean val)
Sets the font for the range of cells to be a bold font. |
void |
setFontUnderline(int val)
Sets the font for the range of cells to be a bold font. |
void |
setForeground(Color c)
Sets the foreground color used to draw the text for the range of cells. |
void |
setFormat(Object val)
Sets a value that determines how the text for each cell is formatted. |
void |
setHorizontalAlignment(int val)
Sets the HorizontalAlignment for the range of cells. |
void |
setHorizontalTextPosition(int val)
Sets the horizontal position of the text in relation to the icon. |
void |
setIcon(Icon icon)
Sets icon this displayed of each cell in the range. |
void |
setNegativeNumberRed(boolean val)
Sets a value for the range of cells that determines whether negative numbers are displayed in a red color. |
void |
setOpaque(boolean val)
Sets a value for the range of cells that determines whether the background for the cell is painted. |
void |
setRotation(int val)
Sets the rotation for the range of cells. |
void |
setShowGrid(boolean showGrid)
Sets whether the table draws grid lines around cells. |
void |
setTextStyle(int val)
Sets the TextStyle for the range of cells. |
void |
setValue(Object value)
Sets the text contents/object for the range of cells. |
void |
setVerticalAlignment(int val)
Sets the VerticalAlignment for the range of cells. |
void |
setVerticalTextPosition(int val)
Sets the vertical position of the text in relation to the icon. |
void |
setWordWrap(boolean val)
Sets the WordWrap for the range of cells. |
void |
spanCells()
Makes the top left cell span across the space occupied by the cell range. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SERIES_SAME
public static final int SERIES_INTEGER
public static final int SERIES_LONG
public static final int SERIES_DOUBLE
public static final int SERIES_DAY
public static final int SERIES_MONTH
public static final int SERIES_YEAR
Method Detail |
---|
public String toString()
toString
in class Object
public String getClipString()
public boolean contains(int row, int col)
public void justifyOrder()
public void reOrder(boolean rowsTopToBottom, boolean columnsLeftToRight)
public void spanCells()
public void removeSpans()
public void outline(Color color, int lineStyle, int lineWidth)
SOLID
DOUBLE_LINE
DASH
DOT
DASH_DOT
DASH_DOT_DOT
GRID_LINE
- solid single-pixel line drawn where the grid lines are drawn
GRID_DASH
- dashed single-pixel line drawn where the grid lines are drawn
GRID_DOT
- dotted single-pixel line drawn where the grid lines are drawn
GRID_DASH_DOT
- alternating dashes and dotted single-pixel lines drawn where the grid lines are drawn
GRID_DASH_DOT_DOT
- alternating dashes and two dotted single-pixel lines drawn where the grid lines are drawn
public void outline(Color color, int lineStyle, int lineWidth, int borderLines)
SOLID
DOUBLE_LINE
DASH
DOT
DASH_DOT
DASH_DOT_DOT
GRID_LINE
- solid single-pixel line drawn where the grid lines are drawn
GRID_DASH
- dashed single-pixel line drawn where the grid lines are drawn
GRID_DOT
- dotted single-pixel line drawn where the grid lines are drawn
GRID_DASH_DOT
- alternating dashes and dotted single-pixel lines drawn where the grid lines are drawn
GRID_DASH_DOT_DOT
- alternating dashes and two dotted single-pixel lines drawn where the grid lines are drawn
BORDER_NONE
- no border is drawn
BORDER_OUTLINE
- a border line is drawn are all four sides
BORDER_LEFT
BORDER_TOP
BORDER_RIGHT
BORDER_BOTTOM
public void fillColumns(int seriesType, double increment, boolean copyCellStyles)
seriesType
- One of: SERIES_SAME, SERIES_INTEGER, SERIES_LONG, SERIES_DOUBLE, SERIES_DAY, SERIES_MONTH, SERIES_YEARincrement
- amount to increase the cell value from the preceeding cellcopyCellStyles
- If true then all of the cell properties will be copied from the preceeding cellreOrder(boolean, boolean)
public void fillRows(int seriesType, double increment, boolean copyCellStyles)
seriesType
- One of: SERIES_SAME, SERIES_INTEGER, SERIES_LONG, SERIES_DOUBLE, SERIES_DAY, SERIES_MONTH, SERIES_YEARincrement
- amount to increase the cell value from the preceeding cellcopyCellStyles
- If true then all of the cell properties will be copied from the preceeding cellreOrder(boolean, boolean)
public void fillDown()
public void fillUp()
public void fillRight()
public void fillLeft()
public void setValue(Object value)
public void setForeground(Color c)
DsCellProperties.setForeground(java.awt.Paint)
public void setBackground(Color c)
DsCellProperties.setBackground(java.awt.Paint)
public void setFont(Font f)
DsCellProperties.setFont(java.awt.Font)
public void setFontName(String val)
DsCellProperties.setFontName(java.lang.String)
public void setFontSize(int val)
DsCellProperties.setFontSize(int)
public void setFontBold(boolean val)
DsCellProperties.setFontBold(boolean)
public void setFontItalic(boolean val)
DsCellProperties.setFontItalic(boolean)
public void setFontStrikeThrough(boolean val)
DsCellProperties.setFontStrikeThrough(boolean)
public void setFontUnderline(int val)
DsCellProperties.setFont(java.awt.Font)
public void setNegativeNumberRed(boolean val)
DsCellProperties.setNegativeNumberRed(boolean)
public void setOpaque(boolean val)
DsCellProperties.setOpaque(boolean)
public void setWordWrap(boolean val)
DsCellProperties.setWordWrap(boolean)
public void setEditable(boolean val)
DsCellProperties.setEditable(boolean)
public void setHorizontalAlignment(int val)
DsCellProperties.setHorizontalAlignment(int)
public void setVerticalAlignment(int val)
DsCellProperties.setVerticalAlignment(int)
public void setTextStyle(int val)
DsCellProperties.setTextStyle(int)
public void setRotation(int val)
DsCellProperties.setRotation(int)
public void setShowGrid(boolean showGrid)
DsCellProperties.setBorderStyle(int)
,
DsCellProperties.setBorderLines(int)
public void setBorderStyle(int val)
DsCellProperties.setBorderStyle(int)
public void setBorderLines(int val)
DsCellProperties.setBorderLines(int)
public void setBorderLineWidth(int val)
DsCellProperties.setBorderLineWidth(int)
public void setBorderLineColor(Color c)
DsCellProperties.setBorderLineColor(java.awt.Paint)
public void setBorder(Border b)
DsCellProperties.setBorder(int, int, java.awt.Paint)
public void setIcon(Icon icon)
DsCellProperties.setIcon(javax.swing.Icon)
public void setHorizontalTextPosition(int val)
DsCellProperties.setHorizontalTextPosition(int)
public void setVerticalTextPosition(int val)
DsCellProperties.setVerticalTextPosition(int)
public void setFormat(Object val)
DsCellProperties.setFormat(java.lang.Object)
public void setData(Object val)
DsCell.setData(java.lang.Object)
public void clear(boolean clearStyleOnly)
clearStyleOnly
- If true it does not alter the value for the cell. If false the cell value is also removed.public void convertToNumber()
public void convertToGeneral()
public DsCellRange find(Object searchFor, int matchType, int action)
searchFor
- Object to find.matchType
- One of: FIND_STRING
- case insensitive search of a string that is equal to the toString() of the cell value
FIND_PREFIX
- case insensitive search of a string that matches the first part of the cell value's toString()
FIND_REGEX
- cell value whose toString() matches the given regular expression
FIND_EQUALS
- cell value that is equal to the given value. For strings this is case sensitive.
FIND_NE
- cell value that is not equal to the given value. For strings this is case sensitive.
FIND_GTE
- cell value that is greater than or equal to the given value
FIND_LTE
- cell value that is less than or equal to the given value
FIND_GT
- cell value that is greater than the given value
FIND_LT
- cell value that is less than the given value
FIND_ALL
- Search all cells. Otherwise search is stopped on the first match. Should be OR'ed in with one of the above values
action
- One of: SELECT_NONE, SELECT_CELL, SELECT_ROW
public DsCellRange find(Object searchFor, int matchType, int action, int startRow, int startCol)
grid.getCells( grid.getRowCount() - 1, grid.getColumnCount() -1, 0, 0 );
searchFor
- Object to find.matchType
- One of: FIND_STRING
- case insensitive search of a string that is equal to the toString() of the cell value
FIND_PREFIX
- case insensitive search of a string that matches the first part of the cell value's toString()
FIND_REGEX
- cell value whose toString() matches the given regular expression
FIND_EQUALS
- cell value that is equal to the given value. For strings this is case sensitive.
FIND_NE
- cell value that is not equal to the given value. For strings this is case sensitive.
FIND_GTE
- cell value that is greater than or equal to the given value
FIND_LTE
- cell value that is less than or equal to the given value
FIND_GT
- cell value that is greater than the given value
FIND_LT
- cell value that is less than the given value
FIND_ALL
- Search all cells. Otherwise search is stopped on the first match. Should be OR'ed in with one of the above values
action
- One of: SELECT_NONE, SELECT_CELL, SELECT_ROWstartRow
- row to begin search from. -1 means start with first row in range otherwise it must be a valid row within the range.startCol
- column to begin search from. -1 means start with first column in range.
public DsCellRange replace(Object searchFor, int matchType, Object replaceWith)
searchFor
- Object to find.matchType
- One of: FIND_STRING
- case insensitive search of a string that is equal to the toString() of the cell value
FIND_PREFIX
- case insensitive search of a string that matches the first part of the cell value's toString()
FIND_REGEX
- cell value whose toString() matches the given regular expression
FIND_EQUALS
- cell value that is equal to the given value. For strings this is case sensitive.
FIND_NE
- cell value that is not equal to the given value. For strings this is case sensitive.
FIND_GTE
- cell value that is greater than or equal to the given value
FIND_LTE
- cell value that is less than or equal to the given value
FIND_GT
- cell value that is greater than the given value
FIND_LT
- cell value that is less than the given value
FIND_ALL
- Search all cells. Otherwise search is stopped on the first match. Should be OR'ed in with one of the above values
replaceWith
- the new value for each cell that is found
|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |