Examples of XShapes


Examples of com.sun.star.drawing.XShapes

        SOfficeFactory SOF = SOfficeFactory.getFactory(
                                    (XMultiServiceFactory)Param.getMSF());

        //put something on the masterpage
        log.println( "inserting some Shapes" );
        XShapes oShapes = (XShapes)
            UnoRuntime.queryInterface(XShapes.class, oObj);
        oShapes.add(SOF.createShape(xDrawDoc, 2000, 1500, 1000, 1000, "Line"));
        oShapes.add(SOF.createShape
            (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"));
        oShapes.add(SOF.createShape
            (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle"));

        log.println( "creating a new environment for MasterPage object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );
View Full Code Here

Examples of com.sun.star.drawing.XShapes

            throw new StatusException("Couldn't get DrawPage", e);
        }

        //put something on the drawpage
        log.println( "inserting some Shapes" );
        XShapes oShapes = (XShapes)
            UnoRuntime.queryInterface(XShapes.class, oDrawPage);
        XShape shape1 = SOF.createShape(
            xImpressDoc, 5000, 3500, 7500, 5000, "Rectangle");
        oShapes.add(shape1);
       
        oShapes = (XShapes)
            UnoRuntime.queryInterface(XShapes.class, secondDrawPage);
        shape1 = SOF.createShape(
            xImpressDoc, 3000, 4500, 15000, 1000, "Ellipse");
        oShapes.add(shape1);

        XModel aModel = (XModel)
            UnoRuntime.queryInterface(XModel.class, xImpressDoc);

        XInterface oObj = aModel.getCurrentController();
View Full Code Here

Examples of com.sun.star.drawing.XShapes

            throw new StatusException("Couldn't get DrawPage", e);
        }

        //put something on the drawpage
        log.println( "inserting some Shapes" );
        XShapes oShapes = (XShapes)
            UnoRuntime.queryInterface(XShapes.class, oDrawPage);
        XShape shape1 = SOF.createShape(
            xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
        XShape shape2 = SOF.createShape(
            xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
        XShape shape3 = SOF.createShape(
            xDrawDoc, 3000, 500, 5000, 1000, "Line");
        oShapes.add(shape1);
        oShapes.add(shape2);
        oShapes.add(shape3);
        shortWait();

        log.println("switch to PresentationView...");
        try{
            utils.dispatchURL(xMSF, xDrawDoc, ".uno:DiaMode");
        } catch (Exception e){
            e.printStackTrace(log);
            throw new StatusException(Status.failed(e.toString()));
        }

        utils.shortWait(500);
       
        XModel aModel = (XModel)
            UnoRuntime.queryInterface(XModel.class, xDrawDoc);

        XInterface oObj = aModel.getCurrentController();

        log.println("bring first document to front...");
        DesktopTools.bringWindowToFromt(aModel);
       
        XModel aModel2 = (XModel)
            UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);

        XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
                                XWindow.class,aModel2.getCurrentController());

        log.println( "creating a new environment for impress view object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );

        if (anotherWindow != null) {
            tEnv.addObjRelation("XWindow.AnotherWindow",anotherWindow);
        }

        Object oShapeCol1 = null;
        Object oShapeCol2 = null;
        try {
            oShapeCol1 = xMSF.
                createInstance("com.sun.star.drawing.ShapeCollection");
            oShapeCol2 = xMSF.
                createInstance("com.sun.star.drawing.ShapeCollection");
        } catch(com.sun.star.uno.Exception e) {
            e.printStackTrace(log);
            throw new StatusException(Status.failed("Couldn't create instance"));
        }

        XShapes xShapes1 = (XShapes)
            UnoRuntime.queryInterface(XShapes.class, oShapeCol1);
        XShapes xShapes2 = (XShapes)
            UnoRuntime.queryInterface(XShapes.class, oShapeCol2);
        xShapes1.add(shape2);
        xShapes1.add(shape3);
        xShapes2.add(shape1);
        shortWait();
       
        tEnv.addObjRelation("Selections", new Object[] {
            oDrawPage, oShapeCol1, oShapeCol2});
        tEnv.addObjRelation("Comparer", new Comparator() {
View Full Code Here

Examples of com.sun.star.drawing.XShapes

    public void _attachShapeToLayer() {
        requiredMethod("insertNewByIndex()");
        shape = (XInstCreator)tEnv.getObjRelation("Shape");
        oShape = shape.createInstance();
        XShape oSh = (XShape) oShape;
        XShapes oShapes = (XShapes) tEnv.getObjRelation("Shapes");
        oShapes.add(oSh);
        boolean result = false;

        log.println("attachShapeToLayer() ... ");

        oObj.attachShapeToLayer((XShape) oShape,oL);
View Full Code Here

Examples of com.sun.star.drawing.XShapes

            XDrawPageSupplier oDPS = (XDrawPageSupplier)
                UnoRuntime.queryInterface(XDrawPageSupplier.class, oDoc);
            oDP = oDPS.getDrawPage();
            }
            XShapes shapes = (XShapes) UnoRuntime.queryInterface
                (XShapes.class, oDP);
            XShape button = FormTools.createControlShape
                (oDoc, 100, 100, 10000, 50000, "CommandButton");
            shapes.add(button);

            XControlModel CM = ((XControlShape)button).getControl();
            log.println("Getting ControlModel "
                + ((CM == null) ? "FAILED" : "OK"));
View Full Code Here

Examples of com.sun.star.drawing.XShapes

        xShape.setControl( xModel );

        // add the shape to the shapes collection of the document
        XDrawPage pageWhereToInsert = ( m_insertPage != -1 ) ? m_document.getDrawPage( m_insertPage ) : m_document.getMainDrawPage();

        XShapes xDocShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, pageWhereToInsert );
        xDocShapes.add( xShape );

        // some initializations which are the same for all controls
        XPropertySet xModelProps = UNO.queryPropertySet( xModel );
        try
        {
View Full Code Here

Examples of com.sun.star.drawing.XShapes

    }

    public XShape groupShapesTogether(XMultiServiceFactory _xMSF, XShape _xLabelShape, XShape _xControlShape){
       try {
           Object oGroupShape = _xMSF.createInstance("com.sun.star.drawing.ShapeCollection");
           XShapes xShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oGroupShape);
           xShapes.add(_xLabelShape);
           xShapes.add(_xControlShape);
           return this.xShapeGrouper.group(xShapes);
       } catch (Exception e) {
           e.printStackTrace(System.out);
           return null;
       }}
View Full Code Here

Examples of com.sun.star.drawing.XShapes

        xShape.setControl( xModel );

        // add the shape to the shapes collection of the document
        XDrawPage pageWhereToInsert = ( m_page != null ) ? m_page : m_document.getMainDrawPage();

        XShapes xDocShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, pageWhereToInsert );
        xDocShapes.add( xShape );

        // and outta here with the XPropertySet interface of the model
        XPropertySet xModelProps = dbfTools.queryPropertySet( xModel );
        return xModelProps;
    }
View Full Code Here

Examples of com.sun.star.drawing.XShapes

            failed("Couldn't create test environment");
        }

        //get a Shape
        log.println( "getting Shape" );
        XShapes oShapes = (XShapes) UnoRuntime.queryInterface
            (XShapes.class, oDP);
        XInterface oObj = SOF.createShape
            (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle");
        for (int i=0; i < 10; i++) {
            oShapes.add(
                SOF.createShape(xDrawDoc,
                    5000, 3500, 7510 + 10 * i, 5010 + 10 * i, "Rectangle"));
        }
        XShape oShape = SOF.createShape
            (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse");
        oShapes.add((XShape) oObj);
        oShapes.add((XShape) oShape);


        XPropertySet oShapeProps = (XPropertySet)
            UnoRuntime.queryInterface(XPropertySet.class, oObj);
        XStyle aStyle = null;
View Full Code Here

Examples of com.sun.star.drawing.XShapes

    public synchronized TestEnvironment createTestEnvironment(
            TestParameters Param, PrintWriter log ) throws StatusException {
        XInterface oObj = null;
        XDrawPageSupplier XDPSupp;
        XDrawPage xDP = null;
        XShapes oShapes = null;

        log.println( "creating a test environment" );
        SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() );
        XDPSupp = (XDrawPageSupplier) UnoRuntime.queryInterface
            (XDrawPageSupplier.class, xTextDoc);
        xDP = XDPSupp.getDrawPage();
        oObj = xDP;

        //dbg.printInterfaces(oObj);
        //System.exit(0);

        log.println( "inserting some Shapes" );
        oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oObj);
        oShapes.add(SOF.createShape(xTextDoc,2000,1500,1000,1000,"Line"));
        oShapes.add(SOF.createShape(xTextDoc,3000,4500,15000,1000,"Ellipse"));
        oShapes.add(SOF.createShape(xTextDoc,5000,3500,7500,5000,"Rectangle"));

        log.println( "creating a new environment for bodytext object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );

        ShapeDsc sDsc = new ShapeDsc(15000,13500,7500,10000,"Rectangle");
View Full Code Here
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.