Package com.sun.star.awt

Examples of com.sun.star.awt.Point


        tEnv.addObjRelation("LimitedBounds", "toolkit.AccessibleTabPage");

        XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface(
                                               XAccessibleComponent.class,
                                               oObj);
        final Point point = accComp.getLocationOnScreen();

        shortWait();

        XInterface xEventInt = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Variables");
        final XAccessibleComponent eventAccComp = (XAccessibleComponent) UnoRuntime.queryInterface(
View Full Code Here


        shortWait();
       
        XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface(
            XAccessibleComponent.class,
            oObj);
        final Point point = accComp.getLocationOnScreen();
       
        shortWait();
       
        tEnv.addObjRelation("EventProducer",
            new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
View Full Code Here

                ("com.sun.star.drawing.ClosedBezierShape") ;
            oShape = (XShape) UnoRuntime.queryInterface
                (XShape.class, oInst) ;

            Point[] points = new Point[2];
            points[0] = new Point();
            points[0].X = 50;
            points[0].Y = 50;
            points[1] = new Point();
            points[1].X = 5000;
            points[1].Y = 5000;

            Point[][] the_points = new Point[1][2];
            the_points[0] = points;

            PolygonFlags[] flags = new PolygonFlags[2];
            flags[0] = PolygonFlags.NORMAL;
            flags[1] = PolygonFlags.NORMAL;

            PolygonFlags[][] the_flags = new PolygonFlags[1][2];
            the_flags[0] = flags;

            PolyPolygonBezierCoords coords = new PolyPolygonBezierCoords();
            coords.Coordinates=the_points;
            coords.Flags = the_flags;

            DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);

            oShape.setSize(new Size(3000,3000)) ;
            oShape.setPosition(new Point(4000,4000)) ;

            oObj = oShape ;

            XPropertySet shapeProps = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, oObj);
