Class RecentFilesMenu

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants

public class RecentFilesMenu extends JMenu
RecentFilesMenu is a menu that keeps track of recently loaded files.
See Also:
  • Constructor Details

    • RecentFilesMenu

      public RecentFilesMenu(Preferences preferences)
    • RecentFilesMenu

      public RecentFilesMenu(Preferences preferences, String title)
  • Method Details

    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class AbstractButton
    • loadFromPreferences

      public void loadFromPreferences()
      Loads the list of recent files from preferences. Loads at most MAX_RECENT_FILES items.
    • saveToPreferences

      public void saveToPreferences()
      Saves the list of recent files to preferences. Saves at most MAX_RECENT_FILES items.
    • removePath

      public void removePath(String filePath)
    • addPath

      public void addPath(String filePath)
      Adds a path to the list of recent files. If the path already exists in the list, it will be moved to the head of the list.
      Parameters:
      filePath - the path to add.
    • clear

      public void clear()
      Clears the list of recent files. To commit the change, call saveToPreferences().
    • getMostRecentLoad

      public String getMostRecentLoad()
    • setSaveScene

      public void setSaveScene(SaveScene saveScene)