* Display all resources that fall in the given window.
* @param left the left boundary
* @param right the right boundary
*/
protected void displayResourcesInWindow(double left, double right) {
NetworkVisualizationModel model = getModel();
// We dont need to update if we
// have not shifted bounds.
if ((displayed.size() > 0) && (left == oldLeft) && (right == oldRight)) {
return;
} else {
oldLeft = left;
oldRight = right;
}
// clean up Event Hookups
for (int i = 0; i < displayed.size(); i++) {
ResourceRow row = displayed.get(i);
row.cleanUp();
}
// blank the resource Panel
displayed.clear();
getContentElement().setInnerHTML("");
// We do a naive linear search until the kinks can be ironed
// out of more sophisticated search.
List<NetworkResource> networkResources = model.getSortedResources();
for (int i = 0; i < networkResources.size(); i++) {
NetworkResource resource = networkResources.get(i);
if (isResourceInWindow(resource, left, right)) {
displayResource(left, right, resource);
}