Beispiel #1
0
        public AnotoPostIt createNewPostItWithNoteID(int noteID)
        {
            foreach (AnotoPostIt postIt in anotoNotes)
            {
                //note with this ID already exists
                if (postIt.Id == noteID)
                {
                    return(null);
                }
            }
            AnotoPostIt newPostIt = new AnotoPostIt(noteID);

            for (int i = 0; i < bufferedTraces.Count;)
            {
                if (bufferedTraces[i].InkDots[0].PaperNoteID == noteID)
                {
                    newPostIt.updateContent(bufferedTraces[i]);
                    bufferedTraces.RemoveAt(i);
                }
                else
                {
                    i++;
                }
            }
            newPostIt.IsAvailable = true;
            return(newPostIt);
        }
Beispiel #2
0
 void newPostIt_contentUpdatedHandler(AnotoPostIt updatedNote)
 {
     if (noteContentUpdatedHandler != null)
     {
         noteContentUpdatedHandler(updatedNote);
     }
 }
Beispiel #3
0
 public void traceGeneratedHandler(AnotoInkTrace generatedTrace)
 {
     if (!generatedTrace.isComplete())
     {
         return;
     }
     // TODO Auto-generated method stub
     if (generatedTrace.isPotentialAssignGesture())
     {
         //if the ID of the paper outside the note is not the wallpaper
         //then it is not "assign" gesture
         if (generatedTrace.InkDots[0].PaperNoteID != wallPaperID)
         {
             processMultipleIDsTrace(generatedTrace);
         }
         else
         {
             //add new PostIt from buffered traces
             //first get the ID of the note to be created
             // it should be different from the wallpaper
             int postItID = 0;
             foreach (AnotoInkDot inkDot in generatedTrace.InkDots)
             {
                 if (inkDot.PaperNoteID != wallPaperID)
                 {
                     postItID = inkDot.PaperNoteID;
                     break;
                 }
             }
             AnotoPostIt newPostIt = createNewPostItWithNoteID(postItID);
             if (newPostIt != null)
             {
                 newPostIt.extractPositionFromAssigningTrace(generatedTrace);
                 newPostIt.postItRemovedHandler  += new AnotoPostIt.DrawablePostItRemoved(newPostIt_postItRemovedHandler);
                 newPostIt.contentUpdatedHandler += new AnotoPostIt.DrawableContentUpdated(newPostIt_contentUpdatedHandler);
                 anotoNotes.Add(newPostIt);
                 if (newNoteAddedHandler != null)
                 {
                     newNoteAddedHandler(newPostIt);
                 }
             }
             else
             {
                 processMultipleIDsTrace(generatedTrace);
             }
         }
     }
     else
     {
         if (generatedTrace.isMultiIDTrace())
         {
             processMultipleIDsTrace(generatedTrace);
         }
         else
         {
             processSingleIDTrace(generatedTrace);
         }
     }
 }
Beispiel #4
0
 void newPostIt_postItRemovedHandler(AnotoPostIt removedNote)
 {
     removedNote.IsAvailable = false;
     if (noteRemovedHandler != null)
     {
         noteRemovedHandler(removedNote);
     }
 }
Beispiel #5
0
        public void processSingleIDTrace(AnotoInkTrace trace)
        {
            AnotoPostIt postIt = getPostItWithID(trace.InkDots[0].PaperNoteID);

            if (postIt == null)
            {
                bufferedTraces.Add(trace);
            }
            else
            {
                if (postIt.IsAvailable)
                {
                    postIt.updateContent(trace);
                }
            }
        }
Beispiel #6
0
 public void addPostIt(AnotoPostIt note)
 {
     anotoNotes.Add(note);
 }