fop svn-trunk

org.apache.fop.afp
Class AFPPaintingState

java.lang.Object
  extended by org.apache.fop.util.AbstractPaintingState
      extended by org.apache.fop.afp.AFPPaintingState
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class AFPPaintingState
extends AbstractPaintingState
implements java.lang.Cloneable

This keeps information about the current painting state when writing to an AFP datastream.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.fop.util.AbstractPaintingState
AbstractPaintingState.AbstractData, AbstractPaintingState.StateStack
 
Constructor Summary
AFPPaintingState()
           
 
Method Summary
 java.lang.Object clone()
          
 int getBitsPerPixel()
          Returns the number of bits per pixel
 java.lang.String getImageUri()
          Gets the uri of the current image
protected  int getLandscapeRotation()
          Returns the landscape rotation
 AFPPageFonts getPageFonts()
          Gets the current page fonts
 int getPageHeight()
          Returns the page height
protected  org.apache.fop.afp.AFPPaintingState.AFPPagePaintingState getPagePaintingState()
          Returns the painting state of the current page
 int getPageRotation()
          Returns the page rotation
 int getPageWidth()
          Returns the page width
 java.awt.Point getPoint(int x, int y)
          Returns a point on the current page, taking the current painting state into account.
protected  int getPortraitRotation()
          Returns the rotation to be used for portrait pages
 int getResolution()
          Returns the output/device resolution.
 int getRotation()
          Returns the currently derived rotation
 AFPUnitConverter getUnitConverter()
          Returns the unit converter
protected  AbstractPaintingState instantiate()
          Instantiates a new state object
protected  AbstractPaintingState.AbstractData instantiateData()
          Instantiates a new state data object
 boolean isColorImages()
          Returns true if color images are to be used
 boolean isNativeImagesSupported()
          Returns true if images are supported natively in this AFP environment
 void setBitsPerPixel(int bitsPerPixel)
          Sets the number of bits used per pixel
 void setColorImages(boolean colorImages)
          Sets whether images are color or not
 void setImageUri(java.lang.String uri)
          Sets the uri of the current image
 void setLandscapeRotation(int rotation)
          Sets the rotation to be used for landscape pages, valid values are 0, 90, 180, 270 (default).
 void setNativeImagesSupported(boolean nativeImagesSupported)
          Sets whether images are natively supported or not in the AFP environment
 void setPageHeight(int pageHeight)
          Sets the page height
 void setPageWidth(int pageWidth)
          Sets the page width
 void setPortraitRotation(int rotation)
          Sets the rotation to be used for portrait pages, valid values are 0 (default), 90, 180, 270.
 void setResolution(int resolution)
          Sets the output/device resolution
 java.lang.String toString()
          
 
Methods inherited from class org.apache.fop.util.AbstractPaintingState
checkTransform, clear, clearTransform, concatenate, getBackColor, getBaseTransform, getColor, getData, getFontName, getFontSize, getLineWidth, getStateStack, getTransform, resetTransform, restore, restoreAll, save, saveAll, setBackColor, setColor, setDashArray, setData, setFontName, setFontSize, setLineWidth
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AFPPaintingState

public AFPPaintingState()
Method Detail

setPortraitRotation

public void setPortraitRotation(int rotation)
Sets the rotation to be used for portrait pages, valid values are 0 (default), 90, 180, 270.

Parameters:
rotation - The rotation in degrees.

getPortraitRotation

protected int getPortraitRotation()
Returns the rotation to be used for portrait pages

Returns:
the rotation to be used for portrait pages

setLandscapeRotation

public void setLandscapeRotation(int rotation)
Sets the rotation to be used for landscape pages, valid values are 0, 90, 180, 270 (default).

Parameters:
rotation - The rotation in degrees.

getLandscapeRotation

protected int getLandscapeRotation()
Returns the landscape rotation

Returns:
the landscape rotation

setBitsPerPixel

public void setBitsPerPixel(int bitsPerPixel)
Sets the number of bits used per pixel

Parameters:
bitsPerPixel - number of bits per pixel

getBitsPerPixel

public int getBitsPerPixel()
Returns the number of bits per pixel

Returns:
the number of bits per pixel

setColorImages

public void setColorImages(boolean colorImages)
Sets whether images are color or not

Parameters:
colorImages - color image output

isColorImages

public boolean isColorImages()
Returns true if color images are to be used

Returns:
true if color images are to be used

setNativeImagesSupported

public void setNativeImagesSupported(boolean nativeImagesSupported)
Sets whether images are natively supported or not in the AFP environment

Parameters:
nativeImagesSupported - true if images are natively supported in this AFP environment

isNativeImagesSupported

public boolean isNativeImagesSupported()
Returns true if images are supported natively in this AFP environment

Returns:
true if images are supported natively in this AFP environment

setResolution

public void setResolution(int resolution)
Sets the output/device resolution

Parameters:
resolution - the output resolution (dpi)

getResolution

public int getResolution()
Returns the output/device resolution.

Returns:
the resolution in dpi

instantiateData

protected AbstractPaintingState.AbstractData instantiateData()
Instantiates a new state data object

Specified by:
instantiateData in class AbstractPaintingState
Returns:
a new state data object

instantiate

protected AbstractPaintingState instantiate()
Instantiates a new state object

Specified by:
instantiate in class AbstractPaintingState
Returns:
a new state object

getPagePaintingState

protected org.apache.fop.afp.AFPPaintingState.AFPPagePaintingState getPagePaintingState()
Returns the painting state of the current page

Returns:
the painting state of the current page

getPageFonts

public AFPPageFonts getPageFonts()
Gets the current page fonts

Returns:
the current page fonts

setPageWidth

public void setPageWidth(int pageWidth)
Sets the page width

Parameters:
pageWidth - the page width

getPageWidth

public int getPageWidth()
Returns the page width

Returns:
the page width

setPageHeight

public void setPageHeight(int pageHeight)
Sets the page height

Parameters:
pageHeight - the page height

getPageHeight

public int getPageHeight()
Returns the page height

Returns:
the page height

getPageRotation

public int getPageRotation()
Returns the page rotation

Returns:
the page rotation

setImageUri

public void setImageUri(java.lang.String uri)
Sets the uri of the current image

Parameters:
uri - the uri of the current image

getImageUri

public java.lang.String getImageUri()
Gets the uri of the current image

Returns:
the uri of the current image

getRotation

public int getRotation()
Returns the currently derived rotation

Returns:
the currently derived rotation

getUnitConverter

public AFPUnitConverter getUnitConverter()
Returns the unit converter

Returns:
the unit converter

getPoint

public java.awt.Point getPoint(int x,
                               int y)
Returns a point on the current page, taking the current painting state into account.

Parameters:
x - the X-coordinate
y - the Y-coordinate
Returns:
a point on the current page

clone

public java.lang.Object clone()

Overrides:
clone in class AbstractPaintingState

toString

public java.lang.String toString()

Overrides:
toString in class AbstractPaintingState

fop svn-trunk

Copyright 1999-2009 The Apache Software Foundation. All Rights Reserved.