if (filterDesc == null) {
//
// First time filter is converted: create its corresponding
// SVG filter
//
Kernel kernel = convolveOp.getKernel();
Element filterDef =
domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_FILTER_TAG);
Element feConvolveMatrixDef =
domFactory.createElementNS(SVG_NAMESPACE_URI,
SVG_FE_CONVOLVE_MATRIX_TAG);
// Convert the kernel size
feConvolveMatrixDef.setAttributeNS(null, SVG_ORDER_ATTRIBUTE,
kernel.getWidth() + SPACE +
kernel.getHeight());
// Convert the kernel values
StringBuffer kernelMatrixBuf = new StringBuffer();
float data[] = kernel.getKernelData(null);
for(int i=0; i<data.length; i++){
kernelMatrixBuf.append(doubleString(data[i]));
kernelMatrixBuf.append(SPACE);
}