Java 类org.eclipse.swt.graphics.Point 实例源码

项目:applecommander    文件:TextFilterAdapter.java   
protected void createTextWidget(String textContents) {
    StyledText styledText = new StyledText(getComposite(), SWT.NONE);
    styledText.setText(textContents);
    styledText.setFont(getCourierFont());
    styledText.setEditable(false);
    //styledText.setWordWrap(true);     // seems to throw size out-of-whack
    Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    getComposite().setContent(styledText);
    getComposite().setExpandHorizontal(true);
    getComposite().setExpandVertical(true);
    getComposite().setMinWidth(size.x);
    getComposite().setMinHeight(size.y);
    getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());

    getToolItem().setSelection(true);       
    setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
}
项目:xcalendar    文件:XCalendarTimeWidget.java   
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
    // Background
    final GC gc = frame.getGc();
    final boolean hovered = mouse.isEntered();
    final XCalendarModel model = popup.getModel();
    final XCalendarTheme theme = model.getTheme();
    final XVirtualCalendar calendar = model.getCalendar();
    int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
    gc.setBackground(theme.getBackground(true, false, false, hovered));
    gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

    // Foreground
    String t1 = this.type.text(theme, calendar);
    gc.setForeground(theme.getForeground(true, false, true));
    gc.setFont(theme.getBold()); final Point s1 = extent(gc, t1);
    gc.drawText(t1, x + 1 + ((w - s1.x) >> 1), y + 1 + ((h - s1.y) >> 1));

    if(this.type == XCalendarTime.HOUR || this.type == XCalendarTime.MINUTE) {
        String t2 = ":"; Point s2 = extent(gc, t2);
        gc.setBackground(theme.getBackground(true, false, false, false));
        gc.drawText(t2, x + 1 + w + (getMargin().x >> 2), y + 1 + ((h - s2.y) >> 1));
    }
}
项目:eclipse-batch-editor    文件:AbstractFilterableTreeQuickDialog.java   
@Override
protected Point getInitialSize() {
    IDialogSettings dialogSettings = getDialogSettings();
    if (dialogSettings == null) {
        /* no dialog settings available, so fall back to min settings */
        return new Point(minWidth, minHeight);
    }
    Point point = super.getInitialSize();
    if (point.x < minWidth) {
        point.x = minWidth;
    }
    if (point.y < minHeight) {
        point.y = minHeight;
    }
    return point;
}
项目:tap17-muggl-javaee    文件:ArrayEntriesWindow.java   
/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param arrayModificationHandler The ArrayModificationHandler the holds the represented array.
 * @param myDimension The dimension of a probably multidimensional array this Window represents.
 * @param dimensionsIndexes Dimension indexes of the higher-level dimensions the array represented might be a part of.
 */
private void createShell(ArrayModificationHandler arrayModificationHandler, int myDimension, int[] dimensionsIndexes) {
    this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
    this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Array Entries");
    this.shell.setLayout(new FillLayout(SWT.VERTICAL));

    // Initialize the composite.
    new ArrayEntriesComposite(this, this.shell, this.display, SWT.NONE, arrayModificationHandler, myDimension, dimensionsIndexes);

    // Compute the needed size.
    Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    point.x += 2;
    point.y += 2;
    int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, this.parent.getShell());
    this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
项目:neoscada    文件:TitleRenderer.java   
@Override
public void render ( final Graphics g, final Rectangle clientRectangle )
{
    if ( this.title == null || this.title.isEmpty () )
    {
        return;
    }

    g.setClipping ( this.rect );

    g.setFont ( createFont ( g.getResourceManager () ) );

    final Point size = g.textExtent ( this.title );

    final int x = this.rect.width / 2 - size.x / 2;
    final int y = this.padding;
    g.drawText ( this.title, this.rect.x + x, this.rect.y + y, null );

    g.setClipping ( clientRectangle );
}
项目:tap17-muggl-javaee    文件:ClassInspectionWindow.java   
/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param parentShell The parent windows' Shell.
 * @param className The name of the class to inspect.
 * @param classFile The ClassFile to inspect.
 */
