Package cs213.photoAlbum.GUIView

Examples of cs213.photoAlbum.GUIView.SearchResults


  /* (non-Javadoc)
   * @see cs213.photoAlbum.control.ControlInterface#listPhotoInfo(java.lang.String)
   */
  @Override
  public String[] listPhotoInfo(String filename) {
    Photo p = backend.getPhoto(filename);
   
    if (p == null){
      return null;
    }
   
    int tagsize = 0;
    int numalbums = 0;
   
    if (p.listTags() != null){
      tagsize = p.listTags().length;
    }
    if (p.listAlbums() != null){
      numalbums = p.listAlbums().length;
    }
   
    String[] ret = new String[5];
   
    ret[0] = p.toString();
    ret[1] = p.caption;
    ret[3] = /*"Date: " +*/p.cal.getTime().toString();
    ret[2] = "";//"Album:";
   
    for (int i = 0; i < p.listAlbums().length; i++){
      ret[2] = ret[2] + p.listAlbums()[i] + ", ";
    }
    ret[2] = ret[2].substring(0, ret[2].length() - 2);
   
    ret[4] = "";
    if (p.listTags().length != 0){
      //ret[4] = "Tags:\n ";
      for (int i = 0; i < p.listTags().length; i++){
        ret[4] = ret[4] + p.listTags()[i] + ", ";
      }
    }
    if(ret[4].length() != 0)
      ret[4] = ret[4].substring(0, ret[4].length()-2);
//    int index = 4;
View Full Code Here


    }
    inrange = PhotoSort.dateSort(inrange);
   
    String[] ret = new String[inrange.size()];
    for (int i = 0; i < ret.length; i++){
      Photo p = inrange.get(i);
      ret[i] = p.caption + " - Album: ";
      for (int j = 0; j < p.listAlbums().length; j++){
        ret[i] = ret[i] + p.listAlbums()[j] + ", ";
      }
      ret[i] = ret[i].substring(0, ret[i].length() - 2) + " Date: " + p.cal.getTime().toString();
         
    }
    return ret;
View Full Code Here

    }
   
    String[] ret = new String[withtags.size()];
   
    for (int i = 0; i < withtags.size(); i++){
      Photo p =withtags.get(i);
      ret[i] = p.caption + " - Album: ";

      for (int j = 0; j < p.listAlbums().length; j++){
        ret[i] = ret[i] + p.listAlbums()[j] + ", ";
      }
      ret[i] = ret[i].substring(0, ret[i].length() - 2) + " Date: " + p.cal.getTime().toString();

    }
   
View Full Code Here

        int row = table.getSelectedRow();
       
        String type = (String) table.getModel().getValueAt(row, 0);
        String value = (String) table.getModel().getValueAt(row, 1);
//       
        Tag currenttag = new Tag(type, value);
       
        tags.remove(currenttag);
        SearchByTag nextWindow = new SearchByTag(view, tags);
        SearchByTag.this.dispose();
//        updateTags();
View Full Code Here

       
        String type = (String) tagTable.getModel().getValueAt(row, 0);
        String value = (String) tagTable.getModel().getValueAt(row, 1);
       
        if (value != null) {
          Tag currenttag = new Tag(type, value);
          tags.remove(currenttag);
          EditPhotoDialog nextWindow = new EditPhotoDialog(view, fileName, tags);
          EditPhotoDialog.this.dispose();
        } else {
          JFrame frame = new JFrame();
View Full Code Here

    });
   
    add.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e){
        if (AddTagDialog.this.value.getText().length() != 0){       
        AddTagDialog.this.editPhoto.newTag = new Tag(AddTagDialog.this.type.getText(), AddTagDialog.this.value.getText());
        AddTagDialog.this.dispose();
        }
       
      }
    });
View Full Code Here

    });
   
    add.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e){
        if (AddTagDialog2.this.value.getText().length() != 0){       
        AddTagDialog2.this.editPhoto.newTag = new Tag(AddTagDialog2.this.type.getText(), AddTagDialog2.this.value.getText());
        AddTagDialog2.this.dispose();
        }
       
      }
    });
View Full Code Here

    Photo p = backend.getPhoto(filename);
    if (p == null){
      System.out.println("The photo does not exist.");
      return false;
    }
    p.addTagToList(new Tag(tagType, TagValue));
    return true;
  }
View Full Code Here

  public boolean removeTag(String filename, String tagType, String TagValue) {
    Photo p = backend.getPhoto(filename);
    if (p == null){
      System.out.println("Photo does not exist");
    }
    p.deleteTagFromList(new Tag(tagType, TagValue));
    return false;
  }
View Full Code Here

   
    Photo[] allphotos = backend.getAllPhotos();
    ArrayList<Photo> withtags = new ArrayList<Photo>();
   
    for (int i = 0; i <numtags; i++){
      tags[i] = new Tag(tagArray[2*i], tagArray[2*i + 1]);
    }
   
    for (int i = 0; i < allphotos.length; i++){
      boolean hastags = true;
      for (int j = 0; j < numtags; j++){
View Full Code Here

TOP

Related Classes of cs213.photoAlbum.GUIView.SearchResults

Copyright © 2018 www.massapicom. 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.