Package com.sun.star.beans

Examples of com.sun.star.beans.XPropertySet


      final PropertyValue[] value = new PropertyValue[1];
      value[0] = new PropertyValue();
      value[0].Name = "InputStream";
      value[0].Value = image;

      final XPropertySet xImage = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
        m_xGraphicProvider.queryGraphic( value ) );

      if (xImage != null)
      {
        final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
        if (xInfo.hasPropertyByName("Size100thMM"))
        {
          Size imageSize = (Size) xImage.getPropertyValue("Size100thMM");
          dim.setSize(imageSize.Width, imageSize.Height);
          if (dim.height == 0 && dim.width == 0)
          {
            imageSize = (Size) xImage.getPropertyValue("SizePixel");
            final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
            final double fac = 2540 / dpi;
            dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
          }
        }
        else if (xInfo.hasPropertyByName("SizePixel"))
        {
          final Size imageSize = (Size) xImage.getPropertyValue("SizePixel");
          final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
          final double fac = 2540 / dpi;
          dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
        }
      }
View Full Code Here


    {
      final PropertyValue[] value = new PropertyValue[] { new PropertyValue() };
      value[0].Name = "InputStream";
      value[0].Value = image;

      final XPropertySet xImage = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,
          m_xGraphicProvider.queryGraphic(value));

      if (xImage != null)
      {
        final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
        if (xInfo.hasPropertyByName("MimeType"))
        {
          mimeType = (String) xImage.getPropertyValue("MimeType");
        }
      }
    }
    catch (UnknownPropertyException ex)
    {
View Full Code Here

                    {
                        XMultiServiceFactory xMSF = _aGTA.getMultiServiceFactory();
                        Object aSettings = xMSF.createInstance( "com.sun.star.sheet.GlobalSheetSettings" );
                        if (aSettings != null)
                        {
                            XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aSettings );
                            xPropSet.setPropertyValue( "PrintAllSheets", new Boolean( true ) );
                        }
                    }
                   
                    ArrayList aPrintProps = new ArrayList();
                    GlobalLogWriter.get().println("Property FileName:=" + _sPrintFileURL);
View Full Code Here

    *      {@link ifc.chart._Chart3DBarProperties}(the created bar-diagram)</li>
    * </ul>
    */
    protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {

        XPropertySet  oObj = null;
        XDiagram oDiagram = null;

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

        // get the DataRowPoint_Point
View Full Code Here

    * the instance of the service <code>com.sun.star.chart.ChartGrid</code>.
    * @see com.sun.star.chart.XAxisXSupplier
    * @see com.sun.star.chart.ChartGrid
    */
    protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
        XPropertySet oObj = null;
        XShape oDiagram = null;

        // get the Diagram
        log.println( "getting Diagram" );
        oDiagram = (XDiagram) xChartDoc.getDiagram();
View Full Code Here

           
            XControlModel xDialogModel = (XControlModel)
                UnoRuntime.queryInterface(XControlModel.class,
                mxMSF.createInstance("com.sun.star.awt.UnoControlDialogModel"));
           
            XPropertySet xDialogPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDialogModel);
            xDialogPropertySet.setPropertyValue( "PositionX"new Integer(50) );
            xDialogPropertySet.setPropertyValue( "PositionY"new Integer(50) );
            xDialogPropertySet.setPropertyValue( "Width",    new Integer(256) );
            xDialogPropertySet.setPropertyValue( "Height",    new Integer(256) );
            xDialogPropertySet.setPropertyValue( "Title",    "Tree Control Test");
           
            XMultiServiceFactory xDialogMSF = (XMultiServiceFactory)
                UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel);
           
            XControlModel  xTreeControlModel = (XControlModel)
                UnoRuntime.queryInterface(XControlModel.class,
                xDialogMSF.createInstance("com.sun.star.awt.tree.TreeControlModel"));
           
            XPropertySet XTreeControlModelSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTreeControlModel);

            XTreeControlModelSet.setPropertyValue( "SelectionType",com.sun.star.view.SelectionType.NONE);
            XTreeControlModelSet.setPropertyValue( "PositionX",    new Integer(3 ));
            XTreeControlModelSet.setPropertyValue( "PositionY",    new Integer(3 ));
            XTreeControlModelSet.setPropertyValue( "Width",      new Integer(253));
            XTreeControlModelSet.setPropertyValue( "Height",    new Integer(253) );
            XTreeControlModelSet.setPropertyValue( "DataModel",    mXTreeDataModel );
            XTreeControlModelSet.setPropertyValue( "ShowsRootHandles",new Boolean (false));
            XTreeControlModelSet.setPropertyValue( "ShowsHandles"new Boolean (false));
            XTreeControlModelSet.setPropertyValue( "RootDisplayed"new Boolean (true));
            XTreeControlModelSet.setPropertyValue( "Editable",    new Boolean (true ));
           
            XNameContainer xDialogModelContainer = (XNameContainer)
            UnoRuntime.queryInterface(XNameContainer.class, xDialogModel);
           
            xDialogModelContainer.insertByName( sTreeControlName, xTreeControlModel);