private void createShell(Shell parentShell, String className, ClassFile classFile) {
    this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
    this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Class File Inspection");
    this.shell.setLayout(new FillLayout(SWT.VERTICAL));

    // No need to read it later, so it is not assigned to a variable.
    new ClassInspectionComposite(this, this.shell, this.display, SWT.NONE, className, classFile);

    // Compute the needed size.
    Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    point.x += 2;
    point.y += 2;
    int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
    this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
项目:SWET    文件:BreadcrumbItem.java   
private Point computeSizeOfTextAndImages() {
    int width = 0, height = 0;
    final boolean textISNotEmpty = getText() != null && !getText().equals("");

    if (textISNotEmpty) {
        final GC gc = new GC(this.parentBreadcrumb);
        gc.setFont(this.parentBreadcrumb.getFont());
        final Point extent = gc.stringExtent(getText());
        gc.dispose();
        width += extent.x;
        height = extent.y;
    }

    final Point imageSize = computeMaxWidthAndHeightForImages(getImage(),
            this.selectionImage, this.disabledImage);

    if (imageSize.x != -1) {
        width += imageSize.x;
        height = Math.max(imageSize.y, height);
        if (textISNotEmpty) {
            width += MARGIN * 2;
        }
    }
    width += MARGIN;
    return new Point(width, height);
}
项目:xcalendar    文件:XCalendarClearWidget.java   
/**
 * Render
 */
@Override
public void render(XCalendarFrame frame) {
    // Background
    final GC gc = frame.getGc();
    final XCalendarModel model = popup.getModel();
    final XCalendarTheme theme = model.getTheme();
    final boolean hovered = this.mouse.isEntered();
    int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
    gc.setBackground(theme.getBackground(true, false, false, hovered));
    gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

    // Foreground
    String text = trash_o;
    gc.setForeground(theme.getToolBarBackground(false));
    gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
    gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
项目:tap17-muggl-javaee    文件:OptionsWindow.java   
/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param parentShell The parent windows' Shell.
 * @param classLoader The system MugglClassLoader.
 */
private void createShell(Shell parentShell, MugglClassLoader classLoader) {
    this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
    this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Options");
    this.shell.setLayout(new FillLayout(SWT.VERTICAL));

    final Image small = new Image(shell.getDisplay(),
            OptionsWindow.class.getResourceAsStream("/images/tray_small.png"));
    final Image large = new Image(shell.getDisplay(),
            OptionsWindow.class.getResourceAsStream("/images/tray_large.png"));
    this.shell.setImages(new Image[] { small, large });

    // No need to read it later, so it is not assigned to a variable.
    new OptionsComposite(this, this.shell, SWT.NONE, classLoader);

    // Compute the needed size.
    Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    point.x += 2;
    point.y += 2;
    int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
    this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
项目:AppleCommander    文件:DiskMapTab.java   
/**
 * Handle paint requests for vertical ruler.
 */
protected void paintVerticalRuler(PaintEvent event) {
    // FIXME - not i18n safe!!
    String label = (disk.getBitmapLabels()[0] + "s").toUpperCase(); //$NON-NLS-1$
    if (disk.getBitmapLabels().length == 2) {
        label = (disk.getBitmapLabels()[1] + "s").toUpperCase(); //$NON-NLS-1$
    }
    StringBuffer buf = new StringBuffer();
    for (int i=0; i<label.length(); i++) {
        if (i>0) buf.append("\n"); //$NON-NLS-1$
        buf.append(label.charAt(i));
    }
    label = buf.toString();
    Canvas canvas = (Canvas) event.widget;
    Rectangle area = canvas.getClientArea();
    event.gc.drawLine(area.x + area.width/2, area.y, area.x + area.width/2, area.y + area.height);
    Point size = event.gc.textExtent(label);
    event.gc.drawText(label, area.x + area.width/2 - size.x/2, area.y + area.height/2 - size.y/2);
}
项目:BiglyBT    文件:TabbedEntry.java   
@Override
public Image obfuscatedImage(Image image) {
    Rectangle bounds = swtItem == null ? null : swtItem.getBounds();
    if ( bounds != null ){

        boolean isActive = swtItem.getParent().getSelection() == swtItem;
        boolean isHeaderVisible = swtItem.isShowing();

        Point location = Utils.getLocationRelativeToShell(swtItem.getParent());

        bounds.x += location.x;
        bounds.y += location.y;

        Map<String, Object> map = new HashMap<>();
        map.put("image", image);
        map.put("obfuscateTitle", false);
        if (isActive) {
            triggerEvent(UISWTViewEvent.TYPE_OBFUSCATE, map);

            if (viewTitleInfo instanceof ObfuscateImage) {
                ((ObfuscateImage) viewTitleInfo).obfuscatedImage(image);
            }
        }

        if (isHeaderVisible) {
            if (viewTitleInfo instanceof ObfuscateTab) {
                String header = ((ObfuscateTab) viewTitleInfo).getObfuscatedHeader();
                if (header != null) {
                    UIDebugGenerator.obfuscateArea(image, bounds, header);
                }
            }

            if (MapUtils.getMapBoolean(map, "obfuscateTitle", false)) {
                UIDebugGenerator.obfuscateArea(image, bounds);
            }
        }
    }

    return image;
}
项目:Hydrograph    文件:PaletteToolTip.java   
/**
 * 
 * Returns tooltip bounds
 * 
 * @return org.eclipse.swt.graphics.Rectangle
 */
public Rectangle getToolTipBounds(){
    Point tooltipSize = getToolTipWidthHeight();
    Rectangle bounds = new Rectangle(0, 0, tooltipSize.x, tooltipSize.y);
    logger.debug("tooltip bounds=" + bounds);
    return bounds;
}
项目:time4sys    文件:SrmEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs() {
    if (getPageCount() <= 1) {
        setPageText(0, "");
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(1);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y + 6);
        }
    }
}
项目:eclipse-bash-editor    文件:BashBracketsSupport.java   
protected final IRegion getSignedSelection(ISourceViewer sourceViewer) {
    Point viewerSelection = sourceViewer.getSelectedRange();

    StyledText text = sourceViewer.getTextWidget();
    Point selection = text.getSelectionRange();
    if (text.getCaretOffset() == selection.x) {
        viewerSelection.x = viewerSelection.x + viewerSelection.y;
        viewerSelection.y = -viewerSelection.y;
    }

    return new Region(viewerSelection.x, viewerSelection.y);
}
项目:BiglyBT    文件:ShellFactory.java   
@Override
public Point computeSize(int wHint, int hHint) {
    if (!inSetSize && wHint > 0 && hHint == SWT.DEFAULT) {
        inSetSize = true;
        return super.computeSize(Utils.adjustPXForDPI(wHint), hHint);
    }
    return super.computeSize(wHint, hHint);
}
项目:time4sys    文件:NfpEditor.java   
/**
 * If there is more than one page in the multi-page editor part,
 * this shows the tabs at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void showTabs() {
    if (getPageCount() > 1) {
        setPageText(0, getString("_UI_SelectionPage_label"));
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y - 6);
        }
    }
}
项目:xcalendar    文件:XCalendarMonthWidget.java   
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
    // Background
    final GC gc = frame.getGc();
    final boolean hovered = mouse.isEntered();
    final XCalendarModel model = popup.getModel();
    final XCalendarTheme theme = model.getTheme();
    final XVirtualCalendar calendar = model.getCalendar();

    ZoneId zoneId = model.getZoneId();
    final int year = calendar.getYear();
    final int month = query(calendar, zoneId, col, row);
    final ZonedDateTime d2 = calendar.getTravelDateTime();
    final ZonedDateTime d1 = calendar.getCalendarDateTime();
    boolean selected = isSameYear(d1, d2) && month == d1.getMonthValue();
    this.enabled = isValidYearMonth(year, month, zoneId, calendar::isValid);
    int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
    gc.setBackground(theme.getBackground(enabled, selected, false, hovered));
    gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

    // Foreground
    String text = theme.getMonthTheme()[row][col];
    gc.setForeground(theme.getForeground(enabled, selected, true));
    gc.setFont(theme.getFont()); final Point size = extent(gc, text);
    gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
项目:OCCI-Studio    文件:PlatformEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs() {
    if (getPageCount() <= 1) {
        setPageText(0, "");
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(1);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y + 6);
        }
    }
}
项目:n4js    文件:ShowHistoryAction.java   
@Override
public void runWithEvent(Event event) {
    if (event.widget instanceof ToolItem) {
        final ToolItem toolItem = (ToolItem) event.widget;
        final Control control = toolItem.getParent();
        final Menu menu = getMenuCreator().getMenu(control);

        final Rectangle bounds = toolItem.getBounds();
        final Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
        menu.setLocation(control.toDisplay(topLeft));
        menu.setVisible(true);
    }
}
项目:n4js    文件:N4JSApplicationWorkbenchWindowAdvisor.java   
@Override
public void preWindowOpen() {
    super.preWindowOpen();
    final IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
    configurer.setInitialSize(new Point(1024, 768));
    configurer.setShowCoolBar(true);
    configurer.setShowStatusLine(true);
    configurer.setShowProgressIndicator(true);
    configurer.setShowPerspectiveBar(true);
    initN4Context();
    updateDefaultEditorMappingIfAbsent();
    reviewDisabledCategoriesFromAppModel();

}
项目:gemoc-studio    文件:FsmEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs() {
    if (getPageCount() <= 1) {
        setPageText(0, "");
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(1);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y + 6);
        }
    }
}
项目:convertigo-eclipse    文件:KTable.java   
/**
 * Returns true, if the given cell is selected. Works also in Row Selection
 * Mode.
 * 
 * @param col
 * @param row
 * @return boolean
 */
public boolean isCellSelected(int col, int row) {
  if (!m_MultiSelectMode) {
    if (m_RowSelectionMode)
      return (row == m_FocusRow);
    return (col == m_FocusCol && row == m_FocusRow);
  }

  if (m_RowSelectionMode)
    return (m_Selection.get(new Integer(row)) != null);
  else
    return (m_Selection.get(new Point(col, row)) != null);
}
项目:convertigo-eclipse    文件:SequenceComposite.java   
protected void initialize() {
    GridData gridData = new org.eclipse.swt.layout.GridData();
    gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
    httpData = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    httpData.setLayoutData(gridData);
    httpData.setText("");
    this.setLayout(new GridLayout());
    setSize(new Point(300, 200));
}
项目:SWET    文件:PopupDialog.java   
/**
 * Saves the bounds of the shell in the appropriate dialog settings. The
 * bounds are recorded relative to the parent shell, if there is one, or
 * display coordinates if there is no parent shell. Subclasses typically
 * need not override this method, but may extend it (calling
 * <code>super.saveDialogBounds</code> if additional bounds information
 * should be stored. Clients may also call this method to persist the bounds
 * at times other than closing the dialog.
 * 
 * @param shell
 *            The shell whose bounds are to be stored
 */
protected void saveDialogBounds(Shell shell) {
    IDialogSettings settings = getDialogSettings();
    if (settings != null) {
        Point shellLocation = shell.getLocation();
        Point shellSize = shell.getSize();
        Shell parent = getParentShell();
        if (parent != null) {
            Point parentLocation = parent.getLocation();
            shellLocation.x -= parentLocation.x;
            shellLocation.y -= parentLocation.y;
        }
        String prefix = getClass().getName();
        if (persistSize) {
            settings.put(prefix + DIALOG_WIDTH, shellSize.x);
            settings.put(prefix + DIALOG_HEIGHT, shellSize.y);
        }
        if (persistLocation) {
            settings.put(prefix + DIALOG_ORIGIN_X, shellLocation.x);
            settings.put(prefix + DIALOG_ORIGIN_Y, shellLocation.y);
        }
        if (showPersistActions && showDialogMenu) {
            settings.put(getClass().getName() + DIALOG_USE_PERSISTED_SIZE,
                    persistSize);
            settings.put(getClass().getName() + DIALOG_USE_PERSISTED_LOCATION,
                    persistLocation);

        }
    }
}
项目:Hydrograph    文件:ComponentSearchUtility.java   
/**
 * Calculate the cursor position on current editor
 * @return cursorRelativePosition
 */
private Point calculatePosition() {

    Point cursorAbsLocation = graphicControl.getDisplay().getCursorLocation();
    Point cursorRelativePosition = graphicControl.getDisplay().map(null, graphicControl, cursorAbsLocation);
    if (!isInsideGraphic(cursorRelativePosition, graphicControl.getSize())) {
        return null;
    }
    return cursorRelativePosition;
}
项目:iTrace-Archive    文件:ITrace.java   
/**
 * Finds the control under the specified screen coordinates and calls its
 * gaze handler on the localized point. Returns the gaze response or null if
 * the gaze is not handled.
 */
private IGazeResponse handleGaze(int screenX, int screenY, Gaze gaze){
    Queue<Control[]> childrenQueue = new LinkedList<Control[]>();
    childrenQueue.add(rootShell.getChildren());
    Rectangle monitorBounds = rootShell.getMonitor().getBounds();
    while (!childrenQueue.isEmpty()) {
        for (Control child : childrenQueue.remove()) {
            Rectangle childScreenBounds = child.getBounds();
            Point screenPos = child.toDisplay(0, 0);
            childScreenBounds.x = screenPos.x - monitorBounds.x;
            childScreenBounds.y = screenPos.y - monitorBounds.y;
            if (childScreenBounds.contains(screenX, screenY)) {
                if (child instanceof Composite) {
                    Control[] nextChildren =
                            ((Composite) child).getChildren();
                    if (nextChildren.length > 0 && nextChildren[0] != null) {
                        childrenQueue.add(nextChildren);
                    }
                }
                IGazeHandler handler =
                        (IGazeHandler) child
                                .getData(HandlerBindManager.KEY_HANDLER);
                if (child.isVisible() && handler != null) {
                    return handler.handleGaze(screenX, screenY,
                            screenX - childScreenBounds.x, screenY
                                    - childScreenBounds.y, gaze);
                }
            }
        }
    }
    return null;
}
项目:gemoc-studio-modeldebugging    文件:DecoratingColumLabelProvider.java   
@Override
public Point getToolTipShift(Object element) {
    final Point res;

    if (cellLabelProvider == null) {
        res = null;
    } else {
        res = cellLabelProvider.getToolTipShift(element);
    }

    return res;
}
项目:gemoc-studio-modeldebugging    文件:TracingannotationsEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs() {
    if (getPageCount() <= 1) {
        setPageText(0, "");
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(1);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y + 6);
        }
    }
}
项目:BiglyBT    文件:SideBarToolTips.java   
/**
 * @return
 *
 * @since 3.1.1.1
 */
