Browse Source

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

Alexander Brakowski 10 years ago
parent
commit
17e0b15b46

+ 31 - 27
res/values-de/strings.xml

@@ -21,9 +21,9 @@
 
     <string name="information">Information</string>
     <string name="wifi_not_connected_msg">Sie sind nicht mit einem WLAN Netzwerk verbunden. \n\nBitte verbinden sie sich mit einem, bevor sie HosTaGe starten.</string>
-	<string name="profile_no_services_msg">Das aktive Profil scheint keine Dienste zu überwachen.\n\nBitte aktivieren Sie Dienste in dem aktiven Profil.</string>
+	<string name="profile_no_services_msg">Das aktive Profil scheint keine Dienste zu &#252;berwachen.\n\nBitte aktivieren Sie Dienste in dem aktiven Profil.</string>
 
-    <string name="monitor_current_connection">Überwache aktuelle Verbindung</string>
+    <string name="monitor_current_connection">&#220;berwache Verbindung</string>
     <string name="active_profile">Aktives Profil: </string>
 
     <string name="ssid">SSID:</string>
@@ -45,7 +45,7 @@
     <string name="firstAttack">Erster Angriff:</string>
     <string name="lastAttack">Letzter Angriff:</string>
     <string name="clear">Clear</string>
-    <string name="delete">Löschen</string>
+    <string name="delete">L&#246;schen</string>
     <string name="cancel">Abbrechen</string>
     <string name="close">Schließen</string>
     <string name="show_records">Zeige Aufzeichnungen</string>
@@ -59,10 +59,10 @@
     <string name="RecordBSSID">BSSID</string>
     <string name="RecordSSID">SSID</string>
     <string name="RecordTimestamp">Zeitstempel</string>
-    <string name="RecordProtocol">Protokol</string>
+    <string name="RecordProtocol">Protokoll</string>
 
-    <string name="drawer_open">Öffne Navigation</string>
-    <string name="drawer_close">Schließe Navigation</string>
+    <string name="drawer_open">&#214;ffne Navigation</string>
+    <string name="drawer_close">Schlie&#223;e Navigation</string>
 
     <string name="drawer_overview">Übersicht</string>
     <string name="drawer_threat_map">Threat Map</string>
@@ -70,7 +70,7 @@
     <string name="drawer_services">Dienste</string>
     <string name="drawer_settings">Einstellungen</string>
     <string name="drawer_profile_manager">Profile</string>
-    <string name="drawer_app_info">Über diese App</string>
+    <string name="drawer_app_info">&#220;ber diese App</string>
     <string name="drawer_statistics">Statistiken</string>
 
     <string name="hostage_with_url"><a href="http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage">HosTaGe</a></string>
@@ -82,24 +82,28 @@
 
     <string name="recorded_attacks">Angriffe: </string>
     <string name="current_connection">aktuelle Verbindung</string>
-    <string name="monitor_services">Überwache Dienste</string>
+    <string name="monitor_services">&#220;berwache Dienste</string>
 
-    <string name="device_rooted">Gerät gerooted</string>
+    <string name="device_rooted">Ger&#228;t gerooted</string>
     <string name="porthack_installed">Porthack installiert</string>
     <string name="yes">Ja</string>
     <string name="no">Nein</string>
 
+    <string name="no_data_notification">Es sind keine Attacken vorhanden. &#220;berpr&#252;fen Sie gegebenenfalls Ihre Filtereinstellungen.</string>
+    <string name="no_data_notification_no_filter">Es sind keine Attacken vorhanden.</string>
+
+
     <string name="ui_dev_by">UI Entwicklung</string>
     <string name="core_dev_by">Core Entwicklung</string>
     <string name="advanced_settings">Erweiterte Einstellungen</string>
-    <string name="change_name_of_profile">Ändere den Namen des Profils</string>
-    <string name="change_desc_of_profile">Ändere die Beschreibung des Profils</string>
-    <string name="change_icon_of_profile">Wähle ein Icon für das Profil</string>
+    <string name="change_name_of_profile">&#196;ndere den Namen des Profils</string>
+    <string name="change_desc_of_profile">&#196;ndere die Beschreibung des Profils</string>
+    <string name="change_icon_of_profile">W&#228;hle ein Icon für das Profil</string>
     <string name="profile_description">Beschreibung</string>
     <string name="general">Allgemein</string>
