public void setStrokeWidth(double sw) { strokeWidth = sw; strokeWidthPx = Math.round(canvasControl.pixelSize(sw)); gc().setLineWidth(strokeWidthPx); stroke = strokeWidthPx > 0 && foreground.getAlpha() != 0; }
String getRGBcolor(int id){ Color color = display.getSystemColor(id); return String.format("(%d,%d,%d,%d)", color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()); }
private void _setBackground (Color color) { int pixel = -1; int alpha = 255; if (color != null) { if (color.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); pixel = color.handle; alpha = color.getAlpha(); } if (pixel == background && alpha == backgroundAlpha) return; background = pixel; backgroundAlpha = alpha; updateBackgroundColor (); }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Color {*DISPOSED*}"; return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}"; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Color {*DISPOSED*}"; return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}"; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Color {*DISPOSED*}"; //$NON-NLS-1$ return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Color {*DISPOSED*}"; return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}"; }
/** * Returns a string containing a concise, human-readable description of the * receiver. * * @return a string representation of the receiver */ @Override public String toString() { if( isDisposed() ) { return "Color {*DISPOSED*}"; } return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "}"; }
/** * Returns an <code>RGBA</code> representing the receiver. * * @return the RGBA for the color * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * @since 3.104 */ public RGBA getRGBA () { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return new RGBA(getRed(), getGreen(), getBlue(), getAlpha()); }
/** * Returns an <code>RGBA</code> representing the receiver. * * @return the RGBA for the color * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * @since 3.104 */ public RGBA getRGBA () { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return new RGBA(getRed(), getGreen(), getBlue(), getAlpha()); }
/** * Returns an <code>RGBA</code> representing the receiver. * * @return the RGBA for the color * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * @since 3.104 */ public RGBA getRGBA () { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return new RGBA(getRed(), getGreen(), getBlue(), getAlpha()); }
/** * Returns an <code>RGBA</code> representing the receiver. * * @return the RGBA for the color * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * @since 3.1 */ public RGBA getRGBA() { if( isDisposed() ) { SWT.error( SWT.ERROR_GRAPHIC_DISPOSED ); } return new RGBA( getRed(), getGreen(), getBlue(), getAlpha() ); }
if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); gdkColor = color.handle; backgroundAlpha = color.getAlpha ();
if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); gdkColor = color.handle; backgroundAlpha = color.getAlpha ();
if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); gdkColor = color.handle; backgroundAlpha = color.getAlpha ();
public void renderBackground( IControlAdapter controlAdapter ) { if( hasPreserved( BACKGROUND ) ) { Color actualBackground = controlAdapter.getUserBackground(); boolean actualTransparency = controlAdapter.getBackgroundTransparency(); boolean colorChanged = changed( actualBackground, background, null ); boolean transparencyChanged = changed( actualTransparency, backgroundTransparency, false ); if( transparencyChanged || colorChanged ) { RGB rgb = null; int alpha = 0; if( actualBackground != null ) { rgb = actualBackground.getRGB(); alpha = actualTransparency ? 0 : actualBackground.getAlpha(); } else if( actualTransparency ) { rgb = new RGB( 0, 0, 0 ); } getRemoteObject().set( PROP_BACKGROUND, toJson( rgb, alpha ) ); } } }
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) { gc.setBackground(getBackground()); gc.fillRectangle(rect);
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) { gc.setBackground(getBackground()); gc.fillRectangle(rect);
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) { gc.setBackground(getBackground()); gc.fillRectangle(rect);
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) { gc.setBackground(getBackground()); gc.fillRectangle(rect);