use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.
the class DLPacketPlot method populate.
// private static final Logger logger = LogManager.getLogger(DLPacketPlot.class.getName());
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
LinkedHashMap<Color, PacketSeries> dlDatasets = new LinkedHashMap<Color, PacketSeries>();
AnalysisFilter filter = null;
// logger.info("isDownloadPacket(): "+ isDownloadPacket());
if (analysis != null) {
filter = analysis.getAnalyzerResult().getFilter();
for (Session session : analysis.getAnalyzerResult().getSessionlist()) {
addSeries(session, dlDatasets, filter);
}
}
// Create the XY data set
YIntervalSeriesCollection coll = new YIntervalSeriesCollection();
XYItemRenderer renderer = plot.getRenderer();
for (PacketSeries series : dlDatasets.values()) {
coll.addSeries(series);
renderer.setSeriesPaint(coll.indexOf(series.getKey()), series.getColor());
}
// Create tooltip generator
renderer.setBaseToolTipGenerator(new PacketToolTipGenerator());
plot.setDataset(coll);
// return plot;
}
use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.
the class BatteryPlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
XYSeries series = new XYSeries(0);
if (analysis == null) {
LOGGER.info("analysis data is null");
} else {
TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
if (resultType.equals(TraceResultType.TRACE_FILE)) {
LOGGER.info("didn't get analysis trace data!");
} else {
TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
AnalysisFilter filter = analysis.getAnalyzerResult().getFilter();
batteryInfos = traceresult.getBatteryInfos();
if (batteryInfos.size() > 0 && filter.getTimeRange() != null) {
BatteryInfo first = batteryInfos.get(0);
series.add(filter.getTimeRange().getBeginTime().doubleValue(), first.getBatteryLevel());
}
for (BatteryInfo bi : batteryInfos) {
series.add(bi.getBatteryTimeStamp(), bi.getBatteryLevel());
}
if (batteryInfos.size() > 0) {
BatteryInfo last = batteryInfos.get(batteryInfos.size() - 1);
if (filter.getTimeRange() != null) {
series.add(filter.getTimeRange().getEndTime().doubleValue(), last.getBatteryLevel());
} else {
series.add(traceresult.getTraceDuration(), last.getBatteryLevel());
}
}
XYItemRenderer renderer = plot.getRenderer();
renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
BatteryInfo bi = batteryInfos.get(Math.min(item, batteryInfos.size() - 1));
StringBuffer displayInfo = new StringBuffer(ResourceBundleHelper.getMessageString("battery.tooltip.prefix"));
displayInfo.append(MessageFormat.format(ResourceBundleHelper.getMessageString("battery.tooltip.content"), bi.getBatteryLevel(), bi.getBatteryTemp(), bi.isBatteryState() ? ResourceBundleHelper.getMessageString("battery.tooltip.connected") : ResourceBundleHelper.getMessageString("battery.tooltip.disconnected")));
displayInfo.append(ResourceBundleHelper.getMessageString("battery.tooltip.suffix"));
return displayInfo.toString();
}
});
}
plot.setDataset(new XYSeriesCollection(series));
}
// return plot;
}
use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.
the class PrivateDataDialog method refresh.
/**
* re-analyze best practices
*/
private void refresh() {
AnalysisFilter filter = getCurrentPktAnalyzerResult().getFilter();
((MainFrame) parent).updateFilter(filter);
}
use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.
the class ExcludeTimeRangeAnalysisDialog method closeWindow.
private void closeWindow() {
AnalysisFilter filter = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getFilter();
filter.setTimeRange(new TimeRange(initTimeRangeStartTime, initTimeRangeEndTime));
dispose();
}
use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.
the class FilterApplicationsAndIpDialog method getOkButton.
/**
* Initializes and returns the ok Button.
*/
private JButton getOkButton() {
if (okButton == null) {
okButton = new JButton();
okButton.setText(ResourceBundleHelper.getMessageString(DialogItem.Button_ok));
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
if (ipv4Selection || ipv6Selection) {
if (tcpSelection || udpSelection || dnsSelection) {
if (getCurrentPktAnalyzerResult().getFilter() != null) {
AnalysisFilter filter = getCurrentPktAnalyzerResult().getFilter();
Map<InetAddress, String> domainNames = filter.getDomainNames();
Map<String, ApplicationSelection> appSelections = new HashMap<String, ApplicationSelection>(filter.getAppSelections().size());
for (ApplicationSelection sel : filter.getAppSelections().values()) {
if (domainNames != null) {
sel.setDomainNames(domainNames);
}
appSelections.put(sel.getAppName(), new ApplicationSelection(sel));
}
filter.setIpv4Sel(ipv4Selection);
filter.setIpv6Sel(ipv6Selection);
filter.setTcpSel(tcpSelection);
filter.setUdpSel(udpSelection);
filter.setDnsSelection(dnsSelection);
if (!selectionReturnsData()) {
noResultsError(ResourceBundleHelper.getMessageString("filter.noResultData.error"));
} else {
((MainFrame) parent).updateFilter(filter);
dispose();
}
}
} else {
noResultsError(ResourceBundleHelper.getMessageString("filter.noProtocolSelection.error"));
}
} else {
noResultsError(ResourceBundleHelper.getMessageString("filter.noIpSelection.error"));
}
}
private void noResultsError(String error) {
MessageDialogFactory.getInstance().showErrorDialog(FilterApplicationsAndIpDialog.this, error);
}
});
}
return okButton;
}
Aggregations