-    <string name="select_icon">Wähle Icon</string>
-    <string name="delete_profile">Profil löschen</string>
-    <string name="really_want_delete_profiel">Willst du dieses Profil wirklich löschen?</string>
+    <string name="select_icon">W&#228;hle Icon</string>
+    <string name="delete_profile">Profil l&#252;schen</string>
+    <string name="really_want_delete_profiel">Willst du dieses Profil wirklich l&#252;schen?</string>
     <string name="discard">Verwerfen</string>
     <string name="save">Speichern</string>
     <string name="rec_protocol">Protokoll</string>
@@ -108,14 +112,14 @@
     <string name="rec_sortby">Sortieren</string>
     <string name="rec_latest">Bis</string>
     <string name="rec_earliest">Von</string>
-    <string name="rec_reset_filter">Zurücksetzen</string>
+    <string name="rec_reset_filter">Zur&#252;cksetzen</string>
     <string name="rec_group_by">Gruppieren</string>
     <string name="rec_filter_by">Filtern</string>
     <string name="rec_time">Zeit</string>
     <string name="rec_set_date">Datum auswählen</string>
     <string name="rec_set">Speichern</string>
     <string name="rec_cancel">Abbrechen</string>
-    <string name="stats_protocols">Protokole</string>
+    <string name="stats_protocols">Protokolle</string>
     <string name="stats_networks">Netzwerke</string>
     <string name="stats_attacks">Angriffe</string>
     <string name="stats_visualize">Visualisierung</string>
@@ -124,16 +128,16 @@
     <string name="stats_line_plot">Liniendiagramm</string>
     <string name="stats_other">Andere</string>
     <string name="stats_attacks_count">Angriffe</string>
-    <string name="stats_select_protocol">Wähle Protokol</string>
+    <string name="stats_select_protocol">W&#228;hle Protokoll</string>
     <string name="stats_attacks_essid">Angriffe pro ESSID</string>
     <string name="stats_attacks_bssid">Angriffe pro BSSID</string>
     <string name="stats_attacks_time">Angriffe pro Zeit (24h)</string>
     <string name="stats_attacks_date">Angriffe pro Datum</string>
     <string name="stats_uses_protocol">Nutzung pro Protokoll</string>
-    <string name="stats_attacks_protocol">Angriffe pro Protokol</string>
-    <string name="stats_select_attack_data">Wähle Kriterium zum Vergleich</string>
-    <string name="stats_select_network_data">Wähle Kriterium zum Vergleich</string>
-    <string name="stats_select_protocol_data">Wähle Kriterium zum Vergleich</string>
+    <string name="stats_attacks_protocol">Angriffe pro Protokoll</string>
+    <string name="stats_select_attack_data">W&#228;hle Kriterium zum Vergleich</string>
+    <string name="stats_select_network_data">W&#228;hle Kriterium zum Vergleich</string>
+    <string name="stats_select_protocol_data">W&#228;hle Kriterium zum Vergleich</string>
     <string name="stats_per_cent_all">% von allen</string>
     <string name="pie_all">Alle</string>
 
@@ -146,15 +150,15 @@
 	<string name="record_details_conversation">Unterhaltung</string>
     <string name="profile_vista_desc">Dieses Profil immitiert Windows Vista</string>
 	<string name="profile_seven_desc">Dieses Profil immitiert Windows 7</string>
-    <string name="profile_xp_desc">Dieses Profil aktiviert Dienste die Typisch für Windows XP sind</string>
-    <string name="profile_webserv_http_desc">Dieses Profil immitiert einen simplen Webserver, welcher nur den Port für das HTTP Protokoll überwacht</string>
+    <string name="profile_xp_desc">Dieses Profil aktiviert Dienste die Typisch f&#252;r Windows XP sind</string>
+    <string name="profile_webserv_http_desc">Dieses Profil immitiert einen simplen Webserver, welcher nur den Port für das HTTP Protokoll &#252;berwacht</string>
 	<string name="profile_webserv_apache_desc">Dieses Profil immitiert einen Apache Webserver</string>
 	<string name="profile_webserv_iis_desc">Dieses Profil immitiert einen IIS Webserver</string>
