Package com.sun.star.drawing

Examples of com.sun.star.drawing.XDrawPages


            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
                    XDrawPagesSupplier supp = (XDrawPagesSupplier)
                        UnoRuntime.queryInterface
                        (XDrawPagesSupplier.class, xDrawDoc);
                    final XDrawPages xPages = supp.getDrawPages();
                    XNamed[] pageArray = new XNamed[ xPages.getCount() ];
                    for (int i=0; i < xPages.getCount(); i++) {
                        try {
                            pageArray[i] = (XNamed) UnoRuntime.queryInterface
                                (XNamed.class, xPages.getByIndex(i));
                        } catch (com.sun.star.uno.Exception e) {
                            e.printStackTrace(fLog) ;
                            throw new StatusException
                                ("Can't get page name by index.", e) ;
                        }
                    }
                    fLog.println("Slide names after import:");
                    for ( int i = 0; i < xPages.getCount(); i++ ) {
                        if ((pageArray[i].getName().equals("NewSlide1"))
                            || (pageArray[i].getName().equals("NewSlide2"))) {
                            fLog.println("  " + pageArray[i].getName());
                        }
                        else {
View Full Code Here


        tEnv.addObjRelation("XDocumentHandler.XMLData", xml);

        //get draw pages
        XDrawPagesSupplier drawPagesSupplier = (XDrawPagesSupplier)
            UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
        XDrawPages drawPages = drawPagesSupplier.getDrawPages();
        final XNameAccess xNamePages = (XNameAccess)
            UnoRuntime.queryInterface(XNameAccess.class, drawPages);

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
View Full Code Here

                UnoRuntime.queryInterface(XExporter.class,oObj);
            //xEx.setSourceDocument(xDrawDoc);

            XDrawPagesSupplier supp = (XDrawPagesSupplier)
                UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
            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");
            xEx.setSourceDocument(xDrawDoc);
        } catch (com.sun.star.uno.Exception e) {
View Full Code Here

                public boolean checkImport() {
                    try {
                        XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier)
                            UnoRuntime.queryInterface
                            (XDrawPagesSupplier.class, xImpressDoc) ;
                        XDrawPages xPages = xPagesSup.getDrawPages() ;
                        XNamed xPageName = (XNamed) UnoRuntime.queryInterface
                            (XNamed.class, xPages.getByIndex(0)) ;
                        String gName = xPageName.getName() ;
                        logF.println("Page name returned = '" + gName + "'") ;
                        return impPageName.equals(gName) ;
                    } catch (com.sun.star.uno.Exception e) {
                        logF.println("Exception occured while checking filter :") ;
View Full Code Here

     */
    protected TestEnvironment createTestEnvironment(TestParameters tParam,
                                                    PrintWriter log) {
        XInterface oObj = null;
        XShape oShape = null;
        XDrawPages oDP = null;

        XComponent xComp = (XComponent) UnoRuntime.queryInterface(
                                   XComponent.class, xDoc);


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

        try {
            log.println("getting Drawpages");

            XDrawPagesSupplier oDPS = (XDrawPagesSupplier) UnoRuntime.queryInterface(
                                              XDrawPagesSupplier.class, xDoc);
            oDP = (XDrawPages) oDPS.getDrawPages();
            oDP.insertNewByIndex(1);
            oDP.insertNewByIndex(2);
            oObj = (XDrawPage) AnyConverter.toObject(new Type(XDrawPage.class),
                                                     oDP.getByIndex(0));

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

            oShape = SOF.createShape(xComp, 5000, 3500, 7500, 5000,
View Full Code Here

                "com.sun.star.comp.Draw.XMLExporter", new Object[] {arg});


            XDrawPagesSupplier supp = (XDrawPagesSupplier)
                UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
            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");

            XExporter xEx = (XExporter)
View Full Code Here

         
         
          XDrawPagesSupplier pagesSupplier = (XDrawPagesSupplier) UnoRuntime
              .queryInterface(XDrawPagesSupplier.class, component);
          //System.out.println(pagesSupplier.toString());       
          XDrawPages pages = pagesSupplier.getDrawPages();
          int nbPages = pages.getCount();
               
         
          for (int i = 0; i < nbPages; i++) {
                     
            XDrawPage page = (XDrawPage) UnoRuntime.queryInterface(
                com.sun.star.drawing.XDrawPage.class, pages
                    .getByIndex(i));
           
            XNamed xPageName = (XNamed)UnoRuntime.queryInterface(XNamed.class,page);
           
            xPageName.setName("slide"+(i+1));
View Full Code Here

     
     
      XDrawPagesSupplier pagesSupplier = (XDrawPagesSupplier) UnoRuntime
      .queryInterface(XDrawPagesSupplier.class, document);
      //System.out.println(pagesSupplier.toString());       
      XDrawPages pages = pagesSupplier.getDrawPages();
      int nbPages = pages.getCount();
      String[] slidenames = new String[nbPages];
      Arrays.fill(slidenames,"");
     
      for (int i = 0; i < nbPages; i++) {
       
        XDrawPage page = (XDrawPage) UnoRuntime.queryInterface(
            com.sun.star.drawing.XDrawPage.class, pages
                .getByIndex(i));
        // get all the page shapes
        XShapes xShapes = (XShapes)UnoRuntime.queryInterface(XShapes.class, page);
        int top = 0;
        String slidename = "";
View Full Code Here

   */
  private XDrawPage findMasterPage(String style) throws ImpressException {
    try {
      XMasterPagesSupplier xMasterPageSupplier = unoCast(
          XMasterPagesSupplier.class, component);
      XDrawPages xMasterPages = xMasterPageSupplier.getMasterPages();
      for (int i = 0; i < xMasterPages.getCount(); i++) {
        XDrawPage xMasterPage = unoCast(XDrawPage.class, xMasterPages
            .getByIndex(i));
        XPropertySet masterSet = unoCast(XPropertySet.class,
            xMasterPage);

        if (style.equals(masterSet.getPropertyValue("LinkDisplayName"))) {
View Full Code Here

            throw new StatusException("Couldn't create document", e);
        }
       
        XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
            UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
        XDrawPages the_pages = oDPS.getDrawPages();
        XIndexAccess oDPi = (XIndexAccess)
            UnoRuntime.queryInterface(XIndexAccess.class,the_pages);

        XModel aModel = (XModel)
            UnoRuntime.queryInterface(XModel.class, xImpressDoc);
View Full Code Here

TOP

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

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.