Package info.textgrid.lab.noteeditor.model

Examples of info.textgrid.lab.noteeditor.model.MusicDiagram


    Platform.run(new SafeRunnable() {
      @Override
      public void run() throws Exception {
        saveProperties();
        progressMonitor.beginTask(MusicMessages.MeiseEditor_6, 2);
        final MusicDiagram shutDownDiagram = (MusicDiagram) getMusicDiagram()
            .clone();
        final Mei currentMeiData = MeiFromFormsConverter
            .createMeiFromFormsDiagram(shutDownDiagram, true);
        shutDownDiagram.tearDown();

        if (getEditorInput() instanceof IFileEditorInput) {
          final IFile iFile = ((IFileEditorInput) getEditorInput())
              .getFile();
          if (null != currentMeiData) {
View Full Code Here


                monitor.beginTask(MusicMessages.MeiseEditor_8,
                    2);
                setValidPartName(input.getName());
                setInputWithNotify(input);
                // doSave(monitor);
                final MusicDiagram shutDownDiagram = (MusicDiagram) getMusicDiagram()
                    .clone();
                shutDownDiagram.tearDown();
                Mei currentMeiData = MeiFromFormsConverter
                    .createMeiFromFormsDiagram(
                        shutDownDiagram,
                        saveAllVariants);
                if (null != currentMeiData) {
View Full Code Here

    mei.setId(DEFAULT_MEI_TREE);
    return mei;
  }

  public static Object createEmptyModel() {
    MusicDiagram musicDiagram = new MusicDiagram("defaultFileName", createDefaultMeiTree(DEFAULT_STAVES_COUNT, DEFAULT_MEASURES_COUNT));
    musicDiagram.bootUp();
    return musicDiagram;
  }
View Full Code Here

  public static Mei createDefaultModel() {
    return createDefaultMeiTree(DEFAULT_STAVES_COUNT, DEFAULT_MEASURES_COUNT);
  }

  static public Object createModel() {
    MusicDiagram musicDiagram =  new MusicDiagram("defaultFileName", createDefaultMeiTree(
        DEFAULT_STAVES_COUNT, DEFAULT_MEASURES_COUNT));
    musicDiagram.bootUp();
    return musicDiagram;
  }
View Full Code Here

  }
 
  @Override
  public void redo(){
    CompoundCommand compoundCommand = new CompoundCommand(COMMAND_ID);
    MusicDiagram activeDiagram = MusicPlugin.getDefault().getActiveDiagram();
    SectionForm child = new SectionForm();
    CreateCommand createCmd = new CreateCommand();
    createCmd.setParent(activeDiagram);
    createCmd.setChild(child);
    compoundCommand.add(createCmd);
View Full Code Here

   * @param meiData
   * @return
   */
  public static MusicDiagram createFormsDiagramFromMei(String fileName,
      Mei meiData) {
    MusicDiagram rootDiagram = new MusicDiagram(fileName, meiData);
    rootDiagram.bootUp();
    // read the sources in the mei file
    rootDiagram.setSourceList(loadSourceList(meiData));
    // initialize default ScoreDef
    rootDiagram
        .setScoreDefForm((ScoreDefForm) handleScoreDef(
            MusicContainerFactory
                .createScoreDef(MusicContainerFactory.DEFAULT_STAVES_COUNT),
            rootDiagram));

    // check if music.body is present
    if (!MusicContainerFactory.checkContainsScore(meiData)) {
      // no music or no body present
      meiData.setMusic(((MusicContainerFactory.createDefaultMeiTree(
          MusicContainerFactory.DEFAULT_STAVES_COUNT,
          MusicContainerFactory.DEFAULT_MEASURES_COUNT)).getMusic()));
      LogService.info(MusicMessages.Mei2FormsConverter_0);
    }
    // handle the mei body
    for (int mdivIter = 0; mdivIter < meiData.getMusic().getBody()
        .getMdivs().size(); mdivIter++) {
      final Mdiv mdiv = meiData.getMusic().getBody().getMdivs()
          .get(mdivIter);
      for (Object scoreDefOrSection : mdiv.getScore()
          .getGapsAndSbsAndCorrs()) {
        if (scoreDefOrSection instanceof Section) {
          rootDiagram.addChild(handleSection(
              (Section) scoreDefOrSection, rootDiagram));
        } else if (scoreDefOrSection instanceof ScoreDef) {
          rootDiagram.setScoreDefForm((ScoreDefForm) handleScoreDef(
              (ScoreDef) scoreDefOrSection, rootDiagram));
        } else if (scoreDefOrSection instanceof App) {
          rootDiagram.addChild(handleAppOutsideLayer(
              (App) scoreDefOrSection, rootDiagram));
        } else {
          rootDiagram.addChild(handleUnknownMeiNode(
              (MeiNode) scoreDefOrSection, rootDiagram));
        }

      }
    }
View Full Code Here

TOP

Related Classes of info.textgrid.lab.noteeditor.model.MusicDiagram

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.