You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/02/12 02:33:20 UTC
svn commit: r909201 - in /pivot/trunk:
tutorials/src/org/apache/pivot/tutorials/stocktracker/
wtk-terra/src/org/apache/pivot/wtk/skin/terra/
wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/content/
Author: gbrown
Date: Fri Feb 12 01:33:20 2010
New Revision: 909201
URL: http://svn.apache.org/viewvc?rev=909201&view=rev
Log:
Clarify TableView.CellRenderer API (no method signature change, only variable names/Javadoc).
Modified:
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/ChangeCellRenderer.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewBooleanCellRenderer.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewMultiCellRenderer.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/ChangeCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/ChangeCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/ChangeCellRenderer.java (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/ChangeCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -26,15 +26,15 @@
public static final Color DOWN_COLOR = new Color(0xff, 0x00, 0x00);
@Override
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- super.render(value, rowIndex, columnIndex, tableView, columnName,
- rowSelected, rowHighlighted, rowDisabled);
+ boolean selected, boolean highlighted, boolean disabled) {
+ super.render(row, rowIndex, columnIndex, tableView, columnName,
+ selected, highlighted, disabled);
- if (value != null
- && !rowSelected) {
- StockQuote stockQuote = (StockQuote)value;
+ if (row != null
+ && !selected) {
+ StockQuote stockQuote = (StockQuote)row;
float change = stockQuote.getChange();
getStyles().put("color", change < 0 ? DOWN_COLOR : UP_COLOR);
}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java Fri Feb 12 01:33:20 2010
@@ -256,11 +256,11 @@
}
@Override
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- if (value != null) {
- File file = (File)value;
+ boolean selected, boolean highlighted, boolean disabled) {
+ if (row != null) {
+ File file = (File)row;
String text = null;
Image icon = null;
@@ -294,8 +294,8 @@
label.getStyles().put("font", font);
Color color;
- if (tableView.isEnabled() && !rowDisabled) {
- if (rowSelected) {
+ if (tableView.isEnabled() && !disabled) {
+ if (selected) {
if (tableView.isFocused()) {
color = (Color)tableView.getStyles().get("selectionColor");
} else {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java Fri Feb 12 01:33:20 2010
@@ -473,9 +473,9 @@
/**
* Prepares the renderer for layout or paint.
*
- * @param value
- * The cell value to render, or <tt>null</tt> if called to calculate
- * preferred height for skins that assume a fixed renderer height.
+ * @param row
+ * The row to render, or <tt>null</tt> if called to calculate preferred height for
+ * skins that assume a fixed renderer height.
*
* @param rowIndex
* The index of the row being rendered, or <tt>-1</tt> if <tt>value</tt>
@@ -490,18 +490,18 @@
* @param columnName
* The name of the column being rendered.
*
- * @param rowSelected
+ * @param selected
* If <tt>true</tt>, the row is selected.
*
- * @param rowHighlighted
+ * @param highlighted
* If <tt>true</tt>, the row is highlighted.
*
- * @param rowDisabled
+ * @param disabled
* If <tt>true</tt>, the row is disabled.
*/
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled);
+ boolean selected, boolean highlighted, boolean disabled);
}
/**
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewBooleanCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewBooleanCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewBooleanCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewBooleanCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -52,19 +52,19 @@
@SuppressWarnings("unchecked")
@Override
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- if (value != null) {
+ boolean selected, boolean highlighted, boolean disabled) {
+ if (row != null) {
boolean checkboxSelected = false;
// Get the row and cell data
if (columnName != null) {
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
Object cellData = rowData.get(columnName);
@@ -82,7 +82,7 @@
}
checkbox.setSelected(checkboxSelected);
- checkbox.setEnabled(!checkboxDisabled && tableView.isEnabled() && !rowDisabled);
+ checkbox.setEnabled(!checkboxDisabled && tableView.isEnabled() && !disabled);
}
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -49,21 +49,21 @@
@SuppressWarnings("unchecked")
@Override
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- renderStyles(tableView, rowSelected, rowDisabled);
+ boolean selected, boolean highlighted, boolean disabled) {
+ renderStyles(tableView, selected, disabled);
- if (value != null) {
+ if (row != null) {
Object cellData = null;
// Get the row and cell data
if (columnName != null) {
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
cellData = rowData.get(columnName);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -54,21 +54,21 @@
@Override
@SuppressWarnings("unchecked")
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- renderStyles(tableView, rowSelected, rowDisabled);
+ boolean selected, boolean highlighted, boolean disabled) {
+ renderStyles(tableView, selected, disabled);
String formattedDate = null;
- if (value != null) {
+ if (row != null) {
// Get the row and cell data
if (columnName != null) {
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
Object cellData = rowData.get(columnName);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -38,21 +38,21 @@
@Override
@SuppressWarnings("unchecked")
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- renderStyles(tableView, rowSelected, rowDisabled);
+ boolean selected, boolean highlighted, boolean disabled) {
+ renderStyles(tableView, selected, disabled);
- if (value != null) {
+ if (row != null) {
String formattedFileSize = null;
// Get the row and cell data
if (columnName != null) {
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
Object cellData = rowData.get(columnName);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -63,19 +63,19 @@
@SuppressWarnings("unchecked")
@Override
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- if (value != null) {
+ boolean selected, boolean highlighted, boolean disabled) {
+ if (row != null) {
Image image = null;
// Get the row and cell data
if (columnName != null) {
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
Object cellData = rowData.get(columnName);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewMultiCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewMultiCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewMultiCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewMultiCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -316,14 +316,14 @@
@SuppressWarnings("unchecked")
@Override
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- if (value == null) {
+ boolean selected, boolean highlighted, boolean disabled) {
+ if (row == null) {
for (Class<?> key : cellRenderers) {
TableView.CellRenderer renderer = cellRenderers.get(key);
renderer.render(null, rowIndex, columnIndex, tableView, columnName,
- rowSelected, rowHighlighted, rowDisabled);
+ selected, highlighted, disabled);
}
} else {
Object cellData = null;
@@ -331,10 +331,10 @@
// Get the row and cell data
if (columnName != null) {
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
cellData = rowData.get(columnName);
@@ -361,8 +361,8 @@
cellRenderer.setSize(width, height);
}
- cellRenderer.render(value, rowIndex, columnIndex, tableView, columnName,
- rowSelected, rowHighlighted, rowDisabled);
+ cellRenderer.render(row, rowIndex, columnIndex, tableView, columnName,
+ selected, highlighted, disabled);
}
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -60,21 +60,21 @@
@Override
@SuppressWarnings("unchecked")
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- renderStyles(tableView, rowSelected, rowDisabled);
+ boolean selected, boolean highlighted, boolean disabled) {
+ renderStyles(tableView, selected, disabled);
String formattedNumber = null;
- if (value != null
+ if (row != null
&& columnName != null) {
// Get the row and cell data
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
Object cellData = rowData.get(columnName);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java?rev=909201&r1=909200&r2=909201&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java Fri Feb 12 01:33:20 2010
@@ -47,21 +47,21 @@
@SuppressWarnings("unchecked")
@Override
- public void render(Object value, int rowIndex, int columnIndex,
+ public void render(Object row, int rowIndex, int columnIndex,
TableView tableView, String columnName,
- boolean rowSelected, boolean rowHighlighted, boolean rowDisabled) {
- renderStyles(tableView, rowSelected, rowDisabled);
+ boolean selected, boolean highlighted, boolean disabled) {
+ renderStyles(tableView, selected, disabled);
- if (value != null) {
+ if (row != null) {
Object cellData = null;
// Get the row and cell data
if (columnName != null) {
Dictionary<String, Object> rowData;
- if (value instanceof Dictionary<?, ?>) {
- rowData = (Dictionary<String, Object>)value;
+ if (row instanceof Dictionary<?, ?>) {
+ rowData = (Dictionary<String, Object>)row;
} else {
- rowData = new BeanDictionary(value);
+ rowData = new BeanDictionary(row);
}
cellData = rowData.get(columnName);