Package com.sun.star.drawing

Examples of com.sun.star.drawing.XShape


            XTextFrame xFrame = (XTextFrame) UnoRuntime.queryInterface (
                XTextFrame.class, mxDocFactory.createInstance (
                    "com.sun.star.text.TextFrame" ) );
           
            // Access the XShape interface of the TextFrame
            XShape xShape = (XShape)UnoRuntime.queryInterface(XShape.class, xFrame);
            // Access the XPropertySet interface of the TextFrame
            XPropertySet xFrameProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xFrame );
           
            // Set the size of the new Text Frame using the XShape's 'setSize'
            // method
            Size aSize = new Size();
            aSize.Height = 400;
            aSize.Width = 15000;
            xShape.setSize(aSize);
            // Set the AnchorType to
            // com.sun.star.text.TextContentAnchorType.AS_CHARACTER
            xFrameProps.setPropertyValue( "AnchorType",
                                          TextContentAnchorType.AS_CHARACTER );
            // Go to the end of the text document
View Full Code Here


            // Position the cursor in the 2nd paragraph
            xParaCursor.gotoPreviousParagraph ( false );
           
            // Create a RectangleShape using the document factory
            XShape xRect = (XShape) UnoRuntime.queryInterface(
                XShape.class, mxDocFactory.createInstance (
                    "com.sun.star.drawing.RectangleShape" ) );
           
            // Create an EllipseShape using the document factory
            XShape xEllipse = (XShape) UnoRuntime.queryInterface(
                XShape.class, mxDocFactory.createInstance (
                    "com.sun.star.drawing.EllipseShape" ) );
           
            // Set the size of both the ellipse and the rectangle
            Size aSize = new Size();
            aSize.Height = 4000;
            aSize.Width = 10000;
            xRect.setSize(aSize);
            aSize.Height = 3000;
            aSize.Width = 6000;
            xEllipse.setSize ( aSize );
           
            // Set the position of the Rectangle to the right of the ellipse
            Point aPoint = new Point();
            aPoint.X = 6100;
            aPoint.Y = 0;
View Full Code Here

    }

    public void checkInfluenceOfSpreadsheetChange() {
        assure("Couldn't open document", openSpreadsheetDocument());

        XShape oShape = getInsertedShape();
        XPropertySet sheetProps = (XPropertySet) UnoRuntime.queryInterface(
                                          XPropertySet.class, getSpreadsheet());
        XPropertySet shapeProps = (XPropertySet) UnoRuntime.queryInterface(
                                          XPropertySet.class, oShape);

        String[] previous = getShapeProps(shapeProps, oShape);
        assure("Problems when setting property 'TableLayout'",
               changeProperty(sheetProps, "TableLayout",
                              new Short(com.sun.star.text.WritingMode2.RL_TB)));

        String[] RL_TB = getShapeProps(shapeProps, oShape);
        assure("Problems when setting property 'TableLayout'",
               changeProperty(sheetProps, "TableLayout",
                              new Short(com.sun.star.text.WritingMode2.LR_TB)));

        String[] LR_TB = getShapeProps(shapeProps, oShape);
        assure("Anchor has changed",
               (previous[0].equals(RL_TB[0]) && previous[0].equals(LR_TB[0])));
        assure("HoriOrientPosition has changed",
               (Integer.valueOf(previous[1]).intValue() + Integer.valueOf(
                                                                  RL_TB[1])
                                                                 .intValue() +
                   Integer.valueOf(LR_TB[1]).intValue() == 2099));
        assure("VertOrientPosition has changed",
               (Integer.valueOf(previous[2]).intValue() + Integer.valueOf(
                                                                  RL_TB[2])
                                                                 .intValue() +
                   Integer.valueOf(LR_TB[2]).intValue() == 3*Integer.valueOf(previous[2]).intValue()));
        assure("x-position hasn't changed",
               (previous[3].equals(LR_TB[3]) &&
                   ((Integer.valueOf(previous[3]).intValue() * (-1)) -
                       oShape.getSize().Width != Integer.valueOf(LR_TB[2])
                                                        .intValue())));
        assure("Couldn't close document", closeSpreadsheetDocument());
    }
