Documentation of 'vgp.tutor.model.PjModel' Java class
PjModel ("JavaView Reference Manual")
"JavaView? v5.03.003"
vgp.tutor.model

Class 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)
    • 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
"JavaView? v5.03.003"

"

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

Ads help maintain this website.