Package com.sun.star.drawing

Examples of com.sun.star.drawing.XDrawPage


  public static XControlShape insertControlShape( XComponent oDoc, int height,
                                        int width, int x, int y, String kind ) {

        XControlShape aShape = createControlShape(oDoc,height,width,x,y,kind);
        XDrawPage oDP = DrawTools.getDrawPage(oDoc,0);
        DrawTools.getShapes(oDP).add(aShape);
        return aShape;
    }
View Full Code Here


     * @param nr the index of the DrawPage
     * @return the XDrawpage with index nr of the document
    */            

    public static XDrawPage getDrawPage ( XComponent aDoc, int nr ) {
        XDrawPage oDP = null;
        try {
            oDP = (XDrawPage) AnyConverter.toObject(
                new Type(XDrawPage.class),getDrawPages( aDoc ).getByIndex( nr ));
        } catch ( Exception e ) {
            throw new IllegalArgumentException( "Couldn't get drawpage" );
View Full Code Here

        SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) Param.getMSF()));
        String objName = "HiddenControl";
        XInterface ctrl = SOF.createControl(xDrawDoc, objName);

        try {
            XDrawPage oDP = DrawTools.getDrawPage(xDrawDoc, 0);

            XNameContainer nc = FormTools.getForms(oDP);
            FormTools.insertForm(xDrawDoc, nc, "OHiddenModelForm");

            Object frm = nc.getByName("OHiddenModelForm");
View Full Code Here

        // knitt them
        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
View Full Code Here

            // get internal service factory of the document
            XMultiServiceFactory xCalcFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(
                XMultiServiceFactory.class, xCalcComponent);
            // get Drawpage
            XDrawPageSupplier xDrawPageSupplier = (XDrawPageSupplier)UnoRuntime.queryInterface(XDrawPageSupplier.class, sheet);
            XDrawPage xDrawPage = xDrawPageSupplier.getDrawPage();

            // create and insert RectangleShape and get shape text, then manipulate text
            Object calcShape = xCalcFactory.createInstance(
                "com.sun.star.drawing.RectangleShape");
            XShape xCalcShape = (XShape)UnoRuntime.queryInterface(
                XShape.class, calcShape);
            xCalcShape.setSize(new Size(10000, 10000));
            xCalcShape.setPosition(new Point(7000, 3000));

            xDrawPage.add(xCalcShape);

            XPropertySet xShapeProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, calcShape);
            // wrap text inside shape
            xShapeProps.setPropertyValue("TextContourFrame", new Boolean(true));
View Full Code Here

            Object drawPages = xDrawPagesSupplier.getDrawPages();
            XIndexAccess xIndexedDrawPages = (XIndexAccess)UnoRuntime.queryInterface(
                XIndexAccess.class, drawPages);
            Object drawPage = xIndexedDrawPages.getByIndex(0);
            XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(XDrawPage.class, drawPage);

            // get internal service factory of the document
            XMultiServiceFactory xDrawFactory =
                (XMultiServiceFactory)UnoRuntime.queryInterface(
                    XMultiServiceFactory.class, xDrawComponent);

            Object drawShape = xDrawFactory.createInstance(
                "com.sun.star.drawing.RectangleShape");
            XShape xDrawShape = (XShape)UnoRuntime.queryInterface(XShape.class, drawShape);
            xDrawShape.setSize(new Size(10000, 20000));
            xDrawShape.setPosition(new Point(5000, 5000));
            xDrawPage.add(xDrawShape);

            XText xShapeText = (XText)UnoRuntime.queryInterface(XText.class, drawShape);
            XPropertySet xShapeProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, drawShape);
View Full Code Here

    protected TestEnvironment createTestEnvironment
            (TestParameters tParam, PrintWriter log) {

        XInterface oObj = null;
        //XShape oShape = null;
        XDrawPage oPage = null;

        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println( "creating a test environment" );
View Full Code Here

        m_aTestHelper.Error( "There must be at least one page in the document!" );
        return false;
      }

      Object oPage = xDrawPages.getByIndex( 0 );
      XDrawPage xPage = (XDrawPage) UnoRuntime.queryInterface( XDrawPage.class, oPage );
      if ( xPage == null )
      {
        m_aTestHelper.Error( "Can not get access to drawing page!" );
        return false;
      }
 
      XMultiServiceFactory xDrFactory = ( XMultiServiceFactory ) UnoRuntime.queryInterface( XMultiServiceFactory.class,
                                                  oDoc );
      if ( xDrFactory == null )
      {
        m_aTestHelper.Error( "Can not get drawing factory!" );
        return false;
      }

      Object oShape = xDrFactory.createInstance( "com.sun.star.drawing.OLE2Shape" );
      XShape xShape = ( XShape ) UnoRuntime.queryInterface( XShape.class, oShape );
      if ( xShape == null )
      {
        m_aTestHelper.Error( "Can not create new shape!" );
        return false;
      }

      XPropertySet xShapeProps = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, oShape );
      if ( xShapeProps == null )
      {
        m_aTestHelper.Error( "Can not get access to shapes properties!" );
        return false;
      }

      xPage.add( xShape );
      xShapeProps.setPropertyValue( "CLSID", "078B7ABA-54FC-457F-8551-6147e776a997" );

      Object oEmbObj = xShapeProps.getPropertyValue( "EmbeddedObject" );
      XEmbeddedObject xEmbObj = ( XEmbeddedObject ) UnoRuntime.queryInterface( XEmbeddedObject.class, oEmbObj );
      if ( xEmbObj == null )
View Full Code Here

            XDrawPages set = supp.getDrawPages();

            // This is an XML-export BUG (new slide named "NewSlide2" can not be exported to XML)
            set.insertNewByIndex(1);

            XDrawPage page1 = (XDrawPage)
                UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0));
            XNamed NPage1 = (XNamed)
                UnoRuntime.queryInterface(XNamed.class,page1);
            NPage1.setName("NewSlide1");
            XDrawPage page2 = (XDrawPage)
                UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1));
            XNamed NPage2 = (XNamed)
                UnoRuntime.queryInterface(XNamed.class,page2);
            NPage2.setName("NewSlide2");
View Full Code Here

            XDrawPagesSupplier oDPS =  UnoRuntime.queryInterface(
                                              XDrawPagesSupplier.class,
                                              xSheetDoc);
            XDrawPages oDP =  oDPS.getDrawPages();
            XDrawPage firstDrawPage =  UnoRuntime.queryInterface(
                                              XDrawPage.class,
                                              oDP.getByIndex(0));

            final XMultiServiceFactory xMsf = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
            SOfficeFactory SOF = SOfficeFactory.getFactory(xMsf);
View Full Code Here

TOP

Related Classes of com.sun.star.drawing.XDrawPage

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.