aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>2007-10-16 15:50:14 +0000
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>2007-10-16 15:50:14 +0000
commit5ab4074ecf0abf03576b371704ee111fe02feeb1 (patch)
tree4128b66c86a56dc8ffc2a5ef167bc92af74b7d73
parenta98aa63922d9f2160a773679f42f1f377ef45acb (diff)
downloadvaadin-framework-5ab4074ecf0abf03576b371704ee111fe02feeb1.tar.gz
vaadin-framework-5ab4074ecf0abf03576b371704ee111fe02feeb1.zip
Fixes #966
svn changeset:2531/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java b/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java
index 8705510dec..fcd3a04127 100644
--- a/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java
+++ b/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java
@@ -510,7 +510,6 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
params.remove("changes");
if (changes != null) {
String[] ca = changes.split("\u0001");
- System.out.println("Changes = " + changes);
for (int i = 0; i < ca.length; i++) {
String[] vid = ca[i].split("_");
VariableOwner owner = (VariableOwner) idPaintableMap
@@ -548,8 +547,6 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
private Object convertVariableValue(char variableType, String strValue) {
Object val = null;
- System.out.println("converting " + strValue + " of type "
- + variableType);
switch (variableType) {
case 'a':
val = strValue.split(",");
@@ -573,8 +570,6 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
break;
}
- System.out.println("result: " + val + " of type "
- + (val == null ? "-" : val.getClass().toString()));
return val;
}
@@ -921,21 +916,22 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
* @return
*/
public synchronized Set getDirtyComponents() {
- // TODO not compatible w/ subtree caching
+ HashSet resultset = new HashSet(dirtyPaintabletSet);
+
+ // The following algorithm removes any components that would be painted as
+ // a direct descendant of other components from the dirty components list.
+ // The result is that each component should be painted exactly once and
+ // any unmodified components will be painted as "cached=true".
+
+ for (Iterator i = dirtyPaintabletSet.iterator(); i.hasNext();) {
+ Paintable p = (Paintable) i.next();
+ if (p instanceof Component) {
+ if (dirtyPaintabletSet.contains(((Component) p).getParent()))
+ resultset.remove(p);
+ }
+ }
- // Remove unnecessary repaints from the list
- Object[] paintables = dirtyPaintabletSet.toArray();
- /*
- * for (int i = 0; i < paintables.length; i++) { if (paintables[i]
- * instanceof Component) { Component c = (Component) paintables[i];
- * // Check if any of the parents of c already exist in the list
- * Component p = c.getParent(); while (p != null) { if
- * (dirtyPaintabletSet.contains(p)) {
- * // Remove component c from the dirty paintables as its // parent is
- * also dirty dirtyPaintabletSet.remove(c); p = null; } else p =
- * p.getParent(); } } }
- */
- return Collections.unmodifiableSet(dirtyPaintabletSet);
+ return resultset;
}
/**