Package org.joshy.sketch.model

Examples of org.joshy.sketch.model.SPoly


    }

    @Override
    protected void mousePressed(MouseEvent event, Point2D.Double cursor) {
        if(poly == null) {
            poly = new SPoly();
            poly.addPoint(snapPoint(cursor));
            hotspot = cursor;
            SketchDocument doc = (SketchDocument) context.getDocument();
            doc.getCurrentPage().add(poly);
            context.getUndoManager().pushAction(new UndoableAddNodeAction(context,poly,"polygon"));
View Full Code Here


        //check that the first node is a group
        assertTrue(doc.getPages().get(0).getModel().get(0) instanceof SGroup);
        //go down the tree to the polygon
        SGroup g1 = (SGroup) doc.getPages().get(0).getModel().get(0);
        SGroup g2 = (SGroup) g1.getNodes().get(1);
        SPoly p1 = (SPoly) g2.getNodes().get(0);
        //test the color of the polygon
        assertTrue(p1.getFillPaint() instanceof FlatColor);
        FlatColor c1 = (FlatColor) p1.getFillPaint();
        assertTrue(c1.getRGBA() == 0xFF231F20);
    }
View Full Code Here

TOP

Related Classes of org.joshy.sketch.model.SPoly

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.