-    <string name="profile_webserv_desc">Dieses Profil immitiert einen simplen Webserver, welcher neben dem HTTP Protokoll auch das HTTPS Protokoll unterstützt</string>
+    <string name="profile_webserv_desc">Dieses Profil immitiert einen simplen Webserver, welcher neben dem HTTP Protokoll auch das HTTPS Protokoll unterst&#252;tzt</string>
     <string name="profile_unix_desc">Dieses Profil aktiviert Unix-typische Dienste</string>
     <string name="profile_linux_desc">Dieses Profil immitiert ein Linux System mit entsprechenden Diensten</string>
 	<string name="profile_linux_hard_desc">Dieses Profil immitiert ein Linux System, bei welchem nur SSH aktiv ist</string>
-	<string name="profile_voip_desc">Dieses Profil immitiert einen VOIP Server, welcher das SIP Protokoll überwacht</string>
-    <string name="profile_random_desc">In diesem Profil werden zufällige Protokolle aktiviert</string>
+	<string name="profile_voip_desc">Dieses Profil immitiert einen VOIP Server, welcher das SIP Protokoll &#252;berwacht</string>
+    <string name="profile_random_desc">In diesem Profil werden zuf&#228;llige Protokolle aktiviert</string>
     <string name="profile_paranoid_desc">Dieses Profil aktiviert alle Protokolle</string>
 </resources>

+ 5 - 1
res/values/strings.xml

@@ -89,7 +89,11 @@
     <string name="yes">Yes</string>
     <string name="no">No</string>
 
-	<string name="hostage_with_url"><a href="http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage">HosTaGe</a></string>
+    <string name="no_data_notification">No Attacks are recorded. Please check your filter option.</string>
+    <string name="no_data_notification_no_filter">No Attacks are recorded.</string>
+
+
+    <string name="hostage_with_url"><a href="http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage">HosTaGe</a></string>
     <string name="ui_dev_by">UI developed by</string>
     <string name="core_dev_by">Core developed by</string>
     <string name="advanced_settings">Advanced Settings</string>

+ 2 - 2
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ServicesListAdapter.java

@@ -66,8 +66,8 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
      * Also activates protocols and switches
      *
      * @param position    current position in list
-     * @param convertView
-     * @param parent
+     * @param convertView convert view
+     * @param parent the parent view group
      * @return
      */
     @Override

+ 41 - 18
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;
@@ -93,7 +92,9 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
     private ExpandableListView expListView;
     private ProgressBar spinner;
 
-	HostageDBOpenHelper dbh;
+    private Toast noDataNotificationToast;
+
+    HostageDBOpenHelper dbh;
 
     private String sectionToOpen = "";
     private ArrayList<Integer> openSections;
@@ -113,6 +114,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
     }
 
 
+
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -237,6 +239,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
                             registerListClickCallback(RecordOverviewFragment.this.expListView);
                             RecordOverviewFragment.this.spinner.setVisibility(View.GONE);
                             RecordOverviewFragment.this.actualiseFilterButton();
+                            RecordOverviewFragment.this.showEmptyDataNotification();
                         }
                     });
                 }
@@ -273,7 +276,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();
@@ -457,7 +460,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) {
 
@@ -562,6 +565,7 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
                                 adapter.notifyDataSetChanged();
                                 RecordOverviewFragment.this.spinner.setVisibility(View.GONE);
                             }
+                            RecordOverviewFragment.this.showEmptyDataNotification();
                         }
                     });
                 }
@@ -570,9 +574,28 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
         loader.start();
     }
 
