com.miginfocom.ashape.shapes
Class FeatherAShape

java.lang.Object
  extended by com.miginfocom.ashape.shapes.AbstractAShape
      extended by com.miginfocom.ashape.shapes.FilterAShape
          extended by com.miginfocom.ashape.shapes.FeatherAShape
All Implemented Interfaces:
AShape, PropertyProvider

public class FeatherAShape
extends FilterAShape

An attributed shape that feather (i.e. blur) the contained attrShape.

The following attibutes is currently used by this shape:
A_FEATHER_RADIUS
Note that any attributes used by AbstractAShape will also be adhered to.


Field Summary
static PropertyKey A_FEATHER_RADIUS
          Value type: Float, not null.
 
Fields inherited from class com.miginfocom.ashape.shapes.FilterAShape
A_FILTER_SLICE_SPEC
 
Fields inherited from class com.miginfocom.ashape.shapes.AbstractAShape
hitShape, RETURN_LIVE_ATTR_MAP, SIZE_CONV_MAP
 
Fields inherited from interface com.miginfocom.ashape.shapes.AShape
A_ALIGN_X, A_ALIGN_Y, A_ANTI_ALIAS, A_BORDER, A_CLIP_TYPE, A_COMPOSITE, A_CROP, A_CROP_TO_VISIBILITY_BOUNDS, A_FONT, A_HIT_AREA_Z, A_ICON, A_IMAGE, A_INHERIT, A_LAYOUT, A_MAXIMUM_HEIGHT, A_MAXIMUM_WIDTH, A_MINIMUM_HEIGHT, A_MINIMUM_WIDTH, A_MOUSE_CURSOR, A_PAINT, A_PAINT_LAYER, A_PLACE_RECT, A_PREFERRED_HEIGHT, A_PREFERRED_WIDTH, A_REPORT_HIT_AREA, A_SHADOW_TARGET_PAINT, A_SHAPE, A_SHAPES, A_STROKE, A_SUB_SHAPE_SORTER, A_TEXT, A_TEXTURE_PAINT_ANCHOR, A_UNDERLINE_HEIGHT, A_VISIBILITY, A_WRAPPED_ASHAPE, CLIP_PARENT_BOUNDS, CLIP_PARENT_SHAPE
 
Constructor Summary
FeatherAShape()
          Empty constructor for XML builders.
FeatherAShape(java.lang.String name, AShape attrShape, java.awt.Paint targetPaint, float radius, SliceSpec sliceSpec)
          Constructor
 
Method Summary
protected  java.awt.image.BufferedImageOp getBufferedOp()
          Returns a BufferedImageOp to use for blurring.
protected  java.awt.Dimension getFilterMargin()
          Returns the extra margin around the buffered image that for instance the blur filter need to not chop of the blurred outer part.
 
Methods inherited from class com.miginfocom.ashape.shapes.FilterAShape
addSubShape, addSubShape, clearBuf, getHitBounds, getNaturalSize, invalidateCachedImage, paintShape, shouldRecreateSlicedImage
 
Methods inherited from class com.miginfocom.ashape.shapes.AbstractAShape
addAttributes, addToHitShapeList, containsProperty, getAttribute, getAttributes, getClipShape, getDoubleAttribute, getFloatAttribute, getHitShape, getIntAttribute, getLayout, getLayoutSize, getLongAttribute, getModCount, getName, getPaintLayer, getParent, getProperty, getReferenceBounds, getRoot, getShapeBounds, getSubShapeDeep, getSubShapes, getSubShapesImpl, hasAttribute, increaseModCount, isRoot, isVisible, layout, paintBorder, paintSubTree, removeAttribute, removeSubShape, setAttribute, setAttributeDeep, setAttributes, setHitShape, setName, setParent, setReferenceBounds, setReferenceBounds, setSubShapes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A_FEATHER_RADIUS

public static final PropertyKey A_FEATHER_RADIUS
Value type: Float, not null. The radius of the blur/feather. This class uses a GaussianBlur a.t.m.

Constructor Detail

FeatherAShape

public FeatherAShape()
Empty constructor for XML builders.


FeatherAShape

public FeatherAShape(java.lang.String name,
                     AShape attrShape,
                     java.awt.Paint targetPaint,
                     float radius,
                     SliceSpec sliceSpec)
Constructor

Parameters:
name - The name. Not null
attrShape - The containd shape to feather. Not null.
targetPaint - The paint to feather towards. May be null.
radius - The radius of the blur/feather. This class uses a GaussianBlur a.t.m.
sliceSpec - An optional specification for how to slice the shape.
See Also:
SlicedImage
Method Detail

getBufferedOp

protected java.awt.image.BufferedImageOp getBufferedOp()
Returns a BufferedImageOp to use for blurring. Creates one the first time and then returns the same since the class's properties are immutable.

Specified by:
getBufferedOp in class FilterAShape
Returns:
a BufferedImageOp to use for blurring.

getFilterMargin

protected java.awt.Dimension getFilterMargin()
Description copied from class: FilterAShape
Returns the extra margin around the buffered image that for instance the blur filter need to not chop of the blurred outer part. The margin should be an even number to avoid rounding errors at later stages.

Specified by:
getFilterMargin in class FilterAShape
Returns:
The extra margin around the buffered image. Not null and can be an private instance so don't change it.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.