Package info.textgrid.lab.noteeditor.mei2013

Examples of info.textgrid.lab.noteeditor.mei2013.Body


    scpd.setDescription(MusicMessages.MEI_documentation_app_select);
    descriptors.add(scpd);
  }

  private void createDefaultApp() {
    setMeiNode(new App());
  }
View Full Code Here


    tpd.setDescription(MusicMessages.MEI_documentation_generic_n);
    descriptors.add(tpd);
  }

  private void createDefaultBeam() {
    setMeiNode(new Beam());
  }
View Full Code Here

        contentNode.unsetArtics();
      }
      return contentNode;
    } else if (childForm instanceof BeamGroupForm) {
      BeamGroupForm contentForm = (BeamGroupForm) childForm;
      Beam contentNode = (Beam) contentForm.getMeiNode();
      contentNode.getFTremsAndChordsAndDamages().clear();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getFTremsAndChordsAndDamages().add(
            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

    sourceDesc.getSources().add(source);
    fileDesc.setSourceDesc(sourceDesc);   
    meiHead.setFileDesc(fileDesc)
    mei.setMeiHead(meiHead);
    Music music = new Music();
    Body body = new Body();
    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
    body.getMdivs().add(mdiv);
    music.setBody(body);
    mei.setMusic(music);
    mei.setId(DEFAULT_MEI_TREE);
    return mei;
  }
View Full Code Here

    lpd.setDescription(MusicMessages.MEI_documentation_note_artic);
    descriptors.add(lpd);
  }

  private void createDefaultChord() {
    setMeiNode(new Chord());
  }
View Full Code Here

            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof ChordGroupForm) {
      ChordGroupForm contentForm = (ChordGroupForm) childForm;
      Chord contentNode = (Chord) contentForm.getMeiNode();
      contentNode.getRestoresAndArticsAndUnclears().clear();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getRestoresAndArticsAndUnclears().add(
            handleScoreChild(contentChildForm, saveAllVariants));
      }
      if(contentNode.getArtics().isEmpty()) {
        contentNode.unsetArtics();
      }
      return contentNode;
    } else if (childForm instanceof BeamGroupForm) {
      BeamGroupForm contentForm = (BeamGroupForm) childForm;
      Beam contentNode = (Beam) contentForm.getMeiNode();
      contentNode.getFTremsAndChordsAndDamages().clear();
      for (BasicElement contentChildForm : contentForm.getChildren()) {
        contentNode.getFTremsAndChordsAndDamages().add(
            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

      clearedString = clearedString.replace("]",
          StringConstants.STRING_EMPTY);
      if (!(clearedString).equals(StringConstants.STRING_EMPTY)) {
        String[] split = (clearedString).split(","); //$NON-NLS-1$
        for (int i = 0; i < split.length && !split[i].isEmpty(); i++) {
          DataARTICULATION da = DataARTICULATION.fromValue(split[i]
              .toLowerCase().replace('_', '-').trim());
          getNote().getArtics().add(da);
        }
      }
      firePropertyChange(StringConstants.NOTE_ARTIC, null, value);
View Full Code Here

      clearedString = clearedString.replace("]",
          StringConstants.STRING_EMPTY);
      if (!(clearedString).equals(StringConstants.STRING_EMPTY)) {
        String[] split = (clearedString).split(","); //$NON-NLS-1$
        for (int i = 0; i < split.length && !split[i].isEmpty(); i++) {
          DataARTICULATION da = DataARTICULATION.fromValue(split[i]
              .toLowerCase().replace('_', '-').trim());
          getChord().getArtics().add(da);
        }
      }
      firePropertyChange(StringConstants.CHORD_ARTIC, null, value);
View Full Code Here

    if (FigureRenderLibrary.isFormInVisibleArea(staffForm.getId(),
        this.figurePassingObject)) {
      // render system lines
      MeasureForm measureForm = (MeasureForm) MeiNodeNavigator
          .findAncestorForm(MeasureForm.class, staffForm);
      DataBARRENDITION left = ((Measure) measureForm.getMeiNode())
          .getLeft();
      DataBARRENDITION right = ((Measure) measureForm.getMeiNode())
          .getRight();
      int staffPointY = this.figurePassingObject.getLocationMap().get(
          staffForm.getId()).y;
      String measureId = MeiNodeNavigator.findAncestorForm(
          MeasureForm.class, staffForm).getId();
View Full Code Here

        } else {
          return StringConstants.STRING_EMPTY;
        }
    } else if (StringConstants.MEASURE_BARRENDITION_LEFT.equals(propertyId)) {
      if (((Measure) getMeiNode()).isSetLeft()) {
        DataBARRENDITION leftBarRendition = ((Measure) getMeiNode()).getLeft();
        switch(leftBarRendition){
        case DASHED:
          return 1;
        case DBL:
          return 2;
        case DBLDASHED:
          return 3;
        case DBLDOTTED:
          return 4;
        case DOTTED:
          return 5;
        case END:
          return 6;
        case INVIS:
          return 7;
        case RPTBOTH:
          return 8;
        case RPTEND:
          return 9;
        case RPTSTART:
          return 10;
        case SINGLE:
          return 11;
        default:
          return 0;
        }
      } else {
        // default undefined: [0]
        return 0;
      }
    } else if (StringConstants.MEASURE_BARRENDITION_RIGHT.equals(propertyId)) {
      if (((Measure) getMeiNode()).isSetRight()) {
        DataBARRENDITION rightBarRendition = ((Measure) getMeiNode()).getRight();
        switch(rightBarRendition){
        case DASHED:
          return 1;
        case DBL:
          return 2;
View Full Code Here

TOP

Related Classes of info.textgrid.lab.noteeditor.mei2013.Body

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.