Class Scale
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.types.DataType
-
- org.apache.tools.ant.types.optional.image.ImageOperation
-
- org.apache.tools.ant.types.optional.image.TransformOperation
-
- org.apache.tools.ant.types.optional.image.Scale
-
- All Implemented Interfaces:
java.lang.Cloneable,DrawOperation
public class Scale extends TransformOperation implements DrawOperation
- See Also:
Image
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScale.ProportionsAttributeEnumerated 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.ProjectComponent
description, location, project
-
-
Constructor Summary
Constructors Constructor Description Scale()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.media.jai.PlanarImageexecuteDrawOperation()Abstract method which is intended to create an image buffer and return it so it can be drawn into another object.javax.media.jai.PlanarImageexecuteTransformOperation(javax.media.jai.PlanarImage image)Performs the transformations.floatgetHeight()Get the height.floatgetWidth()Get the width.javax.media.jai.PlanarImageperformScale(javax.media.jai.PlanarImage image)Scale an image.voidsetHeight(java.lang.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(java.lang.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
-
Methods inherited from class org.apache.tools.ant.types.optional.image.ImageOperation
addDraw, addRotate, addScale, addText
-
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toString
-
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
-
-
-
Method Detail
-
setProportions
public void setProportions(Scale.ProportionsAttribute pa)
Sets the behaviour regarding the image proportions.- Parameters:
pa- the enumerated value.
-
setWidth
public void setWidth(java.lang.String width)
Sets the width of the image, either as an integer or a %. Defaults to 100%.- Parameters:
width- the value to use.
-
setHeight
public void setHeight(java.lang.String height)
Sets the height of the image, either as an integer or a %. Defaults to 100%.- Parameters:
height- the value to use.
-
getWidth
public float getWidth()
Get the width.- Returns:
- the value converted from the width string.
-
getHeight
public float getHeight()
Get the height.- Returns:
- the value converted from the height string.
-
performScale
public javax.media.jai.PlanarImage performScale(javax.media.jai.PlanarImage image)
Scale an image.- Parameters:
image- the image to scale.- Returns:
- the scaled image.
-
executeTransformOperation
public javax.media.jai.PlanarImage executeTransformOperation(javax.media.jai.PlanarImage image)
Performs the transformations..- Specified by:
executeTransformOperationin classTransformOperation- Parameters:
image- The image to perform the transformation on.- Returns:
- the transformed image.
-
executeDrawOperation
public javax.media.jai.PlanarImage executeDrawOperation()
Abstract method which is intended to create an image buffer and return it so it can be drawn into another object. Use an Alpha channel for a "transparent" background..- Specified by:
executeDrawOperationin interfaceDrawOperation- Returns:
- a planar image
-
-