Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Control.computeSize()


            Control[] children = composite.getChildren();
            Rectangle carea = composite.getClientArea();
            Control content = children[0];
            Control label = children[1];
            Point contentSize = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
            Point labelSize = label.computeSize(carea.width - 2
                    - LABEL_MARGIN_WIDTH * 2, SWT.DEFAULT);
            content.setBounds(carea.width / 2 - contentSize.x / 2, carea.height
                    / 2 - contentSize.y / 2, contentSize.x, contentSize.y);
            label.setBounds(LABEL_MARGIN_WIDTH, content.getLocation().y
                    + contentSize.y + VERTICAL_SPACING, carea.width
View Full Code Here


    protected Point getObjectSize(Hashtable resourceTable, int wHint) {
        Control control = getControl(resourceTable);
        if (control==null)
            return new Point(0,0);
        int realWhint = FormUtil.getWidthHint(wHint, control);
        Point size = control.computeSize(realWhint, SWT.DEFAULT);
        if (realWhint!=SWT.DEFAULT && fill)
            size.x = Math.max(size.x, realWhint);
        if (width !=SWT.DEFAULT)
            size.x = width;
        if (height != SWT.DEFAULT)
View Full Code Here

  protected Point getObjectSize(Hashtable resourceTable, int wHint) {
    Control control = getControl(resourceTable);
    if (control==null)
      return new Point(0,0);
    int realWhint = FormUtil.getWidthHint(wHint, control);
    Point size = control.computeSize(realWhint, SWT.DEFAULT);
    if (realWhint!=SWT.DEFAULT && fill)
      size.x = Math.max(size.x, realWhint);
    if (width !=SWT.DEFAULT)
      size.x = width;
    if (height != SWT.DEFAULT)
View Full Code Here

                final ScrolledComposite scrolledComposite = (ScrolledComposite) composite;
                final Control scrolledCompositeContent = scrolledComposite.getContent();
               
                if( scrolledCompositeContent != null )
                {
                  scrolledComposite.setMinSize( scrolledCompositeContent.computeSize( SWT.DEFAULT, SWT.DEFAULT ) );
                  updatePageIncrement( scrolledComposite );
                }
            }
        }
    }
View Full Code Here

                } else if (i > 0) { /* we assume this window is contents */
                    hide = false;
                }

                if (!hide) {
                    Point e = w.computeSize(wHint, hHint, flushCache);
                    result.x = Math.max(result.x, e.x);
                    result.y += e.y + VGAP;
                }
            }

View Full Code Here

            for (int i = 0; i < ws.length; i++) {
                Control w = ws[i];

                if (w == seperator1) { // Separator
                    Point e = w.computeSize(SWT.DEFAULT, SWT.DEFAULT,
                            flushCache);
                    w.setBounds(clientArea.x, clientArea.y, clientArea.width,
                            e.y);
                    clientArea.y += e.y;
                    clientArea.height -= e.y;
View Full Code Here

                            e.y);
                    clientArea.y += e.y;
                    clientArea.height -= e.y;
                } else if (getToolBarControl() == w) {
                    if (toolBarChildrenExist()) {
                        Point e = w.computeSize(SWT.DEFAULT, SWT.DEFAULT,
                                flushCache);
                        w.setBounds(clientArea.x, clientArea.y,
                                clientArea.width, e.y);
                        clientArea.y += e.y + VGAP;
                        clientArea.height -= e.y + VGAP;
View Full Code Here

                        clientArea.y += e.y + VGAP;
                        clientArea.height -= e.y + VGAP;
                    }
                } else if (getCoolBarControl() == w) {
                    if (coolBarChildrenExist()) {
                        Point e = w.computeSize(clientArea.width, SWT.DEFAULT,
                                flushCache);
                        w.setBounds(clientArea.x, clientArea.y,
                                clientArea.width, e.y);
                        clientArea.y += e.y + VGAP;
                        clientArea.height -= e.y + VGAP;
View Full Code Here

                        clientArea.y += e.y + VGAP;
                        clientArea.height -= e.y + VGAP;
                    }
                } else if (statusLineManager != null
                        && statusLineManager.getControl() == w) {
                    Point e = w.computeSize(SWT.DEFAULT, SWT.DEFAULT,
                            flushCache);
                    w.setBounds(clientArea.x, clientArea.y + clientArea.height
                            - e.y, clientArea.width, e.y);
                    clientArea.height -= e.y + VGAP;
                } else {
View Full Code Here

    Control pageControl = page.getControl();
    if (pageControl == null) {
      // control not created yet
      return new Point(0, 0);
    }
    Point contentSize = pageControl.computeSize(SWT.DEFAULT, SWT.DEFAULT,
        true);
    Rectangle rect = pageContainerLayout.getClientArea(pageContainer);
    Point containerSize = new Point(rect.width, rect.height);
    return new Point(Math.max(0, contentSize.x - containerSize.x), Math
        .max(0, contentSize.y - containerSize.y));
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.