Package com.sun.star.awt

Examples of com.sun.star.awt.Size



    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);
View Full Code Here


                ControlForm curSubControlForm = ((ControlForm) oControlForms.get(1));
                if (curSubControlForm != null){
                    adjustSubFormPosSize(_NBorderType);
                }
            }
            setFormSize(new Size(aFormSize.Width, getActualFormHeight()));
            unlockallControllers();
        }
View Full Code Here

              new Object[] {UIConsts.INTEGERS[8], sArrangementHeader[_formindex], new Integer(97), YPos, IControlStep, new Short(curtabindex++), new Integer(207)}
            );
           
            int nypos = SOBASEIMAGEYPOSITION + 12+ _formindex * SOIMAGELISTHEIGHT;
            ilLayouts = new ImageList();
            ilLayouts.setPos(new Size( 107,nypos));
            ilLayouts.setImageSize(new Size(26,26));
            ilLayouts.setCols(4);
            ilLayouts.setRows(1);
            ilLayouts.name = "ImageList_" + formindex;
            ilLayouts.setStep(new Short((short) FormWizard.SOCONTROLPAGE));
            ilLayouts.setShowButtons(false);
            ilLayouts.setRenderer(new LayoutRenderer());
            ilLayouts.setSelectionGap(new Size(2,2));
            ilLayouts.setGap(new Size(3,3));
            ilLayouts.scaleImages = Boolean.FALSE;
            ilLayouts.tabIndex = (int) curtabindex++;
            ilLayouts.helpURL = 34453 + (formindex * 4);
           
            ilLayouts.setListModel(model);
View Full Code Here

                nControlBaseWidth = curDBControl.getSize().Width;
            if (FieldColumns[i].FieldType == DataType.TIMESTAMP){
                TimeStampControl oDBTimeStampControl = (TimeStampControl) curDBControl;
                nControlBaseWidth = oDBTimeStampControl.getSize().Width;
                if (this.isReducable(i) || WidthFactor > 0)
                    oDBTimeStampControl.setSize( new Size(nControlBaseWidth + WidthFactor * CorrWidth, oDBTimeStampControl.getSize().Height));
            }
            else{
                if (this.isReducable(i) || WidthFactor > 0)
                    curDBControl.setSize( new Size(nControlBaseWidth + WidthFactor * CorrWidth, curDBControl.getSize().Height));
            }
            iLocTCPosX = curDBControl.getPosition().X + curDBControl.getSize().Width + cHoriDistance;
            if (curLabelControl.getSize().Width > curDBControl.getSize().Width)
                iLocTCPosX = curLabelControl.getPosition().X + curLabelControl.getSize().Width + cHoriDistance;
        }
View Full Code Here

        for (int i = StartA; i <= LastIndex; i++){
            if (i == StartA){
                nXTCPos = LabelControlList[i].getPosition().X;
                nXDBPos = nXTCPos + nMaxTCWidth  + cHoriDistance;
            }
            LabelControlList[i].setSize(new Size(nMaxTCWidth, nTCHeight));
            resetDBShape(DBControlList[i], nXDBPos);
            checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true);
        }
    }
View Full Code Here

    try {
        if (bControlsareCreated){
            LabelControlList[i].setPosition(new Point(nXTCPos, nYTCPos));
            if (icurArrangement != FormWizard.SOCOLUMNARLEFT){
                nTCWidth = LabelControlList[i].getPreferredWidth(FieldColumns[i].FieldTitle);
                LabelControlList[i].setSize(new Size(nTCWidth, nTCHeight));
            }
            else
                nTCWidth = LabelControlList[i].getSize().Width;
        }
        else{
            Point aPoint = new Point(nXTCPos, nYTCPos);
            Size aSize = new Size(nTCWidth,nTCHeight);
            this.LabelControlList[i] = new Control(oFormHandler, xFormName, FormHandler.SOLABEL, FieldColumns[i].FieldName, aPoint, aSize);
            if (bIsVeryFirstRun){
                if (icurArrangement == FormWizard.SOCOLUMNARTOP)
                    nYDBPos = nYTCPos + nTCHeight;
            }
            nTCWidth = LabelControlList[i].getPreferredWidth(FieldColumns[i].FieldTitle);
        }
        curLabelControl = LabelControlList[i];
        if (icurArrangement == FormWizard.SOCOLUMNARLEFT){
            // Note This If Sequence must be called before retrieving the outer Points
            if (bIsFirstRun){
                nMaxTCWidth = nTCWidth;
                bIsFirstRun = false;
            }
            else if (nTCWidth > nMaxTCWidth){
                nMaxTCWidth = nTCWidth;
            }
        }
        checkOuterPoints(nXTCPos, nTCWidth, nYTCPos, nTCHeight, false);
        if ((icurArrangement == FormWizard.SOCOLUMNARTOP) || (icurArrangement == FormWizard.SOTOPJUSTIFIED)){
            nXDBPos = nXTCPos;
            nYDBPos = nYTCPos + nTCHeight;
            curLabelControl.xPropertySet.setPropertyValue("Align", new Short((short)com.sun.star.awt.TextAlign.LEFT));             
        }
        else
            curLabelControl.xPropertySet.setPropertyValue("Align", new Short((short)_iAlign));     
        if (!bControlsareCreated)
            curLabelControl.setSize(new Size(nTCWidth,nTCHeight));
//      if (CurHelpText != ""){
//          oModel.HelpText = CurHelptext;
//      }
    } catch (Exception e) {
        e.printStackTrace(System.out);
View Full Code Here

        }
        this.curDBControl = DBControlList[i];
        nDBHeight = curDBControl.getDBHeight();
        nDBWidth = curDBControl.getDBWidth();
        if (FieldColumns[i].FieldType != DataType.TIMESTAMP)
            curDBControl.setSize(new Size(nDBWidth, nDBHeight));
        if (curDBControl.getControlType() == FormHandler.SOCHECKBOX){
            nYDBPos = nYDBPos +(int)((oFormHandler.getDBRefHeight() - nDBHeight)/2);
            aPoint = new Point(nXDBPos, nYDBPos);
            curDBControl.setPosition(aPoint);
        }
