Package rocks.xmpp.extensions.privatedata.rosternotes.model

Examples of rocks.xmpp.extensions.privatedata.rosternotes.model.Annotation$Note


  /**
   * Create a note with default values
   */
  private void createDefaultNote() {
    Note note = new Note();
    note.setPname(GraphicalConstants.DEFAULT_NOTE_PITCHNAME);
    note.setDur(GraphicalConstants.DEFAULT_NOTE_DURATION);
    note.setOct(GraphicalConstants.DEFAULT_NOTE_OCTAVE);
    setMeiNode(note);
  }
View Full Code Here


        } catch (Exception e) {
          LogService.error(e.getMessage(), e);
        }
      }
      if(meiNode instanceof Note) {
        Note newNote = new Note();
        Note meiNote = (Note) meiNode;
        if(meiNote.isSetDur())
          newNote.setDur(meiNote.getDur());
        if(meiNote.isSetDots())
          newNote.setDots(meiNote.getDots());
        if(meiNote.isSetOct())
        newNote.setOct(((Note) meiNode).getOct());
        if(meiNote.isSetN())
          newNote.setN(meiNote.getN());
        if(meiNote.isSetPname())
          newNote.setPname(meiNote.getPname());
        this.child.setMeiNode(newNote);
        return;
      }
      this.child.setMeiNode(meiNode);
    }
View Full Code Here

            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof NoteForm) {
      NoteForm contentForm = (NoteForm) childForm;
      Note contentNode = (Note) contentForm.getMeiNode();
      if (contentNode.getArtics().isEmpty())
        contentNode.unsetArtics();
      return contentNode;
    } else if (childForm instanceof RestForm) {
      RestForm contentForm = (RestForm) childForm;
      Rest contentNode = (Rest) contentForm.getMeiNode();
      return contentNode;
    } else if (childForm instanceof MRestForm) {
      MRestForm contentForm = (MRestForm) childForm;
      MRest contentNode = (MRest) contentForm.getMeiNode();
      return contentNode;
    } else if (childForm instanceof SpaceForm) {
      SpaceForm contentForm = (SpaceForm) childForm;
      Space contentNode = (Space) contentForm.getMeiNode();
      return contentNode;
    } else if (childForm instanceof DynamForm) {
      DynamForm contentForm = (DynamForm) childForm;
      Dynam contentNode = (Dynam) contentForm.getMeiNode();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getContent().add(
            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof TieForm) {
      TieForm contentForm = (TieForm) childForm;
View Full Code Here

                                public void handle(ActionEvent actionEvent) {
                                    PrivateDataManager privateDataManager = xmppSession.getExtensionManager(PrivateDataManager.class);
                                    try {
                                        List<Annotation.Note> notes = new ArrayList<>();
                                        notes.add(new Annotation.Note("Hallo", item.contact.get().getJid()));
                                        privateDataManager.storeData(new Annotation(notes));
                                    } catch (XmppException e) {
                                        e.printStackTrace();
                                    }

                                }
                            });
                            MenuItem getAnnotationsItems = new MenuItem("Get annotations");
                            getAnnotationsItems.setOnAction(new EventHandler<ActionEvent>() {
                                @Override
                                public void handle(ActionEvent actionEvent) {
                                    PrivateDataManager privateDataManager = xmppSession.getExtensionManager(PrivateDataManager.class);
                                    try {
                                        Annotation annotations = privateDataManager.getData(Annotation.class);
                                        int i = 0;
                                    } catch (XmppException e) {
                                        e.printStackTrace();
                                    }
                                }
View Full Code Here

        super(PrivateData.class, Annotation.class);
    }

    @Test
    public void marshalPrivateData() throws JAXBException, XMLStreamException {
        PrivateData privateData = new PrivateData(new Annotation(null));
        String xml = marshal(privateData);
        Assert.assertEquals("<query xmlns=\"jabber:iq:private\"><storage xmlns=\"storage:rosternotes\"></storage></query>", xml);
    }
View Full Code Here

                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PrivateData privateData = iq.getExtension(PrivateData.class);
        Assert.assertNotNull(privateData);
        Assert.assertTrue(privateData.getData() instanceof Annotation);
        Annotation annotations = (Annotation) privateData.getData();
        Assert.assertEquals(annotations.getNotes().size(), 2);
        Assert.assertEquals(annotations.getNotes().get(0).getJid(), Jid.valueOf("hamlet@shakespeare.lit"));
        Assert.assertEquals(annotations.getNotes().get(0).getValue(), "Seems to be a good writer");
        Assert.assertNotNull(annotations.getNotes().get(0).getCreationDate());
        Assert.assertNotNull(annotations.getNotes().get(0).getModificationDate());
        Assert.assertEquals(annotations.getNotes().get(1).getJid(), Jid.valueOf("juliet@capulet.com"));
        Assert.assertEquals(annotations.getNotes().get(1).getValue(), "Oh my sweetest love ...");
        Assert.assertNotNull(annotations.getNotes().get(1).getCreationDate());
        Assert.assertNotNull(annotations.getNotes().get(1).getModificationDate());
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.privatedata.rosternotes.model.Annotation$Note

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.