public class IlvMapOutputStream extends IlvOutputStream
IlvMapOutputStream
is a specialized IlvOutputStream
that is used to save only the named properties attached to a manager.
This output stream does not save the layers of the manager.Modifier and Type | Field and Description |
---|---|
static String |
CONTENTS_NOT_SAVED_PROPERTY_NAME
The name of the
IlvNamedProperty that indicates, when present
in the manager, that map contents were saved. |
static String |
SKIP_MAPLAYER_CREATION_PROPERTY_NAME
The name of the
IlvNamedProperty that indicates, when present
in the manager layer, that a layer should not be wrapped in an
IlvMapLayer , as is the default behavior. |
static String |
VERSION_PROPERTY_NAME
The name of the
IlvNamedProperty that holds the version of
the .ivl file written by this
IlvMapOutputStream instance. |
Constructor and Description |
---|
IlvMapOutputStream(OutputStream stream,
String imageFilename,
boolean binary)
Creates an
IlvMapOutputStream that will write to an
OutputStream in ASCII mode. |
IlvMapOutputStream(String mapFilename,
boolean binary)
Creates an
IlvMapOutputStream from a file. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes any underlying
OutputStream objects used by this
IlvMapOutputStream instance. |
void |
closeImageStream()
Closes the underlying image stream and cleans up temporary files used
during the save process.
|
static String |
getFileSuffix()
Returns the file extension used for serialized JViews Map files.
|
static String |
getImageFileSuffix()
Returns the file extension used for serialized raster data used by images
objects within an JViews Maps file.
|
FileOutputStream |
getImageStream()
Returns the stream opened to the file where the data for raster
objects in a map is saved.
|
boolean |
isWritingObjects()
Tests if the output stream writes layers or not.
|
void |
registerMappedBufferPosition(IlvRasterMappedBuffer buffer,
long position)
Registers the start position of the specified
IlvRasterMappedBuffer in the serialized raster data file being
written by this IlvMapOutputStream instance. |
static void |
setFileSuffix(String suffix)
Sets the file extension used for serialized JViews Map files.
|
static void |
setImageFileSuffix(String suffix)
Sets the file extension for serialized raster data used by image
objects within an JViews Maps file.
|
void |
setWritingObjects(boolean writeLayers)
Sets whether this
IlvMapOutputStream will write manager
layers. |
void |
write(IlvManager manager,
boolean writeSelection)
Writes a manager to this object's
IlvOutputStream after
thread monitoring is started. |
void |
write(IlvManagerLayer[] layers,
boolean useCopyPaste)
This method does NOT write the layers of a manager
to an output stream.
|
filterObjects, flush, getBinary, getManager, setBinary, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, writeExtensions, writeGradient, writePattern, writeStroke, writeTexture
public static final String VERSION_PROPERTY_NAME
IlvNamedProperty
that holds the version of
the .ivl
file written by this
IlvMapOutputStream
instance.public static final String CONTENTS_NOT_SAVED_PROPERTY_NAME
IlvNamedProperty
that indicates, when present
in the manager, that map contents were saved.public static final String SKIP_MAPLAYER_CREATION_PROPERTY_NAME
IlvNamedProperty
that indicates, when present
in the manager layer, that a layer should not be wrapped in an
IlvMapLayer
, as is the default behavior.public IlvMapOutputStream(OutputStream stream, String imageFilename, boolean binary)
IlvMapOutputStream
that will write to an
OutputStream
in ASCII mode.stream
- The output stream.imageFilename
- The name of the file to write map raster data to.binary
- Set to true
for the stream to write binary data.public IlvMapOutputStream(String mapFilename, boolean binary) throws FileNotFoundException
IlvMapOutputStream
from a file.
The filename passed in the mapFilename
parameter is
suffixed by the file extension returned by calling
getFileSuffix()
to create the map filename, if this has
not been done already.
The name of the file used to store images used in the map is derived from
mapFilename
, with the extension returned by calling
getImageFileSuffix()
.
mapFilename
- The filename for the map.binary
- Set to true
for the stream to write binary
data.FileNotFoundException
- if the map file can not be created.public void write(IlvManagerLayer[] layers, boolean useCopyPaste) throws IOException
write
in class IlvOutputStream
layers
- The layers NOT to be saveduseCopyPaste
- Set to true
to use copy and paste.IOException
- if an I/O error occurs.public void close() throws IOException
OutputStream
objects used by this
IlvMapOutputStream
instance.IOException
- if an I/O error occurs.public void write(IlvManager manager, boolean writeSelection) throws IOException
IlvOutputStream
after
thread monitoring is started.write
in class IlvOutputStream
manager
- The manager that contains the map.writeSelection
- Set to true
to save only the objects
selected by the user but not layer information.IOException
- usual IO errors.IlvOutputStream.write(ilog.views.IlvManager, boolean)
public void closeImageStream() throws IOException
IOException
- if there is a problem closing the image stream.FileNotFoundException
- if the file defined in
IlvMapOutputStream(OutputStream , String , boolean )
cannot be
found.public void setWritingObjects(boolean writeLayers)
IlvMapOutputStream
will write manager
layers.writeLayers
- Set to true
so manager layers are saved.public boolean isWritingObjects()
true
if the output stream writes the layers.public FileOutputStream getImageStream() throws FileNotFoundException
FileNotFoundException
- if the image file defined in
IlvMapOutputStream(OutputStream , String , boolean )
cannot be
found.public void registerMappedBufferPosition(IlvRasterMappedBuffer buffer, long position)
IlvRasterMappedBuffer
in the serialized raster data file being
written by this IlvMapOutputStream
instance.
Note: this method is for internal purpose only. It
ensures that saved objects containing raster data are properly re-mapped on
the serialized raster data file written by this
IlvMapOutputStream
.
buffer
- The IlvRasterMappedBuffer
whose start position
is to be registered.position
- A Long
instance defining the position in the
serialized raster data file where the mapping starts.public static void setFileSuffix(String suffix)
suffix
- The new map file extension.getFileSuffix()
public static String getFileSuffix()
setFileSuffix(String)
public static void setImageFileSuffix(String suffix)
suffix
- The new image file extension.getImageFileSuffix()
public static String getImageFileSuffix()
setImageFileSuffix(String)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.