>Are you
using the bridge module for that?
I am not extend the svg tag so I am not
entend the bridge module.
>I need more details on what your filter looks like to
answer that question. I have
not a good idea about how to a graphics-node look like being
selected.
So, I change
the fill color by feSpecularLighting.
As the lower source, I
create a filter and add the SpecularLightingRable8Bit object.
public static Filter
createFilter(
GraphicsNode filteredNode) { // get filter chain
region
Rectangle2D filterRegion = filteredNode.getGeometryBounds(); // make the initial
source as a RenderableImage
Filter sourceGraphic = filteredNode.getGraphicsNodeRable(); // build a
FilterChainRable8Bit
FilterChainRable filterChain = new FilterChainRable8Bit(sourceGraphic, filterRegion); // 'filterRes'
attribute - default is implementation
specific
filterChain.setFilterResolutionX(-1); filterChain.setFilterResolutionY(-1); // create a map for
filter nodes to advertise themselves as named
source
Map filterNodeMap = new HashMap(11); filterNodeMap.put(SVG_SOURCE_GRAPHIC_VALUE, sourceGraphic); Filter in =
createFilterItem(
filterRegion, filteredNode, sourceGraphic, filterNodeMap ); if (in ==
sourceGraphic)
{
return null; // no filter primitives found, disable the filter. } else { filterChain.setSource(in); return filterChain; } } public static Filter createFilterItem(
Rectangle2D
filterRegion,
GraphicsNode filteredNode, Filter in, Map filterMap){ // 'surfaceScale' attribute - default is 1 float surfaceScale =1; //
'specularConstant' attribute - default is
1
float specularConstant =1; //
'specularExponent' attribute - default is
1
float specularExponent = 1; // extract the
light definition from the filterElement's children
list
//Light light = extractLight(filterElement, ctx); Light light = new PointLight(0, 0, 0, java.awt.Color.blue); //
'kernelUnitLength' attribute
//double [] kernelUnitLength = convertKernelUnitLength(filterElement); double [] kernelUnitLength = null; // The default
region is the union of the input
sources
// regions unless 'in' is 'SourceGraphic' in which case the // default region is the filterChain's region Filter sourceGraphics = (Filter)filterMap.get(SVG_SOURCE_GRAPHIC_VALUE); Rectangle2D defaultRegion; defaultRegion = filterRegion; Rectangle2D primitiveRegion = defaultRegion; Filter filter =
new
SpecularLightingRable8Bit(in,
primitiveRegion, light, specularConstant, specularExponent, surfaceScale, kernelUnitLength); return
filter;
}
|
- How to modify the GraphicsNode of GVT in apache batik? ma zhenduo
- RE: How to modify the GraphicsNode of GVT in apache ... Thierry Kormann
- Re: How to modify the GraphicsNode of GVT in apa... ma zhenduo
- Re: How to modify the GraphicsNode of GVT in... Thomas E Deweese
- Re: How to modify the GraphicsNode of GV... Thomas E Deweese
- The bug about "nodeHitAt" and "tr... ma zhenduo