Package com.sun.star.drawing

Examples of com.sun.star.drawing.XDrawPageSupplier



    public static XDrawPage getDrawPage ( XTextDocument aDoc ) {
        XDrawPage oDP = null;
    try {
         XDrawPageSupplier oDPS = (XDrawPageSupplier)
                        UnoRuntime.queryInterface(XDrawPageSupplier.class,aDoc);
            oDP = (XDrawPage) oDPS.getDrawPage();
    } catch ( Exception e ) {
      throw new IllegalArgumentException( "Couldn't get drawpage" );
    }
        return oDP;
    }
View Full Code Here


        }
       
        // get the draw page for checking the shapes
        xDrawPage = (XDrawPage)tEnv.getObjRelation("XSheetAuditing.DrawPage");
        if (xDrawPage == null) { // get from object
            XDrawPageSupplier oDPS = (XDrawPageSupplier)
                UnoRuntime.queryInterface(XDrawPageSupplier.class, oObj);
            xDrawPage = (XDrawPage) oDPS.getDrawPage();
        }
        if (xDrawPage == null) {
            throw new StatusException(Status.failed("'XSheetAuditing.DrawPage' object relation not found."));
        }
        if (xDrawPage.hasElements()) {
View Full Code Here

    }

    /* ------------------------------------------------------------------ */
    protected XControlModel getListBoxModel( XSpreadsheet sheet )
    {
        XDrawPageSupplier suppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
            XDrawPageSupplier.class, sheet );
        FormComponent formsRoot = new FormComponent( suppPage.getDrawPage() );
        XControlModel listBoxModel = (XControlModel)formsRoot.getByIndex( 0 ).
            getByName( "ListBox" ).query( XControlModel.class );
        return listBoxModel;
    }
View Full Code Here

    protected XDrawPage getMainDrawPage( ) throws com.sun.star.uno.Exception
    {
        XDrawPage xReturn;

        // in case of a Writer document, this is rather easy: simply ask the XDrawPageSupplier
        XDrawPageSupplier xSuppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
            XDrawPageSupplier.class, getDocument() );
        if ( null != xSuppPage )
            xReturn = xSuppPage.getDrawPage();
        else
        {   // the model itself is no draw page supplier - okay, it may be a Writer or Calc document
            // (or any other multi-page document)
            XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
                XDrawPagesSupplier.class, getDocument() );
View Full Code Here

                    // And set the AnchorTypes of both shapes to 'AT_PARAGRAPH'
                    xRectProps.setPropertyValue ( "AnchorType", TextContentAnchorType.AT_PARAGRAPH );
                    xEllipseProps.setPropertyValue ( "AnchorType", TextContentAnchorType.AT_PARAGRAPH );

                    // Access the XDrawPageSupplier interface of the document
                    XDrawPageSupplier xDrawPageSupplier = ( XDrawPageSupplier) UnoRuntime.queryInterface (
                            XDrawPageSupplier.class, mxDoc );

                    // Get the XShapes interface of the draw page
                    XShapes xShapes = ( XShapes ) UnoRuntime.queryInterface (
                            XShapes.class, xDrawPageSupplier.getDrawPage () );

                    // Add both shapes
                    xShapes.add ( xEllipse );
                    xShapes.add ( xRect );
View Full Code Here

        exception.printStackTrace(System.out);
    }}

   
    public XNameContainer getDocumentForms(){
  XDrawPageSupplier xDrawPageSuppl = (XDrawPageSupplier) UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDocument);
  XDrawPage xDrawPage = xDrawPageSuppl.getDrawPage();
  XFormsSupplier xFormsSuppl = (XFormsSupplier) UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage);
  XNameContainer xNamedForms = xFormsSuppl.getForms();
  return xNamedForms;
    }
View Full Code Here

    public static XDrawPage getDrawPage(XTextDocument aDoc) {
        XDrawPage oDP = null;

        try {
            XDrawPageSupplier oDPS = (XDrawPageSupplier) UnoRuntime.queryInterface(
                                             XDrawPageSupplier.class, aDoc);
            oDP = (XDrawPage) oDPS.getDrawPage();
        } catch (Exception e) {
            throw new IllegalArgumentException("Couldn't get drawpage");
        }

        return oDP;
View Full Code Here

    }

    /* ------------------------------------------------------------------ */
    protected XControlModel getListBoxModel( XSpreadsheet sheet )
    {
        XDrawPageSupplier suppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
            XDrawPageSupplier.class, sheet );
        FormComponent formsRoot = new FormComponent( suppPage.getDrawPage() );
        XControlModel listBoxModel = (XControlModel)formsRoot.getByIndex( 0 ).
            getByName( "ListBox" ).query( XControlModel.class );
        return listBoxModel;
    }
View Full Code Here

TOP

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

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.