Package snap.gfx

Class EmbossEffect

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class EmbossEffect extends Effect
An Effect subclass that make drawing look slightly 3D with raised or lowered edges.
  • Field Details

  • Constructor Details

    • EmbossEffect

      public EmbossEffect()
      Creates an emboss effect.
    • EmbossEffect

      public EmbossEffect(double anAlt, double anAzi, double aRad)
      Creates an emboss effect for given altitude, azimuth and radius.
  • Method Details

    • getAltitude

      public double getAltitude()
      Returns altitude of light source.
    • getAzimuth

      public double getAzimuth()
      Returns angle of light source.
    • getRadius

      public double getRadius()
      Returns radius of edge rounding.
    • getBounds

      public Rect getBounds(Rect aRect)
      Override to account for blur radius.
      Overrides:
      getBounds in class Effect
    • applyEffect

      public void applyEffect(PainterDVR aPDVR, Painter aPntr, Rect aRect)
      Performs the ShadowEffect with given PainterDVR.
      Overrides:
      applyEffect in class Effect
    • getEmbossImage

      public Image getEmbossImage(PainterDVR aPDVR, Rect aRect)
      Creates emboss image.
    • copyForAltitude

      public EmbossEffect copyForAltitude(double anAlt)
      Returns a new Emboss for given altitude.
    • copyForAzimuth

      public EmbossEffect copyForAzimuth(double anAzi)
      Returns a new Emboss for given azimuth.
    • copyForRadius

      public EmbossEffect copyForRadius(double aRad)
      Returns a new Emboss for given radius.
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • initProps

      protected void initProps(PropSet aPropSet)
      Override to configure props for this class.
      Overrides:
      initProps in class PropObject
    • getPropValue

      public Object getPropValue(String aPropName)
      Override to support props for this class.
      Overrides:
      getPropValue in class PropObject
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Override to support props for this class.
      Overrides:
      setPropValue in class PropObject
    • toXML

      public XMLElement toXML(XMLArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface XMLArchiver.Archivable
      Overrides:
      toXML in class Effect
    • fromXML

      public Object fromXML(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface XMLArchiver.Archivable
      Overrides:
      fromXML in class Effect