ru.novosoft.dc.rtf.dom
Class Picture

java.lang.Object
  |
  +--ru.novosoft.dc.rtf.dom.Picture

public final class Picture
extends java.lang.Object
implements RTFInline

Description of rtf picture. The meaning of the picture parameters is the following: the WIDTH and HEIGHT parameters describe an ariginal picture width and height in twips. The crop values are applied to the original picture: a positive value crops toward the center of the picture from the corresponding side and negative value crops away from the center, adding a space border around picture. The scaling factors are applied after cropping.


Field Summary
static byte CROP_BOTTOM
          The index of "picture crop in twips from bottom" parameter.
static byte CROP_LEFT
          The index of "picture crop in twips from left" parameter.
static byte CROP_RIGHT
          The index of "picture crop in twips from right" parameter.
static byte CROP_TOP
          The index of "picture crop in twips from top" parameter.
static byte HEIGHT
          The index of "picture height in twips" parameter.
static byte SCALE_X
          The index of "picture horizontal scale in percent" parameter.
static byte SCALE_Y
          The index of "picture vertical scale in percent" parameter.
static byte WIDTH
          The index of "picture width in twips" parameter.
 
Constructor Summary
Picture()
           
 
Method Summary
 void attachContext(PictureContext context)
          Attach a context to the picture.
 long calculateHeight()
          Calculate the real height of the picture in percents of twips.
 long calculateWidth()
          Calculate the real width of the picture in percents of twips.
 PictureContext context()
          Return the context of picture or null if no context attached.
 ShapeEntry defineProperties()
          Define empty shape properties for the picture and return it.
 void exportTo(org.w3c.dom.Element elem)
          Export the contents of this object to the specified DOM element.
 int get(int index)
          Get the value of the parameter of the specified index.
 java.lang.String getURI()
          Return the non-encoded URI of the picture or null if it is undefined.
 ShapeEntry properties()
          Return shape properties or null if they were undefined.
 void set(int index, int value)
          Set a value for the parameter of the specified index.
 void setURI(java.lang.String value)
          Set a non-encoded URI for the picture.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH

public static final byte WIDTH
The index of "picture width in twips" parameter.

HEIGHT

public static final byte HEIGHT
The index of "picture height in twips" parameter.

SCALE_X

public static final byte SCALE_X
The index of "picture horizontal scale in percent" parameter.

SCALE_Y

public static final byte SCALE_Y
The index of "picture vertical scale in percent" parameter.

CROP_LEFT

public static final byte CROP_LEFT
The index of "picture crop in twips from left" parameter.

CROP_RIGHT

public static final byte CROP_RIGHT
The index of "picture crop in twips from right" parameter.

CROP_TOP

public static final byte CROP_TOP
The index of "picture crop in twips from top" parameter.

CROP_BOTTOM

public static final byte CROP_BOTTOM
The index of "picture crop in twips from bottom" parameter.
Constructor Detail

Picture

public Picture()
Method Detail

attachContext

public final void attachContext(PictureContext context)
Attach a context to the picture.

context

public final PictureContext context()
Return the context of picture or null if no context attached.

defineProperties

public final ShapeEntry defineProperties()
Define empty shape properties for the picture and return it.

properties

public final ShapeEntry properties()
Return shape properties or null if they were undefined.

set

public final void set(int index,
                      int value)
Set a value for the parameter of the specified index.

get

public final int get(int index)
Get the value of the parameter of the specified index.

setURI

public final void setURI(java.lang.String value)
Set a non-encoded URI for the picture.

getURI

public final java.lang.String getURI()
Return the non-encoded URI of the picture or null if it is undefined.

calculateWidth

public final long calculateWidth()
Calculate the real width of the picture in percents of twips.

calculateHeight

public final long calculateHeight()
Calculate the real height of the picture in percents of twips.

exportTo

public void exportTo(org.w3c.dom.Element elem)
Export the contents of this object to the specified DOM element.