jv.loader
Class PjImportModel
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PjProject
|
+--jv.loader.PjImportModel
- All Implemented Interfaces:
- java.lang.Cloneable, PsTimeListenerIf, PsUpdateIf, PvPickListenerIf, java.io.Serializable
- Direct Known Subclasses:
- PjVectorField
- public class PjImportModel
- extends PjProject
Import geometry models from file or via http connections into JavaView.
A tutorial applet on different ways to import models in JavaView is
found in vgp.tutor.model.PjModel.
- Version:
- 17.04.00, 2.00 revised (kp) Handle array of geometries.
15.01.00, 1.20 revised (kp) Slight changes in the confirmation handling.
01.08.99, 1.10 revised (kp) Naming of models and model directories changed.
Directories are now lowercase, first char of models is uppercase.
01.08.99, 1.00 created (kp)
- Author:
- Konrad Polthier
- See Also:
PjImportModel_InfoBox,
PjModel, Serialized Form
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS |
|
Constructor Summary |
PjImportModel()
Constructor with default full info panel. |
|
Method Summary |
java.lang.String |
getBaseDir()
|
java.lang.String |
getCategory()
|
int |
getConfirm()
Allow world to check whether user has choosen OK or Cancel,
when existing the import dialog.
|
java.lang.String |
getFileName()
|
PsPanel |
getInfoPanel()
Overwrite method of PsObject to allow choice of different info panels. |
void |
init()
Initialize and reset project, stops the running animation if any.
|
boolean |
load(java.lang.String fullFileName)
Load geometry model from file or URL and add it as selected geometry
to this project.
|
void |
setBase(java.lang.String baseDir)
|
void |
setCategory(java.lang.String category)
|
void |
setFileName(java.lang.String fullFileName)
|
void |
setParentProject(PjProject project)
Register parent project to which the model will be loaded.
|
void |
setTypeOfInfoPanel(int infoType)
Set type of info panel. |
void |
start()
Load geometry file if file name has been specified.
|
| Methods inherited from class jv.project.PjProject |
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickInitial, pickVertex, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setDisplay, setEnabledAutoFit, setParameter, setTime, setViewer, stop, unmarkVertices |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, update, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FULL_INFO_PANEL
public static int FULL_INFO_PANEL
SMALL_INFO_PANEL
public static int SMALL_INFO_PANEL
DIR_LIST
public static java.lang.String DIR_LIST
- Name of file containing list of model files in each directory.
CONFIRM_OK
public static int CONFIRM_OK
CONFIRM_CANCEL
public static int CONFIRM_CANCEL
CONFIRM_CLICKED
public static int CONFIRM_CLICKED
PjImportModel
public PjImportModel()
- Constructor with default full info panel.
init
public void init()
- Description copied from class:
PjProject
- Initialize and reset project, stops the running animation if any.
Does not reset any registered display nor geometry. They must
be reset individually in each subclass.
- Overrides:
init in class PjProject
start
public void start()
- Load geometry file if file name has been specified.
Otherwise do nothing.
- Overrides:
start in class PjProject
- Following copied from class:
jv.project.PjProject
- See Also:
PvViewerIf.start(),
#isEnabledAutoFit(boolean)
getBaseDir
public java.lang.String getBaseDir()
setBase
public void setBase(java.lang.String baseDir)
getCategory
public java.lang.String getCategory()
setCategory
public void setCategory(java.lang.String category)
getFileName
public java.lang.String getFileName()
setFileName
public void setFileName(java.lang.String fullFileName)
setTypeOfInfoPanel
public void setTypeOfInfoPanel(int infoType)
- Set type of info panel. Method must be called before info panel
has been created.
- Parameters:
infoType - type of info panel, e.g. PjImportModel.FULL_INFO_PANEL
getInfoPanel
public PsPanel getInfoPanel()
- Overwrite method of PsObject to allow choice of different info panels.
- Overrides:
getInfoPanel in class PsObject
getConfirm
public int getConfirm()
- Allow world to check whether user has choosen OK or Cancel,
when existing the import dialog.
For example, used by other projects to restore backupped geometry
if user cancels dialog.
setParentProject
public void setParentProject(PjProject project)
- Register parent project to which the model will be loaded.
When parent project is registered then a model container will be immediately
added to parent project. If user selects a model from file then container
model is filled or replaced if model in file has different type.
If user cancels the loading process then the container model is
removed from parent project.
If user accepts the loaded model then it is selected in the parent project.
load
public boolean load(java.lang.String fullFileName)
- Load geometry model from file or URL and add it as selected geometry
to this project.
Use getGeometry() to get a reference to the
loaded model. Use getConfirm() to check whether
user has accepted or cancelled an interactive loading process.
- Parameters:
fullFileName - fully specified file name including code base, or URL.- Returns:
true if model has been successfully loaded.
The software JavaView® is copyright protected. All Rights Reserved.