View Full Code Here

        try {
            // Composing the URL


            // Query for the XPropertySet interface.
            XPropertySet xpropertysetMultiComponentFactory = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xmulticomponentfactory);

            // Get the default context from the office server.
            Object objectDefaultContext = xpropertysetMultiComponentFactory.getPropertyValue("DefaultContext");

            // Query for the interface XComponentContext.
            XComponentContext xcomponentcontext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, objectDefaultContext);

            /* A desktop environment contains tasks with one or more
View Full Code Here

      }
     
      // XComponentContext
      if( null != aInitialObject )
      {
        XPropertySet xPropertySet = (XPropertySet)
          UnoRuntime.queryInterface( XPropertySet.class, aInitialObject);
                  Object xContext = xPropertySet.getPropertyValue("DefaultContext");           
                  XComponentContext xComponentContext = (XComponentContext) UnoRuntime.queryInterface(
          XComponentContext.class, xContext);
        return xComponentContext;
      }
    }
View Full Code Here

       
        XShape aShape = SOF.createShape(xImpressDoc, 5000, 3500, 7500, 5000,
            "Rectangle");
       
       
        XPropertySet xShapeProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, aShape);
       
        try {
            xShapeProps.setPropertyValue("FillStyle", com.sun.star.drawing.FillStyle.SOLID);
            xShapeProps.setPropertyValue("FillTransparence", new Integer(50));
        } catch (UnknownPropertyException ex) {
            ex.printStackTrace(log);
            throw new StatusException("Couldn't make shape transparent", ex);
        } catch (PropertyVetoException ex) {
            ex.printStackTrace(log);
View Full Code Here

            failed(e.getMessage());
            return;
        }

        //get the property-set
        final XPropertySet PropSet = (XPropertySet)
            UnoRuntime.queryInterface(XPropertySet.class, StdStyle);

        XHeaderFooterContent RPHFC = null;

        // get the header
        try {
            Object o = PropSet.getPropertyValue("RightPageHeaderContent");
            RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
                    new com.sun.star.uno.Type(XHeaderFooterContent.class), o);

        } catch(com.sun.star.lang.IllegalArgumentException e) {
            failed(e.getMessage());
        } catch(com.sun.star.lang.WrappedTargetException e){
            failed(e.getMessage());
            return;
        } catch(com.sun.star.beans.UnknownPropertyException e){
            failed(e.getMessage());
            return;
        }

        // insert text into header
        XText center = RPHFC.getCenterText();
        center.setString("First line \n\r Second line \n\r third line ");
        try {
            PropSet.setPropertyValue("RightPageHeaderContent",RPHFC);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
        } catch (com.sun.star.beans.PropertyVetoException e) {
        } catch (com.sun.star.lang.IllegalArgumentException e) {
        } catch (com.sun.star.lang.WrappedTargetException e) {}

        // get footer
        RPHFC = null;
        try {
            Object o = PropSet.getPropertyValue("RightPageHeaderContent");
            RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
                    new com.sun.star.uno.Type(XHeaderFooterContent.class), o);
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            failed(e.getMessage());
        } catch(com.sun.star.lang.WrappedTargetException e){
            failed(e.getMessage());
            return;
        } catch(com.sun.star.beans.UnknownPropertyException e){
            failed(e.getMessage());
            return;
        }

        // insert text into footer
        center = RPHFC.getCenterText();
        center.setString("Third last line\n\r Second last line\n\r last line");
        try {
            PropSet.setPropertyValue("RightPageFooterContent",RPHFC);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
        } catch (com.sun.star.beans.PropertyVetoException e) {
        } catch (com.sun.star.lang.IllegalArgumentException e) {
        } catch (com.sun.star.lang.WrappedTargetException e) {}
View Full Code Here

TOP

Related Classes of com.sun.star.beans.XPropertySet

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.