Package com.sun.star.drawing

Examples of com.sun.star.drawing.XShapes


        int  nRndObjPosX = aRndGen.nextInt( nHalfWidth - nRndObjWidth );
        int nRndObjPosY = aRndGen.nextInt( nHalfHeight - nRndObjHeight )
                    + nHalfHeight;

        XShapes xShapes = (XShapes)
          UnoRuntime.queryInterface( XShapes.class, pPages[ i ] );
        ShapeHelper.createAndInsertShape( xDrawDoc, xShapes,
          new Point( nRndObjPosX, nRndObjPosY ),
            new Size( nRndObjWidth, nRndObjHeight ),
              "com.sun.star.drawing.RectangleShape" );
View Full Code Here


      // if possible insert our new shape in the master page
      if ( PageHelper.isImpressDocument( xDrawDoc ) )
        xDrawPage = PageHelper.getMasterPageByIndex( xDrawDoc, 0 );
      else
        xDrawPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
      XShapes xShapes = (XShapes)
        UnoRuntime.queryInterface( XShapes.class, xDrawPage );
      xShapes.add( xPolyPolygonBezier );

      XPropertySet xShapeProperties = (XPropertySet)
        UnoRuntime.queryInterface( XPropertySet.class, xPolyPolygonBezier );

      // get pagesize
View Full Code Here

            "com.sun.star.drawing.GroupShape" );

      // before it is possible to insert shapes,
      // the group must have been added to the page
      XDrawPage xDrawPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
      XShapes xShapes = (XShapes)
        UnoRuntime.queryInterface( XShapes.class, xDrawPage );
      xShapes.add( xGroup );

      XShapes xShapesGroup = (XShapes)
        UnoRuntime.queryInterface( XShapes.class, xGroup );

      Size aPageSize = PageHelper.getPageSize( xDrawPage );

      int nWidth  = 4000;
      int nHeight = 2000;
      int nPosX = ( aPageSize.Width * 3 ) / 4 - nWidth / 2;
      int nPosY1 = 2000;
      int nPosY2 = aPageSize.Height / 2 - ( nPosY1 + nHeight );
      XShape xRect1 = ShapeHelper.createShape( xDrawDoc,
        new Point( nPosX, nPosY1 ),
          new Size( nWidth, nHeight ),
            "com.sun.star.drawing.EllipseShape" );
      XShape xRect2 = ShapeHelper.createShape( xDrawDoc,
        new Point( nPosX, nPosY2 ),
          new Size( nWidth, nHeight ),
            "com.sun.star.drawing.EllipseShape" );

      xShapesGroup.add( xRect1 );
      xShapesGroup.add( xRect2 );
    }
    catch ( Exception ex )
    {
      System.out.println( "Demo_Group1:" + ex );
    }
View Full Code Here

    {
      XDrawPage xDrawPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
      XShapeGrouper xShapeGrouper = (XShapeGrouper)
        UnoRuntime.queryInterface( XShapeGrouper.class, xDrawPage );

      XShapes xShapesPage = (XShapes)
        UnoRuntime.queryInterface( XShapes.class, xDrawPage );

      xShapeGrouper.group( xShapesPage );
    }
    catch ( Exception ex )
View Full Code Here

        (XDrawPagesSupplier)UnoRuntime.queryInterface(
          XDrawPagesSupplier.class, xComponent );
      XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
      XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(
                XDrawPage.class, xDrawPages.getByIndex( 0 ));
      XShapes xShapes = (XShapes)UnoRuntime.queryInterface(XShapes.class,
                                                                 xDrawPage );
      XShape xShape = ShapeHelper.createShape( xComponent, new Point( 0, 0 ),
        new Size( 5000, 5000 ), "com.sun.star.drawing.RectangleShape" );
      xShapes.add( xShape );
      XPropertySet xPropSet = (XPropertySet)
        UnoRuntime.queryInterface( XPropertySet.class, xShape );
      xPropSet.setPropertyValue( "Style", xTitle1Style );

    }
View Full Code Here

      XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
      XPropertySet xPagePropSet= (XPropertySet)
          UnoRuntime.queryInterface( XPropertySet.class, xPage );

      XShapes xShapes = (XShapes)
          UnoRuntime.queryInterface( XShapes.class, xPage );


      XShape xShape = ShapeHelper.createShape( xDrawDoc,
        new Point( 0, 0 ), new Size( 10000, 2500 ),
          "com.sun.star.drawing.RectangleShape" );
      xShapes.add( xShape );
 
      XPropertySet xPropSet = (XPropertySet)
          UnoRuntime.queryInterface( XPropertySet.class, xShape );
     
      HomogenMatrix3 aHomogenMatrix3 = (HomogenMatrix3)
View Full Code Here

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

      XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
      XPropertySet xPagePropSet= (XPropertySet)
          UnoRuntime.queryInterface( XPropertySet.class, xPage );

      XShapes xShapes = (XShapes)
          UnoRuntime.queryInterface( XShapes.class, xPage );


      XShape xShape = ShapeHelper.createShape( xDrawDoc,
        new Point( 0, 0 ), new Size( 10000, 2500 ),
          "com.sun.star.drawing.RectangleShape" );
      xShapes.add( xShape );
 
      XPropertySet xPropSet = (XPropertySet)
          UnoRuntime.queryInterface( XPropertySet.class, xShape );
     
      HomogenMatrix3 aHomogenMatrix3 = (HomogenMatrix3)
