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/07/02 18:58:03 UTC

svn commit: r960055 - in /pivot/trunk: charts/src/org/apache/pivot/charts/ core/src/org/apache/pivot/xml/ wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/content/

Author: gbrown
Date: Fri Jul  2 16:58:02 2010
New Revision: 960055

URL: http://svn.apache.org/viewvc?rev=960055&view=rev
Log:
Eliminate private setters for inner classes such as TableView.Colum; there is no need for setter methods in these cases.

Modified:
    pivot/trunk/charts/src/org/apache/pivot/charts/ChartView.java
    pivot/trunk/core/src/org/apache/pivot/xml/Element.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/GridPane.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewMultiCellRenderer.java

Modified: pivot/trunk/charts/src/org/apache/pivot/charts/ChartView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/charts/src/org/apache/pivot/charts/ChartView.java?rev=960055&r1=960054&r2=960055&view=diff
==============================================================================
--- pivot/trunk/charts/src/org/apache/pivot/charts/ChartView.java (original)
+++ pivot/trunk/charts/src/org/apache/pivot/charts/ChartView.java Fri Jul  2 16:58:02 2010
@@ -58,10 +58,6 @@ public abstract class ChartView extends 
             return chartView;
         }
 
-        private void setChartView(ChartView chartView) {
-            this.chartView = chartView;
-        }
-
         public String getKey() {
             return key;
         }
@@ -178,7 +174,7 @@ public abstract class ChartView extends 
             }
 
             categories.insert(category, index);
-            category.setChartView(ChartView.this);
+            category.chartView = ChartView.this;
 
             chartViewCategoryListeners.categoryInserted(ChartView.this, index);
         }
@@ -204,7 +200,7 @@ public abstract class ChartView extends 
 
             if (count > 0) {
                 for (int i = 0, n = removed.getLength(); i < n; i++) {
-                    removed.get(i).setChartView(null);
+                    removed.get(i).chartView = null;
                 }
 
                 chartViewCategoryListeners.categoriesRemoved(ChartView.this, index, removed);

Modified: pivot/trunk/core/src/org/apache/pivot/xml/Element.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/xml/Element.java?rev=960055&r1=960054&r2=960055&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/xml/Element.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/xml/Element.java Fri Jul  2 16:58:02 2010
@@ -66,10 +66,6 @@ public class Element extends Node implem
             return element;
         }
 
