Package ca.phon.media

Class TimeUIModel

java.lang.Object
ca.phon.media.TimeUIModel

public class TimeUIModel extends Object
Time model for UI applications. Useful for time based media.
  • Field Details

    • MIN_PIXELS_PER_SECOND

      public static final float MIN_PIXELS_PER_SECOND
      See Also:
    • MAX_PIXELS_PER_SECOND

      public static final float MAX_PIXELS_PER_SECOND
      See Also:
    • DEFAULT_PIXELS_PER_SECOND

      public static final float DEFAULT_PIXELS_PER_SECOND
      See Also:
  • Constructor Details

    • TimeUIModel

      public TimeUIModel()
  • Method Details

    • roundTime

      public static double roundTime(double time)
      Utility method to round time to nearest millisecond.
      Parameters:
      time -
      Returns:
      roundedTime
    • getTimeInsets

      public Insets getTimeInsets()
    • setTimeInsets

      public void setTimeInsets(Insets timeInsets)
    • getStartTime

      public float getStartTime()
    • setStartTime

      public void setStartTime(float startTime)
    • getEndTime

      public float getEndTime()
    • setEndTime

      public void setEndTime(float endTime)
    • getMediaEndTime

      public float getMediaEndTime()
    • setMediaEndTime

      public void setMediaEndTime(float mediaEndTime)
    • getCurrentTime

      public float getCurrentTime()
    • setCurrentTime

      public void setCurrentTime(float currentTime)
    • getPixelsPerSecond

      public float getPixelsPerSecond()
    • setPixelsPerSecond

      public void setPixelsPerSecond(float pixelsPerSecond)
    • getPreferredWidth

      public int getPreferredWidth()
      Returns the preferred UI width of the component based on current time values
      Returns:
    • timeAtX

      public float timeAtX(double x)
    • xForTime

      public double xForTime(float time)
    • addMarker

      public TimeUIModel.Marker addMarker(float time, Color color)
    • addMarker

      public void addMarker(TimeUIModel.Marker marker)
    • removeMarker

      public void removeMarker(TimeUIModel.Marker marker)
    • getMarkers

      public Collection<TimeUIModel.Marker> getMarkers()
    • clearMarkers

      public void clearMarkers()
    • addInterval

      public TimeUIModel.Interval addInterval(float startTime, float endTime)
    • addInterval

      public TimeUIModel.Interval addInterval(TimeUIModel.Marker startMarker, TimeUIModel.Marker endMarker)
    • addInterval

      public void addInterval(TimeUIModel.Interval interval)
    • removeInterval

      public void removeInterval(TimeUIModel.Interval interval)
    • getIntervals

      public Collection<TimeUIModel.Interval> getIntervals()
    • clearIntervals

      public void clearIntervals()
    • addTimeUIModelListener

      public void addTimeUIModelListener(TimeUIModelListener listener)
    • removeTimeUIModelListener

      public void removeTimeUIModelListener(TimeUIModelListener listener)
    • getTimeUIModelListeners

      public TimeUIModelListener[] getTimeUIModelListeners()
    • fireIntervalAdded

      public void fireIntervalAdded(TimeUIModel.Interval interval)
    • fireIntervalRemoved

      public void fireIntervalRemoved(TimeUIModel.Interval interval)
    • fireMarkerAdded

      public void fireMarkerAdded(TimeUIModel.Marker marker)
    • fireMarkerRemoved

      public void fireMarkerRemoved(TimeUIModel.Marker marker)
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
    • addPropertyChangeListener

      public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
    • removePropertyChangeListener

      public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)