示例#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;
 }
示例#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);
   }
 }
示例#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);
   }
 }
示例#4
0
 public static boolean deleteMultimediaByID(Page page, int multimediID) {
   return deleteMultimediaByID(page.getMultimedia(), multimediID);
 }
示例#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);
 }
示例#6
0
 public static boolean isMultimediaEmpty(Page page) {
   return page.getMultimedia().isEmpty();
 }