com.xmlmind.fo.graphic
Class GraphicImpl

java.lang.Object
  extended by com.xmlmind.fo.graphic.GraphicImpl
All Implemented Interfaces:
Graphic

public class GraphicImpl
extends Object
implements Graphic

Basic implementation of Graphic.


Field Summary
 Object clientData
          Value returned by getClientData().
 String format
          Value returned by getFormat().
 int height
          Value returned by getHeight().
 String location
          Value returned by getLocation().
 int type
          Value returned by getType().
 int width
          Value returned by getWidth().
 double xResolution
          Value returned by getXResolution().
 double yResolution
          Value returned by getYResolution().
 
Fields inherited from interface com.xmlmind.fo.graphic.Graphic
TYPE_RASTER, TYPE_RASTERIZABLE, TYPE_VECTOR
 
Constructor Summary
GraphicImpl(String location, String format, int width, int height, double xResolution, double yResolution, int type, Object clientData)
          Constructs a graphic having specified characteristics.
GraphicImpl(String location, String format, int width, int height, double xResolution, double yResolution, Object clientData)
          Equivalent to this(location, format, width, height, xResolution, yResolution, TYPE_RASTER, clientData).
 
Method Summary
 Object getClientData()
          Returns opaque client data associated to this graphic.
 String getFormat()
          Returns the MIME type of this graphic.
 int getHeight()
          Returns the height in pixels of this graphic.
 String getLocation()
          Returns the location of this graphic file.
 int getType()
          Returns the type of this graphic.
 int getWidth()
          Returns the width in pixels of this graphic.
 double getXResolution()
          Returns the horizontal resolution in DPI if known; a negative or null number otherwise.
 double getYResolution()
          Returns the vertical resolution in DPI if known; a negative or null number otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

public final String location
Value returned by getLocation().


format

public final String format
Value returned by getFormat().


width

public final int width
Value returned by getWidth().


height

public final int height
Value returned by getHeight().


xResolution

public final double xResolution
Value returned by getXResolution().


yResolution

public final double yResolution
Value returned by getYResolution().


type

public final int type
Value returned by getType().


clientData

public final Object clientData
Value returned by getClientData().

Constructor Detail

GraphicImpl

public GraphicImpl(String location,
                   String format,
                   int width,
                   int height,
                   double xResolution,
                   double yResolution,
                   Object clientData)
Equivalent to this(location, format, width, height, xResolution, yResolution, TYPE_RASTER, clientData).


GraphicImpl

public GraphicImpl(String location,
                   String format,
                   int width,
                   int height,
                   double xResolution,
                   double yResolution,
                   int type,
                   Object clientData)
Constructs a graphic having specified characteristics.

Method Detail

getLocation

public String getLocation()
Description copied from interface: Graphic
Returns the location of this graphic file. This location is always an URL in its string form. It may be a "data:" URL.

Specified by:
getLocation in interface Graphic

getFormat

public String getFormat()
Description copied from interface: Graphic
Returns the MIME type of this graphic. Example: "image/x-wmf".

Specified by:
getFormat in interface Graphic

getWidth

public int getWidth()
Description copied from interface: Graphic
Returns the width in pixels of this graphic.

Specified by:
getWidth in interface Graphic

getHeight

public int getHeight()
Description copied from interface: Graphic
Returns the height in pixels of this graphic.

Specified by:
getHeight in interface Graphic

getXResolution

public double getXResolution()
Description copied from interface: Graphic
Returns the horizontal resolution in DPI if known; a negative or null number otherwise.

IMPORTANT: this number should reflect exactly the information stored in the source located by Graphic.getLocation().

Specified by:
getXResolution in interface Graphic

getYResolution

public double getYResolution()
Description copied from interface: Graphic
Returns the vertical resolution in DPI if known; a negative or null number otherwise.

IMPORTANT: this number should reflect exactly the information stored in the source located by Graphic.getLocation().

Specified by:
getYResolution in interface Graphic

getType

public int getType()
Description copied from interface: Graphic
Returns the type of this graphic.

Specified by:
getType in interface Graphic
See Also:
Graphic.TYPE_VECTOR, Graphic.TYPE_RASTER, Graphic.TYPE_RASTERIZABLE

getClientData

public Object getClientData()
Description copied from interface: Graphic
Returns opaque client data associated to this graphic. May return null.

Specified by:
getClientData in interface Graphic