Browse Source

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/scm-ssi-student-hostagev2

Alexander Brakowski 10 years ago
parent
commit
162f684883

+ 57 - 38
src/de/tudarmstadt/informatik/hostage/ui2/fragment/RecordOverviewFragment.java

@@ -99,6 +99,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         setHasOptionsMenu(true);
     }
 
+    @Override
 	public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
 
@@ -165,7 +166,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	 }
 
 
-    /*Initialises the expandable list view in a backgorund thread*/
+    /**Initialises the expandable list view in a backgorund thread*/
     private void initialiseListView(){
         if (loader != null) loader.interrupt();
 
@@ -237,7 +238,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
     }
 
 
-    /*
+    /**
     *  Returns the Fragment layout ID
     *  @return int The fragment layout ID
     * */
@@ -245,7 +246,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         return R.layout.fragment_record_list;
     }
 
-    /*
+    /**
     * Gets called if the user clicks on item in the filter menu.
     *
     * @param AbstractPopupItem item
@@ -292,7 +293,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
 
 
-
+    @Override
     public void onStart() {
         super.onStart();
         if (this.expListView.getExpandableListAdapter() != null){
@@ -350,7 +351,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	 *
 	 * ***************************/
 
-    /*
+    /**
     *  Reloads the data in the ExpandableListView for the given filter object.
     *  @param ExpandableListView  listview
     * */
@@ -422,7 +423,9 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         return adapter;
 	}
 
-
+    /**
+     * Actualises the list in a background thread
+     */
     private void actualiseListViewInBackground(){
         if (loader != null && loader.isAlive()) loader.interrupt();
 
@@ -462,7 +465,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         loader.start();
     }
 
-    /*Thsi will open a section in the ExpandableListView with the same title as the parameter s.
+    /**This will open a section in the ExpandableListView with the same title as the parameter s.
     *
     * @param String s (the section title to open)
     *
@@ -478,7 +481,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         }
     }
 
-    /*
+    /**
     * Returns the base context.
     * @return Context baseContext
     * */
@@ -486,14 +489,14 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		return this.getActivity().getBaseContext();
 	}
 
-    /*Returns the application context.
+    /**Returns the application context.
     * @return Context application context
     * */
 	private Context getApplicationContext(){
 		return this.getActivity().getApplicationContext();
 	}
 
-    /*Sets the list view listener on the given ExpandableListView.
+    /**Sets the list view listener on the given ExpandableListView.
     *
     * @param ExpandableListView listview
     * */
@@ -536,7 +539,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	 * ***************************/
 
 
-    /*Returns the date format "H:mm d.M.yy" for the given timestamp (long)
+    /**Returns the date format "H:mm d.M.yy" for the given timestamp (long)
     * @param Long timestamp*/
 	@SuppressLint("SimpleDateFormat")
 	private String getDateAsString(long timeStamp) {
@@ -574,31 +577,31 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	 *
 	 * ***************************/
 
-    /*Opens the grouping dialog*/
+    /**Opens the grouping dialog*/
     private void openGroupingDialog(){
         ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_GROUP, this.groupingTitles(), this.selectedGroup(), false , this);
         newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_GROUP);
     }
 
-    /*opens the bssid filter dialog*/
+    /**opens the bssid filter dialog*/
 	private void openBSSIDFilterDialog(){
 		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_BSSID,this.bssids(), this.selectedBSSIDs(), true , this);
 	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_BSSID);
 	}
 
-    /*opens the essid filter dialog*/
+    /**opens the essid filter dialog*/
 	private void openESSIDFilterDialog(){
 		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_ESSID,this.essids(), this.selectedESSIDs(), true , this);
 	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_ESSID);
 	}
 
-    /*opens the protocol filter dialog*/
+    /**opens the protocol filter dialog*/
 	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);
 	}
 
-    /*opens the timestamp filter dialog (minimal timestamp required)*/
+    /**opens the timestamp filter dialog (minimal timestamp required)*/
 	private void openTimestampFromFilterDialog(){
 		this.wasBelowTimePicker = false;
 		DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
@@ -606,7 +609,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         if (this.filter.aboveTimestamp != Long.MIN_VALUE)newFragment.setDate(this.filter.aboveTimestamp);
 	}
 
-    /*opens time timestamp filter dialog (maximal timestamp required)*/
+    /**opens time timestamp filter dialog (maximal timestamp required)*/
 	private void openTimestampToFilterDialog(){
 		this.wasBelowTimePicker = true;
 		DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
@@ -614,7 +617,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         if (this.filter.belowTimestamp != Long.MAX_VALUE) newFragment.setDate(this.filter.belowTimestamp);
     }
 
