use of com.android.tools.idea.profiling.view.nodes.CaptureTypeNode in project android by JetBrains.
the class CapturesTreeStructure method update.
public void update() {
CaptureService service = CaptureService.getInstance(myProject);
myRoot.clear();
Map<CaptureType, CaptureTypeNode> types = Maps.newHashMap();
for (CaptureType type : service.getTypes()) {
CaptureTypeNode typeNode = myTypeNodes.get(type);
if (typeNode == null) {
typeNode = new CaptureTypeNode(type);
}
types.put(type, typeNode);
myRoot.addType(typeNode);
}
myTypeNodes = types;
Map<Capture, CaptureNode> captures = Maps.newHashMap();
for (Map.Entry<CaptureType, Collection<Capture>> entry : service.getCapturesByType().asMap().entrySet()) {
CaptureTypeNode typeNode = myTypeNodes.get(entry.getKey());
typeNode.clear();
for (Capture capture : entry.getValue()) {
CaptureNode captureNode = myCaptureNodes.get(capture);
if (captureNode == null) {
captureNode = new CaptureNode(myProject, capture);
} else {
captureNode.update();
}
captures.put(capture, captureNode);
typeNode.addCapture(captureNode);
}
}
myCaptureNodes = captures;
}
Aggregations