Package org.lilypondbeans.jccparser

Examples of org.lilypondbeans.jccparser.ASTPitch


    public void punktierung() {
        SimpleNode el = UpdateNodeTask.getInstance().getLastCurrent();
        if (el == null || el.id != ParserTreeConstants.JJTPITCH) {
            return;
        }
        ASTPitch pitch = (ASTPitch) el;
        NoteEditor ed = NoteEditor.create(pitch);
        if (ed.pitch.durationDots == 1) {
            ed.pitch.durationDots = 0;
        } else {
            ed.pitch.durationDots = 1;
View Full Code Here


    public void setNotenWert(int durationInteger) {
        SimpleNode el = UpdateNodeTask.getInstance().getLastCurrent();
        if (el == null || el.id != ParserTreeConstants.JJTPITCH) {
            return;
        }
        ASTPitch pitch = (ASTPitch) el;
        pitch.durationInteger = durationInteger;
        NoteEditor ed = NoteEditor.create(pitch);
        ed.pitch.durationInteger = durationInteger;
        ed.save();
        NetbeansTextEditor.getInstance().selectPosition(pitch);
View Full Code Here

    public void setVZUp() {
        SimpleNode el = UpdateNodeTask.getInstance().getLastCurrent();
        if (el == null || el.id != ParserTreeConstants.JJTPITCH) {
            return;
        }
        ASTPitch pitch = (ASTPitch) el;
        NoteEditor ed = NoteEditor.create(pitch);
        ASTDocument sc = (ASTDocument) el.getParentContext().getContext(ASTContext.TYPE_DOCUMENT);
        try {
            int vz[] = sc.language.fromNoteName(ed.pitch.notename);
            ed.pitch.notename = sc.language.toNoteName(vz[0], vz[1] + 1);
            pitch.noteSignature++;
            ((PitchLayout) pitch.getlayoutObject()).signatureToPaint = ((PitchLayout) pitch.getlayoutObject()).signatureToPaint + 1;
            play(pitch);

            ed.save();
            NetbeansTextEditor.getInstance().selectPosition(pitch);
        } catch (Exception ex) {
View Full Code Here

    public void setVZDown() {
        SimpleNode el = UpdateNodeTask.getInstance().getLastCurrent();
        if (el == null || el.id != ParserTreeConstants.JJTPITCH) {
            return;
        }
        ASTPitch pitch = (ASTPitch) el;
        NoteEditor ed = NoteEditor.create(pitch);
        ASTDocument sc = (ASTDocument) el.getParentContext().getContext(ASTContext.TYPE_DOCUMENT);
        try {
            int vz[] = sc.language.fromNoteName(ed.pitch.notename);
            ed.pitch.notename = sc.language.toNoteName(vz[0], vz[1] - 1);
            pitch.noteSignature--;
            ((PitchLayout) pitch.getlayoutObject()).signatureToPaint = ((PitchLayout) pitch.getlayoutObject()).signatureToPaint - 1;
            play(pitch);
            ed.save();

            NetbeansTextEditor.getInstance().selectPosition(pitch);
        } catch (Exception ex) {
View Full Code Here

            /*   if (!ne.getText(ne.getPositionEnd(el.jjtGetLastToken()) - 1, 1).equals(" ")) {
            space = space + " ";
            }*/
            int pos = NetbeansTextEditor.getInstance().getPositionEnd(el.jjtGetLastToken());
            UpdateNodeTask.getInstance().lastCurrent = null;
            ASTPitch out = new ASTPitch(ParserTreeConstants.JJTPITCH);

            NetbeansTextEditor.getInstance().insertAfterASTItem(el, s, out);
            NetbeansTextEditor.getInstance().selectPosition(ne.getPositionBegin(out.jjtGetFirstToken()) - 1, 0);

        }

//        NoteEditor.create((Note) getMarkierung()).noteEinfuegen(name, true, akkord);
    }
View Full Code Here

    public void noteEntfernen() {
        SimpleNode el = UpdateNodeTask.getInstance().getLastCurrent();
        if (el == null || el.id != ParserTreeConstants.JJTPITCH) {
            return;
        }
        ASTPitch pitch = (ASTPitch) el;

        NoteEditor ed = NoteEditor.create(pitch);

        gotoPrev();
        ed.delete();
View Full Code Here

        }

        //create temporary Pitch
        try {
            //Hohe relativ zu Vorgänger
            ASTPitch prev = (ASTPitch) node;
            pitch.noteHeight=noteHeight;
            pitch.absoluteHeight = noteHeight;
            if (!prev.isBreake() && !pitch.isBreake()) {
                int highPrev = prev.absoluteHeight;
                if (prev.jjtGetParent().id == ParserTreeConstants.JJTCHORD) {
                    highPrev = ((ASTPitch) prev.jjtGetParent().jjtGetChild(0)).absoluteHeight;
                }
                while (Math.abs(highPrev - pitch.absoluteHeight) > 3) {
                    if (pitch.absoluteHeight > highPrev) {
                        pitch.absoluteHeight -= 7;
                    } else {
                        pitch.absoluteHeight += 7;
                    }
                }
            }
            pitch.setBeattime(prev.getBeattime());
            pitch.clef = prev.clef;
            pitch.duration = prev.duration;

            pitch.durationDots = prev.durationDots;
            pitch.durationInteger = prev.durationInteger;

            pitch.lastBar = prev.lastBar;
            pitch.stemDirection = prev.stemDirection;
            pitch.jjtSetParent(prev.jjtGetParent());
            pitch.jjtGetParent().jjtAddChild(pitch, pitch.jjtGetParent().jjtGetNumChildren());
            pitch.setParentContext(prev.getParentContext());

            PitchLayout.testLayout(new LayoutEnv(), pitch);
            if (chordMode) {
                pitch.getlayoutObject().x = prev.getlayoutObject().x;
            } else {
                //move others
                prev.getlayoutObject().moveAllXInSameGroup(prev.getlayoutObject().x, pitch.getlayoutObject().distanceRight);
                pitch.getlayoutObject().x = prev.getlayoutObject().x + prev.getlayoutObject().distanceRight;
            }
        } catch (Exception exception) {
            exception.printStackTrace();
        }
        NetbeansTextEditor.getInstance().selectPosition(pitch);//.getAst().getOffset() + 1 + note.getAst().getLen(), s.length());
View Full Code Here

TOP

Related Classes of org.lilypondbeans.jccparser.ASTPitch

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.