Class PeriodicMarkerEventSource

java.lang.Object
org.eclipse.tracecompass.tmf.ui.markers.PeriodicMarkerEventSource
All Implemented Interfaces:
IMarkerEventSource

@NonNullByDefault public class PeriodicMarkerEventSource extends Object implements IMarkerEventSource
Marker event source that produces periodic markers.
Since:
2.0
  • Constructor Details

    • PeriodicMarkerEventSource

      public PeriodicMarkerEventSource(String category, PeriodicMarkerEventSource.Reference reference, double period, long rollover, org.eclipse.swt.graphics.RGBA color, boolean foreground)
      Constructs a periodic marker event source with line markers at period boundaries.

      The markers will have the given category and color. The reference defines the marker with the given index to be at the specified time.

      Parameters:
      category - the marker category
      reference - the reference marker time and index
      period - the period in time units
      rollover - the number of periods before the index rolls-over to 0, or 0 for no roll-over
      color - the marker color
      foreground - true if the marker is drawn in foreground, and false otherwise
    • PeriodicMarkerEventSource

      public PeriodicMarkerEventSource(String category, PeriodicMarkerEventSource.Reference reference, double period, long rollover, org.eclipse.swt.graphics.RGBA color1, org.eclipse.swt.graphics.RGBA color2, boolean foreground)
      Constructs a periodic marker event source with alternating shading markers.

      The markers will have the given category. Periods will be shaded with the first and second colors alternatively. The reference defines the marker with the given index to be at the specified time. The reference will be shaded with the first color if its index is even, or the second color if it is odd.

      Parameters:
      category - the marker category
      reference - the reference marker time and index
      period - the period in time units
      rollover - the number of periods before the index rolls-over to 0, or 0 for no roll-over
      color1 - the first marker color
      color2 - the second marker color
      foreground - true if the marker is drawn in foreground, and false otherwise
  • Method Details

    • getMarkerCategories

      public List<String> getMarkerCategories()
      Description copied from interface: IMarkerEventSource
      Gets the list of marker categories that this object provides.
      Specified by:
      getMarkerCategories in interface IMarkerEventSource
      Returns:
      The list of marker categories
    • getMarkerList

      public List<IMarkerEvent> getMarkerList(String category, long startTime, long endTime, long resolution, org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from interface: IMarkerEventSource
      Gets the list of marker events of a specific category that intersect the given time range (inclusively).

      The list should also include the nearest previous and next markers that do not intersect the time range.

      Specified by:
      getMarkerList in interface IMarkerEventSource
      Parameters:
      category - The marker category
      startTime - Start of the time range
      endTime - End of the time range
      resolution - The resolution
      monitor - The progress monitor object
      Returns:
      The list of marker events
    • getMarkerLabel

      public String getMarkerLabel(long index)
      Get the marker label for the given marker index.

      This method can be overridden by clients.

      Parameters:
      index - the marker index
      Returns:
      the marker label
    • isApplicable

      public boolean isApplicable(long index)
      Returns true if the marker is applicable at the specified index.

      This method can be overridden by clients. Returning false will essentially filter-out the marker.

      Parameters:
      index - the marker index
      Returns:
      true if the marker is applicable
      Since:
      3.0