com.arctorus.documents
Class Texture

java.lang.Object
  extended by com.arctorus.documents.Texture
All Implemented Interfaces:
java.lang.Cloneable

public final class Texture
extends java.lang.Object
implements java.lang.Cloneable

Texture used to fill shapes. By default alignment set to the center of a shape and texture mirror turned off.


Constructor Summary
Texture()
           
 
Method Summary
 TextureAlignmentType getAlignment()
          Return texture alignment type.
 byte[] getData()
          Get copy of image data as byte array.
 java.lang.String getFormatName()
          Get image format or file extension e.g.
 TextureMirrorType getMirrorType()
          Return mirror type of a texture.
 float getOffsetX()
          Return X offset of a texture.
 float getOffsetY()
          Return Y offset of a texture.
 boolean isRotated()
          Determines whether the texture rotated with a shape.
 void setAlignment(TextureAlignmentType alignment)
          Set texture alignment type.
 void setData(java.io.InputStream inputStream)
          Set image data from input stream.
 void setMirrorType(TextureMirrorType mirrorType)
          Set mirror type of a texture.
 void setOffsetX(float offsetX)
          Set X offset of a texture.
 void setOffsetY(float offsetY)
          Set Y offset of a texture.
 void setRotated(boolean isRotate)
          Set whether the texture rotated with a shape.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Texture

public Texture()
Method Detail

getFormatName

public java.lang.String getFormatName()
Get image format or file extension e.g. "jpg", "bmp", etc.


setData

public void setData(java.io.InputStream inputStream)
             throws java.io.IOException,
                    DocumentException
Set image data from input stream.

Parameters:
inputStream - input stream to read image from.
Throws:
java.io.IOException
DocumentException - in case image doesn't contain data or has unsupported image type.

getData

public byte[] getData()
Get copy of image data as byte array.

Returns:
image data.

getAlignment

public TextureAlignmentType getAlignment()
Return texture alignment type.


setAlignment

public void setAlignment(TextureAlignmentType alignment)
Set texture alignment type.

Parameters:
alignment - new texture alignment.

getMirrorType

public TextureMirrorType getMirrorType()
Return mirror type of a texture. Works for Microsoft Office formats only.


setMirrorType

public void setMirrorType(TextureMirrorType mirrorType)
Set mirror type of a texture. Works for Microsoft Office formats only.

Parameters:
mirrorType - new mirror type.

getOffsetX

public float getOffsetX()
Return X offset of a texture. Value is in the range [0..1];


setOffsetX

public void setOffsetX(float offsetX)
Set X offset of a texture.

Parameters:
offsetX - new X offset. Must be in the range [0..1].

getOffsetY

public float getOffsetY()
Return Y offset of a texture. Value is in the range [0..1];


setOffsetY

public void setOffsetY(float offsetY)
Set Y offset of a texture.

Parameters:
offsetY - new Y offset. Must be in the range [0..1].

isRotated

public boolean isRotated()
Determines whether the texture rotated with a shape.


setRotated

public void setRotated(boolean isRotate)
Set whether the texture rotated with a shape.

Parameters:
isRotate - true to rotate texture with a shape.