Examples of XWindow


Examples of com.sun.star.awt.XWindow

    protected boolean clickOnSheet() {
        log.println("try to open contex menu...");
        AccessibilityTools at = new AccessibilityTools();
       
        XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)tParam.getMSF(), docModel);
       
        XAccessible xRoot = at.getAccessibleObject(xWindow);
       
        XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
       
View Full Code Here

Examples of com.sun.star.awt.XWindow

            XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
            assure("failed: there is no window peer", xWindowPeer != null);


            // resize and move the window to a well known position and size
            XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
            assure("failed: there is no window, cast wrong?", xWindow != null);

            xWindow.setVisible(Boolean.TRUE);

            int x = 100;
            int y = 100;
            int width = 640;
            int height = 480;
            xWindow.setPosSize(x, y, width, height, com.sun.star.awt.PosSize.POSSIZE);

            com.sun.star.awt.Rectangle aRect = xWindow.getPosSize();
            com.sun.star.awt.Point aPoint = new com.sun.star.awt.Point(aRect.X, aRect.Y);
            com.sun.star.awt.Size aSize = new com.sun.star.awt.Size(aRect.Width, aRect.Height);

            log.println("Window position and size in pixel:");
            log.println("X:" + aPoint.X);
            log.println("Y:" + aPoint.Y);
            log.println("Width:" + aSize.Width);
            log.println("Height:" + aSize.Height);
            log.println("");

            assure("Window pos size wrong", aSize.Width == width && aSize.Height == height && aPoint.X == x && aPoint.Y == y);

            // XToolkit aToolkit = xWindowPeer.getToolkit();
            m_xConversion = (XUnitConversion) UnoRuntime.queryInterface(XUnitConversion.class, xWindowPeer);

            // try to get the position of the window in 1/100mm with the XUnitConversion method
            try
            {
                com.sun.star.awt.Point aPointInMM_100TH = m_xConversion.convertPointToLogic(aPoint, com.sun.star.util.MeasureUnit.MM_100TH);
                log.println("Window position:");
                log.println("X:" + aPointInMM_100TH.X + " 1/100mm");
                log.println("Y:" + aPointInMM_100TH.Y + " 1/100mm");
                log.println("");
            }
            catch (com.sun.star.lang.IllegalArgumentException e)
            {
                assure("failed: IllegalArgumentException caught in convertPointToLogic " + e.getMessage(), Boolean.FALSE);
            }

            // try to get the size of the window in 1/100mm with the XUnitConversion method
            com.sun.star.awt.Size aSizeInMM_100TH = null;
            com.sun.star.awt.Size aSizeInMM_10TH = null;
            try
            {
                aSizeInMM_100TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_100TH);
                log.println("Window size:");
                log.println("Width:" + aSizeInMM_100TH.Width + " 1/100mm");
                log.println("Height:" + aSizeInMM_100TH.Height + " 1/100mm");
                log.println("");

                // try to get the size of the window in 1/10mm with the XUnitConversion method

                aSizeInMM_10TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_10TH);
                log.println("Window size:");
                log.println("Width:" + aSizeInMM_10TH.Width + " 1/10mm");
                log.println("Height:" + aSizeInMM_10TH.Height + " 1/10mm");
                log.println("");

                // check the size with a delta which must be smaller a given difference
                assure("Size.Width  not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10);
                assure("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10);

                // simply check some more parameters
                checkSize(aSize, com.sun.star.util.MeasureUnit.MM, "mm");
                checkSize(aSize, com.sun.star.util.MeasureUnit.CM, "cm");
                checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_1000TH, "1/1000inch");
                checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_100TH, "1/100inch");
                checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_10TH, "1/10inch");
                checkSize(aSize, com.sun.star.util.MeasureUnit.INCH, "inch");
                // checkSize(aSize, com.sun.star.util.MeasureUnit.M, "m");
                checkSize(aSize, com.sun.star.util.MeasureUnit.POINT, "point");
                checkSize(aSize, com.sun.star.util.MeasureUnit.TWIP, "twip");
                // checkSize(aSize, com.sun.star.util.MeasureUnit.KM, "km");
                // checkSize(aSize, com.sun.star.util.MeasureUnit.PICA, "pica");
                // checkSize(aSize, com.sun.star.util.MeasureUnit.FOOT, "foot");
                // checkSize(aSize, com.sun.star.util.MeasureUnit.MILE, "mile");
            }
            catch (com.sun.star.lang.IllegalArgumentException e)
            {
                assure("failed: IllegalArgumentException caught in convertSizeToLogic " + e.getMessage(), Boolean.FALSE);
            }

            // convert the 1/100mm window size back to pixel
            try
            {
                com.sun.star.awt.Size aNewSize = m_xConversion.convertSizeToPixel(aSizeInMM_100TH, com.sun.star.util.MeasureUnit.MM_100TH);
                log.println("Window size:");
                log.println("Width:" + aNewSize.Width + " pixel");
                log.println("Height:" + aNewSize.Height + " pixel");

                // assure the pixels are the same as we already know
                assure("failed: Size from pixel to 1/100mm to pixel", aSize.Width == aNewSize.Width && aSize.Height == aNewSize.Height);
            }
            catch (com.sun.star.lang.IllegalArgumentException e)
            {
                assure("failed: IllegalArgumentException caught in convertSizeToPixel " + e.getMessage(), Boolean.FALSE);
            }

            // close the window.
            // IMHO a little bit stupid, but the XWindow doesn't support a XCloseable interface
            xWindow.dispose();
    }
