Package com.sun.star.awt

Examples of com.sun.star.awt.Point


        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 contains point ("
                + curX + ",0) - OK");
        } else {
            log.println
                ("Upper bound of box contains 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("Contains 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 contains point ("
                + curX + "," + (bounds.Height - 1) + ") - OK");
        } else {
            log.println
                ("Lower bound of box contains 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 contains point (0,"
                + curY + ") - OK");
        } else {
            log.println
                ("Left bound of box contains 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 contains point ("
                + (bounds.Width - 1) + "," + curY + ") - OK");
        } else {
            log.println
                ("Right bound of box contains 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");
        } else {
View Full Code Here


                    +  util.AccessibilityTools.accessibleToString(children[i]));

                log.println("finding the point which lies on the component");
                int curX = 0;
                int curY = 0;
                while (!children[i].containsPoint(new Point(curX, curY))
                       && curX < chBnd.Width) {
                    curX++;
                    curY++;
                };

                if (curX==chBnd.Width) {
                    log.println("Couldn't find a point with contains");
                    continue;
                }

                // trying the point laying on child
                XAccessible xAcc = oObj.getAccessibleAtPoint
                    (new Point(chBnd.X , chBnd.Y));
                if (xAcc == null) {
                    log.println("The child not found at point ("
                        + (chBnd.X ) + "," + chBnd.Y + ") - FAILED");
                    result = false;
                } else {
                    XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface
                        (XAccessible.class, children[i]);
                    log.println("Child found at point ("
                        + (chBnd.X ) + "," + chBnd.Y + ") - OK");
                    boolean res = util.AccessibilityTools.equals(xAccCh, xAcc);
                    if (!res) {
                        int expIndex = xAccCh.getAccessibleContext().getAccessibleIndexInParent();
                        int gotIndex = xAcc.getAccessibleContext().getAccessibleIndexInParent();
                        if (expIndex < gotIndex) {
                            log.println("The children found is not the same");
                            log.println("The expected child " +
                                xAccCh.getAccessibleContext().getAccessibleName());
                            log.println("is hidden behind the found Child ");
                            log.println(xAcc.getAccessibleContext().getAccessibleName()+" - OK");
                        } else {
                            log.println("The children found is not the same - FAILED");
                            log.println("Expected: "
                                +xAccCh.getAccessibleContext().getAccessibleName());
                            log.println("Found: "
                                +xAcc.getAccessibleContext().getAccessibleName());
                            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");
                    result &= true;
                } else {
View Full Code Here

     * </ul>
     */
    public boolean _getLocation() {

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

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

        return result;
    }
View Full Code Here

    public boolean _getLocationOnScreen() {

        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

    */      
    public static XControlShape createControlShape( XComponent oDoc, int height,
                                        int width, int x, int y, String kind ) {
                                       
       Size size = new Size();       
        Point position = new Point();
        XControlShape oCShape = null;
        XControlModel aControl = null;

        //get MSF
        XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
View Full Code Here

  public static XControlShape createUnoControlShape( XComponent oDoc, int height,
                                        int width, int x, int y, String kind, String defControl ) {

       Size size = new Size();
        Point position = new Point();
        XControlShape oCShape = null;
        XControlModel aControl = null;

        //get MSF
       XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc );
View Full Code Here

  public static XControlShape createControlShapeWithDefaultControl( XComponent oDoc, int height,
                                        int width, int x, int y, String kind ) {

       Size size = new Size();
        Point position = new Point();
        XControlShape oCShape = null;
        XControlModel aControl = null;

        //get MSF
       XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc );
View Full Code Here

            nMargin = 1000;
        xPropPageStyle.setPropertyValue("RightMargin", new Integer(nMargin));
        xPropPageStyle.setPropertyValue("LeftMargin", new Integer(nMargin));
        xPropPageStyle.setPropertyValue("TopMargin", new Integer(nMargin));
        xPropPageStyle.setPropertyValue("BottomMargin", new Integer(nMargin));
        aMainFormPoint = new Point(nMargin, nMargin);
        nFormWidth = (int) (0.8 * (double) nPageWidth) - 2 * nMargin;
        nFormHeight = (int) (0.65 * (double) nPageHeight) - 2 * nMargin;
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }}
View Full Code Here

        return aSubFormSize;
    }

    private Point getSubFormPoint(){
        ControlForm curMainControlForm = ((ControlForm) oControlForms.get(0));
        return new Point(curMainControlForm.aStartPoint.X,
                        (curMainControlForm.aStartPoint.Y + curMainControlForm.getFormSize().Height +  SOFORMGAP));
    }
View Full Code Here

    private void adjustSubFormPosSize(Short _NBorderType){
        ControlForm oMainControlForm = (ControlForm) oControlForms.get(0);
        ControlForm oSubControlForm = (ControlForm) oControlForms.get(1);
        oSubControlForm.setFormSize(new Size(nFormWidth, (int)nFormHeight - oMainControlForm.getFormSize().Height));
        if (oSubControlForm.curArrangement == FormWizard.SOGRID){
            Point aPoint = oSubControlForm.oGridControl.getPosition();
            int idiffheight = oSubControlForm.getEntryPointY() - oMainControlForm.getActualFormHeight()- oMainControlForm.aStartPoint.Y - SOFORMGAP;
            oSubControlForm.setStartPoint(new Point(aPoint.X, (aPoint.Y - idiffheight)));
            oSubControlForm.oGridControl.setPosition(oSubControlForm.aStartPoint);
            oSubControlForm.oGridControl.setSize(getSubFormSize());
        }
        else{
//          oSubControlForm.oFormController.adjustYPositions(_idiffheight);
            oSubControlForm.setStartPoint( new Point(oSubControlForm.aStartPoint.X, oMainControlForm.getActualFormHeight() + oMainControlForm.aStartPoint.Y + SOFORMGAP));
            oSubControlForm.oFormController.positionControls(oSubControlForm.curArrangement, oSubControlForm.aStartPoint, oSubControlForm.getAvailableFormSize(), curUIControlArranger.getAlignValue(), _NBorderType);
        }
    }
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.