Package org.joshy.sketch.tools

Source Code of org.joshy.sketch.tools.DrawOvalTool

package org.joshy.sketch.tools;

import org.joshy.gfx.draw.FlatColor;
import org.joshy.gfx.draw.GFX;
import org.joshy.gfx.event.KeyEvent;
import org.joshy.gfx.event.MouseEvent;
import org.joshy.sketch.modes.vector.VectorDocContext;
import org.joshy.sketch.model.SOval;

import java.awt.geom.Point2D;

/**
* Draw a new oval as a resizable node
*/
public class DrawOvalTool extends DrawTool {

    public DrawOvalTool(VectorDocContext context) {
        super(context);
    }

    @Override
    public void call(KeyEvent event) {
    }

    @Override
    protected void mousePressed(MouseEvent event, Point2D.Double cursor) {
        node = new SOval(0,0,0.0,0.0);
        node.setTranslateX(cursor.getX());
        node.setTranslateY(cursor.getY());
        node.setFillPaint(FlatColor.GRAY);
        super.mousePressed(event, cursor);
    }

    public void drawOverlay(GFX g) {
       
    }
}
TOP

Related Classes of org.joshy.sketch.tools.DrawOvalTool

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.