View Full Code Here

Examples of com.sun.star.awt.XWindow

        log.println("... done");

  log.println("Opening document with label wizard");
  xTextDoc = wHelper.openFromDialog("private:factory/swriter?slot=21051", "", false);
        shortWait();
        XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, wHelper.getToolkit ().getActiveTopWindow ());
        UITools ut = new UITools(m_xMSF,xWindow);
        notifyEvents.clear();
        log.println("pressing button 'New Document'");
        try{
            ut.clickButton ("New Document");
View Full Code Here

Examples of com.sun.star.awt.XWindow

    * does not return null.
    */
    public void _getComponentWindow() {
        boolean result = true;

        XWindow win = oObj.getComponentWindow() ;
       
        if (tEnv.getTestCase().getObjectName().equals("Desktop")) {
            log.println("Desktop has no component window");
            tRes.tested("getComponentWindow()", true) ;
            return;
View Full Code Here

Examples of com.sun.star.awt.XWindow

            log.println("Desktop has no container window");
            tRes.tested("getContainerWindow()", true) ;
            return;
        }

        XWindow win = oObj.getContainerWindow() ;
        if (win == null)
            log.println("getContainerWindow() returns null") ;
        boolean res = isDesktop(log,tEnv,"getContainerWindow()");
        if (res) result=res; else result = (win != null);
        tRes.tested("getContainerWindow()", result) ;
View Full Code Here

Examples of com.sun.star.awt.XWindow

        requiredMethod("contextChanged()") ;
        requiredMethod("setCreator()") ;

        boolean result = true;
       
        XWindow oldWindow = oObj.getComponentWindow();
        XController oldController = oObj.getController();
        boolean rs = oObj.setComponent(null, null);
        if (rs) {  // component must be changed
            result &= oObj.getComponentWindow() == null;
            result &= oObj.getController() == null;
View Full Code Here

Examples of com.sun.star.awt.XWindow

     *  object</li>
     * </ul>
     */
    public void _initialize() {
        requiredMethod("setComponent()") ;
        XWindow win = oObj.getContainerWindow() ;
        boolean bOK = true;
        try {
            oObj.initialize(win) ;
        } catch (com.sun.star.uno.RuntimeException e){
            String message="Frame::initialized() is called more then once, which isnt usefull nor allowed.";
View Full Code Here

Examples of com.sun.star.awt.XWindow

        return getWindow(msf, xModel, false);
    }
   
    private static XWindow getWindow(XMultiServiceFactory msf, XModel xModel,
        boolean containerWindow) {
        XWindow xWindow = null;
       
        try {
            if (xModel == null) {
                System.out.println("invalid model (==null)");
            }
View Full Code Here

Examples of com.sun.star.awt.XWindow

     * the window closes, deltes the temp directory.
     */
    public WWD_Events(XMultiServiceFactory xmsf) throws Exception {
        super(xmsf);
        Create c = new Create();
        XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,chkFTP);
        xWindow.addKeyListener(c);
        xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,chkLocalDir);
        xWindow.addKeyListener(c);
        xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,chkZip);
        xWindow.addKeyListener(c);
    }
View Full Code Here

Examples of com.sun.star.awt.XWindow

        }

        XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
                                      XExtendedToolkit.class, oObj);

        XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
                                                              tk.getActiveTopWindow());

        XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);

        oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.