Class ScrubBarGUI

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

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

  • 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()
    • getLastCount

      public int getLastCount()