Package org.joshy.sketch.actions

Examples of org.joshy.sketch.actions.UndoableAddNodeAction


            return;
        } else {
            if(node == null) return;
            SketchDocument doc = context.getDocument();
            doc.getCurrentPage().add(node);
            context.getUndoManager().pushAction(new UndoableAddNodeAction(context,node,"Ngon"));
            context.getSelection().setSelectedNode(node);
            node = null;
            start = null;
            context.redraw();
            context.releaseControl();
View Full Code Here


        if(!notInMainDocument) {
            SketchDocument doc = context.getDocument();
            doc.getCurrentPage().add(textNode);
            context.getSelection().setSelectedNode(textNode);
        }
        context.getUndoManager().pushAction(new UndoableAddNodeAction(context,textNode,"text"));
        this.notInMainDocument = false;
    }
View Full Code Here

        if(!notInMainDocument) {
            SketchDocument doc = context.getDocument();
            doc.getCurrentPage().add(textNode);
            context.getSelection().setSelectedNode(textNode);
        }
        context.getUndoManager().pushAction(new UndoableAddNodeAction(context,textNode,"text"));
        textNode = null;
        this.notInMainDocument = false;
    }
View Full Code Here

            setDefaultCursor();
            if(node != null) {
                if(!editingExisting) {
                    SketchDocument doc = context.getDocument();
                    doc.getCurrentPage().add(node);
                    context.getUndoManager().pushAction(new UndoableAddNodeAction(context,node,"path"));
                }
                node = null;
                clear();
                editingExisting = false;
            }
View Full Code Here

        if(node == null) {
            node = new SPath();
            currentPoint = new SPath.PathPoint(start.x,start.y);
            currentPoint.startPath = true;
            node.addPoint(currentPoint);
            context.getUndoManager().pushAction(new UndoableAddNodeAction(context,node,"path"));
            context.redraw();
            return;
        }

        if(selectedPoint != null && (defaultTool == Tool.Move || defaultTool == Tool.Reshape)) {
View Full Code Here

        cursor = snapPoint(cursor);
        node = new SArrow(cursor,cursor);
        node.setStrokeWidth(3);
        node.setFillPaint(FlatColor.BLACK);
        context.getDocument().getCurrentPage().add(node);
        context.getUndoManager().pushAction(new UndoableAddNodeAction(context,node,"arrow"));
        context.redraw();
    }
View Full Code Here

        cursor = snapToGrid(cursor);
        start = cursor;

        SketchDocument doc = context.getDocument();
        doc.getCurrentPage().add(node);
        context.getUndoManager().pushAction(new UndoableAddNodeAction(context, node,"node"));
        context.redraw();
    }
View Full Code Here

            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"));
            point = new Point2D.Double();
            point.setLocation(cursor);
            poly.addPoint(point);
            context.redraw();
        } else {
View Full Code Here

TOP

Related Classes of org.joshy.sketch.actions.UndoableAddNodeAction

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.