예제 #1
0
  /** Method to set the time on graph panel. */
  private synchronized void setTimeLineLinkedComponents(
      double timeStamp, double dTimeRangeInterval) {

    if (analysisData != null) {
      boolean bTCPTimeStampFound = false;
      boolean bExactMatch = false;

      // Do exact match of dTimeInterval == 0.0;
      // If dTimeInterval < 0.0, don't try to match up with the TCP_Flow
      // or packets when click comes from graph or video
      if (dTimeRangeInterval == 0.0) {
        bExactMatch = true;
      } else if (dTimeRangeInterval < 0.0) {
        repaint();
        return;
      }

      // Attempt to find corresponding packet for time.
      double packetTimeStamp = 0.0;
      double packetTimeStampDiff = 0.0;
      double previousPacketTimeStampDiff = 9999.0;
      TCPSession bestMatchingTcpSession = null;
      PacketInfo bestMatchingPacketInfo = null;
      for (TCPSession tcpSess : analysisData.getTcpSessions()) {
        PacketInfo packetInfo =
            getBestMatchingPacketInTcpSession(tcpSess, bExactMatch, timeStamp, dTimeRangeInterval);
        if (packetInfo != null) {
          packetTimeStamp = packetInfo.getTimeStamp();
          packetTimeStampDiff = timeStamp - packetTimeStamp;
          if (packetTimeStampDiff < 0.0) {
            packetTimeStampDiff *= -1.0;
          }
          if (packetTimeStampDiff < previousPacketTimeStampDiff) {
            bestMatchingTcpSession = tcpSess;
            bestMatchingPacketInfo = packetInfo;
            bTCPTimeStampFound = true;
          }
        }
      }

      if (bTCPTimeStampFound) {
        getJTCPFlowsTable().selectItem(bestMatchingTcpSession);
        jPacketViewTable.selectItem(bestMatchingPacketInfo);
        jPacketViewTable.setGridColor(Color.LIGHT_GRAY);
        if (bestMatchingPacketInfo != null) {
          jHttpReqResPanel.select(bestMatchingPacketInfo.getRequestResponseInfo());
        } else {
          jHttpReqResPanel.select(null);
        }
      } else {
        getJTCPFlowsTable().selectItem(null);
        jPacketViewTable.selectItem(null);
        jHttpReqResPanel.select(null);
        if (aroVideoPlayer != null) {
          aroVideoPlayer.setMediaDisplayTime(graphPanel.getCrosshair());
        }
      }
    }
  }
예제 #2
0
 /**
  * Sets the trace data to be displayed on the Diagnostic tab screen.
  *
  * @param analysisData The trace analysis data to be displayed.
  */
 public synchronized void setAnalysisData(TraceData.Analysis analysisData) {
   this.analysisData = analysisData;
   if (analysisData != null) {
     jTCPFlowsTableModel.setData(analysisData.getTcpSessions());
   } else {
     jTCPFlowsTableModel.setData(null);
   }
   getGraphPanel().resetChart(analysisData);
   deviceNetworkProfilePanel.refresh(analysisData);
 }