Package org.lilypondbeans.draw

Examples of org.lilypondbeans.draw.LayoutCalculator


            ASTScore score = root.reparse(1, false);

            if (score == null) {
                throw new ParseException("no scores found");
            }
            new LayoutCalculator(score, 80, 50).calcPositions();
            //  new DFSPrinter().print(root);
        } catch (ReparseException ex) {
            // Exceptions.printStackTrace(ex);
            parser.syntaxErrors.add(ex);
            Logger.getLogger(LyParser.class.getName()).log(Level.INFO, null, ex);
View Full Code Here


                view.paintImmediately(visRect.x, visRect.y, visRect.width, visRect.height);
                g2.drawImage(dragImage,
                        AffineTransform.getTranslateInstance(point.getLocation().getX(),
                        point.getLocation().getY()),
                        null);
                LayoutCalculator calc = UpdateNodeTask.getInstance().getLastScore().layoutCalculator;

                SimpleNode nd = calc.getElementAtPoint(point.x, point.y);
                current = nd;
                updateView();
                // NetbeansTextEditor.getInstance().selectPosition(nd);
                return ConnectorState.ACCEPT;
            }

            public void accept(Widget widget, Point point, Transferable transferable) {
                Image image = getImageFromTransferable(transferable);
                try {
                    Object o = null;
                    PaletteItem pal = (PaletteItem) transferable.getTransferData(ActiveEditorDrop.FLAVOR);
                    LayoutCalculator calc = UpdateNodeTask.getInstance().getLastScore().layoutCalculator;
                    SimpleNode el = calc.getElementAtPoint(point.x, point.y);

                    if (el == null) {
                        return;
                    }
View Full Code Here

        int v = staff.childContexts.indexOf(voice);
        int s = staff.number - 1;
        ASTContext toSearch = null;
        ASTScore score = (ASTScore) el.getParentContext().getContext(ASTContext.TYPE_SCORE);
        LayoutCalculator calc = score.layoutCalculator;
        int line = calc.getLine(el);
        if (v > 0) {
            toSearch = staff.childContexts.get(v - 1);
        } else if (s > 0) {
            toSearch = staff.getParentContext().childContexts.get(s - 1).childContexts.get(0);
        } else {//next Line
View Full Code Here

        ASTContext voice = el.getParentContext().getContext(ASTContext.TYPE_VOICE);
        ASTContext staff = voice.getContext(ASTContext.TYPE_STAFF);

        int v = staff.childContexts.indexOf(voice);
        int s = staff.number - 1;
        LayoutCalculator calc = ((ASTScore) el.getParentContext().getContext(ASTContext.TYPE_SCORE)).layoutCalculator;

        int line = calc.getLine(el);
        ASTContext toSearch = null;
        if (v < staff.childContexts.size() - 1) {
            toSearch = staff.childContexts.get(v + 1);
        } else if (s < staff.getParentContext().childContexts.size() - 1) {
            toSearch = staff.getParentContext().childContexts.get(s + 1).childContexts.get(0);
        } else {//next Line


            if (line >= calc.getLinePosition().length) {
                return;
            } else {
                line++;
                ASTScore score = (ASTScore) el.getParentContext().getContext(ASTContext.TYPE_SCORE);
View Full Code Here

        System.out.println(String.valueOf(x) + ":" + String.valueOf(y));
        if (UpdateNodeTask.getInstance().getLastScore() == null) {
            markFirstPitchBlock();
            return;
        }
        LayoutCalculator calc = UpdateNodeTask.getInstance().getLastScore().layoutCalculator;

        SimpleNode nd = calc.getElementAtPoint(x, y);
        /*    if (nd.id == ParserTreeConstants.JJTCLEF) {
        int line = calc.getLine(nd);
        if (line == 0 && !calc.hasPitches()) {
        markFirstPitchBlock();
        return;
View Full Code Here

        }
        // root.dump("");
        ASTScore score = root.reparse(1, midi);

        if (!midi) {
            new LayoutCalculator(score, 10, 80).calcPositions();
            for (org.lilypondbeans.jccparser.ParseException ex : parser.syntaxErrors) {
                throw ex;
            }
        }
        return score;
View Full Code Here

TOP

Related Classes of org.lilypondbeans.draw.LayoutCalculator

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.