com.sodius.mdw.core.model.diagram
Interface DiagramImage

All Known Implementing Classes:
DiagramFileImage, DiagramTemporaryImage

public interface DiagramImage

Describes the contents of a diagram image.

Since:
2.1.0
See Also:
DiagramProvider

Field Summary
static int UNKNOWN_SIZE
          The value used to identify an unknown width or height.
 
Method Summary
 void dispose()
          Dispose the image.
 int getHeight()
          Returns the height of the image.
 int getWidth()
          Returns the width of the image.
 InputStream openStream()
          Opens a InputStream to read image bytes.
 

Field Detail

UNKNOWN_SIZE

static final int UNKNOWN_SIZE
The value used to identify an unknown width or height.

See Also:
Constant Field Values
Method Detail

openStream

InputStream openStream()
                       throws IOException
Opens a InputStream to read image bytes.

Returns:
a stream to read image bytes.
Throws:
IOException - if the image contents is not accessible.

getWidth

int getWidth()
Returns the width of the image.

Returns:
the width of the image (UNKNOWN_SIZE if unknown).

getHeight

int getHeight()
Returns the height of the image.

Returns:
the height of the image (UNKNOWN_SIZE if unknown).

dispose

void dispose()
Dispose the image. Client who requested this image should call this method when the image is not used anymore.