View Full Code Here

* @param _aFont
* @return width of given text in 1/100mm
*/
    Size getPreferredSize(String _sText, FontDescriptor _aFont)
    {
        Size aSizeMM_100TH = new Size(0,0);
        try
        {
            // Object aControlContainer = getGlobalMSF().createInstance("com.sun.star.awt.UnoControlContainer");
            // XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(XControlContainer.class, aControlContainer);

            final Object aFixedTextModel = getGlobalMSF().createInstance("com.sun.star.awt.UnoControlFixedTextModel");
            final XControlModel xFixedTextModel = (XControlModel)UnoRuntime.queryInterface(XControlModel.class, aFixedTextModel);

            final PropertySetHelper aPropertySetHelper = new PropertySetHelper(xFixedTextModel);
//          aPropertySetHelper.showProperties();
            aPropertySetHelper.setPropertyValueDontThrow("FontDescriptor", _aFont);
           
            final Object aUnoCtrlFixedText = getGlobalMSF().createInstance("com.sun.star.awt.UnoControlFixedText");
//            XServiceInfo xServiceInfo2 = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, aUnoCtrlFixedText);
//            String[] sServices2 = xServiceInfo2.getSupportedServiceNames();

            final XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, aUnoCtrlFixedText);
            xWindow.setVisible(false);

            final XControl xControl = (XControl)UnoRuntime.queryInterface(XControl.class, aUnoCtrlFixedText);
            xControl.setModel(xFixedTextModel);

            final com.sun.star.awt.XFixedText xFixedText = (com.sun.star.awt.XFixedText)UnoRuntime.queryInterface(com.sun.star.awt.XFixedText.class, aUnoCtrlFixedText);
            xFixedText.setText(_sText);
           
            final XLayoutConstrains xLayoutConstraints = (XLayoutConstrains)UnoRuntime.queryInterface(XLayoutConstrains.class, aUnoCtrlFixedText);
            final Size aSizeInPixel = xLayoutConstraints.getPreferredSize();
                   
            final XWindowPeer xPeerOfReportDefinition = (XWindowPeer)UnoRuntime.queryInterface(XWindowPeer.class, getReportDefinition().getCurrentController().getFrame().getComponentWindow());
            xControl.createPeer(null, xPeerOfReportDefinition);

            final XWindowPeer x = xControl.getPeer();
View Full Code Here

                {
                    m_aFixedTextHelper.setCharHeight(_nCharHeight);
                }

                final FontDescriptor xFont = m_aFixedTextHelper.getFontDescriptor();
                final Size aSize = getPreferredSize(_sLabel, xFont);
                nWidth = aSize.Width;
                // cache the found width
                m_aLabelWidthMap.put(sKey, new Integer(nWidth));
            }
            catch (com.sun.star.uno.Exception e)
View Full Code Here

   

    public Size changePageAlignment(XPropertySet _xPropPageStyle, boolean _bIsLandscape){
        try {
            _xPropPageStyle.setPropertyValue("IsLandscape", new Boolean(_bIsLandscape));
            Size aPageSize = (Size) AnyConverter.toObject(Size.class, _xPropPageStyle.getPropertyValue("Size"));
            int nPageWidth = aPageSize.Width;
            int nPageHeight = aPageSize.Height;
            Size aSize = new Size(nPageHeight, nPageWidth);
            _xPropPageStyle.setPropertyValue("Size", aSize);
            return (Size) AnyConverter.toObject(Size.class,_xPropPageStyle.getPropertyValue("Size"));
        } catch (Exception e) {
            e.printStackTrace(System.out);
            return null;
View Full Code Here

TOP

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

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.