Search in sources :

Example 1 with RpcNetworkCaptureModel

use of com.android.tools.idea.monitor.ui.network.model.RpcNetworkCaptureModel in project android by JetBrains.

the class NetworkProfilerUiManager method setupExtendedOverviewUi.

// TODO: Revisit for L3 design, this was intended for L2.
@Override
public void setupExtendedOverviewUi(@NotNull JPanel toolbar, @NotNull JPanel overviewPanel) {
    super.setupExtendedOverviewUi(toolbar, overviewPanel);
    myRadioSegment = new NetworkRadioSegment(myTimeCurrentRangeUs, myDataStore, myEventDispatcher);
    setupAndRegisterSegment(myRadioSegment, NETWORK_CONNECTIVITY_HEIGHT, NETWORK_CONNECTIVITY_HEIGHT, NETWORK_CONNECTIVITY_HEIGHT);
    overviewPanel.add(myRadioSegment);
    NetworkCaptureModel captureModel = new RpcNetworkCaptureModel(myDataStore.getDeviceProfilerService(), myDataCache);
    myCaptureSegment = new NetworkCaptureSegment(myTimeCurrentRangeUs, captureModel, httpData -> {
        String responseFilePath = httpData.getHttpResponsePayloadId();
        File file = !StringUtil.isEmptyOrSpaces(responseFilePath) ? myDataCache.getFile(responseFilePath) : null;
        VirtualFile virtualFile = file != null ? LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file) : null;
        if (virtualFile != null) {
            myDetailedView.showConnectionDetails(virtualFile);
            myEventDispatcher.getMulticaster().profilerExpanded(ProfilerType.NETWORK);
        }
    }, myEventDispatcher);
    setupAndRegisterSegment(myCaptureSegment, DEFAULT_MONITOR_MIN_HEIGHT, DEFAULT_MONITOR_PREFERRED_HEIGHT, DEFAULT_MONITOR_MAX_HEIGHT);
    overviewPanel.add(myCaptureSegment);
    myChoreographer.register(myCaptureSegment);
    setSegmentState(overviewPanel, myCaptureSegment, AccordionLayout.AccordionState.MAXIMIZE);
}
Also used : NetworkCaptureModel(com.android.tools.idea.monitor.ui.network.model.NetworkCaptureModel) Range(com.android.tools.adtui.model.Range) RpcNetworkCaptureModel(com.android.tools.idea.monitor.ui.network.model.RpcNetworkCaptureModel) EventDispatcher(com.intellij.util.EventDispatcher) StringUtil(com.intellij.openapi.util.text.StringUtil) VirtualFile(com.intellij.openapi.vfs.VirtualFile) BaseSegment(com.android.tools.idea.monitor.ui.BaseSegment) ProfilerEventListener(com.android.tools.idea.monitor.tool.ProfilerEventListener) Set(java.util.Set) HttpDataCache(com.android.tools.idea.monitor.ui.network.model.HttpDataCache) Choreographer(com.android.tools.adtui.Choreographer) NetworkDataPoller(com.android.tools.idea.monitor.ui.network.model.NetworkDataPoller) Sets(com.google.common.collect.Sets) LocalFileSystem(com.intellij.openapi.vfs.LocalFileSystem) File(java.io.File) BaseProfilerUiManager(com.android.tools.idea.monitor.ui.BaseProfilerUiManager) java.awt(java.awt) Poller(com.android.tools.datastore.Poller) Project(com.intellij.openapi.project.Project) AccordionLayout(com.android.tools.adtui.AccordionLayout) NotNull(org.jetbrains.annotations.NotNull) SeriesDataStore(com.android.tools.datastore.SeriesDataStore) javax.swing(javax.swing) VirtualFile(com.intellij.openapi.vfs.VirtualFile) RpcNetworkCaptureModel(com.android.tools.idea.monitor.ui.network.model.RpcNetworkCaptureModel) NetworkCaptureModel(com.android.tools.idea.monitor.ui.network.model.NetworkCaptureModel) RpcNetworkCaptureModel(com.android.tools.idea.monitor.ui.network.model.RpcNetworkCaptureModel) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Aggregations

AccordionLayout (com.android.tools.adtui.AccordionLayout)1 Choreographer (com.android.tools.adtui.Choreographer)1 Range (com.android.tools.adtui.model.Range)1 Poller (com.android.tools.datastore.Poller)1 SeriesDataStore (com.android.tools.datastore.SeriesDataStore)1 ProfilerEventListener (com.android.tools.idea.monitor.tool.ProfilerEventListener)1 BaseProfilerUiManager (com.android.tools.idea.monitor.ui.BaseProfilerUiManager)1 BaseSegment (com.android.tools.idea.monitor.ui.BaseSegment)1 HttpDataCache (com.android.tools.idea.monitor.ui.network.model.HttpDataCache)1 NetworkCaptureModel (com.android.tools.idea.monitor.ui.network.model.NetworkCaptureModel)1 NetworkDataPoller (com.android.tools.idea.monitor.ui.network.model.NetworkDataPoller)1 RpcNetworkCaptureModel (com.android.tools.idea.monitor.ui.network.model.RpcNetworkCaptureModel)1 Sets (com.google.common.collect.Sets)1 Project (com.intellij.openapi.project.Project)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 LocalFileSystem (com.intellij.openapi.vfs.LocalFileSystem)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 EventDispatcher (com.intellij.util.EventDispatcher)1 java.awt (java.awt)1 File (java.io.File)1