vgp.tutor.model

## Class PjModel

- java.lang.Object
- - jv.object.PsObject
  - - jv.project.PjProject
    - - vgp.tutor.model.PjModel

- All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, PsTimeListenerIf, PsUpdateIf, PvPickListenerIf

      public class PjModel
      extends PjProject
      implements java.awt.event.ActionListener

  Tutorial on usage of importing models from file. Three methods to load a geometry from file are presented:
  1. The first loading takes place inside the start method of the project where a geometry from a given file is loaded, without any user interaction. Of course, the code may be inserted into any other method than the start() method. This is a batch version.
  2. The second loading may be invoked by opening the control panel of JavaView and import a model from the menu `File --> Import --> ...`. This adds the loaded geometry to this project, and this project overwrites the methods addGeometry() and selectGeometry() to show how the project might react on newly loaded geometries. Here just a message is printed.
  3. The third loading may be invoked by including a separate panel of the project PjImportModel into the info panel of this project. In this case the import project should exist as instance, and this project should be its ActionListener to be able to receive events invoked by the import project when its info panel has received user interaction.
  See Also:
    `PvViewer`, Serialized Form
  Author:
    Konrad Polthier
  Version:
    15.01.00, 1.00 created (kp)

- - ### Field Summary

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PjModel()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `actionPerformed(java.awt.event.ActionEvent event)`
    `boolean` | `addGeometry(PgGeometryIf geom)` Overwrite method of superclass to be able to react when new geometry is loaded from file by menu import.
    `void` | `init()` Initialize and reset project, stops the running animation if any.
    `void` | `removeGeometry(PgGeometryIf geom)` Overwrite method of superclass to be able to react when new geometry is loaded from file by menu import.
    `void` | `selectGeometry(PgGeometryIf geom)` Overwrite method of superclass to be able to react when new geometry is loaded from file by menu import.
    `void` | `start()` Start method is invoke when project is selected in the viewer.

    - ### Methods inherited from class jv.project.PjProject

      `addDisplay, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getParameterInfo, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickInitial, pickVertex, removeDisplay, removeGeometries, selectDisplay, setAnimation, setBackColor, setBorderType, setDisplay, setEnabledAutoFit, setGeometry, setParameterInfo, setTime, setViewer, stop, unmarkVertices`

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, update, updatePanels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface jv.anim.PsTimeListenerIf

      `getName`

    - ### Methods inherited from interface jv.project.PvPickListenerIf

      `getName`

- - ### Constructor Detail

    - #### PjModel

          public PjModel()

  - ### Method Detail

    - #### 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()

      Start method is invoke when project is selected in the viewer. Here the loading of geometry from file is demonstrated as a batch version using another instance of PjImportModel.
      Overrides:
        `start` in class `PjProject`
      See Also:
        `PvViewerIf.start()`, `PjProject.isEnabledAutoFit()`

    - #### actionPerformed

          public void actionPerformed(java.awt.event.ActionEvent event)

      Specified by:
        `actionPerformed` in interface `java.awt.event.ActionListener`

    - #### addGeometry

          public boolean addGeometry(PgGeometryIf geom)

      Overwrite method of superclass to be able to react when new geometry is loaded from file by menu import. This method is invoked when the import menu is pressed.
      Overrides:
        `addGeometry` in class `PjProject`
      Parameters:
        `geom` - geometry to be added to this project and the current display.
      Returns:
        `false` if geometry was null or already registered in project.

    - #### selectGeometry

          public void selectGeometry(PgGeometryIf geom)

      Overwrite method of superclass to be able to react when new geometry is loaded from file by menu import. This method is invoked when the imported geometry is accepted.
      Specified by:
        `selectGeometry` in interface `PvPickListenerIf`
      Overrides:
        `selectGeometry` in class `PjProject`
      Parameters:
        `geom` - Now selected geometry of display.

    - #### removeGeometry

          public void removeGeometry(PgGeometryIf geom)

      Overwrite method of superclass to be able to react when new geometry is loaded from file by menu import. This method is invoked when the imported geometry is cancelled.
      Overrides:
        `removeGeometry` in class `PjProject`

"

The software JavaView? is copyright protected. All Rights Reserved.
"