View Full Code Here

     */
    protected TestEnvironment createTestEnvironment
            (TestParameters tParam, PrintWriter log) {

        XInterface oObj = null;
        XShape oShape = 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

        try {
            SrvObj = docMSF.createInstance( service );
        }
        catch( com.sun.star.uno.Exception cssuE ){
        }
        XShape shape = (XShape)UnoRuntime.queryInterface( XShape.class, SrvObj );
        try {
            shape.setSize(size);
        }
        catch( com.sun.star.beans.PropertyVetoException pvE ){
        }

        XTextFrame TF = (XTextFrame)UnoRuntime.queryInterface( ifcClass, SrvObj );
View Full Code Here

                                                     int y, String kind ) {
        //possible values for kind are 'Ellipse', 'Line' and 'Rectangle'

        ShapeDsc sDsc = new ShapeDsc( height, width, x, y, kind );
        InstCreator instCreate = new InstCreator( oDoc, sDsc );
        XShape oShape = (XShape)instCreate.getInstance();
       
        return oShape;
    }
View Full Code Here

                    XTextFrame xFrame = (XTextFrame) UnoRuntime.queryInterface (
                            XTextFrame.class, mxDocFactory.createInstance (
                                    "com.sun.star.text.TextFrame" ) );

                    // Access the XShape interface of the TextFrame
                    XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xFrame);
                    // Access the XPropertySet interface of the TextFrame
                    XPropertySet xFrameProps = (XPropertySet)UnoRuntime.queryInterface(
                            XPropertySet.class, xFrame );

                    // Set the size of the new Text Frame using the XShape's 'setSize' method
                    Size aSize = new Size();
                    aSize.Height = 400;
                    aSize.Width = 15000;
                    xShape.setSize(aSize);
                    // Set the AnchorType to com.sun.star.text.TextContentAnchorType.AS_CHARACTER
                    xFrameProps.setPropertyValue( "AnchorType", TextContentAnchorType.AS_CHARACTER );
                    // Go to the end of the text document
                    mxDocCursor.gotoEnd( false );
                    // Insert a new paragraph
View Full Code Here

                    // Position the cursor in the 2nd paragraph
                    xParaCursor.gotoPreviousParagraph ( false );

                    // Create a RectangleShape using the document factory
                    XShape xRect = (XShape) UnoRuntime.queryInterface(
                            XShape.class, mxDocFactory.createInstance (
                                    "com.sun.star.drawing.RectangleShape" ) );

                    // Create an EllipseShape using the document factory
                    XShape xEllipse = (XShape) UnoRuntime.queryInterface(
                            XShape.class, mxDocFactory.createInstance (
                                    "com.sun.star.drawing.EllipseShape" ) );

                    // Set the size of both the ellipse and the rectangle
                    Size aSize = new Size();
                    aSize.Height = 4000;
                    aSize.Width = 10000;
                    xRect.setSize(aSize);
                    aSize.Height = 3000;
                    aSize.Width = 6000;
                    xEllipse.setSize ( aSize );

                    // Set the position of the Rectangle to the right of the ellipse
                    Point aPoint = new Point();
                    aPoint.X = 6100;
                    aPoint.Y = 0;
View Full Code Here

            manipulateTable(xCellRange);

            // insert RectangleShape and get shape text, then manipulate text
            Object writerShape = xWriterFactory.createInstance(
                "com.sun.star.drawing.RectangleShape");
            XShape xWriterShape = (XShape)UnoRuntime.queryInterface(
                XShape.class, writerShape);
            xWriterShape.setSize(new Size(10000, 10000));
            XTextContent xTextContentShape = (XTextContent)UnoRuntime.queryInterface(
                XTextContent.class, writerShape);

            xText.insertTextContent(xText.getEnd(), xTextContentShape, false);
View Full Code Here

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

TOP

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

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.