modules/graphics/src/main/java/javafx/scene/effect/Effect.java

Print this page




 254                                               Node node,
 255                                               BoundsAccessor boundsAccessor);
 256     /**
 257      *
 258      * @treatAsPrivate implementation detail
 259      * @deprecated This is an internal API that is not intended for use and will be removed in the next version
 260      */
 261     @Deprecated
 262     public abstract Effect impl_copy();
 263 
 264     static BaseBounds transformBounds(BaseTransform tx, BaseBounds r) {
 265         if (tx == null || tx.isIdentity()) {
 266             return r;
 267         }
 268         BaseBounds ret = new RectBounds();
 269         ret = tx.transform(r, ret);
 270         return ret;
 271     }
 272 
 273     // utility method used in calculation of bounds in BoxBlur and DropShadow effects
 274     static int getKernelSize(int ksize, int iterations) {

 275         if (ksize < 1) ksize = 1;
 276         ksize = (ksize-1) * iterations + 1;
 277         ksize |= 1;
 278         return ksize / 2;
 279     }
 280 
 281     // utility method used for calculation of bounds in Shadow and DropShadow effects
 282     static BaseBounds getShadowBounds(BaseBounds bounds,
 283                                       BaseTransform tx,
 284                                       float width,
 285                                       float height,
 286                                       BlurType blurType) {
 287         int hgrow = 0;
 288         int vgrow = 0;
 289 
 290         switch (blurType) {
 291             case GAUSSIAN:
 292                 float hradius = width < 1.0f ? 0.0f : ((width - 1.0f) / 2.0f);
 293                 float vradius = height < 1.0f ? 0.0f : ((height - 1.0f) / 2.0f);
 294                 hgrow = (int) Math.ceil(hradius);




 254                                               Node node,
 255                                               BoundsAccessor boundsAccessor);
 256     /**
 257      *
 258      * @treatAsPrivate implementation detail
 259      * @deprecated This is an internal API that is not intended for use and will be removed in the next version
 260      */
 261     @Deprecated
 262     public abstract Effect impl_copy();
 263 
 264     static BaseBounds transformBounds(BaseTransform tx, BaseBounds r) {
 265         if (tx == null || tx.isIdentity()) {
 266             return r;
 267         }
 268         BaseBounds ret = new RectBounds();
 269         ret = tx.transform(r, ret);
 270         return ret;
 271     }
 272 
 273     // utility method used in calculation of bounds in BoxBlur and DropShadow effects
 274     static int getKernelSize(float fsize, int iterations) {
 275         int ksize = (int) Math.ceil(fsize);
 276         if (ksize < 1) ksize = 1;
 277         ksize = (ksize-1) * iterations + 1;
 278         ksize |= 1;
 279         return ksize / 2;
 280     }
 281 
 282     // utility method used for calculation of bounds in Shadow and DropShadow effects
 283     static BaseBounds getShadowBounds(BaseBounds bounds,
 284                                       BaseTransform tx,
 285                                       float width,
 286                                       float height,
 287                                       BlurType blurType) {
 288         int hgrow = 0;
 289         int vgrow = 0;
 290 
 291         switch (blurType) {
 292             case GAUSSIAN:
 293                 float hradius = width < 1.0f ? 0.0f : ((width - 1.0f) / 2.0f);
 294                 float vradius = height < 1.0f ? 0.0f : ((height - 1.0f) / 2.0f);
 295                 hgrow = (int) Math.ceil(hradius);