JsArrayString layoutTargets = currentDependencyTree
.getHorizontalLayoutTargetsJsArray();
int length = layoutTargets.length();
for (int i = 0; i < length; i++) {
ManagedLayout layout = (ManagedLayout) connectorMap
.getConnector(layoutTargets.get(i));
if (layout instanceof DirectionalManagedLayout) {
currentDependencyTree
.markAsHorizontallyLayouted(layout);
DirectionalManagedLayout cl = (DirectionalManagedLayout) layout;
try {
String key = null;
if (Profiler.isEnabled()) {
key = "layoutHorizontally() for "
+ Util.getSimpleName(cl);
Profiler.enter(key);
}
cl.layoutHorizontally();
layoutCount++;
if (Profiler.isEnabled()) {
Profiler.leave(key);
}
} catch (RuntimeException e) {
VConsole.error(e);
}
countLayout(layoutCounts, cl);
} else {
currentDependencyTree
.markAsHorizontallyLayouted(layout);
currentDependencyTree.markAsVerticallyLayouted(layout);
SimpleManagedLayout rr = (SimpleManagedLayout) layout;
try {
String key = null;
if (Profiler.isEnabled()) {
key = "layout() for " + Util.getSimpleName(rr);
Profiler.enter(key);
}
rr.layout();
layoutCount++;
if (Profiler.isEnabled()) {
Profiler.leave(key);
}
} catch (RuntimeException e) {
VConsole.error(e);
}
countLayout(layoutCounts, rr);
}
if (debugLogging) {
updatedSet.add(layout.getConnectorId());
}
}
layoutTargets = currentDependencyTree
.getVerticalLayoutTargetsJsArray();
length = layoutTargets.length();
for (int i = 0; i < length; i++) {
ManagedLayout layout = (ManagedLayout) connectorMap
.getConnector(layoutTargets.get(i));
if (layout instanceof DirectionalManagedLayout) {
currentDependencyTree.markAsVerticallyLayouted(layout);
DirectionalManagedLayout cl = (DirectionalManagedLayout) layout;
try {
String key = null;
if (Profiler.isEnabled()) {
key = "layoutHorizontally() for "
+ Util.getSimpleName(cl);
Profiler.enter(key);
}
cl.layoutVertically();
layoutCount++;
if (Profiler.isEnabled()) {
Profiler.leave(key);
}
} catch (RuntimeException e) {
VConsole.error(e);
}
countLayout(layoutCounts, cl);
} else {
currentDependencyTree
.markAsHorizontallyLayouted(layout);
currentDependencyTree.markAsVerticallyLayouted(layout);
SimpleManagedLayout rr = (SimpleManagedLayout) layout;
try {
String key = null;
if (Profiler.isEnabled()) {
key = "layout() for " + Util.getSimpleName(rr);
Profiler.enter(key);
}
rr.layout();
layoutCount++;
if (Profiler.isEnabled()) {
Profiler.leave(key);
}
} catch (RuntimeException e) {
VConsole.error(e);
}
countLayout(layoutCounts, rr);
}
if (debugLogging) {
updatedSet.add(layout.getConnectorId());
}
}
}
Profiler.leave("LayoutManager handle ManagedLayout");