Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Point


                Transform transform = new Transform(e.gc.getDevice());
                transform.rotate(270);
                e.gc.setTransform(transform);

                String s = activeTopBar.getShortTitle();
                Point size = e.gc.textExtent(s);
                e.gc.drawText(s, -size.x, 0, true);
                //e.gc.drawText(s, 0,0, true);
                transform.dispose();
              } catch (Exception ex) {
                // setTransform can trhow a ERROR_NO_GRAPHICS_LIBRARY error
View Full Code Here


     
      //Avoid dividing by 0 when there are no items
      int nbRows = itemsPerRow > 0 ? (controls.length+itemsPerRow-1) / itemsPerRow : 1;
     
      cached = true;
      cachedSize = new Point(2 * borderW + (maxWidth+margin) * itemsPerRow - margin, 2 * borderH + (margin + maxHeight) * nbRows - margin);
     
    }
   
    return cachedSize;
   
View Full Code Here

    }

    final Control control = skinObject.getControl();

    if (control != null && !control.isDisposed()) {
      Point size;
      if (visible) {
        final FormData fd = (FormData) control.getLayoutData();
        size = (Point) control.getData("v3.oldHeight");
        //System.out.println(control.getData("SkinID") + " oldHeight = " + size + ";v=" + control.getVisible() + ";s=" + control.getSize());
        if (size == null) {
          size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
          if (fd.height > 0) {
            size.y = fd.height;
          }
          if (fd.width > 0) {
            size.x = fd.width;
          }
        }
      } else {
        size = new Point(0, 0);
      }
      setVisibility(skin, configID, skinObject, size, save, fast, null);
    }
  }
View Full Code Here

      if (control != null && !control.isDisposed()) {
        if (visible) {
          FormData fd = (FormData) control.getLayoutData();
          fd.width = 0;
          fd.height = 0;
          control.setData("oldSize", new Point(0, 0));

          skinObject.setVisible(visible);

          // FormData should now be 0,0, but setVisible may have
          // explicitly changed it
          fd = (FormData) control.getLayoutData();
         
          if (fd.width != 0 || fd.height != 0) {
            return;
          }

          if (destSize != null) {
            if (fd != null
                && (fd.width != destSize.x || fd.height != destSize.y)) {
              if (fast) {
                fd.width = destSize.x;
                fd.height = destSize.y;
                control.setLayoutData(fd);
                Utils.relayout(control);
              } else {
                slide(skinObject, fd, destSize, runAfterSlide);
                runAfterSlide = null; // prevent calling again
              }
            }
          } else {
            if (fd.width == 0) {
              fd.width = SWT.DEFAULT;
            }
            if (fd.height == 0) {
              fd.height = SWT.DEFAULT;
            }
            control.setLayoutData(fd);
            Utils.relayout(control);
          }
          control.setData("v3.oldHeight", null);
        } else {
          final FormData fd = (FormData) control.getLayoutData();
          if (fd != null) {
            Point oldSize = new Point(fd.width, fd.height);
            if (oldSize.y <= 0) {
              oldSize = null;
            }
            control.setData("v3.oldHeight", oldSize);
View Full Code Here

      public void runSupport() {
        if (control.isDisposed()) {
          return;
        }
        Point size = (Point) control.getData("slide.destSize");
        if (size == null) {
          return;
        }

        if (firstTime) {
View Full Code Here

    SWTSkinObjectText soSubTitle = (SWTSkinObjectText) skin.getSkinObject("subtitle");
    if (soSubTitle != null) {
      soSubTitle.setTextID("label.clickone");
    }

    Point computeSize = skinnedDialog.getShell().computeSize(600, SWT.DEFAULT, true);
    skinnedDialog.getShell().setSize(computeSize);
    Shell mainShell = UIFunctionsManagerSWT.getUIFunctionsSWT().getMainShell();
    Utils.centerWindowRelativeTo(skinnedDialog.getShell(), mainShell);
  }
View Full Code Here

            if (minWidth >= 0) {
              FormData fd = (FormData) button.getLayoutData();
              if (fd == null) {
                fd = new FormData();
              }
              Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
              if (size.x < minWidth) {
                fd.width = minWidth;
              } else {
                fd.width = -1;
              }
View Full Code Here

      }
      button.setEnabled(b);
      button.setText(buttonText);

      RowData rowData = new RowData();
      Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      size.x += BUTTON_PADDING;
      if (size.x < MIN_BUTTON_WIDTH) {
        size.x = MIN_BUTTON_WIDTH;
      }
      rowData.width = size.x;
View Full Code Here

    final SWTSkinObject soWaitProgress = skin.getSkinObject("progress");
    if (soWaitProgress != null) {
      soWaitProgress.getControl().addPaintListener(new PaintListener() {
        public void paintControl(PaintEvent e) {
          Control c = (Control) e.widget;
          Point size = c.getSize();
          e.gc.setBackground(ColorCache.getColor(e.display, "#23a7df"));
          Object data = soWaitProgress.getData("progress");
          if (data instanceof Long) {
            int waitProgress = ((Long) data).intValue();
            int breakX = size.x * waitProgress / 100;
View Full Code Here

        return;
      }
     
      boolean size_changed = (old_size == null || old_size.x != bounds.width || old_size.y != bounds.height);

      old_size = new Point(bounds.width,bounds.height);

      refresh_count++;

      if ( refresh_count > graphicsUpdate ){
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.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.