Click or drag to resize

Getting Started

This document describes how to get started with using STK Components in your application.

Adding STK Components to an Application

In order to use STK Components in your own application, perform these steps:

  1. Obtain a valid license file (either a temporary license from AGI support or the license you purchased). The file should be named AGI.Foundation.lic (exactly). You can request a temporary development license from AGI Technical Support by e-mailing your request to support@agi.com.

  2. Add the STK Components JAR files to your project. In Eclipse, this is easily accomplished by right-clicking your project and then selecting Build Path, then Configure Build Path... Then, in the Libraries tab on the right, click Add External JARs..., navigate to the location where you unpacked the STK Components files, and select the JAR files you would like to use in your application. You can also copy the desired JARs into your project directory and use the Add JARs... button to add the JARs using a path relative to your project directory.

  3. Attach the Javadoc to the STK Components JARs. This is optional, but recommended, in order to have documentation and parameter names available when developing. In Eclipse, this is done by right-clicking your project and then selecting Build Path, then Configure Build Path... Then, in the Libraries tab on the right, for each STK Components JAR you have added, expand the plus on the left, select Javadoc location:, then click Edit... on the right. Select the Javadoc in archive radio button, then set the Archive Path field, using the Browse... button to navigate to the location where you unpacked the STK Components files, and select the agi.foundation.javadoc zip file which is in the Documentation directory. You will need to repeat these steps for each STK Components JAR file.

  4. Ensure that your AGI.Foundation.lic license file will be available at the root level of your application's classpath at runtime. In Eclipse, simply adding the license file to the root of your project's source directory will copy it to the output directory and make it available when running your application through Eclipse. Make sure that the license file appears in Eclipse by selecting your project and pressing F5, or right-clicking and choosing Refresh. When packaging your project for deployment, ensure that your license file is included at the root level of your application's JAR file. See the Licensing and Deployment topic for details and advanced scenarios.

For a detailed walkthrough of building an application with STK Components, see the Tutorial.

Insight3D®

Insight3D currently only works in a JVM running on the Microsoft Windows platform. See the System Requirements topic for more information. Also, due to its use of native code, some additional work is required to use the Insight3D visualization component. In addition to adding the STK Components JARs to your project, you also need to make sure that agi.foundation.graphics.native.dll is in the JVM's library path. The 64-bit Insight3D library agi.foundation.graphics.native.x64.dll must be in a subdirectory relative to agi.foundation.graphics.native.dll. The subdirectory should be named AGI.Foundation.Graphics.x64. Also, the two subdirectories Microsoft.VC90.ATL and Microsoft.VC90.CRT must be located in the same directory as their respective Insight3D DLL. Finally, if you are using Insight3D to load videos as 2D textures you will also need to place the FFMpeg video processing libraries: avcodec-55.dll, avformat-55.dll, avutil-55.dll, and swscale-2.dll into the same directory as their respective Insight3D dll. These files and directories are found in the Jars directory of the STK Components distribution.

The easiest way to make sure that the necessary files and directories are in the JVM's library path is to put them in the current working directory from which you launch your application. In Eclipse, that can be accomplished by putting them directly into the root of your Eclipse project. Alternatively, you can specify the library path explicitly when launching the JVM from the command-line: java -Djava.library.path=c:\path\to\directory\containing\agi.foundation.graphics.native.dll

All interaction with Insight3D types must take place in the Swing Event Dispatch Thread (EDT). This means that your main method must create your user interface using code like the following:

public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            new MainFrameContainingInsight3D().setVisible(true);
        }
    });
}