org.apache.tools.ant.types.optional.image

Class Scale

public class Scale extends TransformOperation implements DrawOperation

See Also: Image

Nested Class Summary
static classScale.ProportionsAttribute
Enumerated class for proportions attribute.
Method Summary
PlanarImageexecuteDrawOperation()
{@inheritDoc }.
PlanarImageexecuteTransformOperation(PlanarImage image)
{@inheritDoc }.
floatgetHeight()
Get the height.
floatgetWidth()
Get the width.
PlanarImageperformScale(PlanarImage image)
Scale an image.
voidsetHeight(String height)
Sets the height of the image, either as an integer or a %.
voidsetProportions(Scale.ProportionsAttribute pa)
Sets the behaviour regarding the image proportions.
voidsetWidth(String width)
Sets the width of the image, either as an integer or a %.

Method Detail

executeDrawOperation

public PlanarImage executeDrawOperation()
{@inheritDoc }.

executeTransformOperation

public PlanarImage executeTransformOperation(PlanarImage image)
{@inheritDoc }.

getHeight

public float getHeight()
Get the height.

Returns: the value converted from the height string.

getWidth

public float getWidth()
Get the width.

Returns: the value converted from the width string.

performScale

public PlanarImage performScale(PlanarImage image)
Scale an image.

Parameters: image the image to scale.

Returns: the scaled image.

setHeight

public void setHeight(String height)
Sets the height of the image, either as an integer or a %. Defaults to 100%.

Parameters: height the value to use.

setProportions

public void setProportions(Scale.ProportionsAttribute pa)
Sets the behaviour regarding the image proportions.

Parameters: pa the enumerated value.

setWidth

public void setWidth(String width)
Sets the width of the image, either as an integer or a %. Defaults to 100%.

Parameters: width the value to use.