STK Java API - AWT/Swing Custom Application
Description
This application type is used to utilize STK's analysis engine and embed its visualization controls (3D Globe, 2D Map, Gfx Analysis) into your existing or new AWT/Swing-based GUI application. Note that the visualization and analysis computations in the STK Engine occur within your Java application process and run on the AWT Event Dispatch Thread.
Abstract Window Toolkit (AWT) / Swing extension
What's included in this API?
The API to develop, run, and deploy an STK Custom Application based on the AWT/Swing UI window framework, which is based on the STK Java API, includes the following lists of libraries, packages, and javadocs:
JAR libraries:
- agi.core.jar
- agi.core.swing.jar
- agi.stkutil.jar
- agi.stkobjects.jar
- agi.stkobjects.astrogator.jar
- agi.stkobjects.aviator.jar
- agi.stkvgt.jar
- agi.stkgraphics.jar
- agi.stkx.jar
- agi.stkx.swing.jar
JNI native libraries:
- AgJNICore.dll/libagjnicore.so
- AgJNIStkUtil.dll/libagjnistkutil.so
- AgJNIStkObjects.dll/libagjnistkobjects.so
- AgJNIStkGator.dll/libagjnistkgator.so
- AgJNIStkAvtr.dll/libagjnistkavtr.so
- AgJNIStkVGT.dll/libagjnistkvgt.so
- AgJNIStkGraphics.dll/libagjnistkgraphics.so
- AgJNIStkX.dll/libagjnistkx.so
Packages:
- agi.*
- agi.core.*
- agi.core.awt.*
- agi.stkutil.*
- agi.stkobjects.*
- agi.stkobjects.astrogator.*
- agi.stkobjects.aviator.*
- agi.stkvgt.*
- agi.stkgraphics.*
- agi.stkx.*
- agi.stkx.awt.*
- agi.stkx.swing.*
Documentation
- Documentation for including Javadocs in Eclipse IDE
- STK Custom Application samples are provided within the STK and STK Engine install. To configure and run these samples, see Eclipse samples configuration.
To use these samples:
- Build these samples in Eclipse by referring to Eclipse samples configuration.
- Right click on the Java file that contains a main method within any sample Eclipse project and choose Run as -> Java Application.
Development/Runtime Configuration
Development Environments
Use the above listed JAR and JNI native libraries as input to the following development environment configurations:
- Standalone environment - Instructions to configure a non-gui development environment for developing the Java Custom Application.
- Eclipse IDE - Instructions to configure an Eclipse Java application development project.
Use the samples listed above as reference for implementing an AWT/Swing Custom Application.
Deployment
Deployment instructions for a STK Custom Application.
- Follow the appropriate deployment instructions for an STK or STK Engine application.
- Locate the JavaDevKit directory in the STK 13 or STK Engine 13's installation area, for instance:
- Add the jar files located in the bin directory to your Java application's runtime environment's CLASSPATH environment variable or the Java Virtual Machine's (java.exe) classpath input argument.
- Add the bin directory to your Java application's runtime environment's PATH environment variable on windows or LD_LIBRARY_PATH on Linux, or the Java Virtual Machine's (java.exe) equivalent native library path setting such that the AGI jar files can load the native AgJNI*.dlls(libagjni*.so on Linux) that are in that directory.
Platform | Path |
---|---|
Windows 64bit | <Install_Dir>\bin |
Linux | <Install_Dir>/bin |
FAQ
A set of frequently asked questions/issues and their answers/solutions.
Topics
- How do I init/uninit my console application to use STK Custom Application?
- How do I init/uninit my AWT Based GUI application to use STK Custom Application?
- How do I init/uninit my application to use STK Custom Application without the Object Model / Astrogator / Vector Geometry Tool / Graphics API?
How do I init/uninit my console application to use STK Custom Application?
Typically, console applications do not utilize GUI functionality as are provided by frameworks such as AWT and SWT. However, at this time the STK Java API does not provide an initialization/uninitialization strategy for non-GUI applications. As such, one must initialize/uninitialize their console applications that use the STK Java API with one of the window framework initialization/uninitialization strategies, ergo AWT or SWT. This is a known issue that will be resolved in a future release. The AWT window framework initialization/uninitialization strategy is recommended in this case, an example of which follows:
This initialization/uninitialization strategy may require further configuration of the Java Runtime's CLASSPATH setting to add dependencies on either the AWT or SWT window framework JAR libraries depending on the runtime configuration of running context of the GUI-less application.
- Initialization:
- Uninitialization:
agi.core.awt.AgAwt_JNI.initialize_AwtDelegate();
agi.stkengine.AgStkCustomApplication_JNI.initialize(true);
agi.core.awt.AgAwt_JNI.initialize_AwtComponents();
This is the reverse order of the preceding initialize.
agi.core.awt.AgAwt_JNI.uninitialize_AwtComponents();
agi.stkengine.AgStkCustomApplication_JNI.uninitialize();
agi.core.awt.AgAwt_JNI.uninitialize_AwtDelegate();
How do I init/uninit my AWT Based GUI application to use STK Custom Application?
- Initialization:
agi.core.awt.AgAwt_JNI.initialize_AwtDelegate();
agi.stkengine.AgStkCustomApplication_JNI.initialize(true);
agi.core.awt.AgAwt_JNI.initialize_AwtComponents(); - Uninitialization:
This is the reverse order of the preceding initialize.
agi.core.awt.AgAwt_JNI.uninitialize_AwtComponents();
agi.stkengine.AgStkCustomApplication_JNI.uninitialize();
agi.core.awt.AgAwt_JNI.uninitialize_AwtDelegate();
How do I init/uninit my application to use STK Custom Application without the Object Model / Astrogator / Vector Geometry Tool / Graphics API?
- Initializing/Uninitializing with the following techniques will allow you to exclude the following binaries from your development and runtime configuration:
agi.stkobjects.jar
AgJNIStkObjects.dll/libagjnistkobjects.so
agi.stkobjects.astrogator.jar
AgJNIStkGator.dll/libagjnistkgator.so
agi.stkobjects.aviator.jar
AgJNIStkAvtr.dll/libagjnistkavtr.so
agi.stkvgt.jar
AgJNIStkVGT.dll/libagjnistkvgt.so
agi.stkgraphics.jar
AgJNIStkGraphics.dll/libagjnistkgraphics.so
- Initialization:
- Uninitialization:
agi.core.awt.AgAwt_JNI.initialize_AwtDelegate();
agi.core.AgCore_JNI.initialize();
agi.stkutil.AgStkutil_JNI.initialize();
agi.stkx.AgStkx_JNI.initialize();
//agi.stkobjects.AgStkobjects_JNI.initialize();
//agi.stkobjects.astrogator.AgStkgator_JNI.initialize();
//agi.stkobjects.aviator.AgStkobjectsAviator_JNI.initialize();
//agi.stkvgt.AgCrdn_JNI.initialize();
//agi.stkgraphics.AgStkGraphics_JNI.initialize();
agi.core.awt.AgAwt_JNI.initialize_AwtComponents();
this is the reverse order of the preceding initialize.
agi.core.awt.AgAwt_JNI.uninitialize_AwtComponents();
//agi.stkgraphics.AgStkGraphics_JNI.uninitialize();
//agi.stkvgt.AgCrdn_JNI.uninitialize();
//agi.stkobjects.aviator.AgStkobjectsAviator_JNI.uninitialize();
//agi.stkobjects.astrogator.AgStkgator_JNI.uninitialize();
//agi.stkobjects.AgStkobjects_JNI.uninitialize();
agi.stkx.AgStkx_JNI.uninitialize();
agi.stkutil.AgStkutil_JNI.uninitialize();
agi.core.AgCore_JNI.uninitialize();
agi.core.awt.AgAwt_JNI.uninitialize_AwtDelegate();