problems.add(new FXGMissingAttributeProblem(node.getDocumentPath(), node.getStartLine(),
node.getStartColumn(), FXGConstants.FXG_SOURCE_ATTRIBUTE, node.getNodeName()));
return null;
}
DefineImage imageTag = createDefineBitsTag(node, source);
if(imageTag == null)
return null;
if ((node.visible) && (!node.isPartofClipMask))
{
DefineShapeTag imageShape;
ScalingGrid scalingGrid = context.scalingGrid;
if (scalingGrid != null)
{
Rect grid = TypeHelper.rect(scalingGrid.scaleGridLeft, scalingGrid.scaleGridTop, scalingGrid.scaleGridRight, scalingGrid.scaleGridBottom);
imageShape = ImageHelper.create9SlicedShape(imageTag, grid, Double.NaN, Double.NaN);
PlaceObject3Tag po3 = PlaceObject3Tag(imageShape, context);
return po3;
}
else
{
if (ImageHelper.bitmapImageNeedsClipping(imageTag, node))
{
PlaceObject3Tag p03 = bitmapWithClip(imageTag, node);
return p03;
}
else
{
imageShape = ImageHelper.createShapeForImage(imageTag, node);
PlaceObject3Tag po3 = PlaceObject3Tag(imageShape, context);
return po3;
}
}
}
else
{
if (!ImageHelper.bitmapImageNeedsClipping(imageTag, node))
{
double width = (Double.isNaN(node.width)) ? imageTag.getWidth() : node.width;
double height = (Double.isNaN(node.height)) ? imageTag.getHeight() : node.height;
List<ShapeRecord> shapeRecords = ShapeHelper.rectangle(0.0, 0.0, width, height);
DefineShapeTag shape = createDefineShapeTag(null, shapeRecords, new SolidColorFillNode(), null, context.getTransform());
PlaceObject3Tag po3 = PlaceObject3Tag(shape, context);
return po3;
}
else
{
double width = ((imageTag.getWidth() < node.width) || Double.isNaN(node.width)) ? imageTag.getWidth() : node.width;
double height = ((imageTag.getHeight() < node.height) || (Double.isNaN(node.height))) ? imageTag.getHeight() : node.height;
List<ShapeRecord> shapeRecords = ShapeHelper.rectangle(0.0, 0.0, width, height);
DefineShapeTag shape = createDefineShapeTag(null, shapeRecords, new SolidColorFillNode(), null, context.getTransform());
PlaceObject3Tag po3 = PlaceObject3Tag(shape, context);
return po3;
}