类 ShadowFilter

  • 所有已实现的接口:
    java.awt.image.BufferedImageOp, java.lang.Cloneable

    public class ShadowFilter
    extends AbstractBufferedImageOp
    A filter which draws a drop shadow based on the alpha channel of the image.
    • 构造器概要

      构造器 
      构造器 说明
      ShadowFilter()
      Construct a ShadowFilter.
      ShadowFilter​(float radius, float xOffset, float yOffset, float opacity)
      Construct a ShadowFilter.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)  
      boolean getAddMargins()
      Get whether to increase the size of the output image to accomodate the shadow.
      float getAngle()
      Returns the angle of the shadow.
      java.awt.geom.Rectangle2D getBounds2D​(java.awt.image.BufferedImage src)  
      float getDistance()
      Get the distance of the shadow.
      float getOpacity()
      Get the opacity of the shadow.
      java.awt.geom.Point2D getPoint2D​(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)  
      float getRadius()
      Get the radius of the kernel.
      int getShadowColor()
      Get the color of the shadow.
      boolean getShadowOnly()
      Get whether to only draw the shadow without the original image.
      void setAddMargins​(boolean addMargins)
      Set whether to increase the size of the output image to accomodate the shadow.
      void setAngle​(float angle)
      Specifies the angle of the shadow.
      void setDistance​(float distance)
      Set the distance of the shadow.
      void setOpacity​(float opacity)
      Set the opacity of the shadow.
      void setRadius​(float radius)
      Set the radius of the kernel, and hence the amount of blur.
      void setShadowColor​(int shadowColor)
      Set the color of the shadow.
      void setShadowOnly​(boolean shadowOnly)
      Set whether to only draw the shadow without the original image.
      java.lang.String toString()  
      • 从类继承的方法 java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 构造器详细资料

      • ShadowFilter

        public ShadowFilter()
        Construct a ShadowFilter.
      • ShadowFilter

        public ShadowFilter​(float radius,
                            float xOffset,
                            float yOffset,
                            float opacity)
        Construct a ShadowFilter.
        参数:
        radius - the radius of the shadow
        xOffset - the X offset of the shadow
        yOffset - the Y offset of the shadow
        opacity - the opacity of the shadow
    • 方法详细资料

      • setAngle

        public void setAngle​(float angle)
        Specifies the angle of the shadow.
        参数:
        angle - the angle of the shadow.
        另请参阅:
        getAngle()
      • getAngle

        public float getAngle()
        Returns the angle of the shadow.
        返回:
        the angle of the shadow.
        另请参阅:
        setAngle(float)
      • setDistance

        public void setDistance​(float distance)
        Set the distance of the shadow.
        参数:
        distance - the distance.
        另请参阅:
        getDistance()
      • getDistance

        public float getDistance()
        Get the distance of the shadow.
        返回:
        the distance.
        另请参阅:
        setDistance(float)
      • setRadius

        public void setRadius​(float radius)
        Set the radius of the kernel, and hence the amount of blur. The bigger the radius, the longer this filter will take.
        参数:
        radius - the radius of the blur in pixels.
        另请参阅:
        getRadius()
      • getRadius

        public float getRadius()
        Get the radius of the kernel.
        返回:
        the radius
        另请参阅:
        setRadius(float)
      • setOpacity

        public void setOpacity​(float opacity)
        Set the opacity of the shadow.
        参数:
        opacity - the opacity.
        另请参阅:
        getOpacity()
      • getOpacity

        public float getOpacity()
        Get the opacity of the shadow.
        返回:
        the opacity.
        另请参阅:
        setOpacity(float)
      • setShadowColor

        public void setShadowColor​(int shadowColor)
        Set the color of the shadow.
        参数:
        shadowColor - the color.
        另请参阅:
        getShadowColor()
      • getShadowColor

        public int getShadowColor()
        Get the color of the shadow.
        返回:
        the color.
        另请参阅:
        setShadowColor(int)
      • setAddMargins

        public void setAddMargins​(boolean addMargins)
        Set whether to increase the size of the output image to accomodate the shadow.
        参数:
        addMargins - true to add margins.
        另请参阅:
        getAddMargins()
      • getAddMargins

        public boolean getAddMargins()
        Get whether to increase the size of the output image to accomodate the shadow.
        返回:
        true to add margins.
        另请参阅:
        setAddMargins(boolean)
      • setShadowOnly

        public void setShadowOnly​(boolean shadowOnly)
        Set whether to only draw the shadow without the original image.
        参数:
        shadowOnly - true to only draw the shadow.
        另请参阅:
        getShadowOnly()
      • getShadowOnly

        public boolean getShadowOnly()
        Get whether to only draw the shadow without the original image.
        返回:
        true to only draw the shadow.
        另请参阅:
        setShadowOnly(boolean)
      • getBounds2D

        public java.awt.geom.Rectangle2D getBounds2D​(java.awt.image.BufferedImage src)
        指定者:
        getBounds2D 在接口中 java.awt.image.BufferedImageOp
        覆盖:
        getBounds2D 在类中 AbstractBufferedImageOp
      • getPoint2D

        public java.awt.geom.Point2D getPoint2D​(java.awt.geom.Point2D srcPt,
                                                java.awt.geom.Point2D dstPt)
        指定者:
        getPoint2D 在接口中 java.awt.image.BufferedImageOp
        覆盖:
        getPoint2D 在类中 AbstractBufferedImageOp
      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dst)
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object