public void dispose() { gc.dispose(); if ( transform != null && transform.isDisposed() == false ) { transform.dispose(); } for ( Color color : colors ) { color.dispose(); } for ( Font font : fonts ) { font.dispose(); } }
public void dispose() { gc.dispose(); if ( transform != null && transform.isDisposed() == false ) { transform.dispose(); } for ( Color color : colors ) { color.dispose(); } for ( Font font : fonts ) { font.dispose(); } }
if ( ( (Transform) object ).isDisposed() ) { return;
/** * Returns <code>true</code> if the Transform represents the identity matrix and false otherwise. * * @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> * otherwise */ public boolean isIdentity() { if( isDisposed() ) { SWT.error( SWT.ERROR_GRAPHIC_DISPOSED ); } return Arrays.equals( elements, IDENTITY_MATRIX ); }
/** * 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 "Transform {*DISPOSED*}"; float[] elements = new float[6]; getElements(elements); return "Transform {" + elements [0] + "," + elements [1] + "," +elements [2] + "," +elements [3] + "," +elements [4] + "," +elements [5] + "}"; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ public String toString() { if (isDisposed()) return "Transform {*DISPOSED*}"; float[] elements = new float[6]; getElements(elements); return "Transform {" + elements [0] + ", " + elements [1] + ", " +elements [2] + ", " +elements [3] + ", " +elements [4] + ", " +elements [5] + "}"; }
/** * 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 "Transform {*DISPOSED*}"; float[] elements = new float[6]; getElements(elements); return "Transform {" + elements [0] + "," + elements [1] + "," +elements [2] + "," +elements [3] + "," +elements [4] + "," +elements [5] + "}"; }
/** * 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 "Transform {*DISPOSED*}"; float[] elements = new float[6]; getElements(elements); return "Transform {" + elements [0] + "," + elements [1] + "," +elements [2] + "," +elements [3] + "," +elements [4] + "," +elements [5] + "}"; }
/** * 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 "Transform {*DISPOSED*}"; float[] elements = new float[6]; getElements(elements); return "Transform {" + elements [0] + "," + elements [1] + "," +elements [2] + "," +elements [3] + "," +elements [4] + "," +elements [5] + "}"; }
/** * Returns <code>true</code> if the Transform represents the identity matrix * and false otherwise. * * @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> otherwise */ public boolean isIdentity() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); float[] m = new float[6]; getElements(m); return m[0] == 1 && m[1] == 0 && m[2] == 0 && m[3] == 1 && m[4] == 0 && m[5] == 0; }
/** * Returns <code>true</code> if the Transform represents the identity matrix * and false otherwise. * * @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> otherwise */ public boolean isIdentity() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); return Gdip.Matrix_IsIdentity(handle); }
/** * Returns <code>true</code> if the Transform represents the identity matrix * and false otherwise. * * @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> otherwise */ public boolean isIdentity() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); float[] m = new float[6]; getElements(m); return m[0] == 1 && m[1] == 0 && m[2] == 0 && m[3] == 1 && m[4] == 0 && m[5] == 0; }
/** * Modifies the receiver such that the matrix it represents becomes the * identity matrix. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.4 */ public void identity() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); Gdip.Matrix_SetElements(handle, 1, 0, 0, 1, 0, 0); }
/** * Returns <code>true</code> if the Transform represents the identity matrix * and false otherwise. * * @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> otherwise */ public boolean isIdentity() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); float[] m = new float[6]; getElements(m); return m[0] == 1 && m[1] == 0 && m[2] == 0 && m[3] == 1 && m[4] == 0 && m[5] == 0; }
/** * Modifies the receiver such that the matrix it represents becomes the * identity matrix. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.4 */ public void identity() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); Cairo.cairo_matrix_init(handle, 1, 0, 0, 1, 0, 0); }
/** * Modifies the receiver such that the matrix it represents becomes the * identity matrix. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> * * @since 3.4 */ public void identity() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); Cairo.cairo_matrix_init(handle, 1, 0, 0, 1, 0, 0); }
/** * Modifies the receiver so that it represents a transformation that is * equivalent to its previous transformation scaled by (scaleX, scaleY). * * @param scaleX the amount to scale in the X direction * @param scaleY the amount to scale in the Y direction * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void scale(float scaleX, float scaleY) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); Cairo.cairo_matrix_scale(handle, scaleX, scaleY); }
/** * Modifies the receiver such that the matrix it represents becomes * the mathematical inverse of the matrix it previously represented. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_CANNOT_INVERT_MATRIX - if the matrix is not invertible</li> * </ul> */ public void invert() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (Cairo.cairo_matrix_invert(handle) != 0) { SWT.error(SWT.ERROR_CANNOT_INVERT_MATRIX); } }
/** * Modifies the receiver such that the matrix it represents becomes * the mathematical inverse of the matrix it previously represented. * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_CANNOT_INVERT_MATRIX - if the matrix is not invertible</li> * </ul> */ public void invert() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (Gdip.Matrix_Invert(handle) != 0) SWT.error(SWT.ERROR_CANNOT_INVERT_MATRIX); }
/** * Modifies the receiver so that it represents a transformation that is * equivalent to its previous transformation translated by (offsetX, offsetY). * * @param offsetX the distance to translate in the X direction * @param offsetY the distance to translate in the Y direction * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void translate(float offsetX, float offsetY) { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); Cairo.cairo_matrix_translate(handle, DPIUtil.autoScaleUp(offsetX), DPIUtil.autoScaleUp(offsetY)); }