Re-structure LTTng sub-project as per the Linux Tools guidelines
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / common / ParamsUpdater.java
index ae9c3a5bb3a35c03f9fa0ff234fdc733d6e88160..5f3b76d368096ba4e731be49d09d0b4a0503aca4 100644 (file)
  *******************************************************************************/
 package org.eclipse.linuxtools.lttng.ui.views.common;
 
-import org.eclipse.linuxtools.lttng.event.LttngTimestamp;
+import org.eclipse.linuxtools.lttng.core.event.LttngTimestamp;
 import org.eclipse.linuxtools.lttng.ui.TraceDebug;
-import org.eclipse.linuxtools.tmf.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.TmfTimeScaleSelectionEvent;
 
 /**
@@ -40,9 +40,14 @@ public class ParamsUpdater {
        // time interval
        private double pixelsPerNs = 0;
        private int eventsDiscarded = 0;
+       private int eventsDiscardedOutOfView = 0;
+       private int eventsDiscardedNotVisible = 0;
        private int eventsDiscardedWrongOrder = 0;
        private TmfTimeRange trange = null;
 
+       public static final int OUT_OF_VIEWRANGE = 0;
+       public static final int NOT_VISIBLE = 1;
+
        // ========================================================================
        // Methods
        // ========================================================================
@@ -80,8 +85,8 @@ public class ParamsUpdater {
         * @param selTime
         */
        public void setSelectedTime(long selTime) {
-               TraceDebug.debug("Selected time changed from: \n\t" + selectedTime
-                               + " to: \n\t" + selTime);
+               TraceDebug.debug("Selected time changed from: \n\t" + selectedTime //$NON-NLS-1$
+                               + " to: \n\t" + selTime); //$NON-NLS-1$
                selectedTime = selTime;
        }
 
@@ -147,16 +152,16 @@ public class ParamsUpdater {
                        // update succeeded
                        updated = true;
 
-                       TraceDebug.debug("Configuration updated to: StartTime: " /* */
+                       TraceDebug.debug("Configuration updated to: StartTime: " /* */ //$NON-NLS-1$
                                        + fTimeStart /* */
-                                       + "-" /* */
+                                       + "-" /* */ //$NON-NLS-1$
                                        + fTimeEnd /* */
-                                       + " width: " /* */
-                                       + width + " k: " + pixelsPerNs); /* */
+                                       + " width: " /* */ //$NON-NLS-1$
+                                       + width + " k: " + pixelsPerNs); /* */ //$NON-NLS-1$
                } else {
                        TraceDebug
-                                       .debug("End time is not greater than start time, start time: "
-                                                       + time0 + " end time: " + time1);
+                                       .debug("End time is not greater than start time, start time: " //$NON-NLS-1$
+                                                       + time0 + " end time: " + time1); //$NON-NLS-1$
                }
 
                return updated;
@@ -182,7 +187,7 @@ public class ParamsUpdater {
        public int getWidth() {
                if (width == 0) {
                        TraceDebug
-                                       .debug("Unexpected width value of 0 pixels, returning default");
+                                       .debug("Unexpected width value of 0 pixels, returning default"); //$NON-NLS-1$
                        return DEFAULT_WIDTH;
                }
 
@@ -218,13 +223,23 @@ public class ParamsUpdater {
                eventsDiscarded = value;
                if (value == 0) {
                        eventsDiscardedWrongOrder = 0;
+                       eventsDiscardedNotVisible = 0;
+                       eventsDiscardedOutOfView = 0;
                }
        }
 
        /**
         * 
         */
-       public void incrementEventsDiscarded() {
+       public void incrementEventsDiscarded(int reason) {
+               if (reason == OUT_OF_VIEWRANGE) {
+                       this.eventsDiscardedOutOfView++;
+               }
+
+               if (reason == NOT_VISIBLE) {
+                       this.eventsDiscardedNotVisible++;
+               }
+
                this.eventsDiscarded++;
        }
 
@@ -252,6 +267,22 @@ public class ParamsUpdater {
 
        }
 
+       /**
+        * @return
+        */
+       public int getEventsDiscardedNotVisible() {
+               return eventsDiscardedNotVisible;
+
+       }
+
+       /**
+        * @return
+        */
+       public int getEventsDiscardedOutOfViewRange() {
+               return eventsDiscardedOutOfView;
+
+       }
+
        /**
         * @return
         */
This page took 0.026795 seconds and 5 git commands to generate.