Browse Source

fixed many comments

Julien Clauter 10 years ago
parent
commit
06f012cc53

+ 16 - 17
src/de/tudarmstadt/informatik/hostage/ui2/fragment/RecordOverviewFragment.java

@@ -10,7 +10,6 @@ import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.Environment;
-import android.os.Message;
 import android.preference.PreferenceManager;
 import android.util.Log;
 import android.view.LayoutInflater;
@@ -276,7 +275,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
     /**
     * Gets called if the user clicks on item in the filter menu.
     *
-    * @param AbstractPopupItem item
+    * @param  item {@link AbstractPopupItem AbstractPopupItem }
     * */
 	public void onFilterMenuItemSelected(AbstractPopupItem item) {
 		String title = item.getTitle();
@@ -459,7 +458,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
     /**
     *  Reloads the data in the ExpandableListView for the given filter object.
-    *  @param ExpandableListView  listview
+    *  @param  mylist {@link ExpandableListView ExpandableListView}
     * */
 	private RecordListAdapter populateListViewFromDB(ExpandableListView mylist) {
 
@@ -594,7 +593,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
     /**This will open a section in the ExpandableListView with the same title as the parameter s.
     *
-    * @param String s (the section title to open)
+    * @param s String (the section title to open)
     *
     * */
     private void setSectionToOpen(String s){
@@ -625,7 +624,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
     /**Sets the list view listener on the given ExpandableListView.
     *
-    * @param ExpandableListView listview
+    * @param mylist  {@link ExpandableListView ExpandableListView }
     * */
 	private void registerListClickCallback(ExpandableListView mylist) {
         mylist.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@@ -667,7 +666,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
 
     /**Returns the date format "H:mm d.M.yy" for the given timestamp (long)
-    * @param Long timestamp*/
+    * @param timeStamp long */
 	@SuppressLint("SimpleDateFormat")
 	private String getDateAsString(long timeStamp) {
 
@@ -757,7 +756,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.
-    * @param Record rec
+    * @param  rec {@link Record Record }
     * @return String grouptitle*/
     public String getGroupValue(Record rec){
         int index = this.groupingTitles().indexOf(this.groupingKey);
@@ -803,7 +802,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.
-    * @param View anchorView*/
+    * @param  v View the anchorView*/
 	private void openFilterPopupMenuOnView(View v){
 
         SimplePopupTable filterMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
@@ -841,7 +840,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
     /**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
+    * @param  title String
     * @return boolean value
     * */
     private boolean isFilterSetForTitle(String title){
@@ -870,7 +869,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 	}
 
     /**Returns all grouping titles
-    * @param Context context
+    * @param  context Context
     * @return ArrayList<String> titles*/
     public ArrayList<String> groupingTitles(Context context){
         ArrayList<String> titles = new ArrayList<String>();
@@ -1034,7 +1033,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
     /**
      * Will be called if the users selects a timestamp.
-     * @param DateTimeDialogFragment dialog
+     * @param  dialog {@link DateTimeDialogFragment DateTimeDialogFragment }
      * */
 	public void onDateTimePickerPositiveClick(DateTimeDialogFragment dialog) {
 		if(this.wasBelowTimePicker){
@@ -1047,7 +1046,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
     }
     /**
      * Will be called if the users cancels a timestamp selection.
-     * @param DateTimeDialogFragment dialog
+     * @param dialog  {@link DateTimeDialogFragment DateTimeDialogFragment }
      * */
 	public void onDateTimePickerNegativeClick(DateTimeDialogFragment dialog) {
 		if(this.wasBelowTimePicker){
@@ -1060,7 +1059,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
     /**
      * Will be called if the users clicks the positiv button on a ChechlistDialog.
-     * @param ChecklistDialog dialog
+     * @param  dialog  {@link ChecklistDialog ChecklistDialog }
      */
 	public void onDialogPositiveClick(ChecklistDialog dialog) {
 		String title = dialog.getTitle();
@@ -1124,7 +1123,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
     /**
      * Will be called if the users clicks the negativ button on a ChechlistDialog.
-     * @param ChecklistDialog dialog
+     * @param  dialog  {@link ChecklistDialog ChecklistDialog }
      */
 	public void onDialogNegativeClick(ChecklistDialog dialog) {}
 
@@ -1137,8 +1136,8 @@ 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
+    * @param createNetworks number of networks to create
+    * @param attacksPerNetwork maximal number of attack per network
     * */
 	private void addRecordToDB( int createNetworks, int attacksPerNetwork) {
         if ((dbh.getRecordCount() > 0)) dbh.clearData();
@@ -1242,7 +1241,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 
 
     /**Navigation. Shows the record detail view for the given record
-    * @param Record record to show
+    * @param  record  {@link Record Record } to show
     * */
     private void pushRecordDetailViewForRecord(Record record){
 

+ 33 - 31
src/de/tudarmstadt/informatik/hostage/ui2/fragment/StatisticsFragment.java

@@ -247,7 +247,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     /**Configures the given rootview.
     * Sets the Spinner, the list and all requiered buttons.
     * It also actualises the current plot type.
-    * @param View rootView
+    * @param  rootView View
     * */
     public void configureRootView(View rootView){
         LinearLayout plotLayout = (LinearLayout) rootView.findViewById(R.id.plot_layout);
@@ -301,7 +301,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
 
     /**Sets the title over the plot view.
-    * @param String title
+    * @param  title String
     * */
     public void setTitle(String title){
         TextView titleView = (TextView) this.rootView.findViewById(R.id.title_text_view);
@@ -336,7 +336,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
 
     /**Sets the current chart to the given type and acualises it.
-    * @param ChartType type
+    * @param  type  {@link de.tudarmstadt.informatik.hostage.ui2.fragment.StatisticsFragment.ChartType ChartType}
     * */
     public void setChartType(ChartType type){
         boolean shouldChange = true;
@@ -379,7 +379,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
 
     /**Returns the plot view for a given type.
-    * @param ChartType type.
+    * @param type  {@link de.tudarmstadt.informatik.hostage.ui2.fragment.StatisticsFragment.ChartType ChartType}
     * */
     public View getPlotViewForType(ChartType type){
         switch (type){
@@ -443,7 +443,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * MENU
     * */
     /**Opens the Bar Option Menu above the given anchor view.
-    * @param View the anchor view*/
+    * @param anchorView View*/
      private void openBarSelectionMenuOnView(View anchorView){
         SimplePopupTable visualiseMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
             public void onItemClick(Object ob) {
@@ -523,7 +523,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * */
     /**
      * Will be called if the user selects the positiv button on an checklist dialog.
-     * @param ChecklistDialog dialog
+     * @param dialog  {@link ChecklistDialog ChecklistDialog}
      * */
      public void onDialogPositiveClick(ChecklistDialog dialog) {
         String title = dialog.getTitle();
@@ -588,7 +588,7 @@ 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
+     * @param dialog  {@link ChecklistDialog ChecklistDialog}
      * */
     public void onDialogNegativeClick(ChecklistDialog dialog) {
 
@@ -663,7 +663,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     /**
      * Opens the filter menu above an given anchor view.
-     * @param View anchor view
+     * @param  anchor View
      */
      private void openFilterMenuOnView(View anchor){
         SimplePopupTable filterMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
@@ -702,7 +702,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     /**
      * Will be called if the user selected an filter item.
-     * @param AbstractPopupItem item
+     * @param  item  {@link AbstractPopupItem AbstractPopupItem}
      */
     private void onFilterMenuItemSelected(AbstractPopupItem item){
         if (item instanceof SplitPopupItem){
@@ -926,7 +926,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
 
     /**
-     * Returns the current line graph.
+     * Returns the current  {@link com.echo.holographlibrary.LineGraph Linegraph} .
      * @return LineGraph current line graph
      */
     public LineGraph getLineGraphView(){
@@ -940,7 +940,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
 
     /**
-     * Returns the current BarGraph.
+     * Returns the current  {@link com.echo.holographlibrary.BarGraph BarGraph} .
      * @return BarGraph the current bar graph
      */
     public BarGraph getBarGraphView(){
@@ -967,7 +967,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     /**
      * Sets the data for the given PieGraph
-     * @param PieGraph piegraph
+     * @param piegraph  {@link com.echo.holographlibrary.PieGraph PieGraph}
      */
      public void setPieGraphData(PieGraph piegraph){
         this.currentData = this.getPieData();
@@ -992,7 +992,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     /**
      * Sets the data for the given LineGraph
-     * @param LineGraph linegraph
+     * @param linegraph {@link LineGraph Linegraph}
      */
     public void setLineGraphData(LineGraph linegraph){
         this.currentData = this.getLineData();
@@ -1092,7 +1092,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     /**
     * Set the graph data to the given graph
-    * @param BarGraph bargraph
+    * @param bargraph {@link BarGraph BarGraph}
     * */
     public void setBarGraphData(BarGraph bargraph){
         this.currentData = this.getBarData();
@@ -1121,7 +1121,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * */
     /**
      * Returns the DataBaseHandler result for the current filter.
-     * @param ArrayList<Record> records
+     * @return records {@link java.util.ArrayList}, {@link Record Record}
      */
      public ArrayList<Record> getFetchedRecords(){
         if (this.filter == null) this.clearFilter();
@@ -1330,9 +1330,11 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     *  LINE PLOT DATA
     */
 
-    /**Returns the line graph data responding to the selectedCompareData key.
+    /**
+     * 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*/
+     * @return plotItems {@link PlotComparisonItem PlotComparisonItems}
+     */
     public ArrayList<PlotComparisonItem> attacksPerTime(){
         HashMap<String,HashMap<Long, ArrayList<Record> > > lineMap = new HashMap<String, HashMap<Long, ArrayList<Record>>>();
 
@@ -1412,7 +1414,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     */
     /**Returns plotitems for the comparison "attacks per bssid"
      * The returned data is resized to the specified limit.
-     * @return ArrayList<PlotComparisonItem> the data
+     * @return ArrayList of  {@link PlotComparisonItem PlotComparisonItems}
     */
     public ArrayList<PlotComparisonItem> attacksPerBSSID(String protocol){
         LogFilter filter = new LogFilter();
@@ -1452,7 +1454,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         return this.resizeData(plotItems);
     }
     /**Returns plotitems for the comparison "attacks per essid"
-    * @return ArrayList<PlotComparisonItem> the data
+    * @return ArrayList of  {@link PlotComparisonItem PlotComparisonItems}
     */
     public ArrayList<PlotComparisonItem> attacksPerESSID(String protocol){
         LogFilter filter = new LogFilter();
@@ -1498,8 +1500,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     * 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.
     *
-    * @param AtrrayList<PlotComparisonItem> the list to normalize
-    * @return ArrayList<PlotComparisonItem> the normalized data
+    * @param plotItems to normalize  {@link PlotComparisonItem PlotComparisonItems}
+    * @return the normalized ArrayList of  {@link PlotComparisonItem PlotComparisonItems}
     */
     private ArrayList<PlotComparisonItem> resizeData(ArrayList<PlotComparisonItem> plotItems){
         if (plotItems != null){
@@ -1634,7 +1636,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
      * */
     /**
      * Returns true if the current filter is set for a given filter menu title.
-     * @param String filter menu title
+     * @param  title of the filter menu item {@link String String}
      * @return boolean b
      */
      private boolean isFilterSetForTitle(String title){
@@ -1672,8 +1674,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     /**
      * Returns the current hour from a date.
-     * @param timeInMillis
-     * @return
+     * @param timeInMillis long
+     * @return milliseconds in long
      */
     public long getDayHourFromDate(long timeInMillis){
 
@@ -1688,7 +1690,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
     /**
      * Returns the current date without the seconds, minutes, hours.
-     * @param long date
+     * @param timeInMillis long
      * @return long date with time 00:00:00
      * */
     public long getDateFromMilliseconds(long timeInMillis){
@@ -1708,7 +1710,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     static final DateFormat dateFormat = new SimpleDateFormat("d.M.yy");
 
     /**Returns a date as a formated string
-     * @param long date
+     * @param timeStamp date
      * @return String date format (d.M.yy)*/
     @SuppressLint("SimpleDateFormat")
     private String getDateAsDayString(long timeStamp) {
@@ -1742,7 +1744,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
      */
     /**
      * Will be called if the users taps on a list row.
-     * @param int index
+     * @param index int
      */
     private void userTappedOnLegendItem(int index){
         if (index < this.currentData.size()){
@@ -1793,19 +1795,19 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     }
 
     /**Will be called if the user clicked on a slice
-     * @param int slice index*/
+     * @param index of the slice (int)*/
     public void onSliceClick(int index){
     }
     /**Will be called if the user clicked on a bar
-     * @param int bar index*/
+     * @param index of the bar (int)*/
     public void onBarClick(int index){
         this.userTappedOnLegendItem(index);
     }
 
     /**
      * Displays a record over view fragment.
-     * @param LogFilter filter
-     * @param String sortKey
+     * @param filter  {@link de.tudarmstadt.informatik.hostage.ui.LogFilter LogFilter}
+     * @param sortKey String
      */
     private void pushRecordOverviewForFilter(LogFilter filter, String sortKey){