Examples of MovieItem


Examples of com.almilli.movierentals.MovieItem

    }

    @Override
    public boolean handleAction(BView view, Object action) {
        if (action.equals("push")) {
            MovieItem selected = queueList.getSelectedItem();
            queueList.showDetails(selected);
            return true;
           
        } else if (action.equals("modifiedQueue")) {
            //just remove any data that shouldn't be there
            int size = queueList.size();
            for (int i=0; i < size; i++) {
                MovieItem item = (MovieItem)queueList.get(i);
                if (item != null) {
                    if (!item.isInQueue()) {
                        //remove it from this list because it was removed from the queue
                        queueList.setFocus(queueList.getFocus()-1, false);
                        queueList.remove(item);
                        size--;
                    }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

    }

    @Override
    public boolean handleEnter(Object arg, boolean isReturn) {
      if (isReturn) {
          MovieItem item = queueList.getSelectedItem();
          if (item != null) {
            if (!item.isInQueue()) {
              //remove it from this list because it was removed from the queue
              queueList.setFocus(queueList.getFocus()-1, false);
              queueList.remove(item);
            }
          }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

       
        List<MovieItem> queue = new ArrayList<MovieItem>();
       
        int size = queueList.size();
        for (int i=0; i < size; i++) {
            MovieItem item = (MovieItem)queueList.get(i);
            queue.add(item);
        }
        try {
            service.updateQueueOrder(queue);
            queueList.clearModified();
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

       
    super(parent, x, y, width, height, rowHeight, mutable, showRatings);
  }

    protected void createRow(BView parent, int index) {
        MovieItem item = searchResults.get(index);
        super.createRow(parent, index, item);
    }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

    }
   
    @Override
    public boolean handleAction(BView view, Object action) {
        if (action.equals("push")) {
            MovieItem selected = getSearchResults().get(queueList.getFocus());
            queueList.showDetails(selected);
            return true;
        }
       return super.handleAction(view, action);
    }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

    protected abstract List<MovieItem> getMovieItemList();

    @Override
    public boolean handleAction(BView view, Object action) {
        if (action.equals("push")) {
            MovieItem selected = queueList.getSelectedItem();
            queueList.showDetails(selected);
            return true;
        }
       return super.handleAction(view, action);
    }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

          movieId = matcher.group(1);
        }
       
      } else if ("item".equals(localName) && movieId != null) {
        //create the movie item
        MovieItem item = service.createMovieItem(movieId);
                if (item.getTitle() == null) {
                    item.setTitle(title);
                }
        items.add(item);
        isItem = false;
      }
    }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

   
    MovieItem createMovieItem(String movieId) {
        if (movieId == null) {
            throw new IllegalArgumentException("The movieId cannot be null.");
        }
        MovieItem item = allMovies.get(movieId);
        if (item == null) {
            item = new MovieItem();
            item.setMovieId(movieId);
            allMovies.put(movieId, item);
        }
        return item;
    }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

                    arrivalDate = dateFormat.parse(NodeUtils.getTextData(node));
                }
            } catch (ParseException e) {}
     
      //create a movie item
      MovieItem movie = createMovieItem(movieId);
      movie.setQueueId(queueId);
            movie.setDiscSet(discSet);
      movie.setTitle(title);
      movie.setMpaa(mpaa);
      movie.setAvailability(availability);
      movie.setRating(rating);
            if (myRating) {
                movie.setMyRating(rating);
            }
            movie.setShippedDate(shippedDate);
            movie.setArrivalDate(arrivalDate);
            movie.addDetailFlag(MovieItem.DETAIL_QUEUE);
      items.add(movie);
    }
  }
View Full Code Here

Examples of com.almilli.movierentals.MovieItem

    NodeList all = new NodeList();
    movie.collectInto(all, infoCollector);

        String movieId = ((Tag)movie).getAttribute("id");
    MovieItem item = null;
    if (all.size() > 0) {
            item = createMovieItem(movieId);
     
      int i=0;
           
            //save off the title and image
            item.setTitle(NodeUtils.getTextData(infoCollector.getNode(i++)));

            //get the icon
            ImageTag icon = (ImageTag)infoCollector.getNode(i++);
            item.setIconUrl(icon.getImageURL().replace("&amp;&amp;", "&"));
           
            //strip off the query params
            int index = item.getIconUrl().indexOf('?');
            if (index != -1) {
                item.setIconUrl(item.getIconUrl().substring(0, index)+ "?wid=130&hei=182&cvt=jpeg");
                item.setIconWidth(130);
                item.setIconHeight(182);
            }
            if (item.getIconUrl().startsWith("//")) {
                item.setIconUrl("http:" + item.getIconUrl());
            }
           
            //the mpaa rating
      item.setMpaa(NodeUtils.getTextData(infoCollector.getNode(i++)));
           
            //the release year
      item.setYear(NodeUtils.getTextData(infoCollector.getNode(i++)));

      //rating
            int rating = -1;
            boolean myRating = false;
      Node ratingNode = infoCollector.getNode(i++);
            if (ratingNode != null) {
          String ratingStr = ((Tag)ratingNode).getAttribute("src");
          Matcher matcher = ratingPattern.matcher(ratingStr);
          if (matcher.matches()) {
                    myRating = "rt".equals(matcher.group(1));
            rating = Integer.parseInt(matcher.group(2));
          }
          item.setRating(rating);
            }
            if (myRating) {
                item.setMyRating(rating);
            }
     
      //summary
            item.setSummary(NodeUtils.getTextData(infoCollector.getNode(i++)));
           
            item.addDetailFlag(MovieItem.DETAIL_SEARCH);
    }
    return item;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.