STK Java API - STK Graphics Plugin
Description
Custom graphics are used to visualize rasters, projections, and custom image globe overlays in a 3D display. Custom graphics can be defined by developers and users of STK via a plugin architecture in many software programming languages including Java.
What's included in this API?
The API to develop/run/deploy an STK Graphics Java Plugin based on the STK Java API includes the following lists of libraries/packages/javadocs:
JAR libraries:
- agi.core.jar
- agi.stk.plugin.util.jar
- agi.stk.plugin.graphics.ar
- agi.stkutil.jar
- agi.stkvgt.jar
- agi.stkgraphics.jar
- agi.stkstkobjects.jar
- agi.stkobjects.astrogator.jar
- agi.stkobjects.aviator.jar
JNI native libraries:
- AgJNICore.dll/libagjnicore.so
- AgJNIStkPluginUtil.dll/libagjnistkpluginutil.so
- AgJNIStkPluginGraphics.dll/libagjnistkplugingraphics.so
- AgJNIStkUtil.dll/libagjnistkutil.so
- AgJNIStkVGT.dll/libagjnistkvgt.so
- AgJNIStkGraphics.dll/libagjnistkgraphics.so
- AgJNIStkObjects.dll/libagjnistkobjects.so
- AgJNIStkGator.dll/libagjnistkgator.so
- AgJNIStkAvtr.dll/libagjnistkavtr.so
Packages:
- agi.*
- agi.core.*
- agi.stk.plugin.util.*
- agi.stk.plugin.graphics.*
- agi.stkutil.*
- agi.stkvgt.*
- agi.stkgraphics.*
- agi.stkobjects.*
- agi.stkobjects.astrogator.*
- agi.stkobjects.aviator.*
Documentation
- Graphics ProjectionStream and RasterStream
- Documentation for including Javadocs in Eclipse IDE
- The following STK Graphics Java Plugin samples are provided within the STK and STK engine install:
- Extend_STK_Plugin_Graphics_Common - Sample that shows common reusable code and configuration for all Graphics plugins.
- Extend_STK_Plugin_Graphics_ProjectionStream_Basic - Sample that shows how to implement a generic projection stream graphics plugin.
- Extend_STK_Plugin_Graphics_RasterStream_Basic - Sample that shows how to implement a generic raster stream graphics plugin.
- Extend_STK_Plugin_Graphics_CustomImageGlobeOverlay_OpenStreetMap - Sample that shows how to implement a Open Street Map custom image globe overlay.
To use these samples:
- Build these samples in Eclipse by referring to the Eclipse samples configuration page.
- Locate the STK installation's Graphics.xml. The default installation location for instance:
- Copy Access Constraints.xml to your STK plugin configuration user directory, which is
C:\Users\<user id>\Documents\STK_ODTK 13\Config\Plugins
for Windows users (or<STK_CONFIG_DIR>/<STK version>/Config/Plugins
for LINUX users). - Locate the three sample Graphics JavaPlugin entries for your chosen platform in the comment block that start with the following:
- Copy the three entries to the uncommented section under the Graphics Plugins category element within the XML file.
- In the copied JavaPlugin element entries, if the sample plugin's compiled .class files (and package structure) are not located in the directory specified by the ClassPath entry, then change it to the directory location of the plugin's *.class file's base package space.
- Refer to STK documentation for configuration of Graphics during display time to use the above plugin samples.
Platform | Path |
---|---|
Windows 64bit | <Install_Dir>\CodeSamples\Extend\Graphics\Graphics.xml |
Linux | <Install_Dir>/CodeSamples/Extend/Graphics/Graphics.xml |
<JavaPlugin ProgID="AgJNISTKPluginGraphicsDriver10.Driver" ...
Development/Runtime Configuration
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 plugin application.
-
Eclipse IDE - Instructions to configure an Eclipse Java plugin application development project.
Use the samples listed above as reference for implementing the IAgStkGraphicsPluginRasterStream, IAgStkGraphicsPluginProjectionStream, IAgStkGraphicsPluginCustomImageGlobeOverlay and IAgStkGraphicsPluginWithSite interfaces.
Deployment instructions for a STK Graphics Java Plugin application:
- Follow the appropriate installation instructions for the STK or STK Engine product.
- Install your STK Graphics Java Plugin JAR file and its dependent JAR files to your preferred installation location.
- Create an Graphics Plugin XML file.
- Create a JavaPlugin element entry within the Graphics Plugin category element scope.
- Change the DisplayName attribute to a meaningful name for your plugin that will be displayed in the STK GUI.
- Change the ClassName attribute to the fully package qualified name of your plugin Java class.
- Change the ClassPath attribute to contain a semi-colon separated list of the absolute file paths to the JAR files that contain your plugin as well as JARs that your plugin depend upon.
- Copy your Graphics Plugin XML file to the STK or STK Engine installation's Plugins directory if it is writable. The default installation location for instance:
- Refer to the STK documentation on how to configure your scenario to use your Graphics Java plugin during display.
Make sure the name of your Graphics XML file is unique as to not conflict with other plugin xml files.
Do NOT include the AGI Plugin JARs, as these are automatically configured/loaded by STK at runtime.
Platform | Path |
Windows 64bit | <Install_Dir>\Plugins\<Name of plugin xml file>.xml |
Linux | <Install_Dir>/Plugins/<Name of plugin xml file>.xml |
If this is not a writable location, copy your Graphics Plugin XML file to the STK Plugin configuration user directory, which typically is <STK User Area>\Config\Plugins
on windows and <STK_CONFIG_DIR>/<STKVERSION>/Config/Plugins
on LINUX.
FAQ
A set of frequently asked questions/issues and their answers/solutions.
Topics
How/when do I run my Graphics Java plugin application?
STK is responsible for creating and initializing your plugin when necessary during 3D Graphics window redraw.
Do I need a main method declared?
You do NOT need to declare a main method within your plugin. The latest installed JRE on the deployed machine fill be embedded/started within STK, your Java plugin class which you indicated in the ClassName attribute of your JavaPlugin entry within your plugin xml file.