Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Point


    ((GridData) fFolderViewerContainer.getLayoutData()).exclude = !excluded;
    fFolderViewerContainer.getShell().layout();

    fAddFolderBar.setVisible(excluded);

    Point size = fFolderViewerContainer.getShell().getSize();
    fFolderViewerContainer.getShell().setSize(size.x, size.y + (excluded ? fViewerHeight : -fViewerHeight));

    if (excluded)
      fFolderViewer.getTree().setFocus();
    else
View Full Code Here


  /*
   * @see org.eclipse.swt.widgets.Composite#computeSize(int, int, boolean)
   */
  @Override
  public Point computeSize(int wHint, int hHint, boolean changed) {
    Point point = super.computeSize(wHint, hHint, changed);

    /* Compute from Condition Item */
    if (fVisibleItemCount > 0 && fItems.size() > 0) {
      int itemHeight = fItems.get(0).computeSize(wHint, hHint).y + 4;
      point.y = fVisibleItemCount * itemHeight;
 
View Full Code Here

    createConditionMenu(conditionMenu, item);
    addButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        if (event.detail == SWT.ARROW) {
          Rectangle rect = item.getBounds();
          Point pt = new Point(rect.x, rect.y + rect.height);
          pt = buttonBar.toDisplay(pt);
          conditionMenu.setLocation(pt.x, pt.y);
          conditionMenu.setVisible(true);
        } else
          onAdd(item);
View Full Code Here

    addButton.setText(Messages.NewsColumnSelectionControl_ADD);
    addButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        Rectangle rect = addButton.getBounds();
        Point pt = new Point(rect.x, rect.y + rect.height);
        pt = addButton.toDisplay(pt);
        menu.setLocation(pt.x, pt.y);
        menu.setVisible(true);
      }
    });
View Full Code Here

  }

  private GridData setButtonLayoutData(Button button) {
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    int widthHint = Dialog.convertHorizontalDLUsToPixels(fFontMetrics, IDialogConstants.BUTTON_WIDTH);
    Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    data.widthHint = Math.max(widthHint, minSize.x);
    button.setLayoutData(data);
    return data;
  }
View Full Code Here

      fNewState.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          if (fNewState.getSelection() && !fUnreadState.getSelection()) {
            Point toolTipLocation = toDisplay(fUnreadState.getLocation());
            toolTipLocation.y += fUnreadState.getSize().y;
            if (Application.IS_WINDOWS)
              toolTipLocation.x += 5;
            else if (Application.IS_LINUX)
              toolTipLocation.x += 12;

            unreadStateToolTip.setLocation(toolTipLocation);
            unreadStateToolTip.setVisible(true);
          } else {
            unreadStateToolTip.setVisible(false);
          }
        }
      });

      fUnreadState.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          if (fUnreadState.getSelection() && !fNewState.getSelection()) {
            Point toolTipLocation = toDisplay(fNewState.getLocation());
            toolTipLocation.y += fNewState.getSize().y;
            if (Application.IS_WINDOWS)
              toolTipLocation.x += 5;
            else if (Application.IS_LINUX)
              toolTipLocation.x += 12;
View Full Code Here

    fColorItem = new ToolItem(fBar, SWT.DROP_DOWN);
    fColorItem.setImage(createColorImage(fSelectedColor));
    fColorItem.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        Rectangle rect = fColorItem.getBounds();
        Point pt = new Point(rect.x, rect.y + rect.height);
        pt = fBar.toDisplay(pt);
        fColorMenu.setLocation(pt.x, pt.y);
        fColorMenu.setVisible(true);
      }
    });
View Full Code Here

     * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
     */
    @Override
    protected void initializeBounds() {
      super.initializeBounds();
      Point bestSize = getShell().computeSize(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT);
      getShell().setSize(bestSize);
      LayoutUtils.positionShell(getShell());
    }
View Full Code Here

   * @return The size of the Text as Point.
   */
  public static Point getTextSize(Drawable drawable, Font font, String text) {
    GC gc = new GC(drawable);
    gc.setFont(font);
    Point p = gc.textExtent(text);
    gc.dispose();

    return p;
  }
View Full Code Here

     * of the popup to match the actual size of the Text widget being used.
     */
    control.getDisplay().timerExec(100, new Runnable() {
      public void run() {
        if (!control.isDisposed()) {
          adapter.setPopupSize(new Point(control.getSize().x, large ? 90 : 50));
        }
      }
    });

    return Pair.create(proposalProvider, adapter);
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.