Package com.sun.star.awt

Examples of com.sun.star.awt.Point


        tRes.tested("setElementPos()", true);
    }
   
    public void _setElementPosSize() {
        requiredMethod("createElement()");
        Point p = new Point();
        p.X = 150;
        p.Y = 0;
        Size size = new Size();
        size.Height = 50;
        size.Width = 80;
View Full Code Here


    }
   
    public void _refreshArrows() {
        boolean result = true;
       
        Point p0 = pos;

        try {
            result &= xSheet[1].getCellByPosition(6, 7).getValue() == 4;
            xSheet[1].getCellByPosition(6, 7).setFormula("= SQRT(" + sheetName + ".G7)");
            result &= xSheet[1].getCellByPosition(6, 7).getValue() == 3;
        }
        catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            throw new StatusException("Could not set formulas on sheets.", e);
        }
       
        result &= hasRightAmountOfShapes(1);
        Point p1 = pos;

        // points have to be the same: if not we have an auto update
        boolean res = (p0.X == p1.X && p0.Y == p1.Y);
        result &= res;
        if (!res)
            log.println("Arrow has been refreshed, but this should have been switched off.");
       
        oObj.refreshArrows();

        result &= hasRightAmountOfShapes(1);
        Point p2 = pos;
       
        // points have to differ
        res = (p1.X != p2.X || p1.Y != p2.Y);
        result &= res;
        if (!res)
View Full Code Here

        XControlShape xShape = (XControlShape)UnoRuntime.queryInterface( XControlShape.class,
            xDocAsFactory.createInstance( "com.sun.star.drawing.ControlShape" ) );

        // position and size of the shape
        xShape.setSize( new Size( nWidth * 100, nHeight * 100 ) );
        xShape.setPosition( new Point( nXPos * 100, nYPos * 100 ) );

        // adjust the anchor so that the control is tied to the page
        XPropertySet xShapeProps = UNO.queryPropertySet( xShape );
        TextContentAnchorType eAnchorType = TextContentAnchorType.AT_PARAGRAPH;
        xShapeProps.setPropertyValue( "AnchorType", eAnchorType );
View Full Code Here

//      xGroupShape = xShape;
        oDateControl  = new DatabaseControl(oFormHandler, _xFormName, _curFieldName, DataType.DATE, aPoint);
        int nDBHeight = oDateControl.getDBHeight();
        nDateWidth = oDateControl.getPreferredWidth();
        oDateControl.setSize(new Size(nDateWidth , nDBHeight));
        Point aTimePoint = new Point(aPoint.X + 10 + nDateWidth, aPoint.Y);
        oTimeControl = new DatabaseControl(oFormHandler, _xFormName, _curFieldName, DataType.TIME, aTimePoint);
        nTimeWidth = oTimeControl.getPreferredWidth();
        oTimeControl.setSize(new Size(nTimeWidth,nDBHeight));
        nDBWidth = nDateWidth + nTimeWidth + 10;
        xShapes.add(oDateControl.xShape);
View Full Code Here

    }


    public void setPosition(Point _aPoint){
        // --> TESTING
        Point aBeforePt = xShapeGroup.getPosition();
        // <--
        xShapeGroup.setPosition(_aPoint);
//      oDateControl.xShape.setPosition(_aPoint);
//      Point atimepoint = new Point(oDateControl.xShape.getPosition().X + oDateControl.xShape.getSize().Width, oDateControl.xShape.getPosition().Y );
//      oTimeControl.xShape.setPosition(atimepoint);
        // --> TESTING
        Point aAfterPt = xShapeGroup.getPosition();
        // <--
    }
View Full Code Here

            return null;
    }


    public void initializeBasicControlValues(){
        Control oLabelControl = new Control(this, SOLABEL, new Point(), new Size());
        XDevice xDevice = (XDevice) UnoRuntime.queryInterface(XDevice.class, oLabelControl.xWindowPeer);
        iXPixelFactor = (int) (100000/xDevice.getInfo().PixelPerMeterX);
        iYPixelFactor = (int) (100000/xDevice.getInfo().PixelPerMeterY);
        nLabelHeight = (oLabelControl.getPreferredHeight("The quick brown fox...") + 1);
        Control oTextControl = new Control(this, SOTEXTBOX, new Point(), new Size());
        nDBRefHeight = (oTextControl.getPreferredHeight("The quick brown fox...") + 1);
        BasicLabelDiffHeight = (nDBRefHeight - nLabelHeight)/2;
        xDrawPage.remove(oLabelControl.xShape);
        xDrawPage.remove(oTextControl.xShape);
    }
View Full Code Here

    if (ControlList != null){
        for (int i = 0; i < ControlList.length; i++){
            if (ControlList[i] != null)
//              try {
//                  this.xDrawPage.remove(ControlList[i].xShape);
                    ControlList[i].setPosition(new Point(this.iXNirwanaPos, this.iYNirwanaPos));
//                  String sControlName = (String) ControlList[i].xPropertySet.getPropertyValue("Name");
//
//                  if (_xNamedForm.hasByName(sControlName))
//                      _xNamedForm.removeByName(sControlName);
//              } catch (Exception e) {
View Full Code Here

    public void moveShapesToNirwana(){
    try {
        for (int i = 0; i < this.xDrawPage.getCount(); i++){
            XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xDrawPage.getByIndex(i));
            xShape.setPosition(new Point(this.iXNirwanaPos, this.iYNirwanaPos));
        }
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }}
View Full Code Here

        PolygonFlags[] flags = new PolygonFlags[1];
        flags[0] = PolygonFlags.NORMAL;
        fArray[0] = flags;
        Point[][] pArray = new Point[1][1];
        Point[] points = new Point[1];
        Point aPoint = new Point();
        aPoint.X = 1;
        aPoint.Y = 2;
        points[0] = aPoint;
        pArray[0] = points;
        if ( oldPPC.Coordinates.length == 0 ) {
View Full Code Here

     */
    public boolean _getIndexAtPoint() {

        boolean res = true;
        log.println("getIndexAtPoint(-1, -1):");
        Point pt = new Point(-1, -1);
        int index = oObj.getIndexAtPoint(pt);
        log.println(Integer.toString(index));
        res &= index == -1;

        if (chBounds != null) {
            pt = new Point(chBounds.X , chBounds.Y );
          log.println("getIndexAtPoint(" + pt.X + ", " + pt.Y + "):");
          index = oObj.getIndexAtPoint(pt);
          log.println(Integer.toString(index));
          res &= index == (chCount - 1);
    }
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.