-    /*opens the sorting dialog*/
+    /**opens the sorting dialog*/
 	private void openSortingDialog(){
 		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_SORTING,this.sortTypeTiles(), this.selectedSorttype(), false , this);
 	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
@@ -626,7 +629,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
      *
      * ***************************/
 
-    /*returns the group title for the given record. Uses the groupingKey to decied which value of the record should be used.
+    /**returns the group title for the given record. Uses the groupingKey to decied which value of the record should be used.
     * @param Record rec
     * @return String grouptitle*/
     public String getGroupValue(Record rec){
@@ -643,7 +646,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         }
     }
 
-    /*Returns the Group titles for the specified grouping key. e.g. groupingKey is "ESSID" it returns all available essids.
+    /**Returns the Group titles for the specified grouping key. e.g. groupingKey is "ESSID" it returns all available essids.
     * @return ArrayList<String> grouptitles*/
     public ArrayList<String> getGroupTitles(){
         int index = this.groupingTitles().indexOf(this.groupingKey);
@@ -666,7 +669,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	 *
 	 * ***************************/
 
-    /*Opens the filter menu on a anchor view. The filter menu will always be on top of the anchor.
+    /**Opens the filter menu on a anchor view. The filter menu will always be on top of the anchor.
     * @param View anchorView*/
 	private void openFilterPopupMenuOnView(View v){
 
@@ -703,7 +706,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		filterMenu.showOnView(v);
 	}
 
-    /*Returns true  if the filter object is set for the given title otherwise false. e.g. the filter object has protocols,
+    /**Returns true  if the filter object is set for the given title otherwise false. e.g. the filter object has protocols,
     * so the method will return for the title FILTER_MENU_TITLE_PROTOCOLS TRUE.
     * @param String title
     * @return boolean value
@@ -727,13 +730,13 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         return false;
     }
 
-    /*clears the filter. Does not invoke populatelistview!*/
+    /**clears the filter. Does not invoke populatelistview!*/
 	private void clearFilter(){
     	if(filter == null) this.filter = new LogFilter();
     	this.filter.clear();
 	}
 
-    /*Returns all grouping titles
+    /**Returns all grouping titles
     * @param Context context
     * @return ArrayList<String> titles*/
     public ArrayList<String> groupingTitles(Context context){
@@ -744,7 +747,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         }
         return titles;
     }
-    /*Returns all grouping titles.
+    /**Returns all grouping titles.
     * @return ArrayList<String> tiles*/
     public ArrayList<String> groupingTitles(){
         ArrayList<String> titles = new ArrayList<String>();
@@ -754,7 +757,8 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         }
         return titles;
     }
-    /*Returns a bool array. This array is true at the index of the groupingKey in groupingTitles(), otherwise false.
+    /**
+     * Returns a bool array. This array is true at the index of the groupingKey in groupingTitles(), otherwise false.
     * @return boolean[] selection
     * */
     public boolean[] selectedGroup(){
@@ -768,7 +772,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         return selected;
     }
 
-    /*Returns all protocol titles / names.
+    /**Returns all protocol titles / names.
     * @return ArrayList<String> protocolTitles
     * */
 	public ArrayList<String> protocolTitles(){
@@ -779,7 +783,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		}
 		return titles;
 	}
-    /*Return a boolean array of the selected / filtered protocols. If the filter object has
+    /**Return a boolean array of the selected / filtered protocols. If the filter object has
     * an protocol from the protocolTitles() array, the index of it will be true, otherwise false.
     * @return boolean[] protocol selection
     * */
@@ -795,7 +799,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		return selected;
 	}
 
-    /*
+    /**
     * Returns the Sorttype Titles
     * @return ArayList<String> Sort type titles
     * */
@@ -807,7 +811,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		titles.add(MainActivity.getContext().getString(R.string.ESSID));
 		return titles;
 	}
-    /*
+    /**
     * Returns an boolean array. The array is true at the index of the selected sort type..
     * The index of the selected sort type is the same index in the sortTypeTiles array.
     * @return boolean array, length == sortTypeTiles().length
@@ -823,7 +827,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		return selected;
 	}
 
-    /*
+    /**
     * Returns all unique bssids.
     * @return ArrayList<String>
     * */