View Full Code Here

      xDrawDoc = Helper.createDocument( xOfficeContext,
        "private:factory/simpress", "_blank", 0, pPropValues );


      XDrawPage   xPage;
      XShapes     xShapes;
      XPropertySet xShapePropSet;

      // create pages, so that three are available
        while ( PageHelper.getDrawPageCount( xDrawDoc ) < 3 )
        PageHelper.insertNewDrawPageByIndex( xDrawDoc, 0 );


      // set the slide transition for the first page
      xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
      xShapes = (XShapes)
        UnoRuntime.queryInterface( XShapes.class, xPage );
      // set slide transition effect
      setSlideTransition( xPage,
        com.sun.star.presentation.FadeEffect.FADE_FROM_RIGHT,
          com.sun.star.presentation.AnimationSpeed.FAST,
            1, 0 ); // automatic object and slide transition
     
      // create a rectangle that is placed on the top left of the page
      xShapePropSet = ShapeHelper.createAndInsertShape( xDrawDoc,
        xShapes,new Point( 1000, 1000 ), new Size( 5000, 5000 ),
          "com.sun.star.drawing.RectangleShape" );
      xShapePropSet.setPropertyValue("Effect",
                com.sun.star.presentation.AnimationEffect.WAVYLINE_FROM_BOTTOM );

      /* the following three properties provokes that the shape is dimmed
         to red
         after the animation has been finished */
      xShapePropSet.setPropertyValue( "DimHide", new Boolean( false ) );
      xShapePropSet.setPropertyValue( "DimPrevious", new Boolean( true ) );
      xShapePropSet.setPropertyValue( "DimColor", new Integer( 0xff0000 ) );


      // set the slide transition for the second page
      xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 1 );
      xShapes = (XShapes)
        UnoRuntime.queryInterface( XShapes.class, xPage );
      setSlideTransition( xPage,
        com.sun.star.presentation.FadeEffect.FADE_FROM_RIGHT,
          com.sun.star.presentation.AnimationSpeed.SLOW,
            1, 0 ); // automatic object and slide transition

      // create an ellipse that is placed on the bottom right of second page
      xShapePropSet = ShapeHelper.createAndInsertShape( xDrawDoc,
        xShapes, new Point( 21000, 15000 ), new Size( 5000, 5000 ),
          "com.sun.star.drawing.EllipseShape" );
      xShapePropSet.setPropertyValue(
        "Effect", com.sun.star.presentation.AnimationEffect.HIDE );


      // create two objects for the third page
      // clicking the first object lets the presentation jump
      // to page one by using ClickAction.FIRSTPAGE,
      // the second object lets the presentation jump to page two
      // by using a ClickAction.BOOKMARK;
      xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 2 );
      xShapes = (XShapes)
        UnoRuntime.queryInterface( XShapes.class, xPage );
      setSlideTransition( xPage,
        com.sun.star.presentation.FadeEffect.ROLL_FROM_LEFT,
          com.sun.star.presentation.AnimationSpeed.MEDIUM,
            2, 0 );
      XShape xShape = ShapeHelper.createShape( xDrawDoc,
          new Point( 1000, 8000 ), new Size( 5000, 5000 ),
          "com.sun.star.drawing.EllipseShape" );
      xShapes.add( xShape );
      ShapeHelper.addPortion( xShape, "click to go", false );
      ShapeHelper.addPortion( xShape, "to first page", true );
      xShapePropSet = (XPropertySet)
        UnoRuntime.queryInterface( XPropertySet.class, xShape );
      xShapePropSet.setPropertyValue("Effect",
                com.sun.star.presentation.AnimationEffect.FADE_FROM_BOTTOM );
      xShapePropSet.setPropertyValue(
        "OnClick", com.sun.star.presentation.ClickAction.FIRSTPAGE );


      xShape = ShapeHelper.createShape( xDrawDoc,
        new Point( 22000, 8000 ), new Size( 5000, 5000 ),
          "com.sun.star.drawing.RectangleShape" );
      xShapes.add( xShape );
      ShapeHelper.addPortion( xShape, "click to go", false );
      ShapeHelper.addPortion( xShape, "to the second page", true );
      xShapePropSet = (XPropertySet)
        UnoRuntime.queryInterface( XPropertySet.class, xShape );
      xShapePropSet.setPropertyValue("Effect",
View Full Code Here

        "private:factory/sdraw", "_blank", 0, pPropValues );


      // create two rectangles
      XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
      XShapes xShapes = (XShapes)
          UnoRuntime.queryInterface( XShapes.class, xPage );

      XShape xRect1 = ShapeHelper.createShape( xDrawDoc,
        new Point( 1000, 1000 ), new Size( 5000, 5000 ),
          "com.sun.star.drawing.RectangleShape" );

      XShape xRect2 = ShapeHelper.createShape( xDrawDoc,
        new Point( 1000, 7000 ), new Size( 5000, 5000 ),
          "com.sun.star.drawing.RectangleShape" );

      xShapes.add( xRect1 );
      xShapes.add( xRect2 );
      XPropertySet xTextProp = ShapeHelper.addPortion( xRect2,
                                                             "this shape is locked",
                                                             false );
      xTextProp.setPropertyValue( "ParaAdjust", ParagraphAdjust.CENTER );
      ShapeHelper.addPortion( xRect2, "and the shape above is not visible",
View Full Code Here

TOP

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

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.