Package org.joshy.sketch.pixel.model

Examples of org.joshy.sketch.pixel.model.PixelGraphics


    }

    @Override
    protected void mousePressed(MouseEvent event,  Point2D cursor) {
        PixelLayer layer = getContext().getDocument().getCurrentLayer();
        PixelGraphics g = layer.getGraphics();
        g.setFill(getContext().getDocument().getForegroundColor());
        g.fillPixel((int)cursor.getX(),(int)cursor.getY());
        getContext().getCanvas().redraw();
    }
View Full Code Here


    }

    @Override
    protected void mouseDragged(MouseEvent event,  Point2D cursor) {
        PixelLayer layer = getContext().getDocument().getCurrentLayer();
        PixelGraphics g = layer.getGraphics();
        g.setFill(getContext().getDocument().getForegroundColor());
        g.fillPixel((int)cursor.getX(),(int)cursor.getY());
        getContext().getCanvas().redraw();
    }
View Full Code Here

    }

    @Override
    protected void mousePressed(MouseEvent event, Point2D cursor) {
        PixelLayer layer = getContext().getDocument().getCurrentLayer();
        PixelGraphics g = layer.getGraphics();
        g.setFill(getContext().getDocument().getForegroundColor());
        g.fillOval((int)cursor.getX()-radius/2,(int)cursor.getY()-radius/2,radius,radius,smooth.isSelected());
        getContext().getCanvas().redraw();
    }
View Full Code Here

    }

    @Override
    protected void mouseDragged(MouseEvent event,  Point2D cursor) {
        PixelLayer layer = getContext().getDocument().getCurrentLayer();
        PixelGraphics g = layer.getGraphics();
        g.setFill(getContext().getDocument().getForegroundColor());
        g.fillOval((int)cursor.getX()-radius/2,(int)cursor.getY()-radius/2,radius,radius,smooth.isSelected());
        getContext().getCanvas().redraw();
    }
View Full Code Here

    }

    @Override
    protected void mouseReleased(MouseEvent event, Point2D cursor) {
        PixelLayer layer = getContext().getDocument().getCurrentLayer();
        PixelGraphics g = layer.getGraphics();
        g.setFill(getContext().getDocument().getForegroundColor());
        drawPixelLine(g,
                (int)startPoint.getX()
                ,(int)startPoint.getY()
                ,(int)currentPoint.getX()
                ,(int)currentPoint.getY()
View Full Code Here

TOP

Related Classes of org.joshy.sketch.pixel.model.PixelGraphics

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.