@@ -831,7 +835,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		ArrayList<String> records = dbh.getUniqueBSSIDRecords();
 		return records;
 	}
-    /*
+    /**
     * Returns an boolean array. The array is true at the indices of the selected bssids.
     * The index of the selected bssid is the same index in the bssids() array.
     * @return boolean array, length == bssids().length
@@ -848,7 +852,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		return selected;
 	}
 
-    /*
+    /**
     * Returns all unique essids.
     * @return ArrayList<String>
     * */
@@ -856,7 +860,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		ArrayList<String> records = dbh.getUniqueESSIDRecords();
 		return records;
 	}
-    /*
+    /**
     * Returns an boolean array. The array is true at the indices of the selected essids.
     * The index of the selected essid is the same index in the essids() array.
     * @return boolean array, length == essids().length
@@ -873,7 +877,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		return selected;
 	}
 
-    /*
+    /**
      * Returns all filter menu titles.
      * @return ArrayList<String>
      * */
@@ -895,6 +899,10 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	 *
 	 * ***************************/
 
+    /**
+     * Will be called if the users selects a timestamp.
+     * @param DateTimeDialogFragment dialog
+     * */
 	public void onDateTimePickerPositiveClick(DateTimeDialogFragment dialog) {
 		if(this.wasBelowTimePicker){
 			this.filter.setBelowTimestamp(dialog.getDate());
@@ -903,7 +911,10 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		}
         this.actualiseListViewInBackground();
 	}
-
+    /**
+     * Will be called if the users cancels a timestamp selection.
+     * @param DateTimeDialogFragment dialog
+     * */
 	public void onDateTimePickerNegativeClick(DateTimeDialogFragment dialog) {
 		if(this.wasBelowTimePicker){
 			this.filter.setBelowTimestamp(Long.MAX_VALUE);
@@ -912,6 +923,10 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		}
 	}
 