View Full Code Here

    public void _getIndexAtPoint() {
        //requiredMethod("getCharacterBounds()");        
        boolean res = true;
        log.print("getIndexAtPoint(-1, -1):");

        Point pt = new Point(-1, -1);
        int index = oObj.getIndexAtPoint(pt);
        log.println(index);
        res &= (index == -1);

        int lastIndex = chCount;

        if (LimitedBounds != null) {
            if (LimitedBounds instanceof Integer) {
                lastIndex = ((Integer) LimitedBounds).intValue();
            } else {
                lastIndex = chCount - 1;
            }

            log.println(LimitedBounds);
        }

        for (int i = 0; i < lastIndex; i++) {
            Rectangle aRect = null;
            String text = "empty";

            try {
                aRect = oObj.getCharacterBounds(i);
                text = oObj.getTextAtIndex(i, (short) 1).SegmentText;
            } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            } catch (com.sun.star.lang.IllegalArgumentException e) {
            }

            int x = aRect.X + (aRect.Width / 2);
            int y = aRect.Y + (aRect.Height / 2);
            Point aPoint = new Point(x, y);
            int nIndex = oObj.getIndexAtPoint(aPoint);
           
            x = aRect.X;
            y = aRect.Y + (aRect.Height / 2);
            aPoint = new Point(x, y);
            int left = oObj.getIndexAtPoint(aPoint);           
           
           

            int[] previous = (int[]) tEnv.getObjRelation("PreviousUsed");
View Full Code Here

        boolean result = true;

        int curX = 0;

        //while (!oObj.containsPoint(new Point(curX, bounds.Y)) && curX < bounds.Width+bounds.X) {
        while (!oObj.containsPoint(new Point(curX, 0)) &&
               (curX < bounds.Width)) {
            curX++;
        }

        ;

        //if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
        if (curX < bounds.Width) {
            log.println("Upper bound of box containsPoint point (" + curX +
                        ",0) - OK");
        } else {
            log.println(
                    "Upper bound of box containsPoint no component points - FAILED");
            result = false;
        }

        curX = 0;

        //while (!oObj.containsPoint(new Point(curX, bounds.Y+bounds.Height - 1))
        while (!oObj.containsPoint(new Point(curX, bounds.Height - 1)) &&
               (curX < bounds.Width)) {
            log.println("containsPoint returns false for (" + curX + "," +
                        bounds.Height + ")");
            curX++;
        }

        ;

        //if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
        if (curX < bounds.Width) {
            log.println("Lower bound of box containsPoint point (" + curX +
                        "," + (bounds.Height - 1) + ") - OK");
        } else {
            log.println(
                    "Lower bound of box containsPoint no component points - FAILED");
            result = false;
        }

        int curY = 0;

        //while (!oObj.containsPoint(new Point(bounds.X, curY)) && curY < bounds.Height+bounds.Y) {
        while (!oObj.containsPoint(new Point(0, curY)) &&
               (curY < bounds.Height)) {
            curY++;
        }

        ;

        //if ((bounds.Y <= curY) && (curY < bounds.Height+bounds.Y)) {
        if (curY < bounds.Height) {
            log.println("Left bound of box containsPoint point (0," + curY +
                        ") - OK");
        } else {
            log.println(
                    "Left bound of box containsPoint no component points - FAILED");
            result = false;
        }

        curY = 0;

        //while (!oObj.containsPoint(new Point(bounds.X+bounds.Width - 1, curY))
        //       && curY < bounds.Height+bounds.Y) {
        while (!oObj.containsPoint(new Point(bounds.Width - 1, curY)) &&
               (curY < bounds.Height)) {
            curY++;
        }

        ;

        //if ((bounds.Y <= curY) && (curY < bounds.Height + bounds.Y)) {
        if (curY < bounds.Height) {
            log.println("Right bound of box containsPoint point (" +
                        (bounds.Width - 1) + "," + curY + ") - OK");
        } else {
            log.println(
                    "Right bound of box containsPoint no component points - FAILED");
            result = false;
        }

        boolean locRes = true;

        for (int x = -1; x <= bounds.Width; x++) {
            locRes &= !oObj.containsPoint(new Point(x, -1));
            locRes &= !oObj.containsPoint(
                               new Point(x, bounds.Height + bounds.Y));
        }

        if (locRes) {
            log.println("Outer upper and lower bounds contain no component " +
                        "points - OK");
        } else {
            log.println("Outer upper and lower bounds CONTAIN some component " +
                        "points - FAILED");
            result = false;
        }

        locRes = true;

        for (int y = -1; y <= bounds.Height; y++) {
            locRes &= !oObj.containsPoint(new Point(-1, y));
            locRes &= !oObj.containsPoint(
                               new Point(bounds.X + bounds.Width, y));
        }

        if (locRes) {
            log.println("Outer left and right bounds contain no component " +
                        "points - OK");
View Full Code Here

                log.println("finding the point which lies on the component");

                int curX = chBnd.Width / 2;
                int curY = chBnd.Height / 2;

                while (!children[i].containsPoint(new Point(curX, curY)) &&
                       (curX > 0) && (curY > 0)) {
                    curX--;
                    curY--;
                }

                ;

                if ((curX == chBnd.Width) && isShowing) {
                    log.println("Couldn't find a point with containsPoint");

                    continue;
                }

                // trying the point laying on child
                XAccessible xAcc = oObj.getAccessibleAtPoint(
                                           new Point(chBnd.X + curX,
                                                     chBnd.Y + curY));
               

                Point p = new Point(chBnd.X + curX,chBnd.X + curX);
               
                if (isCovered(p) && isShowing) {
                    log.println(
                            "Child might be covered by another and can't be reached");
                    MightBeCovered = true;
                }
               
                KnownBounds.add(chBnd);

                if (xAcc == null) {
                    log.println("The child not found at point (" +
                                (chBnd.X + curX) + "," + (chBnd.Y + curY) +
                                ") - FAILED");

                    if (isShowing) {
                        result = false;
                    } else {
                        result &= true;
                    }
                } else {
                    XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface(
                                                 XAccessible.class,
                                                 children[i]);
                    XAccessibleContext xAccC = (XAccessibleContext) UnoRuntime.queryInterface(
                                                       XAccessibleContext.class,
                                                       children[i]);
                    log.println("Child found at point (" + (chBnd.X + curX) +
                                "," + (chBnd.Y + curY) + ") - OK");

                    boolean res = false;
                    int expIndex;
                    String expName;
                    String expDesc;

                    if (xAccCh != null) {
                        res = util.AccessibilityTools.equals(xAccCh, xAcc);
                        expIndex = xAccCh.getAccessibleContext()
                                         .getAccessibleIndexInParent();
                        expName = xAccCh.getAccessibleContext()
                                        .getAccessibleName();
                        expDesc = xAccCh.getAccessibleContext()
                                        .getAccessibleDescription();
                    } else {
                        res = xAccC.getAccessibleName()
                                   .equals(xAcc.getAccessibleContext()
                                               .getAccessibleName());
                        expIndex = xAccC.getAccessibleIndexInParent();
                        expName = xAccC.getAccessibleName();
                        expDesc = xAccC.getAccessibleDescription();
                    }

                    if (!res) {
                        int gotIndex = xAcc.getAccessibleContext()
                                           .getAccessibleIndexInParent();

                        if (expIndex < gotIndex) {
                            log.println("The children found is not the same");
                            log.println("The expected child " + expName);
                            log.print("is hidden behind the found Child ");
                            log.println(xAcc.getAccessibleContext()
                                            .getAccessibleName() + " - OK");
                        } else {                           
                            log.println(
                                    "The children found is not the same");
                            log.println("Expected: " + expName);
                            log.println("Description:  " + expDesc);
                            log.println("Found: " +
                                        xAcc.getAccessibleContext()
                                            .getAccessibleName());
                            log.println("Description:  " +
                                        xAcc.getAccessibleContext()
                                            .getAccessibleDescription());
                            if (MightBeCovered) {
                                log.println("... Child is covered by another - OK");
                            } else {                               
                                log.println("... FAILED");
                                result = false;
                            }
                           
                        }
                    }
                }


                // trying the point NOT laying on child
                xAcc = oObj.getAccessibleAtPoint(
                               new Point(chBnd.X - 1, chBnd.Y - 1));

                if (xAcc == null) {
                    log.println("No children found at point (" +
                                (chBnd.X - 1) + "," + (chBnd.Y - 1) +
                                ") - OK");
View Full Code Here

     */
    public void _getLocation() {
        requiredMethod("getBounds()");

        boolean result = true;
        Point loc = oObj.getLocation();

        result &= ((loc.X == bounds.X) && (loc.Y == bounds.Y));

        tRes.tested("getLocation()", result);
    }
View Full Code Here

        requiredMethod("getBounds()");

        XAccessibleComponent parent = getParentComponent();

        boolean result = true;
        Point loc = oObj.getLocationOnScreen();
        log.println("Location is (" + loc.X + "," + loc.Y + ")");

        if (parent != null) {
            Point parLoc = parent.getLocationOnScreen();
            log.println("Parent location is (" + parLoc.X + "," + parLoc.Y +
                        ")");

            result &= ((parLoc.X + bounds.X) == loc.X);
            result &= ((parLoc.Y + bounds.Y) == loc.Y);
View Full Code Here

        XAccessibleComponent aCom = (XAccessibleComponent) UnoRuntime.queryInterface(
                                            XAccessibleComponent.class,
                                            acc.getAccessibleContext());

        Point location = aCom.getLocationOnScreen();       
        //Point location = (Point) tEnv.getObjRelation("Location");
        //XAccessibleComponent aCom = (XAccessibleComponent) tEnv.getObjRelation("Location");
        //Point location = aCom.getLocationOnScreen();
        try {
            Robot rob = new Robot();
View Full Code Here

        // change view to sheet containing the chart
        aCalcHelper.raiseChartSheet();
       
        // the unit for measures is 1/100th of a millimeter
        // position at (1cm, 1cm)
        Point aPos    = new Point( 1000, 1000 );
       
        // size of the chart is 15cm x 9.271cm
        Size  aExtent = new Size( 15000, 9271 );
       
        // insert a new chart into the "Chart" sheet of the
View Full Code Here

TOP

Related Classes of com.sun.star.awt.Point

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.