|
@@ -2,6 +2,8 @@ package de.tudarmstadt.informatik.hostage.ui2.fragment;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.annotation.SuppressLint;
|
|
import android.app.Fragment;
|
|
import android.app.Fragment;
|
|
|
|
+import android.app.FragmentManager;
|
|
|
|
+import android.app.FragmentTransaction;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.graphics.Color;
|
|
import android.graphics.Color;
|
|
@@ -54,7 +56,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
|
|
|
static final String FILTER_MENU_TITLE_BSSID = "BSSID";
|
|
static final String FILTER_MENU_TITLE_BSSID = "BSSID";
|
|
static final String FILTER_MENU_TITLE_ESSID = "ESSID";
|
|
static final String FILTER_MENU_TITLE_ESSID = "ESSID";
|
|
- static final String FILTER_MENU_TITLE_PROTOCOLS = "Protocol";
|
|
|
|
|
|
+ static final String FILTER_MENU_TITLE_PROTOCOLS = "Protocols";
|
|
|
|
+ static final String FILTER_MENU_TITLE_PROTOCOL = "Protocol";
|
|
static final String FILTER_MENU_TITLE_TIMESTAMP_BELOW = "Latest";
|
|
static final String FILTER_MENU_TITLE_TIMESTAMP_BELOW = "Latest";
|
|
static final String FILTER_MENU_TITLE_TIMESTAMP_ABOVE = "Earliest";
|
|
static final String FILTER_MENU_TITLE_TIMESTAMP_ABOVE = "Earliest";
|
|
|
|
|
|
@@ -184,7 +187,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
this.legendListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
this.legendListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
- StatisticsFragment.this.userTappedOnItem(i);
|
|
|
|
|
|
+ StatisticsFragment.this.userTappedOnLegendItem(i);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
this.rootView = rootView;
|
|
this.rootView = rootView;
|
|
@@ -215,11 +218,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
ImageButton visualButton = (ImageButton) rootView.findViewById(R.id.plot_data_button);
|
|
ImageButton visualButton = (ImageButton) rootView.findViewById(R.id.plot_data_button);
|
|
visualButton.setOnClickListener(new View.OnClickListener() {
|
|
visualButton.setOnClickListener(new View.OnClickListener() {
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
- StatisticsFragment.this.openPopupMenuOnView(v);
|
|
|
|
|
|
+ StatisticsFragment.this.openBarSelectionMenuOnView(v);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- this.setTitle(this.selectedCompareData);
|
|
|
|
|
|
|
|
ImageButton filterButton = this.getFilterButton();
|
|
ImageButton filterButton = this.getFilterButton();
|
|
filterButton.setOnClickListener(new View.OnClickListener() {
|
|
filterButton.setOnClickListener(new View.OnClickListener() {
|
|
@@ -227,6 +229,12 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
StatisticsFragment.this.openFilterMenuOnView(v);
|
|
StatisticsFragment.this.openFilterMenuOnView(v);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ if (this.currentPlotView instanceof BarGraph){
|
|
|
|
+ this.setTitle("" + this.getCurrentSelectedProtocol() + ": " +this.selectedCompareData);
|
|
|
|
+ } else {
|
|
|
|
+ this.setTitle(this.selectedCompareData);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void setTitle(String title){
|
|
public void setTitle(String title){
|
|
@@ -249,6 +257,12 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
super.onStart();
|
|
super.onStart();
|
|
this.actualiseCurrentPlot();
|
|
this.actualiseCurrentPlot();
|
|
this.currentPlotView.invalidate();
|
|
this.currentPlotView.invalidate();
|
|
|
|
+
|
|
|
|
+ if (this.currentPlotView instanceof BarGraph){
|
|
|
|
+ this.setTitle("" + this.getCurrentSelectedProtocol() + ": " +this.selectedCompareData);
|
|
|
|
+ } else {
|
|
|
|
+ this.setTitle(this.selectedCompareData);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void setChartType(ChartType type){
|
|
public void setChartType(ChartType type){
|
|
@@ -259,10 +273,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
shouldChange = ! (this.currentPlotView instanceof PieGraph);
|
|
shouldChange = ! (this.currentPlotView instanceof PieGraph);
|
|
// SET FILTER BUTTON HIDDEN
|
|
// SET FILTER BUTTON HIDDEN
|
|
ImageButton filterButton = this.getFilterButton();
|
|
ImageButton filterButton = this.getFilterButton();
|
|
- if (filterButton != null) filterButton.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
+ if (filterButton != null) filterButton.setVisibility(View.GONE);
|
|
} else {
|
|
} else {
|
|
if (this.pieGraph != null)
|
|
if (this.pieGraph != null)
|
|
- this.pieGraph.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
+ this.pieGraph.setVisibility(View.GONE);
|
|
// SHOW FILTER BUTTON
|
|
// SHOW FILTER BUTTON
|
|
ImageButton filterButton = this.getFilterButton();
|
|
ImageButton filterButton = this.getFilterButton();
|
|
if (filterButton != null) filterButton.setVisibility(View.VISIBLE);
|
|
if (filterButton != null) filterButton.setVisibility(View.VISIBLE);
|
|
@@ -271,14 +285,14 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
shouldChange = ! (this.currentPlotView instanceof LineGraph);
|
|
shouldChange = ! (this.currentPlotView instanceof LineGraph);
|
|
} else {
|
|
} else {
|
|
if (this.lineGraph != null)
|
|
if (this.lineGraph != null)
|
|
- this.lineGraph.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
+ this.lineGraph.setVisibility(View.GONE);
|
|
}
|
|
}
|
|
if (type == ChartType.BAR_CHART){
|
|
if (type == ChartType.BAR_CHART){
|
|
shouldChange = ! (this.currentPlotView instanceof BarGraph);
|
|
shouldChange = ! (this.currentPlotView instanceof BarGraph);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
if (this.barGraph != null)
|
|
if (this.barGraph != null)
|
|
- this.barGraph.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
+ this.barGraph.setVisibility(View.GONE);
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -310,7 +324,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
/*
|
|
/*
|
|
* MENU
|
|
* MENU
|
|
* */
|
|
* */
|
|
- private void openPopupMenuOnView(View anchorView){
|
|
|
|
|
|
+ private void openBarSelectionMenuOnView(View anchorView){
|
|
SimplePopupTable visualiseMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
|
|
SimplePopupTable visualiseMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
|
|
public void onItemClick(Object ob) {
|
|
public void onItemClick(Object ob) {
|
|
if (ob instanceof AbstractPopupItem){
|
|
if (ob instanceof AbstractPopupItem){
|
|
@@ -325,7 +339,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
SimplePopupItem item = new SimplePopupItem(this.getActivity());
|
|
SimplePopupItem item = new SimplePopupItem(this.getActivity());
|
|
item.setTitle(title);
|
|
item.setTitle(title);
|
|
item.setItemId(id);
|
|
item.setItemId(id);
|
|
- item.setSelected(this.isFilterSetForTitle(title));
|
|
|
|
|
|
+ item.setSelected(false);
|
|
visualiseMenu.addItem(item);
|
|
visualiseMenu.addItem(item);
|
|
id++;
|
|
id++;
|
|
}
|
|
}
|
|
@@ -339,7 +353,6 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
this.selectedCompareData = COMPARE_TITLE_AttacksPerProtocol;
|
|
this.selectedCompareData = COMPARE_TITLE_AttacksPerProtocol;
|
|
this.setChartType(chartType);
|
|
this.setChartType(chartType);
|
|
this.setTitle(COMPARE_TITLE_AttacksPerProtocol);
|
|
this.setTitle(COMPARE_TITLE_AttacksPerProtocol);
|
|
- //this.openProtocolDataDialog();
|
|
|
|
}
|
|
}
|
|
if (item.getTitle().equals(MENU_TITLE_NETWORK)){
|
|
if (item.getTitle().equals(MENU_TITLE_NETWORK)){
|
|
this.openNetworkDataDialog();
|
|
this.openNetworkDataDialog();
|
|
@@ -385,6 +398,11 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
String title = dialog.getTitle();
|
|
String title = dialog.getTitle();
|
|
ArrayList<String> titles =dialog.getSelectedItemTitles();
|
|
ArrayList<String> titles =dialog.getSelectedItemTitles();
|
|
|
|
|
|
|
|
+ if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
|
|
+ this.filter.setProtocols(titles.size() == 0 ? this.protocolTitles() : titles);
|
|
|
|
+ this.actualiseCurrentPlot();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (title.equals(FILTER_MENU_PROTOCOL_SINGLE_CHOICE_TITLE)){
|
|
if (title.equals(FILTER_MENU_PROTOCOL_SINGLE_CHOICE_TITLE)){
|
|
this.filter.setProtocols(titles);
|
|
this.filter.setProtocols(titles);
|
|
this.actualiseCurrentPlot();
|
|
this.actualiseCurrentPlot();
|
|
@@ -498,6 +516,11 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
|
|
|
|
filterMenu.addItem(item);
|
|
filterMenu.addItem(item);
|
|
}
|
|
}
|
|
|
|
+ if (this.filter.isSet()){
|
|
|
|
+ AbstractPopupItem item = new SimplePopupItem(this.getActivity());
|
|
|
|
+ item.setTitle(FILTER_MENU_TITLE_REMOVE);
|
|
|
|
+ filterMenu.addItem(item);
|
|
|
|
+ }
|
|
filterMenu.showOnView(anchor);
|
|
filterMenu.showOnView(anchor);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -519,9 +542,12 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
if (title.equals(FILTER_MENU_TITLE_BSSID)){
|
|
if (title.equals(FILTER_MENU_TITLE_BSSID)){
|
|
this.openBSSIDFilterDialog();
|
|
this.openBSSIDFilterDialog();
|
|
}
|
|
}
|
|
- if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
|
|
|
|
+ if (title.equals(FILTER_MENU_TITLE_PROTOCOL)){
|
|
this.openFilterDialogSelectProtocol();
|
|
this.openFilterDialogSelectProtocol();
|
|
}
|
|
}
|
|
|
|
+ if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
|
|
+ this.openProtocolsFilterDialog();
|
|
|
|
+ }
|
|
if (title.equals(FILTER_MENU_TITLE_REMOVE)){
|
|
if (title.equals(FILTER_MENU_TITLE_REMOVE)){
|
|
this.clearFilter();
|
|
this.clearFilter();
|
|
this.actualiseCurrentPlot();
|
|
this.actualiseCurrentPlot();
|
|
@@ -532,12 +558,13 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
ArrayList<String> titles = new ArrayList<String>();
|
|
ArrayList<String> titles = new ArrayList<String>();
|
|
if (this.currentPlotView instanceof LineGraph){
|
|
if (this.currentPlotView instanceof LineGraph){
|
|
titles.add(FILTER_MENU_TITLE_ESSID);
|
|
titles.add(FILTER_MENU_TITLE_ESSID);
|
|
|
|
+ titles.add(FILTER_MENU_TITLE_PROTOCOLS);
|
|
titles.add(FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
|
|
titles.add(FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
|
|
if (this.filter.hasESSIDs() || this.filter.hasATimestamp()){
|
|
if (this.filter.hasESSIDs() || this.filter.hasATimestamp()){
|
|
titles.add(FILTER_MENU_TITLE_REMOVE);
|
|
titles.add(FILTER_MENU_TITLE_REMOVE);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- titles.add(FILTER_MENU_TITLE_PROTOCOLS);
|
|
|
|
|
|
+ titles.add(FILTER_MENU_TITLE_PROTOCOL);
|
|
String protocol = this.getCurrentSelectedProtocol();
|
|
String protocol = this.getCurrentSelectedProtocol();
|
|
if (protocol.length() > 0){
|
|
if (protocol.length() > 0){
|
|
if (this.selectedCompareData.equals(COMPARE_TITLE_AttacksPerBSSID)){
|
|
if (this.selectedCompareData.equals(COMPARE_TITLE_AttacksPerBSSID)){
|
|
@@ -554,6 +581,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
return titles;
|
|
return titles;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void openProtocolsFilterDialog(){
|
|
|
|
+ ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_PROTOCOLS,this.protocolTitles(), this.selectedProtocols(), true , this);
|
|
|
|
+ newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_PROTOCOLS);
|
|
|
|
+ }
|
|
private void openFilterDialogSelectProtocol(){
|
|
private void openFilterDialogSelectProtocol(){
|
|
ArrayList<String> titles = this.protocolTitles();
|
|
ArrayList<String> titles = this.protocolTitles();
|
|
boolean[] selected = new boolean[titles.size()];
|
|
boolean[] selected = new boolean[titles.size()];
|
|
@@ -654,17 +685,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
this.actualiseCurrentPlot();
|
|
this.actualiseCurrentPlot();
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- *
|
|
|
|
- * PLOT TOUCH HANDLING
|
|
|
|
- *
|
|
|
|
- * */
|
|
|
|
- public void onSliceClick(int index){
|
|
|
|
- this.userTappedOnItem(index);
|
|
|
|
- }
|
|
|
|
- public void onBarClick(int index){
|
|
|
|
- this.userTappedOnItem(index);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
/*
|
|
/*
|
|
*
|
|
*
|
|
* PLOT TYPES
|
|
* PLOT TYPES
|
|
@@ -698,7 +719,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
if (this.barGraph == null) {
|
|
if (this.barGraph == null) {
|
|
this.barGraph = new BarGraph(this.getActivity());
|
|
this.barGraph = new BarGraph(this.getActivity());
|
|
LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
|
|
LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
|
|
- this.barGraph.setLayoutParams(new ViewGroup.LayoutParams(plotLayout.getWidth() - plotLayout.getPaddingLeft() - plotLayout.getPaddingRight(), plotLayout.getHeight() - - plotLayout.getPaddingTop() - plotLayout.getPaddingBottom()));
|
|
|
|
|
|
+ this.barGraph.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT ));
|
|
plotLayout.addView(this.barGraph);
|
|
plotLayout.addView(this.barGraph);
|
|
this.barGraph.setShowBarText(false);
|
|
this.barGraph.setShowBarText(false);
|
|
this.barGraph.setPopupImageID(R.drawable.popup_black);
|
|
this.barGraph.setPopupImageID(R.drawable.popup_black);
|
|
@@ -795,7 +816,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
}
|
|
}
|
|
|
|
|
|
double stepRange = (rangeMax_X - rangeMin_X)/(60*60*24*1000);
|
|
double stepRange = (rangeMax_X - rangeMin_X)/(60*60*24*1000);
|
|
- this.lineGraph.setxAxisStep(Math.max(1,(float)Math.min(stepRange, 4)));
|
|
|
|
|
|
+ this.lineGraph.setxAxisStep(Math.max(1, (float) Math.min(stepRange, 4)));
|
|
|
|
|
|
this.lineGraph.setRangeX(rangeMin_X , rangeMax_X);
|
|
this.lineGraph.setRangeX(rangeMin_X , rangeMax_X);
|
|
|
|
|
|
@@ -851,7 +872,6 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
return this.dbh.getRecordsForFilter(this.filter);
|
|
return this.dbh.getRecordsForFilter(this.filter);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
public void actualiseCurrentPlot(){
|
|
public void actualiseCurrentPlot(){
|
|
LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
|
|
LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
|
|
View plot = this.currentPlotView;
|
|
View plot = this.currentPlotView;
|
|
@@ -859,25 +879,38 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
this.currentPlotView = this.getPieGraphView();
|
|
this.currentPlotView = this.getPieGraphView();
|
|
plot = this.currentPlotView;
|
|
plot = this.currentPlotView;
|
|
}
|
|
}
|
|
- if (plot.getVisibility() == View.INVISIBLE) plot.setVisibility(View.VISIBLE);
|
|
|
|
|
|
+ if (plot.getParent() != null && !plot.getParent().equals(plotLayout)){
|
|
|
|
+ LinearLayout linLayout = (LinearLayout)plot.getParent();
|
|
|
|
+ linLayout.removeView(plot);
|
|
|
|
+ plot.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT ));
|
|
|
|
+ plotLayout.addView(plot);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (plot.getVisibility() == View.GONE) plot.setVisibility(View.VISIBLE);
|
|
|
|
|
|
if (plot instanceof PieGraph){
|
|
if (plot instanceof PieGraph){
|
|
PieGraph pie = (PieGraph) plot;
|
|
PieGraph pie = (PieGraph) plot;
|
|
this.setPieGraphData(pie);
|
|
this.setPieGraphData(pie);
|
|
|
|
+ // HIDE FILTER BUTTON
|
|
|
|
+ ImageButton filterButton = this.getFilterButton();
|
|
|
|
+ if (filterButton != null) filterButton.setVisibility(View.GONE);
|
|
} else {
|
|
} else {
|
|
if (this.pieGraph != null){
|
|
if (this.pieGraph != null){
|
|
- this.pieGraph.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
+ this.pieGraph.setVisibility(View.GONE);
|
|
if (this.pieGraph.getParent() != null){
|
|
if (this.pieGraph.getParent() != null){
|
|
plotLayout.removeView(this.pieGraph);
|
|
plotLayout.removeView(this.pieGraph);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // SHOW FILTER BUTTON
|
|
|
|
+ ImageButton filterButton = this.getFilterButton();
|
|
|
|
+ if (filterButton != null) filterButton.setVisibility(View.VISIBLE);
|
|
}
|
|
}
|
|
if (plot instanceof BarGraph){
|
|
if (plot instanceof BarGraph){
|
|
BarGraph bar = (BarGraph) plot;
|
|
BarGraph bar = (BarGraph) plot;
|
|
this.setBarGraphData(bar);
|
|
this.setBarGraphData(bar);
|
|
} else {
|
|
} else {
|
|
if (this.barGraph != null){
|
|
if (this.barGraph != null){
|
|
- this.barGraph.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
+ this.barGraph.setVisibility(View.GONE);
|
|
if (this.barGraph.getParent() != null){
|
|
if (this.barGraph.getParent() != null){
|
|
plotLayout.removeView(this.barGraph);
|
|
plotLayout.removeView(this.barGraph);
|
|
}
|
|
}
|
|
@@ -888,7 +921,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
this.setLineGraphData(line);
|
|
this.setLineGraphData(line);
|
|
}else {
|
|
}else {
|
|
if (this.lineGraph != null){
|
|
if (this.lineGraph != null){
|
|
- this.lineGraph.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
+ this.lineGraph.setVisibility(View.GONE);
|
|
if (this.lineGraph.getParent() != null){
|
|
if (this.lineGraph.getParent() != null){
|
|
plotLayout.removeView(this.lineGraph);
|
|
plotLayout.removeView(this.lineGraph);
|
|
}
|
|
}
|
|
@@ -1280,7 +1313,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
/**
|
|
/**
|
|
* USERINTERACTION
|
|
* USERINTERACTION
|
|
*/
|
|
*/
|
|
- private void userTappedOnItem(int index){
|
|
|
|
|
|
+ private void userTappedOnLegendItem(int index){
|
|
if (index < this.currentData.size()){
|
|
if (index < this.currentData.size()){
|
|
PlotComparisonItem item = this.currentData.get(index);
|
|
PlotComparisonItem item = this.currentData.get(index);
|
|
ArrayList<String> selectedData;
|
|
ArrayList<String> selectedData;
|
|
@@ -1298,20 +1331,54 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
|
|
filter.setProtocols(selectedData);
|
|
filter.setProtocols(selectedData);
|
|
}
|
|
}
|
|
if (this.currentPlotView instanceof BarGraph){
|
|
if (this.currentPlotView instanceof BarGraph){
|
|
- // TODO set data for BSSID / ESSID
|
|
|
|
|
|
+
|
|
|
|
+ if (this.selectedCompareData.equals(COMPARE_TITLE_AttacksPerESSID)){
|
|
|
|
+ filter.setESSIDs(selectedData);
|
|
|
|
+ } else {
|
|
|
|
+ filter.setBSSIDs(selectedData);
|
|
|
|
+ }
|
|
|
|
+ ArrayList<String> currentSelectedProtocol = new ArrayList<String>();
|
|
|
|
+ currentSelectedProtocol.add(this.getCurrentSelectedProtocol());
|
|
|
|
+ filter.setProtocols(currentSelectedProtocol);
|
|
}
|
|
}
|
|
if (this.currentPlotView instanceof LineGraph){
|
|
if (this.currentPlotView instanceof LineGraph){
|
|
- // TODO set data for BSSID / ESSID
|
|
|
|
|
|
+ selectedData = new ArrayList<String>();
|
|
|
|
+ selectedData.add(item.getTitle());
|
|
|
|
+ filter.setESSIDs(selectedData);
|
|
|
|
+ filter.setProtocols(this.filter.getProtocols());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.filter.hasATimestamp()){
|
|
|
|
+ filter.setAboveTimestamp(this.filter.getAboveTimestamp());
|
|
|
|
+ filter.setBelowTimestamp(this.filter.getBelowTimestamp());
|
|
}
|
|
}
|
|
|
|
|
|
this.pushRecordOverviewForFilter(filter);
|
|
this.pushRecordOverviewForFilter(filter);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public void onSliceClick(int index){
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ public void onBarClick(int index){
|
|
|
|
+ this.userTappedOnLegendItem(index);
|
|
|
|
+ }
|
|
|
|
|
|
private void pushRecordOverviewForFilter(LogFilter filter){
|
|
private void pushRecordOverviewForFilter(LogFilter filter){
|
|
|
|
|
|
|
|
+ FragmentManager fm = this.getActivity().getFragmentManager();
|
|
|
|
+
|
|
|
|
+ if (fm != null){
|
|
|
|
+ RecordOverviewFragment newFragment = new RecordOverviewFragment();
|
|
|
|
+ newFragment.setFilter(filter);
|
|
|
|
+ FragmentTransaction transaction = fm.beginTransaction();
|
|
|
|
+ transaction.replace(R.id.content_frame, newFragment, newFragment.getTag());
|
|
|
|
+ transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
|
|
|
|
+ transaction.addToBackStack(null);
|
|
|
|
+
|
|
|
|
+ transaction.commit();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|