|
GLG Toolkit, Java Class Library
Version 4.6
|
This group contains methods for saving and serializing either drawings or individual objects. More...
This group contains methods for saving and serializing either drawings or individual objects.
Functions | |
| boolean | SaveObject (Object medium, GlgMediumType medium_type) |
| Saves the object into a stream using a default charset. More... | |
| boolean | SaveObject (Object medium, GlgMediumType medium_type, String charset_name) |
| Saves the object into a stream using the specified charset. More... | |
| boolean | SaveObject (String filename) |
| Saves the object to a file using a default charset. More... | |
| boolean | SaveObject (String filename, String charset_name) |
| Saves the object to a file using the specified charset. More... | |
| boolean SaveObject | ( | Object | medium, |
| GlgMediumType | medium_type | ||
| ) |
Saves the object into a stream using a default charset.
This method serializes the object and all its subsidiary objects into a stream using the GLG ASCII save format that provides maximum portability between different deployment environments.
| medium | The destination stream to save to. |
| medium_type | Destination type, must be STREAM. |
| boolean SaveObject | ( | Object | medium, |
| GlgMediumType | medium_type, | ||
| String | charset_name | ||
| ) |
Saves the object into a stream using the specified charset.
This method serializes the object and all its subsidiary objects into a stream using the GLG ASCII save format that provides maximum portability between different deployment environments.
| medium | The destination stream to save to. |
| medium_type | Destination type, must be STREAM. |
| charset_name | Name of a charset for string encoding. |
| boolean SaveObject | ( | String | filename | ) |
Saves the object to a file using a default charset.
This method can be used to save either a viewport, or any GlgObject object.
| filename | The file to save the object to. |
This method saves the specified object and all its subsidiary objects to a file. A GLG object of any type may be saved in this fashion and later loaded using LoadObject. The method uses the GLG ASCII save format that provides maximum portability between different deployment environments.
For applications that load a drawing, modify it and save if back to a file, the drawing should be loaded using LoadObject instead of LoadWidget. LoadWidget extracts the $Widget viewport from the loaded drawing, discarding the rest of the drawing, while LoadObject returns an object that represents the whole drawing.
Using SaveObject to save a viewport loaded with LoadWidget will result in a loss of information contained in the discarded part of the drawing, such as the type of the coordinate system used to display the viewport, which will make it difficult to load and edit the drawing in the Graphics Builder. The following example demonstrates the proper technique:
| boolean SaveObject | ( | String | filename, |
| String | charset_name | ||
| ) |
Saves the object to a file using the specified charset.
This method is similar to the SaveObject method described above, but allows to save using the specified charset.
| filename | The file to save the object to. |
| charset_name | Name of a charset for string encoding. |