Package info.textgrid.lab.noteeditor.mei2013

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


  public void createBeanCreateCloneThenCloneShouldHaveSameStructureAndValuesButEveryElementOfDifferentReference() {
   
    // create some data
    // use a.b.m2.Book which has 1:N relations (collection) to other beans
    Book book = new Book("History of Britain", "John O'Farrel", ImmutableList.copyOf(new Section[] {
      new Section("Section1", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(1, "Bla bla bla"),
      })),
      new Section("Section2", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1066, "Bla bla bla"),
      })),
      new Section("Section3", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(2, "Bla bla bla"),
          new Paragraph(3, "Bla bla bla"),
      })),
    }));
View Full Code Here


public class SimpleApp {
  public static void main(String[] args) {
    // create some data
    // use a.b.m2.Book which has 1:N relations (collection) to other beans
    Book book = new Book("History of Britain", "John O'Farrel", ImmutableList.copyOf(new Section[] {
      new Section("Section1", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(1, "Bla bla bla"),
      })),
      new Section("Section2", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1066, "Bla bla bla"),
      })),
      new Section("Section3", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(2, "Bla bla bla"),
          new Paragraph(3, "Bla bla bla"),
      })),
    }));
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

      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

 
  public static int calculateSingleNotePositionY(NoteForm noteForm, Point location) {
    int octaveNumber = ((Note) noteForm.getMeiNode()).getOct();
    List<BasicElement> staffDefList = MeiNodeNavigator.findDescendantForm(StaffDefForm.class, MusicPlugin.getDefault().getActiveDiagram().getScoreDefForm());
    int staffNumber = (location.y - GraphicalConstants.DEFAULT_STARTPOINT.y) / GraphicalConstants.SHAPE_SINGLESYSTEM_HEIGHT;   
    DataCLEFSHAPE systemClef;
    int clefLine = 2; //warum stand hier "3"? Wenn default G, dann w�re 2 korrekt?
    // ist die Anzahl der Listeneintr�ge gr��er als der Z�hler der Notenzeile? Wann ist das nicht der Fall?
    if (staffDefList.size() > staffNumber) {
      systemClef = ((StaffDef) ((StaffDefForm) staffDefList.get(staffNumber)).getMeiNode()).getClefShape();
      if(((StaffDef) ((StaffDefForm) staffDefList.get(staffNumber)).getMeiNode()).isSetClefLine()) {
        clefLine = Integer.parseInt(((StaffDef) ((StaffDefForm) staffDefList.get(staffNumber)).getMeiNode()).getClefLine().toString());
      } else {
        switch (systemClef) {
        case G:
          clefLine = 2;
          break;
        case C:
          clefLine = 3;
          break;
        case F:
          clefLine = 4;
          break;
        }
      }
    }
    else {
      systemClef = GraphicalConstants.DEFAULT_SYSTEM_CLEF;
    }
    String pitchName = ((Note) noteForm.getMeiNode()).getPname();
    int posY = GraphicalDynamicsSingleton.getInstance()
        .getGraphicalDynamicsOS()
        .translateNotePositionYStartpoint(location.y);
    int octaveOffset = 0;
    for(int i = 1; i <= octaveNumber; i++) {
      if(i%2 == 1) {
        octaveOffset += 17;
      } else {
        octaveOffset += 18;
      }
    }
    posY -= (octaveOffset + 4);
   
    // place the note with respect to clef, clefline and octave position
    // starting position at this moment: upmost system line, "f-5" in G-Clef
   
    int parseInt = pitchName.toLowerCase().codePointAt(0);
   
    int cleffoffset = calculateClefOffsetPositionY(systemClef, clefLine);
   
    int notepitchoffset = calculateNotePitchPlacement(parseInt);
   
    int clefflineoffset = 10;
    if (systemClef.equals(DataCLEFSHAPE.C)) {
      clefflineoffset = 0;
    } else {
      if (systemClef.equals(DataCLEFSHAPE.F)) {
        clefflineoffset = -10;
      }
    }
   
    return posY + notepitchoffset + cleffoffset + clefflineoffset;
View Full Code Here

  }

  @Override
  public void setStemDirUp(boolean isStemDirUp) {
    if (getNote() != 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

   * @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

    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.Section

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.