+    /**
+     * Shows a small toast if the data to show is empty (no records).
+     */
+    private void showEmptyDataNotification(){
+        if (RecordOverviewFragment.this.noDataNotificationToast == null){
+            RecordOverviewFragment.this.noDataNotificationToast =  Toast.makeText(getApplicationContext(), R.string.no_data_notification, Toast.LENGTH_SHORT);
+        }
+        RecordListAdapter adapter = (RecordListAdapter) RecordOverviewFragment.this.expListView.getExpandableListAdapter();
+
+        if (this.getFilterButton().getVisibility() == View.VISIBLE && this.filter.isSet()){
+            this.noDataNotificationToast.setText(R.string.no_data_notification);
+        } else {
+            this.noDataNotificationToast.setText(R.string.no_data_notification_no_filter);
+        }
+        if (adapter == null || adapter.getData().isEmpty())
+            RecordOverviewFragment.this.noDataNotificationToast.show();
+
+    }
+
     /**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){
@@ -603,7 +626,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() {
@@ -645,7 +668,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) {
 
@@ -735,7 +758,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);
@@ -781,7 +804,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() {
@@ -819,7 +842,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){
@@ -848,7 +871,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>();
@@ -1012,7 +1035,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){
@@ -1025,7 +1048,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){
@@ -1038,7 +1061,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();
@@ -1102,7 +1125,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) {}
 
@@ -1115,8 +1138,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();
@@ -1220,7 +1243,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){
 

+ 3 - 3
src/de/tudarmstadt/informatik/hostage/ui2/fragment/ServicesFragment.java

@@ -148,9 +148,9 @@ public class ServicesFragment extends Fragment {
     /**
      * most important method of this class
      *
-     * @param inflater
-     * @param container
-     * @param savedInstanceState
+     * @param inflater the inflater
+     * @param container the container
+     * @param savedInstanceState the saved instance state
      * @return rootView
      */
     @Override

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

@@ -19,6 +19,7 @@ import android.widget.ListView;
 import android.widget.ProgressBar;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.echo.holographlibrary.Bar;
 import com.echo.holographlibrary.BarGraph;
@@ -128,6 +129,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     private ListView legendListView;
 
+    private Toast noDataNotificationToast;
+
 
     private String selectedCompareData = COMPARE_TITLE_AttacksPerProtocol;
 
@@ -244,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);
@@ -298,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);
@@ -333,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;
@@ -376,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){
@@ -430,13 +433,17 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
                 tableHeaderTitleView.setText(FILTER_MENU_TITLE_ESSID);
             }
         }
