/** * Returns the bounds for the specified range of characters. The * bounds is the smallest rectangle that encompasses all characters * in the range. The start and end offsets are inclusive and will be * clamped if out of range. * * @param start the start offset * @param end the end offset * @return the bounds of the character range * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public Rectangle getBounds (int start, int end) { checkLayout(); return DPIUtil.autoScaleDown(getBoundsInPixels(start, end)); }
/** * Returns the bounds for the specified range of characters. The * bounds is the smallest rectangle that encompasses all characters * in the range. The start and end offsets are inclusive and will be * clamped if out of range. * * @param start the start offset * @param end the end offset * @return the bounds of the character range * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public Rectangle getBounds(int start, int end) { checkLayout(); return DPIUtil.autoScaleDown(getDevice(), getBoundsInPixels(start, end)); }
/** * Returns the bounds for the specified range of characters. The * bounds is the smallest rectangle that encompasses all characters * in the range. The start and end offsets are inclusive and will be * clamped if out of range. * * @param start the start offset * @param end the end offset * @return the bounds of the character range * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public Rectangle getBounds(int start, int end) { checkLayout(); return DPIUtil.autoScaleDown(getDevice(), getBoundsInPixels(start, end)); }
/** * Returns the bounds for the specified range of characters. The * bounds is the smallest rectangle that encompasses all characters * in the range. The start and end offsets are inclusive and will be * clamped if out of range. * * @param start the start offset * @param end the end offset * @return the bounds of the character range * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public Rectangle getBounds(int start, int end) { checkLayout(); return DPIUtil.autoScaleDown(getDevice(), getBoundsInPixels(start, end)); }
/** * Returns the bounds of the receiver. The width returned is either the * width of the longest line or the width set using {@link TextLayout#setWidth(int)}. * To obtain the text bounds of a line use {@link TextLayout#getLineBounds(int)}. * * @return the bounds of the receiver * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see #setWidth(int) * @see #getLineBounds(int) */ public Rectangle getBounds() { checkLayout(); Rectangle bounds = DPIUtil.autoScaleDown(getDevice(), getBoundsInPixels()); int lineCount = OS.pango_layout_get_line_count(layout); int totalLineheight = 0; for (int i = 0; i < lineCount; i++) { totalLineheight += this.getLineBounds(i).height; } bounds.height = totalLineheight; return bounds; } Rectangle getBoundsInPixels() {
/** * Returns the bounds of the receiver. The width returned is either the * width of the longest line or the width set using {@link TextLayout#setWidth(int)}. * To obtain the text bounds of a line use {@link TextLayout#getLineBounds(int)}. * * @return the bounds of the receiver * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see #setWidth(int) * @see #getLineBounds(int) */ public Rectangle getBounds() { checkLayout(); Rectangle bounds = DPIUtil.autoScaleDown(getDevice(), getBoundsInPixels()); int lineCount = OS.pango_layout_get_line_count(layout); int totalLineheight = 0; for (int i = 0; i < lineCount; i++) { totalLineheight += this.getLineBounds(i).height; } bounds.height = totalLineheight; return bounds; } Rectangle getBoundsInPixels() {
/** * Returns the bounds of the receiver. The width returned is either the * width of the longest line or the width set using {@link TextLayout#setWidth(int)}. * To obtain the text bounds of a line use {@link TextLayout#getLineBounds(int)}. * * @return the bounds of the receiver * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see #setWidth(int) * @see #getLineBounds(int) */ public Rectangle getBounds() { checkLayout(); Rectangle bounds = DPIUtil.autoScaleDown(getDevice(), getBoundsInPixels()); int lineCount = OS.pango_layout_get_line_count(layout); int totalLineheight = 0; for (int i = 0; i < lineCount; i++) { totalLineheight += this.getLineBounds(i).height; } bounds.height = totalLineheight; return bounds; } Rectangle getBoundsInPixels() {