Example #1
0
 /**
  * Get the currently selected multimedia.
  *
  * @param page
  * @return the first multimedia with selected attribute set.
  */
 public static MultimediaAbstract getSelectedMultimedia(Page page) {
   for (MultimediaAbstract ma : page.getMultimedia()) {
     if (ma.getIsSelected()) {
       return ma;
     }
   }
   return null;
 }
Example #2
0
 /**
  * Since MultimediaAbstract is a model, a View can be attached to it. This allows instant updating
  * when an attribute changed.
  */
 public static void attachView(Page page, TObserver view) {
   for (MultimediaAbstract ma : page.getMultimedia()) {
     ma.addObserver(view);
   }
 }
Example #3
0
 /**
  * Clears the selection of given page.
  *
  * @param page is the Page where mIsSelected attribute is cleared.
  */
 public static void clearMultimediaSelection(Page page) {
   for (MultimediaAbstract ma : page.getMultimedia()) {
     ma.setIsSelected(false);
   }
 }
Example #4
0
 public static boolean deleteMultimediaByID(Page page, int multimediID) {
   return deleteMultimediaByID(page.getMultimedia(), multimediID);
 }
Example #5
0
 /**
  * @param page is where we search for the Multimedia
  * @param multimediaID
  * @return Multimedia in <code>page</code> that matches multimediaID
  */
 public static MultimediaAbstract getMultimediaByID(Page page, int multimediaID) {
   return getMultimediaByID(page.getMultimedia(), multimediaID);
 }
Example #6
0
 public static boolean isMultimediaEmpty(Page page) {
   return page.getMultimedia().isEmpty();
 }