Package info.textgrid.lab.noteeditor.mei2013

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


  }

  @Override
  public void setStemDirUp(boolean isStemDirUp) {
    if (getChord() != null) {
      DataSTEMDIRECTION newDirection;
      if (isStemDirUp) {
        newDirection = DataSTEMDIRECTION.UP;
      } else {
        newDirection = DataSTEMDIRECTION.DOWN;
      }
View Full Code Here


  public static void renderDynam(Graphics graphics, DynamForm dynamForm,
      Point location) {
    graphics.setFont(GraphicalConstants.FONT_SYMBOL_BIG);
    graphics.setLineStyle(SWT.LINE_SOLID);
    graphics.setForegroundColor(calculateVariantColor(dynamForm));
    Dynam dynam = (Dynam) dynamForm.getMeiNode();
    int yShift = +GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT / 2 - 16;
    switch (dynam.getPlace()) {
    case ABOVE:
      yShift -= GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT / 3;
      break;
    case BELOW:
      yShift += GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT / 3;
      break;
    default:
      break;
    }
    Point dynamSymbolCenterLocation = new Point(location.x + 12, location.y
        + yShift);
    String drawString = StringConstants.STRING_EMPTY;
    for (Object childObject : dynam.getContent()) {
      if (childObject instanceof String) {
        // concatenate all strings within this to a single string
        drawString += (String) childObject;
      }
    }
View Full Code Here

      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

            handleScoreChild(sectionChildForm, saveAllVariants));
      }
      return section;
    } else if (childForm instanceof EndingForm) {
      EndingForm endingForm = (EndingForm) childForm;
      Ending ending = (Ending) endingForm.getMeiNode();
      ending.getRegsAndSuppliedsAndCurves().clear();
      for (BasicElement endingChildForm : endingForm.getChildren()) {
        ending.getRegsAndSuppliedsAndCurves().add(
            handleScoreChild(endingChildForm, saveAllVariants));
      }
      return ending;
    } else if (childForm instanceof ScoreDefForm) {
      ScoreDefForm contentForm = (ScoreDefForm) childForm;
View Full Code Here

  public static void renderFermata(Graphics graphics,
      FermataForm fermataForm, Point location) {
    graphics.setFont(GraphicalConstants.FONT_SYMBOL_BIG);
    graphics.setLineStyle(SWT.LINE_SOLID);
    graphics.setForegroundColor(calculateVariantColor(fermataForm));
    Fermata fermata = (Fermata) fermataForm.getMeiNode();
    int yShift = GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT / 2 - 16;
    String fermataText = "\uE210";
    if (!fermata.isSetPlace()) {
      yShift -= GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT / 3;
    } else {
      switch (fermata.getPlace()) {
      case ABOVE:
        yShift -= GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT / 3;
        break;
      case BELOW:
        yShift += GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT / 3;
View Full Code Here

      SlurForm contentForm = (SlurForm) childForm;
      Slur contentNode = (Slur) contentForm.getMeiNode();
      return contentNode;
    } else if (childForm instanceof FermataForm) {
      FermataForm contentForm = (FermataForm) childForm;
      Fermata contentNode = (Fermata) contentForm.getMeiNode();
      return contentNode;
    } else {
      // write back a node of a currently unknown type
      UnknownMeiNodeForm contentForm = (UnknownMeiNodeForm) childForm;
      return contentForm.getMeiNode();
View Full Code Here

   * @return
   */
  public static Mei createDefaultMeiTree(int stavesCount, int measureCount) {
    Mei mei = new Mei();
    MeiHead meiHead = new MeiHead();
    FileDesc fileDesc = new FileDesc();
    TitleStmt titleStmt = new TitleStmt();
    Title title = new Title();
    title.getContent().add("New MEI-2013 document");
    titleStmt.getTitles().add(title);
    fileDesc.setTitleStmt(titleStmt);
    PubStmt pubStmt = new PubStmt();
    fileDesc.setPubStmt(pubStmt);
    SourceDesc sourceDesc = new SourceDesc();
    Source source = new Source();
    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();
View Full Code Here

   */
  private static void handleSourceList(MusicDiagram rootDiagram, Mei meiData) {
    if (!meiData.isSetMeiHead())
      meiData.setMeiHead(new MeiHead());
    if (!meiData.getMeiHead().isSetFileDesc())
      meiData.getMeiHead().setFileDesc(new FileDesc());
    if (!meiData.getMeiHead().getFileDesc().isSetSourceDesc())
      meiData.getMeiHead().getFileDesc().setSourceDesc(new SourceDesc());
    if (!rootDiagram.getSourceList().isEmpty()) {
      meiData.getMeiHead().getFileDesc().getSourceDesc().getSources()
          .clear();
View Full Code Here

    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);
    }
View Full Code Here

    tpd.setCategory(StringConstants.CAT_BASIC);
    descriptors.add(tpd);
  }
 
  private void createDefaultLayer() {
    setMeiNode(new Layer());
  }
View Full Code Here

TOP

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

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.