private String getToolTip(Point mousePos_RelativeToItem) {
    MdiEntryVitalityImage[] vitalityImages = mdiEntry.getVitalityImages();
    for (int i = 0; i < vitalityImages.length; i++) {
        SideBarVitalityImageSWT vitalityImage = (SideBarVitalityImageSWT) vitalityImages[i];
        if (vitalityImage == null) {
            continue;
        }
        String indicatorToolTip = vitalityImage.getToolTip();
        if (indicatorToolTip == null || !vitalityImage.isVisible()) {
            continue;
        }
        Rectangle hitArea = vitalityImage.getHitArea();
        if (hitArea == null) {
            continue;
        }
        if (hitArea.contains(mousePos_RelativeToItem)) {
            return indicatorToolTip;
        }
    }

    if (mdiEntry.getViewTitleInfo() != null) {
        String tt = (String) mdiEntry.getViewTitleInfo().getTitleInfoProperty(ViewTitleInfo.TITLE_INDICATOR_TEXT_TOOLTIP);
        return tt;
    }

    return null;
}
项目:Hydrograph    文件:ComponentSearchUtility.java   
private void createAssitTextBox(Point cursorRelativePosition) {
    assistText = new Text((Composite) graphicControl, SWT.BORDER);
    assistText.setLocation(cursorRelativePosition.x, cursorRelativePosition.y - assistText.getLineHeight());
    assistText.setSize(200, assistText.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    assistText.setTextLimit(51);
    assistText.setFocus();
}
项目:xcalendar    文件:XCalendarMonthWidget.java   
/**
 * 
 */
@Override
public Pair<Point> locate(int x, int y, int w, int m) {
    int unit = w / 4;
    if(col == 3) { x = m; y += unit; } else { x += unit; }
    return new Pair<>(new Point(unit, unit), new Point(x, y));
}
项目:Hydrograph    文件:CommentBoxFigure.java   
/**
 * 
 * Computes location of comment box figure relative to workbench
 * 
 * @param figureMouseLocation
 * @return
 */
private Point getFigureLocationOnWorkbench(Point figureMouseLocation) {

    int subtractFromMouseX, addToMouseY;
    java.awt.Point workbenchAWTMouseLocation = MouseInfo.getPointerInfo().getLocation();
    Point workbenchMouseLocation = new Point(workbenchAWTMouseLocation.x, workbenchAWTMouseLocation.y);

    subtractFromMouseX = figureMouseLocation.x - getBounds().x;
    addToMouseY = getBounds().y - figureMouseLocation.y;

    return new org.eclipse.swt.graphics.Point((workbenchMouseLocation.x - subtractFromMouseX),
            (workbenchMouseLocation.y + addToMouseY));
}
项目:time4sys    文件:TraceEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs() {
    if (getPageCount() <= 1) {
        setPageText(0, "");
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(1);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y + 6);
        }
    }
}
项目:pmTrans    文件:FindReplaceDialog.java   
private boolean replace() {
    Point x = text.getSelection();
    if (!text.getSelectionText().isEmpty()) {
        text.replaceTextRange(text.getSelection().x, text.getSelection().y - text.getSelection().x,
                replaceText.getText());
        text.setSelection(x.x + replaceText.getText().length());
        return true;
    }
    return false;
}
项目:time4sys    文件:GrmEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs() {
    if (getPageCount() <= 1) {
        setPageText(0, "");
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(1);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y + 6);
        }
    }
}
项目:time4sys    文件:DesignEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs() {
    if (getPageCount() <= 1) {
        setPageText(0, "");
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(1);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y + 6);
        }
    }
}
项目:gemoc-studio    文件:GexpressionsEditor.java   
/**
 * If there is more than one page in the multi-page editor part,
 * this shows the tabs at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void showTabs() {
    if (getPageCount() > 1) {
        setPageText(0, getString("_UI_SelectionPage_label"));
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y - 6);
        }
    }
}
项目:iTrace-Archive    文件:TokenHighlighter.java   
public TokenHighlighter(StyledText styledText, boolean show, ProjectionViewer projviewer){
    this.styledText = styledText;
    this.projviewer = projviewer;
    this.styledText.addPaintListener(this);
    this.show = show;
    this.numberOfPoints = 1;
    this.points = new Point[numberOfPoints];
    this.pointIndex = 0;
    this.nulls = 0;
    this.eventBroker = PlatformUI.getWorkbench().getService(IEventBroker.class);
    this.eventBroker.subscribe("iTrace/newstresponse", this);
    //this.gazeQueue = Activator.getDefault().gazeTransport.createClient();
    //System.out.println("gazeQueue");
}
项目:neoscada    文件:DetailViewEditor.java   
/**
 * If there is just one page in the multi-page editor part,
 * this hides the single tab at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void hideTabs ()
{
    if ( getPageCount () <= 1 )
    {
        setPageText ( 0, "" ); //$NON-NLS-1$
        if ( getContainer () instanceof CTabFolder )
        {
            ( (CTabFolder)getContainer () ).setTabHeight ( 1 );
            Point point = getContainer ().getSize ();
            getContainer ().setSize ( point.x, point.y + 6 );
        }
    }
}
项目:time4sys    文件:LibraryEditor.java   
/**
 * If there is more than one page in the multi-page editor part,
 * this shows the tabs at the bottom.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void showTabs() {
    if (getPageCount() > 1) {
        setPageText(0, getString("_UI_SelectionPage_label"));
        if (getContainer() instanceof CTabFolder) {
            ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
            Point point = getContainer().getSize();
            getContainer().setSize(point.x, point.y - 6);
        }
    }
}