public class ImageDataSource extends AbstractDataSource implements ConfigurableUnit
Modifier and Type | Field and Description |
---|---|
protected java.awt.image.BufferedImage |
image
The managed content.
|
protected ApplicationModel |
model
The application model.
|
static java.lang.String |
PROP_RESOLUTION
Represents a format specific property (String).
|
static java.lang.String |
PROP_TRANSPARENCY
Represents a format specific property (String).
|
static java.lang.String |
PROP_TYPE
Represents a format specific property (String).
|
action, ACTION_FILE_EDIT, ACTION_FILE_HEXEDIT, ACTION_FILE_OPEN, ACTION_UNKNOWN, ACTION_URL_EDIT, ACTION_URL_HEXEDIT, ACTION_URL_OPEN, date, encoding, formatProps, name, path, size, type
Constructor and Description |
---|
ImageDataSource()
Constructor method for i18n purposes only.
|
ImageDataSource(java.lang.String name,
java.lang.String path,
java.util.Date date,
java.awt.image.BufferedImage image,
java.lang.String type,
int action)
Init functionality.
|
ImageDataSource(java.lang.String name,
java.lang.String path,
java.util.Date date,
javax.swing.ImageIcon icon,
java.lang.String type,
int action)
Init functionality.
|
Modifier and Type | Method and Description |
---|---|
void |
configureUnit(java.lang.String id,
Configuration config)
Restores values from persistent data stores.
|
void |
finish(java.io.OutputStream ostream)
After the data has been written to the output stream it is flushed, closed and updated here.
|
java.lang.String |
getDisplayName()
Provides the data source display name.
|
OrderedHashtable<java.lang.String,java.lang.String> |
getFormatProperties()
Provides the format specific properties presented by the
AbstractViewer class. |
javax.swing.Icon |
getIcon()
Provides the data source specific icon (optional).
|
java.awt.image.BufferedImage |
getImage()
Provides a
BufferedImage object. |
java.io.InputStream |
getInputStream()
This method returns an
InputStream representing the data and throws the
appropriate exception if it can not do so. |
java.io.OutputStream |
getOutputStream()
This method returns an
OutputStream where the data can be written and throws
the appropriate exception if it can not do so
Note that a new OutputStream object must be returned each time this method
is called, and the stream must be positioned at the location the data is to be written. |
static void |
populateFormatProperties(java.awt.image.BufferedImage image,
OrderedHashtable<java.lang.String,java.lang.String> cache)
Extracts the format properties from the given image.
|
void |
storeUnit(java.lang.String id,
Configuration config)
Stores the current configuration values persistently.
|
void |
unitRegistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was registered with a model.
|
void |
unitUnregistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was unregistered with a model.
|
finalize, getAction, getContentType, getDate, getDisplayAction, getEncoding, getName, getPath, getSize, loadTemporaryFile, setAction, setContentType, setDate, setEncoding, setFormatProperty, setName, setPath, setSize, storeTemporaryFile
public static final java.lang.String PROP_RESOLUTION
public static final java.lang.String PROP_TYPE
public static final java.lang.String PROP_TRANSPARENCY
protected java.awt.image.BufferedImage image
protected ApplicationModel model
public ImageDataSource()
public ImageDataSource(java.lang.String name, java.lang.String path, java.util.Date date, java.awt.image.BufferedImage image, java.lang.String type, int action)
name
- The name of the represented data portion (optional)path
- The path of this object (optional)date
- The date of this object (optional)image
- The managed contenttype
- The MIME type (optional)action
- The load action AbstractDataSource.FILE_OPEN
, ...java.lang.NullPointerException
- If a parameter is null
public ImageDataSource(java.lang.String name, java.lang.String path, java.util.Date date, javax.swing.ImageIcon icon, java.lang.String type, int action)
name
- The name of the represented data portion (optional)path
- The path of this object (optional)date
- The date of this object (optional)icon
- The managed contenttype
- The MIME type (optional)action
- The load action AbstractDataSource.FILE_OPEN
, ...java.lang.NullPointerException
- If a parameter is null
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
representing the data and throws the
appropriate exception if it can not do so.
Note that a new InputStream
object must be returned each time this method
is called, and the stream must be positioned at the beginning of the data.
getInputStream
in interface javax.activation.DataSource
getInputStream
in class AbstractDataSource
java.io.IOException
- If an error occurredjava.lang.NullPointerException
- If the loaded content is null
public java.io.OutputStream getOutputStream() throws java.io.IOException
OutputStream
where the data can be written and throws
the appropriate exception if it can not do so
Note that a new OutputStream
object must be returned each time this method
is called, and the stream must be positioned at the location the data is to be written.
getOutputStream
in interface javax.activation.DataSource
getOutputStream
in class AbstractDataSource
java.io.IOException
- If an error occurredpublic void finish(java.io.OutputStream ostream) throws java.io.IOException
finish
in class AbstractDataSource
ostream
- An output streamjava.io.IOException
- If an error occurredpublic OrderedHashtable<java.lang.String,java.lang.String> getFormatProperties()
AbstractViewer
class.
getFormatProperties
in class AbstractDataSource
null
or emptypublic static void populateFormatProperties(java.awt.image.BufferedImage image, OrderedHashtable<java.lang.String,java.lang.String> cache)
image
- The image, may be null
cache
- The containerpublic java.awt.image.BufferedImage getImage()
BufferedImage
object.
null
public javax.swing.Icon getIcon()
getIcon
in class AbstractDataSource
null
public void configureUnit(java.lang.String id, Configuration config)
configureUnit
in interface ConfigurableUnit
configureUnit
in class AbstractDataSource
id
- The unique identifier for the instanceconfig
- The configurationpublic void storeUnit(java.lang.String id, Configuration config)
storeUnit
in interface ConfigurableUnit
storeUnit
in class AbstractDataSource
id
- The unique identifier for the instanceconfig
- The configurationpublic void unitRegistered(ApplicationModel model, java.lang.String id)
unitRegistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void unitUnregistered(ApplicationModel model, java.lang.String id)
unitUnregistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic java.lang.String getDisplayName()
getDisplayName
in class AbstractDataSource
null
Copyright © 2005-2023 Leisenfels GmbH. All rights reserved.