+    /**
+     * Will be called if the users clicks the positiv button on a ChechlistDialog.
+     * @param ChecklistDialog dialog
+     */
 	public void onDialogPositiveClick(ChecklistDialog dialog) {
 		String title = dialog.getTitle();
 		if(title.equals(FILTER_MENU_TITLE_BSSID)){
@@ -953,6 +968,10 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         this.actualiseListViewInBackground();
 	}
 
+    /**
+     * Will be called if the users clicks the negativ button on a ChechlistDialog.
+     * @param ChecklistDialog dialog
+     */
 	public void onDialogNegativeClick(ChecklistDialog dialog) {}
 
 
@@ -962,7 +981,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	 *
 	 * ***************************/
 
-    /*
+    /**
     * This will clear the database at first and than add new attacks.
     * @param int number of networks to create
     * @param int maximal number of attack per network
@@ -1047,7 +1066,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
     }
 
 
-    /*Navigation. Shows the record detail view for the given record
+    /**Navigation. Shows the record detail view for the given record
     * @param Record record to show
     * */
     private void pushRecordDetailViewForRecord(Record record){

+ 223 - 38
src/de/tudarmstadt/informatik/hostage/ui2/fragment/StatisticsFragment.java

@@ -128,9 +128,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     private ListView legendListView;
 
 
-
     private String selectedCompareData = COMPARE_TITLE_AttacksPerProtocol;
 
+
     public enum ChartType {
         PIE_CHART(0),
         BAR_CHART(1),
@@ -158,14 +158,21 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     }
 
+    /**Returns the FilterButton.
+    * @return ImageButton filterButton*/
     private ImageButton getFilterButton(){
         return (ImageButton) this.rootView.findViewById(R.id.FilterButton);
     }
 
+    /**
+    * Returns the layout ID
+    * @Return int layoutID
+    * */
     public int getLayoutID(){
         return R.layout.fragment_statistics;
     }
 
+    @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
 
@@ -215,14 +222,24 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     }
 
+    /**Returns the base context.
+    * @return Context the base context
+    * */
     private Context getBaseContext(){
         return this.getActivity().getBaseContext();
     }
 
+    /**Returns the application context.
+    * @return Context the application context*/
     private Context getApplicationContext(){
         return this.getActivity().getApplicationContext();
     }
 
+    /**Configures the given rootview.
+    * Sets the Spinner, the list and all requiered buttons.
+    * It also actualises the current plot type.
+    * @param View rootView
+    * */
     public void configureRootView(View rootView){
         LinearLayout plotLayout = (LinearLayout) rootView.findViewById(R.id.plot_layout);
         plotLayout.removeAllViews();
@@ -274,6 +291,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
+    /**Sets the title over the plot view.
+    * @param String title
+    * */
     public void setTitle(String title){
         TextView titleView = (TextView) this.rootView.findViewById(R.id.title_text_view);
         if (title != null && titleView != null){
@@ -282,6 +302,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
+    /**Returns the title over the plot view.
+    * @return String title
+    * */
     public String getTitle(){
         TextView titleView = (TextView) this.rootView.findViewById(R.id.title_text_view);
         if (titleView != null){
@@ -290,6 +313,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return "";
     }
 
+    @Override
     public void onStart() {
         super.onStart();
         this.actualiseCurrentPlot();
@@ -302,6 +326,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
+    /**Sets the current chart to the given type and acualises it.
+    * @param ChartType type
+    * */
     public void setChartType(ChartType type){
         boolean shouldChange = true;
         this.clearFilter();
@@ -342,6 +369,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     }
 
+    /**Returns the plot view for a given type.
+    * @param ChartType type.
+    * */
     public View getPlotViewForType(ChartType type){
         switch (type){
             case PIE_CHART:
@@ -353,6 +383,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
+    /**Actualises the list view. Therefore it requiers the "currentData".*/
     public void actualiseLegendList(){
         StatisticListAdapter adapter = new StatisticListAdapter(this.getApplicationContext(), this.currentData);
         if (this.currentPlotView instanceof LineGraph){
@@ -398,7 +429,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     /*
     * MENU
     * */
-    private void openBarSelectionMenuOnView(View anchorView){
+    /**Opens the Bar Option Menu above the given anchor view.
+    * @param View the anchor view*/
+     private void openBarSelectionMenuOnView(View anchorView){
         SimplePopupTable visualiseMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
             public void onItemClick(Object ob) {
                 if (ob instanceof AbstractPopupItem){
@@ -420,6 +453,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         visualiseMenu.showOnView(anchorView);
     }
 
+    /**Will be called when the users selected an menu item (visualise menu / plot menu).
+    * If the user selected "Protocols" this method sets the current plot type to piegraph.
+    * Otherwise it will open a new dialog to select the comparison type.
+    * */
     private void userSelectMenuItem(AbstractPopupItem item){
         // OPEN A DIALOG TO SPECIFY THE VISUALISE DATA
         if (item.getTitle().equals(MENU_TITLE_PROTOCOLS)){
@@ -436,6 +473,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
+    /**Returns the menu titles (visualise menu / plot menu)*/
     private ArrayList<String> getMenuTitles(){
         ArrayList<String> titles = new ArrayList<String>();
         titles.add(MENU_TITLE_PROTOCOLS);
@@ -447,16 +485,18 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     /*
     * PLOT DATA DIALOGS
     * */
-    private void openProtocolDataDialog(){
-        ArrayList<String> titles = this.getDialogProtocolDataTitle();
-        ChecklistDialog newFragment = new ChecklistDialog(DIALOG_PROTOCOLS_TITLE, titles, this.selectedData(titles), false , this);
-        newFragment.show(this.getActivity().getFragmentManager(), DIALOG_PROTOCOLS_TITLE);
-    }
+//     private void openProtocolDataDialog(){
+//        ArrayList<String> titles = this.getDialogProtocolDataTitle();
+//        ChecklistDialog newFragment = new ChecklistDialog(DIALOG_PROTOCOLS_TITLE, titles, this.selectedData(titles), false , this);
+//        newFragment.show(this.getActivity().getFragmentManager(), DIALOG_PROTOCOLS_TITLE);
+//    }
+    /**Opens the network comparison dialog*/
     private void openNetworkDataDialog(){
         ArrayList<String> titles = this.getDialogNetworkDataTitle();
         ChecklistDialog newFragment = new ChecklistDialog(DIALOG_NETWORK_TITLE, titles, this.selectedData(titles), false , this);
         newFragment.show(this.getActivity().getFragmentManager(), DIALOG_NETWORK_TITLE);
     }
+    /**Opens the attack comparison dialog*/
     private void openAttackDataDialog(){
         ArrayList<String> titles = this.getDialogAttackDataTitle();
         ChecklistDialog newFragment = new ChecklistDialog(DIALOG_ATTACK_TITLE, titles, this.selectedData(titles), false , this);
@@ -468,7 +508,11 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * DIALOG ACTION METHODS
     *
     * */
-    public void onDialogPositiveClick(ChecklistDialog dialog) {
+    /**
+     * Will be called if the user selects the positiv button on an checklist dialog.
+     * @param ChecklistDialog dialog
+     * */
+     public void onDialogPositiveClick(ChecklistDialog dialog) {
         String title = dialog.getTitle();
         ArrayList<String> titles =dialog.getSelectedItemTitles();
 
@@ -524,6 +568,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     }
 
+    /**
+     * Will be called if the user selects the negativ button on an checklist dialog.
+     * @param ChecklistDialog dialog
+     * */
     public void onDialogNegativeClick(ChecklistDialog dialog) {
 
     }
@@ -532,24 +580,39 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * DIALOG DATA
     *
     * */
-    private ArrayList<String> getDialogProtocolDataTitle(){
-        ArrayList<String> data = new ArrayList<String>();
-        data.add(COMPARE_TITLE_AttacksPerProtocol);
-        data.add(COMPARE_TITLE_UsesPerProtocol);
-        return data;
-    }
+
+
+//     private ArrayList<String> getDialogProtocolDataTitle(){
+//        ArrayList<String> data = new ArrayList<String>();
+//        data.add(COMPARE_TITLE_AttacksPerProtocol);
+//        data.add(COMPARE_TITLE_UsesPerProtocol);
+//        return data;
+//    }
+    /**
+     *  Returns the Attacks comparison titles.
+     * @return  ArrayList<String> the titles
+     */
     private ArrayList<String> getDialogAttackDataTitle(){
         ArrayList<String> data = new ArrayList<String>();
         data.add(COMPARE_TITLE_AttacksPerDate);
         data.add(COMPARE_TITLE_AttacksPerTime);
         return data;
     }
+    /**
+     *  Returns the network comparison titles.
+     * @return  ArrayList<String> the titles
+     */
     private ArrayList<String> getDialogNetworkDataTitle(){
         ArrayList<String> data = new ArrayList<String>();
         data.add(COMPARE_TITLE_AttacksPerESSID);
         data.add(COMPARE_TITLE_AttacksPerBSSID);
         return data;
     }
+    /**
+     * DEFAULT
+     *  Returns an boolean array with a default selection. Just the first object is true.
+     * @return  boolean[] selected array
+     */
     private boolean[] selectedData(ArrayList<String> data){
         boolean[] selected = new boolean[data.size()];
          // SET DEFAULT
@@ -562,7 +625,12 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     *  FILTER BUTTON
     *
     * */
-    private void openFilterMenuOnView(View anchor){
+
+    /**
+     * Opens the filter menu above an given anchor view.
+     * @param View anchor view
+     */
+     private void openFilterMenuOnView(View anchor){
         SimplePopupTable filterMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
             public void onItemClick(Object ob) {
                 if (ob instanceof  AbstractPopupItem){
@@ -597,6 +665,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         filterMenu.showOnView(anchor);
     }
 
+    /**
+     * Will be called if the user selected an filter item.
+     * @param AbstractPopupItem item
+     */
     private void onFilterMenuItemSelected(AbstractPopupItem item){
         if (item instanceof SplitPopupItem){
             SplitPopupItem sItem = (SplitPopupItem) item;
@@ -627,6 +699,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
+    /**
+     * Return the menu titles of the filter menu.
+     * @return ArrayList<String> filter menu title
+     * */
     private ArrayList<String> filterMenuTitles(){
         ArrayList<String> titles = new ArrayList<String>();
         if (this.currentPlotView instanceof LineGraph){
@@ -656,6 +732,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return titles;
     }
 
+    /**
+     * Opens a multiple protocol checklist dialog
+     */
     private void openProtocolsFilterDialog(){
         ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_PROTOCOLS,
                                                     this.protocolTitles(),
@@ -664,6 +743,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
                                                     this);
         newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_PROTOCOLS);
     }
+
+    /**
+     * Opens a single protocol checklist dialog
+     */
     private void openFilterDialogSelectProtocol(){
         ArrayList<String> titles = this.protocolTitles();
         boolean[] selected = new boolean[titles.size()];
@@ -676,16 +759,21 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_PROTOCOL_SINGLE_CHOICE_TITLE);
     }
 
+    /**
+     * Opens a multiple essid checklist dialog
+     */
     private void openESSIDFilterDialog(){
         ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_ESSID, this.essids(), this.selectedESSIDs(), true , this);
         newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_ESSID);
     }
 
+    /**Opens a multiple bssid checlist dialog.*/
     private void openBSSIDFilterDialog(){
         ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_BSSID, this.bssids(), this.selectedBSSIDs(), true , this);
         newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_BSSID);
     }
 
+    /** Opens a minimal timestamp dialog.**/
     private void openTimestampFromFilterDialog(){
         this.wasBelowTimePicker = false;
         DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
@@ -695,6 +783,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         if (this.filter.aboveTimestamp != Long.MIN_VALUE)newFragment.setDate(this.filter.aboveTimestamp);
     }
 
+    /** Opens the maximal timestamp dialog.*/
     private void openTimestampToFilterDialog(){
         this.wasBelowTimePicker = true;
         DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
@@ -703,6 +792,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         if (this.filter.belowTimestamp != Long.MAX_VALUE) newFragment.setDate(this.filter.belowTimestamp);
     }
 
+    /** Returns all essids
+     * If the current plot is a bar graph, it just return all possible essids for the selected protocol
+     * @return ArrayList<String> essids
+     * */
     public ArrayList<String> essids(){
         ArrayList<String> records;
         if (this.currentPlotView instanceof BarGraph){
@@ -712,6 +805,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
         return records;
     }
+    /** Returns a boolean array. The position in the array will be true, if the essid is selected in the filter.
+     * @return boolean[] selected essids*/
     public boolean[] selectedESSIDs(){
         ArrayList<String> essids = this.essids();
         boolean[] selected = new boolean[essids.size()];
@@ -724,6 +819,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return selected;
     }
 
+    /** Returns all bssids
+     * If the current plot is a bar graph, it just return all possible bssids for the selected protocol
+     * @return ArrayList<String> bssids
+     * */
     public ArrayList<String> bssids(){
         ArrayList<String> records ;
         if (this.currentPlotView instanceof BarGraph){
@@ -733,6 +832,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
         return records;
     }
+    /** Returns a boolean array. The position in the array will be true, if the bssid is selected in the filter.
+     * @return boolean[] selected bssids*/
     public boolean[] selectedBSSIDs(){
         ArrayList<String> bssids = this.bssids();
 
@@ -746,6 +847,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return selected;
     }
 
+    /**Will be called if the user selects an date on the timestamp dialog*/
     public void onDateTimePickerPositiveClick(DateTimeDialogFragment dialog) {
         if(this.wasBelowTimePicker){
             this.filter.setBelowTimestamp(dialog.getDate());
@@ -755,6 +857,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         this.actualiseCurrentPlot();
     }
 
+    /**Will be called if the user cancels an date selection on the timestamp dialog*/
     public void onDateTimePickerNegativeClick(DateTimeDialogFragment dialog) {
         if(this.wasBelowTimePicker){
             this.filter.setBelowTimestamp(Long.MAX_VALUE);
@@ -770,7 +873,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     *  PLOT TYPES
     *
     * **/
-    public PieGraph getPieGraphView(){
+    /**Returns the current pie graph.
+     * @return PieGraph current piegraph*/
+     public PieGraph getPieGraphView(){
         if (this.pieGraph == null) {
             this.pieGraph = new PieGraph(this.getApplicationContext());
             LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
@@ -785,6 +890,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
          return this.pieGraph;
     }
 
+    /**
+     * Returns the current line graph.
+     * @return LineGraph current line graph
+     */
     public LineGraph getLineGraphView(){
         if (this.lineGraph == null) {
             this.lineGraph = new LineGraph(this.getActivity());
@@ -795,6 +904,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return this.lineGraph;
     }
 
+    /**
+     * Returns the current BarGraph.
+     * @return BarGraph the current bar graph
+     */
     public BarGraph getBarGraphView(){
         if (this.barGraph == null) {
             this.barGraph = new BarGraph(this.getActivity());
@@ -816,7 +929,12 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     /*
     *  FEED PLOTS WITH DATA
     * */
-    public void setPieGraphData(PieGraph piegraph){
+
+    /**
+     * Sets the data for the given PieGraph
+     * @param PieGraph piegraph
+     */
+     public void setPieGraphData(PieGraph piegraph){
         this.currentData = this.getPieData();
         if (this.currentData == null){
             this.currentData = new ArrayList<PlotComparisonItem>();
@@ -837,6 +955,11 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     }
 
+
+    /**
+     * Sets the data for the given LineGraph
+     * @param LineGraph linegraph
+     */
     public void setLineGraphData(LineGraph linegraph){
         this.currentData = this.getLineData();
         if (this.currentData == null){
@@ -934,7 +1057,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         linegraph.invalidate();
     }
 
-    /*
+    /**
     * Set the graph data to the given graph
     * @param BarGraph bargraph
     * */
@@ -964,12 +1087,16 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     *  FETCH & ACTUALISE RECORD DATA
     *
     * */
-    public ArrayList<Record> getFetchedRecords(){
+    /**
+     * Returns the DataBaseHandler result for the current filter.
+     * @param ArrayList<Record> records
+     */
+     public ArrayList<Record> getFetchedRecords(){
         if (this.filter == null) this.clearFilter();
         return this.dbh.getRecordsForFilter(this.filter);
     }
 
-    /*Actualises the current plot.*/
+    /**Actualises the current plot in a background thread.*/
      public void actualiseCurrentPlot(){
          this.spinner.setVisibility(View.VISIBLE);
 
@@ -1087,10 +1214,14 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         this.loader.start();
      }
 
+    /** Calculates and returns the data for the piegraph
+     * @return ArrayList<PlotComparisonItem> data */
     public ArrayList<PlotComparisonItem> getPieData(){
         // DEFAULT
         return this.attacksPerProtocols();
     }
+    /** Calculates and returns the data for the bargraph.
+     * @return ArrayList<PlotComparisonItem> data */
     public ArrayList<PlotComparisonItem> getBarData(){
         String protocol = this.getCurrentSelectedProtocol();
 
@@ -1104,6 +1235,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         // Nothing available
         return new ArrayList<PlotComparisonItem>();
     }
+    /** Calculates and returns the data for the linegraph
+     * @return ArrayList<PlotComparisonItem> data */
     public ArrayList<PlotComparisonItem> getLineData(){
         return this.attacksPerTime();
     }
@@ -1113,6 +1246,12 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * */
 
     /*PROTOCOLS OVERVIEW*/
+
+    /**
+     * Returns the attacks per protocols comparison result.
+     * The returned data is resized to the specified limit.
+     * @return ArrayList<PlotComparisonItem>
+     */
      public ArrayList<PlotComparisonItem> attacksPerProtocols(){
         ArrayList<PlotComparisonItem> plotItems = new ArrayList<PlotComparisonItem>();
          int index = 0;
@@ -1137,8 +1276,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     *  LINE PLOT DATA
     */
 
-    /*Returns the line graph data responding to the selectedCompareData key.
-    * @return ArrayList<PlotComparisonItem attacksPerTime or attacksPerDate*/
+    /**Returns the line graph data responding to the selectedCompareData key.
+     * The returned data is resized to the specified limit.
+     * @return ArrayList<PlotComparisonItem attacksPerTime or attacksPerDate*/
     public ArrayList<PlotComparisonItem> attacksPerTime(){
         HashMap<String,HashMap<Long, ArrayList<Record> > > lineMap = new HashMap<String, HashMap<Long, ArrayList<Record>>>();
 
@@ -1216,8 +1356,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     /*
     *  BAR PLOT DATA
     */
-    /*Returns plotitems for the comparison "attacks per bssid"
-    * @return ArrayList<PlotComparisonItem> the data
+    /**Returns plotitems for the comparison "attacks per bssid"
+     * The returned data is resized to the specified limit.
+     * @return ArrayList<PlotComparisonItem> the data
     */
     public ArrayList<PlotComparisonItem> attacksPerBSSID(String protocol){
         LogFilter filter = new LogFilter();
@@ -1256,7 +1397,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         });
         return this.resizeData(plotItems);
     }
-    /*Returns plotitems for the comparison "attacks per essid"
+    /**Returns plotitems for the comparison "attacks per essid"
     * @return ArrayList<PlotComparisonItem> the data
     */
     public ArrayList<PlotComparisonItem> attacksPerESSID(String protocol){
@@ -1298,7 +1439,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return this.resizeData(plotItems);
     }
 
-    /*
+    /**
     * This will normalize the given list of plot items to the specified length of MAX_NUMBER_OF_CHART_OBJECTS.
     * Creates an "others" group, containing all objects after the (MAX_NUMBER_OF_CHART_OBJECTS - 1)th object from the given list.
     * If the given list does contain MAX_NUMBER_OF_CHART_OBJECTS+1 or more objects, nothing will change.
@@ -1345,7 +1486,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * FILTER STUFF
     * */
 
-    /*
+    /**
     * Returns the first selected protocol from all selected protocols.
     * If no protocol is selected, it return the first protocol in the protocolTitles() list.
     * @return String protocolName
@@ -1358,7 +1499,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
          return this.protocolTitles().get(0);
      }
 
-    /*Return all Protocols
+    /**
+     * Return all Protocols
     *
     * @return ArrayList<String> protocolNames
     * */
@@ -1370,7 +1512,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
         return titles;
     }
-    /*
+    /**
     * Returns a boolean array containing a bool value for each protocol. If the value is true, the filter object contains the protocol.
     * The array sequence equates to the protocolTitles() list.
     * @return boolean[] selection array
@@ -1408,16 +1550,21 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     *
     * */
 
-
+    /** Returns the color for the other group
+     * @return int color*/
     public int getOtherColor(){
         return Color.argb(255, 80, 80, 80); // grey
 	}
-	
+    /** Returns the color for the given index
+     * @return int color*/
     public Integer getColor(int index) {
 		return ColorSequenceGenerator.getColorForIndex(index);
     }
 
-
+    /** Returns the Plot layout.
+     *
+     * @return LinearLayout plot layout
+     */
     public LinearLayout getPlotLayout(){
         if (this.rootView != null){
             return (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
@@ -1426,12 +1573,17 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
-    /**
+    /*
      *
      *  FILTER STUFF
      *
      * */
-    private boolean isFilterSetForTitle(String title){
+    /**
+     * Returns true if the current filter is set for a given filter menu title.
+     * @param String filter menu title
+     * @return boolean b
+     */
+     private boolean isFilterSetForTitle(String title){
         if (title.equals(FILTER_MENU_TITLE_BSSID)){
             return this.filter.hasBSSIDs();
         }
@@ -1450,6 +1602,9 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return false;
     }
 
+    /**
+     * Clears the current filter.
+     */
     private void clearFilter(){
         if(filter == null) this.filter = new LogFilter();
         this.filter.clear();
@@ -1460,6 +1615,12 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     *  DATE TRANSFORMATION
     *
     */
+
+    /**
+     * Returns the current hour from a date.
+     * @param timeInMillis
+     * @return
+     */
     public long getDayHourFromDate(long timeInMillis){
 
         Calendar calendar = Calendar.getInstance();
@@ -1471,20 +1632,30 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return hour;
 
     }
+    /**
+     * Returns the current date without the seconds, minutes, hours.
+     * @param long date
+     * @return long date with time 00:00:00
+     * */
     public long getDateFromMilliseconds(long timeInMillis){
         long millisInDay = 60 * 60 * 24 * 1000;
         return (timeInMillis / millisInDay) * millisInDay;
 
     }
 
-    /*
-    *
+    /**
+    *  Returns the given hour as a formated string.
+     *
     * */
     private String getHourAsTimeString(long hour) {
         return "" + hour + ":00";
     }
 
     static final DateFormat dateFormat = new SimpleDateFormat("d.M.yy");
+
+    /**Returns a date as a formated string
+     * @param long date
+     * @return String date format (d.M.yy)*/
     @SuppressLint("SimpleDateFormat")
     private String getDateAsDayString(long timeStamp) {
         try {
@@ -1496,8 +1667,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
 
     @SuppressLint("SimpleDateFormat")
+    /**Returns a date as a formated string
+     * @param long date
+     * @return String date format (H:mm  dd/MM/yyyy)*/
     private String getDateAsString(long timeStamp) {
-
         try {
             DateFormat sdf = new SimpleDateFormat("H:mm  dd/MM/yyyy");
             Date netDate = (new Date(timeStamp));
@@ -1511,6 +1684,10 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     /**
      * USERINTERACTION
      */
+    /**
+     * Will be called if the users taps on a list row.
+     * @param int index
+     */
     private void userTappedOnLegendItem(int index){
         if (index < this.currentData.size()){
             PlotComparisonItem item = this.currentData.get(index);
@@ -1559,13 +1736,21 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         }
     }
 
+    /**Will be called if the user clicked on a slice
+     * @param int slice index*/
     public void onSliceClick(int index){
-
     }
+    /**Will be called if the user clicked on a bar
+     * @param int bar index*/
     public void onBarClick(int index){
         this.userTappedOnLegendItem(index);
     }
 
+    /**
+     * Displays a record over view fragment.
+     * @param LogFilter filter
+     * @param String sortKey
+     */
     private void pushRecordOverviewForFilter(LogFilter filter, String sortKey){
 
         FragmentManager fm = this.getActivity().getFragmentManager();