Examples of XDrawPage


Examples of com.sun.star.drawing.XDrawPage

      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;
View Full Code Here

Examples of com.sun.star.drawing.XDrawPage

      // Parcours des pages du document
      for (int i = 0; i < componentPages.getCount(); i++) {
        Object objPage = componentPages.getByIndex(i);
        // Chaque page est une page !!!
        XDrawPage page = unoCast(XDrawPage.class, objPage);

        XPropertySet pageSet = unoCast(XPropertySet.class, page);
        Short pageNumber = (Short) pageSet.getPropertyValue("Number");

        // Shapes de titre
        XShape shape = findShapeByType(page, SHAPE_TYPE_TITLETEXT);

        if (shape != null) {
          XSimpleText xSimpleText = unoCast(XSimpleText.class, shape);

          // Recherche du nom de la page maitresse (= style de
          // page)
          XMasterPageTarget xMasterPageTarget = unoCast(
              XMasterPageTarget.class, page);
          XDrawPage xMasterPage = xMasterPageTarget.getMasterPage();
          XPropertySet masterSet = unoCast(XPropertySet.class,
              xMasterPage);

          // Ajout de la page a la liste de resultat
          try {
View Full Code Here

Examples of com.sun.star.drawing.XDrawPage

  }

  public int addSlide(int page, String title, String style)
      throws ImpressException {
    XDrawPage newPage = componentPages.insertNewByIndex(page);

    XMasterPageTarget xMasterPageTarget = unoCast(XMasterPageTarget.class,
        newPage);
    xMasterPageTarget.setMasterPage(findMasterPage(style));
View Full Code Here

Examples of com.sun.star.drawing.XDrawPage

    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

Examples of com.sun.star.drawing.XDrawPage

   * @param index
   * @return
   * @throws ImpressException
   */
  public XDrawPage findNotesPageByIndex(int index) throws ImpressException {
    XDrawPage page = findPageByIndex(index);
    XPresentationPage xPresentationPage = unoCast(XPresentationPage.class,
        page);
    return xPresentationPage.getNotesPage();

  }
View Full Code Here

Examples of com.sun.star.drawing.XDrawPage

   */
  public void writeTOC(int sommaireIndex, TocDesc toc)
      throws ImpressException {
    BundleHelper bundle = BundleHelper.getInstance();

    XDrawPage notesPage = findNotesPageByIndex(sommaireIndex);

    // Suppression du shape principal
    notesPage.remove(findShapeByType(notesPage, SHAPE_TYPE_PAGE));
    // Mise en forme du shape de notes
    XShape notesShape = findShapeByType(notesPage, SHAPE_TYPE_NOTES);
    int xmargin = bundle.getTocXMargin() * 100;
    int ymargin = bundle.getTocYMargin() * 100;
    try {
View Full Code Here

Examples of com.sun.star.drawing.XDrawPage

      throws ImpressException {

    try {
      BundleHelper bundle = BundleHelper.getInstance();

      XDrawPage planPage = findPageByIndex(planIndex);

      // Shape de titre
      XShape titleShape = findShapeByType(planPage, SHAPE_TYPE_TITLETEXT);
      if (titleShape != null) {
        XSimpleText titleText = unoCast(XSimpleText.class, titleShape);
        titleText.setString(bundle.getShortTocTitle());
      }

      // Shape principal
      XShape mainShape = findShapeByType(planPage, SHAPE_TYPE_OUTLINER);
      if (mainShape != null) {
        XSimpleText mainText = unoCast(XSimpleText.class, mainShape);

        XTextCursor cursor = mainText.createTextCursor();
        cursor.getStart();

        XPropertySet xCursorProps = unoCast(XPropertySet.class, cursor);
        TabStop[] tabStops = new TabStop[1];
        tabStops[0] = new TabStop(bundle.getShortTocTabulation(),
            TabAlign.RIGHT, ',', '.');
        xCursorProps.setPropertyValue("ParaTabStops", tabStops);

        StringBuilder planBuilder = new StringBuilder();
        String newLine = "";
        for (SlideDesc slide : toc.getAllSlides()) {
          if (slide.getLevel() == 1) {
            planBuilder.append(newLine);
            planBuilder.append(slide.getTitle());
            planBuilder.append("\t");
            planBuilder.append(slide.getPage());
            newLine = "\n";
          }
        }
        mainText.setString(planBuilder.toString());

      }

      // Shape de notes
      XPresentationPage xPresentationPage = unoCast(
          XPresentationPage.class, planPage);
      XDrawPage planNotesPage = xPresentationPage.getNotesPage();
      XShape notesShape = findShapeByType(planNotesPage, SHAPE_TYPE_NOTES);
      if (notesShape != null) {
        XSimpleText notesText = unoCast(XSimpleText.class, notesShape);
        notesText.setString(bundle.getShortTocNotesText());
      }
View Full Code Here

Examples of com.sun.star.drawing.XDrawPage

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

Examples of com.sun.star.drawing.XDrawPage

            UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc);
        XDrawPages the_pages = oDPS.getDrawPages();
        XIndexAccess oDPi = (XIndexAccess)
            UnoRuntime.queryInterface(XIndexAccess.class,the_pages);

        XDrawPage oDrawPage = null;
        try {
            oDrawPage = (XDrawPage) AnyConverter.toObject(
                        new Type(XDrawPage.class),oDPi.getByIndex(0));
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace( log );
            throw new StatusException("Couldn't get DrawPage", e);
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            e.printStackTrace( log );
            throw new StatusException("Couldn't get DrawPage", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace( log );
            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();

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

        XInterface oObj = aModel.getCurrentController();

        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);
        }


        tEnv.addObjRelation("Selections", new Object[] {
            shape1, shape2, shape3});           


        tEnv.addObjRelation("Pages", the_pages);

        //Adding ObjRelations for XController
        tEnv.addObjRelation("FirstModel", aModel);

        tEnv.addObjRelation("XUserInputInterception.XModel", aModel);
       
        XFrame the_frame = the_Desk.getCurrentFrame();
        tEnv.addObjRelation("Frame", the_frame);

         aModel = (XModel)
            UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
        //Adding ObjRelations for XController
        tEnv.addObjRelation("SecondModel", aModel);

        XController secondController = aModel.getCurrentController();
        tEnv.addObjRelation("SecondController", secondController);
        tEnv.addObjRelation("XDispatchProvider.URL",
                                    "slot:27009");

        //Adding relations for DrawingDocumentDrawView
        XDrawPage new_page = the_pages.insertNewByIndex(1);
        tEnv.addObjRelation("DrawPage", new_page);

        log.println("Implementation Name: "+utils.getImplName(oObj));

        XModifiable modify = (XModifiable)
View Full Code Here

Examples of com.sun.star.drawing.XDrawPage

        // 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
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.