Package com.sun.star.graphic

Examples of com.sun.star.graphic.XGraphic


   
   
// creates a UNO graphic object that can be used to be assigned
// to the property "Graphic" of a controlmodel
    public XGraphic getGraphic(XMultiComponentFactory _xMCF, String _sImageSystemPath){
        XGraphic xGraphic = null;
        try{
            java.io.File oFile = new java.io.File(_sImageSystemPath);
            Object oFCProvider = _xMCF.createInstanceWithContext("com.sun.star.ucb.FileContentProvider", this.m_xContext);
            XFileIdentifierConverter xFileIdentifierConverter = (XFileIdentifierConverter) UnoRuntime.queryInterface(XFileIdentifierConverter.class, oFCProvider);
            String sImageUrl = xFileIdentifierConverter.getFileURLFromSystemPath(_sImageSystemPath, oFile.getAbsolutePath());
View Full Code Here


            PropertyValue GraphicValues[] = new PropertyValue[1];
            GraphicValues[0] = new PropertyValue();
            GraphicValues[0].Name = "URL";
            GraphicValues[0].Value = "private:resource/svx/imagelist/18000/18022";
            XGraphic xGraphic = xGraphicProvider.queryGraphic(GraphicValues);

        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
View Full Code Here

            XPropertySet xICModelPropertySet = oImageControlSample.insertImageControl(xMCF, 68, 30, 32, 90);
            oImageControlSample.insertButton(oImageControlSample, 90, 75, 50, "~Close dialog", (short) PushButtonType.OK_value);           
            oImageControlSample.createWindowPeer();
            // note: due to issue i76718 ("Setting graphic at a controlmodel required dialog peer") the graphic of the image control
            // may not be set before the peer of the dialog has been created.
            XGraphic xGraphic = oImageControlSample.getGraphic(oImageControlSample.m_xMCF, args[0]);
            xICModelPropertySet.setPropertyValue("Graphic", xGraphic);
            oImageControlSample.xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, oImageControlSample.m_xDialogControl);
            oImageControlSample.executeDialog();
        }catch( Exception e ) {
            System.err.println( e + e.getMessage());
View Full Code Here

   
   
// creates a UNO graphic object that can be used to be assigned
// to the property "Graphic" of a controlmodel
    public XGraphic getGraphic(XMultiComponentFactory _xMCF, String _sImageSystemPath){
        XGraphic xGraphic = null;
        try{
            java.io.File oFile = new java.io.File(_sImageSystemPath);
            Object oFCProvider = _xMCF.createInstanceWithContext("com.sun.star.ucb.FileContentProvider", this.m_xContext);
            XFileIdentifierConverter xFileIdentifierConverter = (XFileIdentifierConverter) UnoRuntime.queryInterface(XFileIdentifierConverter.class, oFCProvider);
            String sImageUrl = xFileIdentifierConverter.getFileURLFromSystemPath(_sImageSystemPath, oFile.getAbsolutePath());
View Full Code Here

        m_aTestHelper.Error( "The client for the object must be set!" );
        return false;
      }

      Object oReplacement = xShapeProps.getPropertyValue( "Graphic" );
      XGraphic xReplGraph = ( XGraphic ) UnoRuntime.queryInterface( XGraphic.class, oReplacement );
      if ( xReplGraph == null )
      {
        m_aTestHelper.Error( "The replacement graphic should be available!" );
        return false;
      }
View Full Code Here

           
            PropertyValue GraphicValues[] = new PropertyValue[1];
            GraphicValues[0] = new PropertyValue();
            GraphicValues[0].Name = "URL";
            GraphicValues[0].Value = "private:resource/svx/imagelist/18000/18022";         
            XGraphic xGraphic = xGraphicProvider.queryGraphic(GraphicValues);
           
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

            PropertyValue GraphicValues[] = new PropertyValue[1];
            GraphicValues[0] = new PropertyValue();
            GraphicValues[0].Name = "URL";
            GraphicValues[0].Value = "private:resource/svx/imagelist/18000/18022";
            XGraphic xGraphic = xGraphicProvider.queryGraphic(GraphicValues);

        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
View Full Code Here

    }

   

    public XGraphic setGraphic(XControl xImageControl, String sImageUrl){
        XGraphic xGraphic = null;
        try{
            Object oGraphicProvider = m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.graphic.GraphicProvider", m_xContext);
            XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGraphicProvider);
            PropertyValue[] aPropertyValues = new PropertyValue[1];
            PropertyValue aPropertyValue = new PropertyValue();
View Full Code Here

TOP

Related Classes of com.sun.star.graphic.XGraphic

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.