+        if (this.currentData == null || this.currentData.isEmpty()){
+            tableHeaderTitleView.setText("");
+            tableHeaderValueView.setText("");
+        }
     }
 
     /*
     * 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) {
@@ -516,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();
@@ -581,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) {
 
@@ -656,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() {
@@ -695,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){
@@ -919,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(){
@@ -933,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(){
@@ -960,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();
@@ -985,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();
@@ -1085,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();
@@ -1114,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();
@@ -1232,6 +1239,8 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
                              StatisticsFragment.this.currentPlotView.invalidate();
 
                              StatisticsFragment.this.spinner.setVisibility(View.GONE);
+
+                             StatisticsFragment.this.showEmptyDataNotification();
                          }
                      });
                  }
@@ -1241,6 +1250,24 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         this.loader.start();
      }
 
+    /**
+     * Shows a small toast if the data to show is empty (no records).
+     */
+    private void showEmptyDataNotification(){
+        if (this.noDataNotificationToast == null){
+            this.noDataNotificationToast =  Toast.makeText(getApplicationContext(), R.string.no_data_notification, Toast.LENGTH_SHORT);
+        }
+        if (this.getFilterButton().getVisibility() == View.VISIBLE){
+            this.noDataNotificationToast.setText(R.string.no_data_notification);
+        } else {
+            this.noDataNotificationToast.setText(R.string.no_data_notification_no_filter);
+        }
+        if (this.currentData == null || this.currentData.isEmpty()){
+            this.noDataNotificationToast.show();
+        }
+    }
+
+
     /** Calculates and returns the data for the piegraph
      * @return ArrayList<PlotComparisonItem> data */
     public ArrayList<PlotComparisonItem> getPieData(){
@@ -1303,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>>>();
 
@@ -1385,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();
@@ -1425,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();
@@ -1471,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){
@@ -1607,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){
@@ -1645,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){
 
@@ -1661,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){
@@ -1681,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) {
@@ -1715,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()){
@@ -1766,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){
 

+ 42 - 3
src/de/tudarmstadt/informatik/hostage/ui2/popup/AbstractPopup.java

@@ -19,8 +19,12 @@ import de.tudarmstadt.informatik.hostage.R;
  */
 public abstract class AbstractPopup {
 
-    static final int ORIENTATION_LANDSCAPE = 2;
+    //static final int ORIENTATION_LANDSCAPE = 2;
 
+    /**
+     * OnPopupItemClickListener
+     * The listener will be called if the user selects a table row
+     */
     public interface OnPopupItemClickListener {
         public void onItemClick(Object data);
     }
@@ -32,9 +36,23 @@ public abstract class AbstractPopup {
     private LayoutInflater lInf;
 	private View lastItemView;
 
+    /**
+     * Override to return the layout id.
+     * @return int layoutID
+     */
     abstract public int getLayoutId();
+
+    /**
+     * Override to make additional stuff with the rootview.
+     * @param View rootview
+     */
     abstract void configureView(View view);
 
+    /**
+     * Constructor
+     * @param Context context
+     * @param OnPopupItemClickListener listener
+     */
     public AbstractPopup(Context context, OnPopupItemClickListener listener) {
         super();
         this.context = (Activity) context;
@@ -46,14 +64,26 @@ public abstract class AbstractPopup {
 
     }
 
+    /**
+     * Override to return a linear layout to add a scrollview.
+     * @return LinearLayout
+     */
     public abstract LinearLayout getScrollableItemLayout();
 
+    /**
+     * Returns the root view
+     * @return View the rootview
+     */
     public View getRootView(){
         return this.rootView;
     }
 
+    /**
+     * Adds a table row item.
+     * @param AbstractPopupItem item
+     */
     public void addItem(final AbstractPopupItem item)	{
-        View view = item.getItemView();
+        View view = item.getRootView();
 
         if (this.rootView == null){
             this.rootView = (LinearLayout) this.lInf.inflate(this.getLayoutId(), null);
@@ -83,6 +113,11 @@ public abstract class AbstractPopup {
 
     }
 
+    /**
+     * Returns the rootview.
+     * If the root view is null, it initialises it with the layout id.
+     * @return View the root view
+     */
     public View getPopupView(){
         if (this.rootView == null){
             this.rootView = (LinearLayout) this.lInf.inflate(this.getLayoutId(), null);
@@ -90,6 +125,10 @@ public abstract class AbstractPopup {
         return this.rootView;
     }
 
+    /**
+     * Opens the Popup View on top of the given anchor.
+     * @param View anchorView
+     */
     public void showOnView(final View anchorView)	{
         if (this.rootView == null){
             this.rootView = (LinearLayout) this.lInf.inflate(this.getLayoutId(), null);
@@ -103,7 +142,7 @@ public abstract class AbstractPopup {
 
             Window window = this.context.getWindow();
             window.getDecorView().getWindowVisibleDisplayFrame(windowFrame);
-            int orientation = this.context.getResources().getConfiguration().orientation;
+            //int orientation = this.context.getResources().getConfiguration().orientation;
             int windowWidth = windowFrame.width();
             int windowHeight = windowFrame.height();
 

+ 56 - 11
src/de/tudarmstadt/informatik/hostage/ui2/popup/AbstractPopupItem.java

@@ -14,70 +14,115 @@ public abstract class AbstractPopupItem {
     private int itemId;
     private String title;
 
-    private View itemView;
+    private View rootView;
 
     private LayoutInflater lInf;
 
     public HashMap<Object, Object> data;
 
-
+    /**
+     * Override to return the layout id.
+     * @return int layoutID
+     */
     abstract public int getLayoutId();
 
+    /**
+     * Override to do additional stuff with the rootview.
+     *
+     * @param View rootview
+     */
     abstract public void configureItemView(View view);
 
 
     public void setValue(String key, Object value){
         if (key != null && value != null){
             this.data.put(key, value);
-            if (this.itemView != null) this.configureItemView(this.itemView);
+            if (this.rootView != null) this.configureItemView(this.rootView);
         }
     }
+
+    /**
+     * Add other data to the item.
+     * @param HashMap<Object, Object> data
+     */
     public void setMultipleData(HashMap<Object, Object> map){
         if (map != null){
             for(Object key : map.keySet()){
                 this.data.put(key, map.get(key));
             }
-            if (this.itemView != null) this.configureItemView(this.itemView);
+            if (this.rootView != null) this.configureItemView(this.rootView);
         }
     }
 
     public void setTitle(String title){
         this.title = title;
-        if (this.itemView != null) this.configureItemView(this.itemView);
+        if (this.rootView != null) this.configureItemView(this.rootView);
     }
     public String getTitle(){
         return this.title;
     }
+
+    /**
+     * Set a specific item ID to identify it.
+     * @param int id
+     */
     public void setItemId(int id){
         this.itemId = id;
-        if (this.itemView != null) this.configureItemView(this.itemView);
+        if (this.rootView != null) this.configureItemView(this.rootView);
     }
+
+    /**
+     * Returns the item ID.
+     * @return int ID
+     */
     public int getItemId() {
         return this.itemId;
     }
 
+    /**
+     * Constructor
+     * @param Context context
+     */
     public AbstractPopupItem(Context context) {
         super();
         this.lInf = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         this.data = new HashMap<Object, Object>();
     }
 
-    public View getItemView(){
-        if (this.itemView == null){
-            this.itemView = this.lInf.inflate(this.getLayoutId(), null);
+    /**
+     * Returns the rootview.
+     * This method calls everytime the ConfigureItemView methode.
+     * @return View rootview
+     */
+    public View getRootView(){
+        if (this.rootView == null){
+            this.rootView = this.lInf.inflate(this.getLayoutId(), null);
         }
-        this.configureItemView(this.itemView);
+        this.configureItemView(this.rootView);
 
-        return this.itemView;
+        return this.rootView;
     }
 
+    /**
+     * The method is called if the user clicks the rootview.
+     * @param  MotionEvent event
+     * @return Object object
+     */
     public Object onClickedResult(MotionEvent event){
         return this;
     }
 
+    /**
+     * Will be called if the user selected the view.
+     * @param MotionEvent event
+     */
 	public void onItemSelect(MotionEvent event){
 	}
 
+    /**
+     * Will be called if the user deselects the view.
+     * @param MotionEvent event
+     */
 	public void onItemDeselect(MotionEvent event){
 
 	}

+ 2 - 2
src/de/tudarmstadt/informatik/hostage/ui2/popup/SimplePopupItem.java

@@ -41,12 +41,12 @@ public class SimplePopupItem extends AbstractPopupItem {
 
     public void setSelected(boolean selected){
         this.selected = selected;
-        if (this.getItemView() != null) this.configureItemView(this.getItemView());
+        if (this.getRootView() != null) this.configureItemView(this.getRootView());
     }
 
 	private View getContainer(){
 		if(container == null){
-			container = this.getItemView().findViewById(R.id.popup_item_container);
+			container = this.getRootView().findViewById(R.id.popup_item_container);
 		}
 
 		return container;

+ 20 - 4
src/de/tudarmstadt/informatik/hostage/ui2/popup/SplitPopupItem.java

@@ -23,6 +23,11 @@ public class SplitPopupItem extends AbstractPopupItem {
 	private View left_container;
 	private View right_container;
 
+    /**
+     * Constructor
+     *
+     * @param Context context
+     */
     public SplitPopupItem(Context context){
         super(context);
 
@@ -64,22 +69,33 @@ public class SplitPopupItem extends AbstractPopupItem {
         return this;
     }
 
+    /**
+     * Returns true if the user touched the right side of the view.
+     * @return boolean isRightTouch
+     */
 	private boolean isRightTouch(MotionEvent event){
-		return event.getX() > this.getItemView().getX() + (this.getItemView().getWidth() / 2);
+		return event.getX() > this.getRootView().getX() + (this.getRootView().getWidth() / 2);
 	}
 
+    /**
+     * Returns the left view.
+     * @return View the left view
+     */
 	private View getLeftContainer(){
 		if(left_container == null){
-			left_container = this.getItemView().findViewById(R.id.popup_left_container);
+			left_container = this.getRootView().findViewById(R.id.popup_left_container);
 		}
 
 		return left_container;
 	}
 
-
+    /**
+     * Returns the right view.
+     * @return View the right view
+     */
 	private View getRightContainer(){
 		if(right_container == null){
-			right_container = this.getItemView().findViewById(R.id.popup_right_container);
+			right_container = this.getRootView().findViewById(R.id.popup_right_container);
 		}
 
 		return right_container;