Package gui.media

Class GUIMediaFactory

java.lang.Object
gui.media.GUIMediaFactory

public class GUIMediaFactory extends Object
Simple factory which creates the appropriate GUIMedia object for a given Media object.
  • Method Details

    • getFor

      public static GUIMedia getFor(Media media) throws Exception
      Instatiate the correct GUIMedia sub-class for the given Media object.

      When we load a Media object from storage, we don't yet know specifically what type it is, but each type of Media has a different GUI representation, so we need to check the type of the Media and then create an instance of the correct sub-class of GUIMedia.

      Throws:
      Exception