ru.novosoft.dc.rtf.dom
Class PictureContext

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

public final class PictureContext
extends java.lang.Object
implements java.lang.Cloneable, PictureType

A context of rtf picture contains internal properties of picture. The picture context is an optional part of picture description, because all necessary information can be extracted from the picture itself. While parsing RTF-input, the context could be remove from a picture if the picture is converted to another format.


Field Summary
static byte BITMAP_LINE_WIDTH
          The index of "bitmap line width in bytes" parameter (for bitmap types).
static byte BITMAP_PLANES
          The index of "bitmap color planes" parameter (for bitmap types).
static byte BITS_PER_PIXEL
          The index of "bits per pixel" parameter (for bitmap types or Windows metafile containing a bitmap).
static byte HEIGHT_IN_UNITS
          The index of "picture height in units" parameter (pixels for pictures and yExt field for WMF).
static byte MM_ANISOTROPIC
          Windows metafile type constant.
static byte MM_HIENGLISH
          Windows metafile type constant.
static byte MM_HIMETRIC
          Windows metafile type constant.
static byte MM_ISOTROPIC
          Windows metafile type constant.
static byte MM_LOENGLISH
          Windows metafile type constant.
static byte MM_LOMETRIC
          Windows metafile type constant.
static byte MM_TEXT
          Windows metafile type constant.
static byte MM_TWIPS
          Windows metafile type constant.
static byte PU_ARBITRARY
          OS/2 metafile type constant.
static byte PU_HIENGLISH
          OS/2 metafile type constant.
static byte PU_HIMETRIC
          OS/2 metafile type constant.
static byte PU_LOENGLISH
          OS/2 metafile type constant.
static byte PU_LOMETRIC
          OS/2 metafile type constant.
static byte PU_PELS
          OS/2 metafile type constant.
static byte PU_TWIPS
          OS/2 metafile type constant.
static byte UNIQUE_TAG
          The index of "mostly unique identifier" parameter.
static byte UNITS_PER_INCH
          The index of "units per inch" parameter.
static byte WIDTH_IN_UNITS
          The index of "picture width in units" parameter (pixels for pictures and xExt field for WMF).
 
Fields inherited from interface ru.novosoft.dc.core.PictureType
BMP, DIB, EMF, JPEG, MET, PICT, PNG, WMF
 
Constructor Summary
PictureContext()
           
 
Method Summary
 java.lang.Object clone()
          Create a clone of this object.
 boolean equals(java.lang.Object obj)
          Compare this context with another picture context and return true if contexts coinside.
 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.
 int getMetafileType()
          Return the type of Windows or OS/2 metafile.
 int getType()
          Return the picture type.
 void set(int index, int value)
          Set a value for the parameter of the specified index.
 void setMetafileType(int value)
          Set a type for Windows or OS/2 metafile.
 void setType(int value)
          Set a picture type.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MM_TEXT

public static final byte MM_TEXT
Windows metafile type constant.

MM_LOMETRIC

public static final byte MM_LOMETRIC
Windows metafile type constant.

MM_HIMETRIC

public static final byte MM_HIMETRIC
Windows metafile type constant.

MM_LOENGLISH

public static final byte MM_LOENGLISH
Windows metafile type constant.

MM_HIENGLISH

public static final byte MM_HIENGLISH
Windows metafile type constant.

MM_TWIPS

public static final byte MM_TWIPS
Windows metafile type constant.

MM_ISOTROPIC

public static final byte MM_ISOTROPIC
Windows metafile type constant.

MM_ANISOTROPIC

public static final byte MM_ANISOTROPIC
Windows metafile type constant.

PU_ARBITRARY

public static final byte PU_ARBITRARY
OS/2 metafile type constant.

PU_PELS

public static final byte PU_PELS
OS/2 metafile type constant.

PU_LOMETRIC

public static final byte PU_LOMETRIC
OS/2 metafile type constant.

PU_HIMETRIC

public static final byte PU_HIMETRIC
OS/2 metafile type constant.

PU_LOENGLISH

public static final byte PU_LOENGLISH
OS/2 metafile type constant.

PU_HIENGLISH

public static final byte PU_HIENGLISH
OS/2 metafile type constant.

PU_TWIPS

public static final byte PU_TWIPS
OS/2 metafile type constant.

WIDTH_IN_UNITS

public static final byte WIDTH_IN_UNITS
The index of "picture width in units" parameter (pixels for pictures and xExt field for WMF).

HEIGHT_IN_UNITS

public static final byte HEIGHT_IN_UNITS
The index of "picture height in units" parameter (pixels for pictures and yExt field for WMF).

BITS_PER_PIXEL

public static final byte BITS_PER_PIXEL
The index of "bits per pixel" parameter (for bitmap types or Windows metafile containing a bitmap).

BITMAP_PLANES

public static final byte BITMAP_PLANES
The index of "bitmap color planes" parameter (for bitmap types).

BITMAP_LINE_WIDTH

public static final byte BITMAP_LINE_WIDTH
The index of "bitmap line width in bytes" parameter (for bitmap types).

UNITS_PER_INCH

public static final byte UNITS_PER_INCH
The index of "units per inch" parameter.

UNIQUE_TAG

public static final byte UNIQUE_TAG
The index of "mostly unique identifier" parameter.
Constructor Detail

PictureContext

public PictureContext()
Method Detail

setType

public final void setType(int value)
Set a picture type.

getType

public final int getType()
Return the picture type.

setMetafileType

public final void setMetafileType(int value)
Set a type for Windows or OS/2 metafile.

getMetafileType

public final int getMetafileType()
Return the type of Windows or OS/2 metafile.

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.

equals

public boolean equals(java.lang.Object obj)
Compare this context with another picture context and return true if contexts coinside.
Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
Create a clone of this object.
Overrides:
clone in class java.lang.Object

exportTo

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