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

Class Scale

Implemented Interfaces:
Cloneable, DrawOperation

public class Scale
extends TransformOperation
implements DrawOperation

See Also:
Image

Nested Class Summary

static class
Scale.ProportionsAttribute
Enumerated class for proportions attribute.

Field Summary

Fields inherited from class org.apache.tools.ant.types.optional.image.ImageOperation

instructions

Fields inherited from class org.apache.tools.ant.types.DataType

checked, ref

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Method Summary

PlanarImage
executeDrawOperation()
.
PlanarImage
executeTransformOperation(PlanarImage image)
.
float
getHeight()
Get the height.
float
getWidth()
Get the width.
PlanarImage
performScale(PlanarImage image)
Scale an image.
void
setHeight(String height)
Sets the height of the image, either as an integer or a %.
void
setProportions(Scale.ProportionsAttribute pa)
Sets the behaviour regarding the image proportions.
void
setWidth(String width)
Sets the width of the image, either as an integer or a %.

Methods inherited from class org.apache.tools.ant.types.optional.image.TransformOperation

addRectangle, executeTransformOperation

Methods inherited from class org.apache.tools.ant.types.optional.image.ImageOperation

addDraw, addRectangle, addRotate, addScale, addText

Methods inherited from class org.apache.tools.ant.types.DataType

checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Method Details

executeDrawOperation

public PlanarImage executeDrawOperation()
.
Specified by:
executeDrawOperation in interface DrawOperation

executeTransformOperation

public PlanarImage executeTransformOperation(PlanarImage image)
.
Overrides:
executeTransformOperation in interface TransformOperation

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.