Package snap.gfx
Class EmbossEffect
java.lang.Object
snap.props.PropObject
snap.gfx.Effect
snap.gfx.EmbossEffect
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
An Effect subclass that make drawing look slightly 3D with raised or lowered edges.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final double
static final double
static final double
static final String
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
ConstructorDescriptionCreates an emboss effect.EmbossEffect
(double anAlt, double anAzi, double aRad) Creates an emboss effect for given altitude, azimuth and radius. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyEffect
(PainterDVR aPDVR, Painter aPntr, Rect aRect) Performs the ShadowEffect with given PainterDVR.copyForAltitude
(double anAlt) Returns a new Emboss for given altitude.copyForAzimuth
(double anAzi) Returns a new Emboss for given azimuth.copyForRadius
(double aRad) Returns a new Emboss for given radius.boolean
Standard equals implementation.fromXML
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival.double
Returns altitude of light source.double
Returns angle of light source.Override to account for blur radius.getEmbossImage
(PainterDVR aPDVR, Rect aRect) Creates emboss image.getPropValue
(String aPropName) Override to support props for this class.double
Returns radius of edge rounding.protected void
Override to configure props for this class.void
setPropValue
(String aPropName, Object aValue) Override to support props for this class.toXML
(XMLArchiver anArchiver) XML archival.Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, clone, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues, toString, toStringProps
-
Field Details
-
Altitude_Prop
- See Also:
-
Azimuth_Prop
- See Also:
-
Radius_Prop
- See Also:
-
DEFAULT_ALTITUDE
public static final double DEFAULT_ALTITUDE- See Also:
-
DEFAULT_AZIMUTH
public static final double DEFAULT_AZIMUTH- See Also:
-
DEFAULT_RADIUS
public static final double DEFAULT_RADIUS- See Also:
-
-
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
Override to account for blur radius. -
applyEffect
Performs the ShadowEffect with given PainterDVR.- Overrides:
applyEffect
in classEffect
-
getEmbossImage
Creates emboss image. -
copyForAltitude
Returns a new Emboss for given altitude. -
copyForAzimuth
Returns a new Emboss for given azimuth. -
copyForRadius
Returns a new Emboss for given radius. -
equals
Standard equals implementation. -
initProps
Override to configure props for this class.- Overrides:
initProps
in classPropObject
-
getPropValue
Override to support props for this class.- Overrides:
getPropValue
in classPropObject
-
setPropValue
Override to support props for this class.- Overrides:
setPropValue
in classPropObject
-
toXML
XML archival.- Specified by:
toXML
in interfaceXMLArchiver.Archivable
- Overrides:
toXML
in classEffect
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceXMLArchiver.Archivable
- Overrides:
fromXML
in classEffect
-