Class ScrubBarGUI

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener

public class ScrubBarGUI extends JComponent implements ActionListener
See Also:
  • Field Details

    • PATH_SYNC_ICON

      private static final String PATH_SYNC_ICON
    • PATH_PREV_SET_ICON

      private static final String PATH_PREV_SET_ICON
    • PATH_NEXT_SET_ICON

      private static final String PATH_NEXT_SET_ICON
    • PATH_PLAY_ICON

      public static final String PATH_PLAY_ICON
    • PATH_PAUSE_ICON

      private static final String PATH_PAUSE_ICON
    • PATH_PREV_COUNT_ICON

      private static final String PATH_PREV_COUNT_ICON
    • PATH_NEXT_COUNT_ICON

      private static final String PATH_NEXT_COUNT_ICON
    • PATH_AUDIO_ICON

      private static final String PATH_AUDIO_ICON
    • PATH_FAST_PLAY_ICON

      private static final String PATH_FAST_PLAY_ICON
    • PATH_FULL_PLAY_ICON

      private static final String PATH_FULL_PLAY_ICON
    • scrubBarPanel

      private JPanel scrubBarPanel
    • parent

      private final JFrame parent
    • audioPlayers

      private ArrayList<AudioPlayer> audioPlayers
    • currAudioPlayer

      private AudioPlayer currAudioPlayer
    • currTimeMSec

      private long currTimeMSec
    • topSlider

      private JSlider topSlider
    • isReady

      private boolean isReady
    • isPlaying

      private boolean isPlaying
    • syncButton

      private JButton syncButton
    • prevSetButton

      private JButton prevSetButton
    • nextSetButton

      private JButton nextSetButton
    • playPauseButton

      private JButton playPauseButton
    • prevCountButton

      private JButton prevCountButton
    • nextCountButton

      private JButton nextCountButton
    • playbackSpeedsBox

      JComboBox<String> playbackSpeedsBox
    • audioCheckbox

      private JCheckBox audioCheckbox
    • pageTab2Count

      private Map<String,Integer> pageTab2Count
    • lastCount

      private int lastCount
    • currSetStartCount

      private int currSetStartCount
    • currSetEndCount

      private int currSetEndCount
    • footballFieldPanel

      private final FootballFieldPanel footballFieldPanel
    • totalCounts

      private int totalCounts
    • scrubBarListener

      private final ScrubBarListener scrubBarListener
    • syncListener

      private final SyncListener syncListener
    • PLAY_ICON

      private final ImageIcon PLAY_ICON
    • PAUSE_ICON

      private final ImageIcon PAUSE_ICON
    • fps

      private double fps
    • time

      private double time
    • useFps

      private boolean useFps
    • timeSync

      private ArrayList<SyncTimeGUI.Pair> timeSync
  • Constructor Details

  • Method Details

    • updatePageTabCounts

      public void updatePageTabCounts(Map<String,Integer> pageTabCounts, int totalCounts)
    • reinitialize

      private void reinitialize()
      Upon receiving new pageTab2Count data, call this method to update the Scrub Bar.
    • updateLastCount

      private void updateLastCount()
      Update lastCount field. Important for managing display of the bottom slider. Call this whenever the Scrub Bar receives a new set of Page Tab : Count data. i.e., upon receiving new data for pageTabCount.
    • initialize

      private void initialize()
    • setScrub

      public boolean setScrub(int count)
    • setPlaybackTime

      public void setPlaybackTime()
    • nextStep

      public boolean nextStep(double playbackSpeed)
    • buildLabelTable

      private Hashtable<Integer,JLabel> buildLabelTable()
    • sortMap

      public static List<Map.Entry<String,Integer>> sortMap(Map<String,Integer> map)
      Takes in a map of [String]:[Integer] entries and returns a list of those entries, sorted by the value [Integer] in ascending order. Useful for a variety of situations, not only within this class.
      Parameters:
      map - - The map of [String]:[Integer] entries
      Returns:
      a list of map entries, sorted by the value [Integer] in ascending order.
    • getToolBarPanel

      private JPanel getToolBarPanel()
    • scaleImageIcon

      public static ImageIcon scaleImageIcon(ImageIcon imageIcon, int width, int height)
      Rescale ImageIcon to fit for toolbar icons, or for other purposes
      Parameters:
      imageIcon - - ImageIcon object to rescale.
      Returns:
      Altered ImageIcon with rescaled icon.
    • scaleImageIcon

      private ImageIcon scaleImageIcon(ImageIcon imageIcon)
    • setReady

      public void setReady(boolean ready)
    • setPlaying

      public void setPlaying(boolean playing)
    • getScrubBarPanel

      public JPanel getScrubBarPanel()
    • getAudioCheckbox

      public JCheckBox getAudioCheckbox()
    • isUseFps

      public boolean isUseFps()
    • updateCurrSetCounts

      private void updateCurrSetCounts(String set)
      Call this method to update currSetBeginCount and currSetEndCount, which are important for displaying Count values on the bottom Scrub Bar. Provide the Page Tab of the Set (a Page Tab denotes the start of a new Set). Implementation Details: If you provide: "2", then consider "2A" or "3" as next Page Tab, "2A", then consider "2B" or "3" as next Page Tab, "2Z", then consider "3" as next Page Tab, By knowing the current Page Tab and next Page Tab, we find the beginning and end Counts for the given set. (Technically the parameter is the Page Tab String).
      Parameters:
      set - - For example, "1", "2A", "5B"
    • isPlaying

      public boolean isPlaying()
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • setIsPlayingPause

      public void setIsPlayingPause()
    • setIsPlayingPlay

      public void setIsPlayingPlay()
    • getTime

      public double getTime()
    • prevSet

      public void prevSet()
    • nextSet

      public void nextSet()
    • prevCount

      public void prevCount()
    • nextCount

      public void nextCount()
    • getFps

      public double getFps()
    • getCurrentSetIndex

      public int getCurrentSetIndex()
    • getCurrentSetStart

      public int getCurrentSetStart()
    • isAtLastSet

      public boolean isAtLastSet()
    • isAtStartOfSet

      public boolean isAtStartOfSet()
    • isAtFirstSet

      public boolean isAtFirstSet()
    • getCurrSetDuration

      public int getCurrSetDuration()
    • setTimeSync

      public void setTimeSync(ArrayList<SyncTimeGUI.Pair> timeSync)
    • setAudioPlayer

      public void setAudioPlayer(ArrayList<AudioPlayer> audioPlayers)
    • setCurrAudioPlayer

      public void setCurrAudioPlayer(AudioPlayer ap)
    • setTime

      public void setTime(int time)
    • getSyncButton

      public JButton getSyncButton()