public class LayoutManager {
private static final String LOOP_ABORT_MESSAGE = "Aborting layout after 100 passes. This would probably be an infinite loop.";
+
+ private static final boolean debugLogging = false;
+
private ApplicationConnection connection;
private final Set<Element> measuredNonPaintableElements = new HashSet<Element>();
private final MeasuredSize nullSize = new MeasuredSize();
}
FastStringSet updatedSet = FastStringSet.create();
+ boolean changed = false;
while (currentDependencyTree.hasHorizontalConnectorToLayout()
|| currentDependencyTree.hasVerticaConnectorToLayout()) {
+ changed = true;
for (ManagedLayout layout : currentDependencyTree
.getHorizontalLayoutTargets()) {
if (layout instanceof DirectionalManagedLayout) {
rr.layout();
countLayout(layoutCounts, rr);
}
- updatedSet.add(layout.getConnectorId());
+ if (debugLogging) {
+ updatedSet.add(layout.getConnectorId());
+ }
}
for (ManagedLayout layout : currentDependencyTree
rr.layout();
countLayout(layoutCounts, rr);
}
- updatedSet.add(layout.getConnectorId());
+ if (debugLogging) {
+ updatedSet.add(layout.getConnectorId());
+ }
}
}
- JsArrayString changed = updatedSet.dump();
-
- StringBuilder b = new StringBuilder(" ");
- b.append(changed.length());
- b.append(" requestLayout invocations in ");
- b.append(passDuration.elapsedMillis() - measureTime);
- b.append(" ms");
- if (changed.length() < 30) {
- for (int i = 0; i < changed.length(); i++) {
- if (i != 0) {
- b.append(", ");
- } else {
- b.append(": ");
- }
- String connectorString = changed.get(i);
- if (changed.length() < 10) {
- ServerConnector connector = ConnectorMap
- .get(connection).getConnector(connectorString);
- connectorString = Util.getConnectorString(connector);
+ if (debugLogging) {
+ JsArrayString changedCids = updatedSet.dump();
+
+ StringBuilder b = new StringBuilder(" ");
+ b.append(changedCids.length());
+ b.append(" requestLayout invocations in ");
+ b.append(passDuration.elapsedMillis() - measureTime);
+ b.append(" ms");
+ if (changedCids.length() < 30) {
+ for (int i = 0; i < changedCids.length(); i++) {
+ if (i != 0) {
+ b.append(", ");
+ } else {
+ b.append(": ");
+ }
+ String connectorString = changedCids.get(i);
+ if (changedCids.length() < 10) {
+ ServerConnector connector = ConnectorMap.get(
+ connection).getConnector(connectorString);
+ connectorString = Util
+ .getConnectorString(connector);
+ }
+ b.append(connectorString);
}
- b.append(connectorString);
}
+ VConsole.log(b.toString());
}
- VConsole.log(b.toString());
- if (changed.length() == 0) {
+ if (!changed) {
VConsole.log("No more changes in pass " + passes);
break;
}