Package org.antlr.works.visualization.graphics

Examples of org.antlr.works.visualization.graphics.GContext.drawString()


    public static void draw(GNode node) {
        GContext context = node.getContext();
        context.setColor(context.nodeColor);
        float r = context.getPixelNodeWidth()/2;
        context.drawCircle(node.getX()+r, node.getY(), r, true);
        context.drawString(context.getBoxFont(), node.state.toString(), node.getX()+r, node.getY(), GContext.ALIGN_CENTER);
    }

    public static boolean nodeContainsPoint(GNode node, Point p) {
        float nr = node.getContext().getPixelNodeWidth()/2;
        double r = Math.sqrt(Math.pow(p.x-node.getX()-nr, 2)+Math.pow(p.y-node.getY(), 2));
View Full Code Here


                font = context.getRuleFont();
            else
                font = context.getBoxFont();

            context.setColor(context.getColorForLabel(link.transition.label));           
            context.drawString(font, link.transition.label, sx+(tx-sx)/2, sy-2, GContext.ALIGN_CENTER_UP);
        }
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.