Package info.textgrid.lab.noteeditor.mei2013

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


        } 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


 
  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

  }

  @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

    cpd.setCategory(this.toString());
    descriptors.add(cpd);
  }

  private void createDefaultDynam() {
    this.dynam = new Dynam();
    getDynam().getContent()
        .add(0, GraphicalConstants.DEFAULT_DYNAM_CONTENT);
    getDynam().setPlace(DataSTAFFREL.BELOW);
  }
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

 
  /**
   * create default ending
   */
  private void createDefaultEnding() {
    setMeiNode(new Ending());
  }
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

TOP

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

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.