Package org.locationtech.udig.tools.edit.behaviour.CreateShapeBehaviour

Examples of org.locationtech.udig.tools.edit.behaviour.CreateShapeBehaviour.ShapeFactory


    @Test
    public void testIsValid() throws Exception {
        TestHandler handler=new TestHandler();
       
        CreateShapeBehaviour behav=new CreateShapeBehaviour(new ShapeFactory(){
            @Override
            public GeneralPath create( int width, int height ) {
                GeneralPath path=new GeneralPath();
                path.append(new Rectangle(width, height), false);
                return path;
View Full Code Here


        PrimitiveShape shell = editBlackboard.getGeoms().get(0).getShell();
        editBlackboard.addPoint(100,100,shell);
        shell.getEditGeom().setShapeType(ShapeType.POINT);
        editBlackboard.newGeom("newone", null); //$NON-NLS-1$
       
        CreateShapeBehaviour behav=new CreateShapeBehaviour(new ShapeFactory(){
            @Override
            public GeneralPath create( int width, int height ) {
                GeneralPath path=new GeneralPath();
                path.append(new Rectangle(width, height), false);
                return path;
View Full Code Here

    @Test
    public void testDonut() throws Exception {
        TestHandler handler=new TestHandler();
       
        CreateShapeBehaviour behav=new CreateShapeBehaviour(new ShapeFactory(){
            @Override
            public GeneralPath create( int width, int height ) {
               
                Rectangle2D shell =new Rectangle2D.Float(0,0,width,height);
                float i = ((float)width)/4;
View Full Code Here

* @since 1.1.0
*/
public class EllipseTool extends RectangleTool {
    @Override
    protected ShapeFactory getShapeFactory() {
        ShapeFactory ret = new CreateShapeBehaviour.ShapeFactory() {

            @Override
            public GeneralPath create(int width, int height) {
                GeneralPath path=new GeneralPath();
                path.append(new Ellipse2D.Float(-width, -height,2*width, 2*height), false);
                return path;
            }
           
        };
        ret.setMiddleAsOrigin(true);
        return ret;

    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.tools.edit.behaviour.CreateShapeBehaviour.ShapeFactory

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.