-        private void setElement(Element element) {
-            this.element = element;
-        }
-
         /**
          * Returns the attribute's namespace prefix.
          *
@@ -218,7 +214,7 @@ public class Element extends Node implem
 
             attributes.insert(attribute, index);
             attributeMap.put(attributeName, attribute);
-            attribute.setElement(Element.this);
+            attribute.element = Element.this;
 
             elementListeners.attributeInserted(Element.this, index);
         }
@@ -262,7 +258,7 @@ public class Element extends Node implem
                     Attribute attribute = removed.get(i);
                     String attributeName = attribute.getName();
                     attributeMap.remove(attributeName);
-                    attribute.setElement(null);
+                    attribute.element = null;
                 }
 
                 elementListeners.attributesRemoved(Element.this, index, removed);

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java?rev=960055&r1=960054&r2=960055&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java Fri Jul  2 16:58:02 2010
@@ -48,10 +48,6 @@ public class Form extends Container {
             return form;
         }
 
-        private void setForm(Form form) {
-            this.form = form;
-        }
-
         public String getHeading() {
             return heading;
         }
@@ -172,7 +168,7 @@ public class Form extends Container {
             }
 
             sections.insert(section, index);
-            section.setForm(Form.this);
+            section.form = Form.this;
 
             for (int i = 0, n = section.getLength(); i < n; i++) {
                 Form.this.add(section.get(i));
@@ -203,7 +199,7 @@ public class Form extends Container {
             for (int i = 0, n = removed.getLength(); i < n; i++) {
                 Section section = removed.get(i);
 
-                section.setForm(null);
+                section.form = null;
 
                 for (Component field : section) {
                     Form.this.remove(field);

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/GridPane.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/GridPane.java?rev=960055&r1=960054&r2=960055&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/GridPane.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/GridPane.java Fri Jul  2 16:58:02 2010
@@ -48,10 +48,6 @@ public class GridPane extends Container 
             return gridPane;
         }
 
-        private void setGridPane(GridPane gridPane) {
-            this.gridPane = gridPane;
-        }
-
         @Override
         public int add(Component component) {
             int i = getLength();
@@ -190,7 +186,7 @@ public class GridPane extends Container 
             }
 
             rows.insert(row, index);
-            row.setGridPane(GridPane.this);
+            row.gridPane = GridPane.this;
 
             for (int i = 0, n = row.getLength(); i < n; i++) {
                 Component component = row.get(i);
@@ -223,7 +219,7 @@ public class GridPane extends Container 
             if (count > 0) {
                 for (int i = 0, n = removed.getLength(); i < n; i++) {
                     Row row = removed.get(i);
-                    row.setGridPane(null);
+                    row.gridPane = null;
 
                     for (int j = 0, m = row.getLength(); j < m; j++) {
                         Component component = row.get(j);

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java?rev=960055&r1=960054&r2=960055&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java Fri Jul  2 16:58:02 2010
@@ -79,17 +79,6 @@ public class TablePane extends Container
         }
 
         /**
-         * Sets the table pane with which this row is associated.
-         *
-         * @param tablePane
-         * The row's table pane, or <tt>null</tt> if the row does not
-         * currently belong to a table.
-         */
-        private void setTablePane(TablePane tablePane) {
-            this.tablePane = tablePane;
-        }
-
-        /**
          * Returns the row height.
          *
          * @return
@@ -330,17 +319,6 @@ public class TablePane extends Container
         }
 
         /**
-         * Sets the table pane with which this column is associated.
-         *
-         * @param tablePane
-         * The column's table pane, or <tt>null</tt> if the column does not
-         * currently belong to a table.
-         */
-        private void setTablePane(TablePane tablePane) {
-            this.tablePane = tablePane;
-        }
-
-        /**
          * Returns the column width.
          *
          * @return
@@ -484,7 +462,7 @@ public class TablePane extends Container
             }
 
             rows.insert(row, index);
-            row.setTablePane(TablePane.this);
+            row.tablePane = TablePane.this;
 
             for (int i = 0, n = row.getLength(); i < n; i++) {
                 Component component = row.get(i);
@@ -517,7 +495,7 @@ public class TablePane extends Container
             if (count > 0) {
                 for (int i = 0, n = removed.getLength(); i < n; i++) {
                     Row row = removed.get(i);
-                    row.setTablePane(null);
+                    row.tablePane = null;
 
                     for (int j = 0, m = row.getLength(); j < m; j++) {
                         Component component = row.get(j);
@@ -580,7 +558,7 @@ public class TablePane extends Container
             }
 
             columns.insert(column, index);
-            column.setTablePane(TablePane.this);
+            column.tablePane = TablePane.this;
 
             // Notify listeners
             tablePaneListeners.columnInserted(TablePane.this, index);
@@ -608,7 +586,7 @@ public class TablePane extends Container
             if (count > 0) {
                 for (int i = 0, n = removed.getLength(); i < n; i++) {
                     Column column = removed.get(i);
-                    column.setTablePane(null);
+                    column.tablePane = null;
                 }
 
                 tablePaneListeners.columnsRemoved(TablePane.this, index, removed);

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=960055&r1=960054&r2=960055&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java Fri Jul  2 16:58:02 2010
@@ -147,17 +147,6 @@ public class TableView extends Component
         }
 
         /**
-         * Sets the table view with which this column is associated.
-         *
-         * @param tableView
-         * The column's table view, or <tt>null</tt> if the column does not
-         * currently belong to a table.
-         */
-        private void setTableView(TableView tableView) {
-            this.tableView = tableView;
-        }
-
-        /**
          * Returns the column name.
          *
          * @return
@@ -880,7 +869,7 @@ public class TableView extends Component
             }
 
             columns.insert(column, index);
-            column.setTableView(TableView.this);
+            column.tableView = TableView.this;
 
             tableViewColumnListeners.columnInserted(TableView.this, index);
         }
@@ -906,7 +895,7 @@ public class TableView extends Component
 
             if (count > 0) {
                 for (int i = 0, n = removed.getLength(); i < n; i++) {
-                    removed.get(i).setTableView(null);
+                    removed.get(i).tableView = null;
                 }
 
                 tableViewColumnListeners.columnsRemoved(TableView.this, index, removed);

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=960055&r1=960054&r2=960055&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 Jul  2 16:58:02 2010
@@ -120,10 +120,6 @@ public class TableViewMultiCellRenderer 
                 }
             }
         }
-
-        private void setMultiCellRenderer(TableViewMultiCellRenderer multiCellRenderer) {
-            this.multiCellRenderer = multiCellRenderer;
-        }
     }
 
     /**
@@ -158,7 +154,7 @@ public class TableViewMultiCellRenderer 
             TableView.CellRenderer cellRenderer = item.getCellRenderer();
             cellRenderers.put(valueClass, cellRenderer);
 
-            item.setMultiCellRenderer(TableViewMultiCellRenderer.this);
+            item.multiCellRenderer = TableViewMultiCellRenderer.this;
         }
 
         @Override
@@ -189,8 +185,8 @@ public class TableViewMultiCellRenderer 
                 cellRenderers.remove(previousValueClass);
                 cellRenderers.put(valueClass, cellRenderer);
 
-                previousItem.setMultiCellRenderer(null);
-                item.setMultiCellRenderer(TableViewMultiCellRenderer.this);
+                previousItem.multiCellRenderer = null;
+                item.multiCellRenderer = TableViewMultiCellRenderer.this;
             }
 
             return previousItem;
@@ -216,7 +212,7 @@ public class TableViewMultiCellRenderer 
                 Class<?> valueClass = item.getValueClass();
 
                 cellRenderers.remove(valueClass);
-                item.setMultiCellRenderer(null);
+                item.multiCellRenderer = null;
             }
 
             return removed;