void setIndentInPixels (int indent) { if (indent < 0) return; if (this.indent == indent) return; freeRuns(); this.indent = indent; }
void setWrapIndentInPixels (int wrapIndent) { if (wrapIndent < 0) return; if (this.wrapIndent == wrapIndent) return; freeRuns(); this.wrapIndent = wrapIndent; }
void setTabsInPixels (int[] tabs) { if (Arrays.equals (this.tabs, tabs)) return; freeRuns(); this.tabs = tabs; }
void destroy() { freeRuns(); if (textStorage != null) textStorage.release(); textStorage = null; layoutManager = null; textContainer = null; font = null; text = null; styles = null; segments = null; segmentsChars = null; }
void setWidthInPixels (int width) { if (wrapWidth == width) return; freeRuns(); wrapWidth = width; setWidth(); }
void setWidthInPixels (int width) { if (wrapWidth == width) return; freeRuns(); wrapWidth = width; setWidth(); }
void setWidthInPixels (int width) { if (wrapWidth == width) return; freeRuns(); wrapWidth = width; setWidth(); }
void setWidthInPixels (int width) { if (width < -1 || width == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.wrapWidth == width) return; freeRuns(); this.wrapWidth = width; }
/** * Sets the justification of the receiver. Note that the receiver's * width must be set in order to use justification. * * @param justify new justify * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.2 */ public void setJustify (boolean justify) { checkLayout(); if (this.justify == justify) return; freeRuns(); this.justify = justify; }
/** * Sets the orientation of the receiver, which must be one * of <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>. * * @param orientation new orientation style * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setOrientation (int orientation) { checkLayout(); int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; orientation &= mask; if (orientation == 0) return; if ((orientation & SWT.LEFT_TO_RIGHT) != 0) orientation = SWT.LEFT_TO_RIGHT; if (this.orientation == orientation) return; textDirection = this.orientation = orientation; freeRuns(); }
@Override void destroy() { font = null; text = null; styles = null; freeRuns(); segments = null; segmentsChars = null; if (layout != 0) OS.g_object_unref(layout); layout = 0; if (context != 0) OS.g_object_unref(context); context = 0; }
@Override void destroy() { font = null; text = null; styles = null; freeRuns(); segments = null; segmentsChars = null; if (layout != 0) OS.g_object_unref(layout); layout = 0; if (context != 0) OS.g_object_unref(context); context = 0; }
@Override void destroy() { font = null; text = null; styles = null; freeRuns(); segments = null; segmentsChars = null; if (layout != 0) OS.g_object_unref(layout); layout = 0; if (context != 0) OS.g_object_unref(context); context = 0; }
@Override void destroy () { freeRuns(); font = null; text = null; segmentsText = null; tabs = null; styles = null; runs = null; lineOffset = null; lineY = null; lineWidth = null; segments = null; segmentsChars = null; if (mLangFontLink2 != 0) { /* Release() */ OS.VtblCall(2, mLangFontLink2); mLangFontLink2 = 0; } OS.OleUninitialize(); }
/** * Sets the line spacing of the receiver. The line spacing * is the space left between lines. * * @param spacing the new line spacing * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the spacing is negative</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setSpacing (int spacing) { checkLayout(); if (spacing < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.lineSpacingInPoints == spacing) return; freeRuns(); this.lineSpacingInPoints = spacing; }
/** * Sets the ascent of the receiver. The ascent is distance in pixels * from the baseline to the top of the line and it is applied to all * lines. The default value is <code>-1</code> which means that the * ascent is calculated from the line fonts. * * @param ascent the new ascent * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the ascent is less than <code>-1</code></li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see #setDescent(int) * @see #getLineMetrics(int) */ public void setAscent (int ascent) { checkLayout(); if (ascent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.ascentInPoints == ascent) return; freeRuns(); this.ascentInPoints = ascent; }
/** * Sets the descent of the receiver. The descent is distance in pixels * from the baseline to the bottom of the line and it is applied to all * lines. The default value is <code>-1</code> which means that the * descent is calculated from the line fonts. * * @param descent the new descent * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the descent is less than <code>-1</code></li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see #setAscent(int) * @see #getLineMetrics(int) */ public void setDescent (int descent) { checkLayout(); if (descent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.descentInPoints == descent) return; freeRuns(); this.descentInPoints = descent; }
/** * Sets the default font which will be used by the receiver * to draw and measure text. If the * argument is null, then a default font appropriate * for the platform will be used instead. Note that a text * style can override the default font. * * @param font the new font for the receiver, or null to indicate a default font * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setFont (Font font) { checkLayout(); if (font != null && font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); Font oldFont = this.font; if (oldFont == font) return; this.font = font; if (oldFont != null && oldFont.equals(font)) return; freeRuns(); }
/** * Sets the wrap indent of the receiver. This indent is applied to all lines * in the paragraph except the first line. * * @param wrapIndent new wrap indent * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see #setIndent(int) * * @since 3.6 */ public void setWrapIndent (int wrapIndent) { checkLayout (); if (wrapIndent < 0) return; if (this.wrapIndent == wrapIndent) return; NSAutoreleasePool pool = null; if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init(); try { freeRuns(); this.wrapIndent = wrapIndent; } finally { if (pool != null) pool.release(); } }
/** * Sets the line spacing of the receiver. The line spacing * is the space left between lines. * * @param spacing the new line spacing * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT - if the spacing is negative</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setSpacing (int spacing) { checkLayout(); if (spacing < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (this.spacing == spacing) return; NSAutoreleasePool pool = null; if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init(); try { freeRuns(); this.spacing = spacing; } finally { if (pool != null) pool.release(); } }