jv.loader
Class PgJvxLoader
- java.lang.Object
-
- jv.loader.PgAbstractLoader
-
- jv.loader.PgJvxLoader
-
- All Implemented Interfaces:
- PgLoaderIf
public final class PgJvxLoader extends PgAbstractLoader
Loader for geometry files given in JavaView's JVX file format. For details see the webpage on supported file formats.- Author:
- Konrad Polthier
- Version:
- 22.09.15, 4.20 revised (kp) Getting and setting of smooth edge colors corrected.
23.11.14, 4.10 revised (kp) Special checks to assure a clean jvLite setup.
22.03.10, 4.00 revised (kp) Superclass changed to PgAbstractLoader.
01.11.05, 3.00 revised (kp) New geometry element 'polygon' added to JVX.
14.04.04, 2.00 revised (kp) Enable optimization if elementSet does not have neighbour information.
06.10.03, 1.95 revised (kp) Interface extended by isEnabledOptimization().
13.08.03, 1.90 revised (kp) Saving of header information now optional.
19.04.03, 1.80 revised (kp) Interface extended by setGeometryOption().
16.02.03, 1.70 revised (kp) Alignment of labels during load/save corrected.
21.08.02, 1.60 revised (kp) New methods getGeometries/getAnimations of PgLoaderIf implemented.
20.05.01, 1.50 revised (kp) Parsing of label attributes completed.
20.05.01, 1.40 revised (kp) Two methods parseLabelAtt and parseFun moved from PsXmlLoader.
30.10.00, 1.30 revised (kp) Merge with 2.00.a3 version, some methods moved to PsXmlLoader.
18.10.00, 1.20 revised (kp) Handling of several arrows added.
09.07.00, 1.10 revised (kp) Print length of lists as informal attribute.
27.03.00, 1.00 created (kp)
-
-
Field Summary
-
Fields inherited from interface jv.loader.PgLoaderIf
GEOM_DATA_AUTHOR, GEOM_DATA_COLORS, GEOM_DATA_HEADER, GEOM_DATA_INFO, GEOM_DATA_NORMALS, GEOM_DATA_TEXTURE, GEOM_DATA_VECTORS
-
-
Constructor Summary
Constructors Constructor and Description PgJvxLoader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.String[][]parseFunList(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)Parse an array of PsXmlNodes of same element type, where each element has data consisting of a blank separated list of functions to be interpreted.PgJvxSrc[]read(java.io.BufferedReader in)Read XML file and fill a new PsJvxSrc class.static PgJvxSrc[]read(java.lang.String fileName)Read geometry from file in JavaView JVX format.java.lang.Stringwrite(PgJvxSrc[] geom)Write all geometries in a XML tree structure of instances of typePsXmlNodeand create a XML formatted string.booleanwrite(java.io.Writer writer, PgJvxSrc[] geom)Write all geometries in a XML tree structure of instances of typePsXmlNodeand into a writer.-
Methods inherited from class jv.loader.PgAbstractLoader
getAnimations, getDisplayOption, getGeometries, getSpecializedGeometries, isAnimation, isEnabledOptimization, load, read, setAnimation, setDisplayOption, setGeometryOption, write
-
-
-
-
Method Detail
-
read
public static PgJvxSrc[] read(java.lang.String fileName)
Read geometry from file in JavaView JVX format.Alternatively, one may call load(BuffereredReader) followed by getGeometries() resp. getAnimations() to have a finer control about which information one wants to use from a source. For example, optional display information must be retrieve by a subsequent call getDisplayOption() if available.
- Parameters:
fileName- File or URL to read data from.- Author:
- Konrad Polthier
- Version:
- 03.03.03, 1.10 revised (kp) No longer match case when comparing name with "object_".
12.12.00, 1.00 created (kp)
-
read
public PgJvxSrc[] read(java.io.BufferedReader in)
Read XML file and fill a new PsJvxSrc class.Alternatively, one may call load(BuffereredReader) followed by getGeometries() resp. getAnimations() to have a finer control about which information one wants to use from a source. For example, optional display information must be retrieve by a subsequent call getDisplayOption() if available.
- Specified by:
readin interfacePgLoaderIf- Overrides:
readin classPgAbstractLoader- Parameters:
in- BufferedReader to read textual data from.- Returns:
- Array of JVX geometries.
- See Also:
PgAbstractLoader.write(Writer, PgJvxSrc [])- Author:
- Konrad Polthier
- Version:
- 16.04.00, 1.10 revised (kp) Return type changed from PsXmlNode to PsXmlsrc.
16.01.00, 1.00 created (kp)
-
write
public boolean write(java.io.Writer writer, PgJvxSrc[] geom)Write all geometries in a XML tree structure of instances of typePsXmlNodeand into a writer.- Specified by:
writein interfacePgLoaderIf- Overrides:
writein classPgAbstractLoader- Parameters:
writer- Write all data to this streamgeom- Array with geometries to save- Returns:
trueon success.- See Also:
write(PgJvxSrc [])- Version:
- 18.02.01, 1.00 revised (kp)
18.02.01, 1.00 created (kp)
-
write
public java.lang.String write(PgJvxSrc[] geom)
Write all geometries in a XML tree structure of instances of typePsXmlNodeand create a XML formatted string.- Parameters:
geom- Array with geometries to save- Returns:
- formatted string of xml tree.
- See Also:
write(Writer, PgJvxSrc [])
-
parseFunList
public static java.lang.String[][] parseFunList(PsXmlNode parentNode, java.lang.String type, java.lang.String[] attr)
Parse an array of PsXmlNodes of same element type, where each element has data consisting of a blank separated list of functions to be interpreted.- Parameters:
parentNode- parent node containing a set of color nodes as childrentype- type of elements in arrayattr- array of attributes the vector might have, may be null.- Returns:
- parsed string array, or null if failed
- Version:
- 20.05.01, 1.10 revised (kp) Moved to PgJvxLoader from PsXmlLoader.
-
-
"