modules/graphics/src/main/java/com/sun/scenario/effect/AbstractShadow.java

Print this page




  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.scenario.effect;
  27 
  28 /**
  29  * An implementation supertype for both Gaussian and Box filter based
  30  * shadows to facilitate their conditional usage inside the various
  31  * composite shadow effects like DropShadow and InnerShadow.
  32  *
  33  * The radius, width and height parameters all refer to the corresponding
  34  * dimension that a "Gaussian" blur filter would use - other shadow
  35  * implementations will have to use whatever parameters produce a
  36  * similar effect.
  37  * The width and height parameters should relate to the radius parameter
  38  * by the equation {@code w,h = 2 * r + 1} and if the width and height are
  39  * set to something different then the radius parameter will be an average
  40  * of the corresponding individual dimensional radius values.
  41  */
  42 public abstract class AbstractShadow extends CoreEffect {
  43     public AbstractShadow(Effect input) {
  44         super(input);
  45     }
  46 
  47     public enum ShadowMode {
  48         ONE_PASS_BOX,
  49         TWO_PASS_BOX,
  50         THREE_PASS_BOX,
  51         GAUSSIAN,
  52     }
  53 
  54     public abstract ShadowMode getMode();
  55     public abstract AbstractShadow implFor(ShadowMode m);
  56     public abstract float getGaussianRadius();
  57     public abstract void  setGaussianRadius(float r);
  58     public abstract float getGaussianWidth();
  59     public abstract void  setGaussianWidth(float w);
  60     public abstract float getGaussianHeight();
  61     public abstract void  setGaussianHeight(float h);
  62     public abstract float getSpread();


  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.scenario.effect;
  27 
  28 /**
  29  * An implementation supertype for both Gaussian and Box filter based
  30  * shadows to facilitate their conditional usage inside the various
  31  * composite shadow effects like DropShadow and InnerShadow.
  32  *
  33  * The radius, width and height parameters all refer to the corresponding
  34  * dimension that a "Gaussian" blur filter would use - other shadow
  35  * implementations will have to use whatever parameters produce a
  36  * similar effect.
  37  * The width and height parameters should relate to the radius parameter
  38  * by the equation {@code w,h = 2 * r + 1} and if the width and height are
  39  * set to something different then the radius parameter will be an average
  40  * of the corresponding individual dimensional radius values.
  41  */
  42 public abstract class AbstractShadow extends LinearConvolveCoreEffect {
  43     public AbstractShadow(Effect input) {
  44         super(input);
  45     }
  46 
  47     public enum ShadowMode {
  48         ONE_PASS_BOX,
  49         TWO_PASS_BOX,
  50         THREE_PASS_BOX,
  51         GAUSSIAN,
  52     }
  53 
  54     public abstract ShadowMode getMode();
  55     public abstract AbstractShadow implFor(ShadowMode m);
  56     public abstract float getGaussianRadius();
  57     public abstract void  setGaussianRadius(float r);
  58     public abstract float getGaussianWidth();
  59     public abstract void  setGaussianWidth(float w);
  60     public abstract float getGaussianHeight();
  61     public abstract void  setGaussianHeight(float h);
  62     public abstract float getSpread();