| BlueSpray - Help © SchoonerTurtles, Inc. 2012-2015
Introduction
Contents
Getting Started
Download
Navigating
Tutorials
Scripting
Advanced
About
| # Extending BlueSpray ## Introduction BlueSpray can be easily extended to include new transforms, file IO libraries, and other high-performance features. All you have to do is create new classes by extending the existing classes, building a JAR file, and then saving the JAR file in the BlueSpray extensions folder. BlueSpray will see the JAR when started and your extensions will appear where expected in BlueSpray. Extending BlueSpray does require knowning how to program in Java and how to use a Java development envrionment. For a compiled language, Java is relatively easy to learn and one of the most popular programming lanaguages. There are a huge number of books available to learn java including "Java in a Nutshell", "Just Java", and "Core Java". The Java Tutorials available from Oracle are also a great resource. You do not need to know everything about Java, just enough to get started programming in BlueSpray as the examples below will show. There are a number of Java Integrated Develoment Environments (IDE) available including NetBeans and Eclipse, both of which are free to use and available on the Internet. We use NetBeans primarily. If you are new to Java, download one of the development envrionments menetioned above and go through a few code examples in one of the turtorials mentioned before continuing. Below is information on developing in the NetBeans development environment. Creating an Extension in NetBeans Currently, BlueSpray allows Transform and File extensions. We recommend you review the material below on how to create extensions and then refer to the appropriate extension reference below. STTransform - transforms for any type of layer (point, vector and/or raster) STTransformRaster - transforms specifically for raster data (this class contains helper functions) STFile - extensions for supporting additional file formats Hierarchy summary for extensions: - STBase – can be loaded and saved to/from STX files - STContent – can appear in the project tree - STItem – appear in containers (docs and scenes) - STProcesses – have inputs and/or outputs and runs threads (appears in “new” menu) - STTransform – appear in appropriate data menus - STTransformRaster – supports tiling of raster data - STIO - input and/or output data to/from BlueSpray - STFile - File handlers ### STTransform Transforms take one or more input objects and output one or more input objects. The variety of possible transforms is huge and limited only by your imagination. BlueSpray was built not only to make it easy to created transforms but also to allow them to run at great speed. STTransform can be extended to transform point, vector, and/or raster data. ### STTransformRaster Large rasters do not always fit into memory. STTransformRaster allows your transforms to operate on large rasters by breaking the raster into Tiles. When your transform is selected, a tile will be read from a raster file or a pyramid, your transform will be run on it, and then the result will be saved to disk. This is repeated for all tiles in the raster. ### STFile There are a huge number of different file formats for geospatial and other data. BlueSpray includes the most common file formats but you can add additional file handlers for other file formats. ## Additional Extensions BlueSpray can also be extended with the following types of extensions. Contact SchoonerTurtles for more information. STItem STScaleBar STLayer STNetworkService STProjector STPainter STTools ## Overview BlueSpray was built with extensions in mind. The hiearchy chart below shows the typical extensions developers will want to create in bold. The approach is to create a new Java class following the instructions on the following pages. Your class can access any of the other classes within BlueSpray (and their are quite a few) and you can add additional classes from OpenSource libraries or of your own creation. You'll then build your class and any required libraries into a JAR and place the JAR in the appropriate extensions folder in the same folder as BlueSpray. Then your extension will appear in BlueSpray the next time you start the application. The instructions that follow will get you started with writing extensions. These are reference information and include all of the BlueSpray classes. In theory, you can extend any part of BlueSpray and even replace the entire user interface. If you do, please contact SchoonerTurtles as this level of modification can be a copyright violation. Hierarchy summary for extensions: - STBase – can be loaded and saved to/from STX files - STContent – can appear in the project tree - STItem – appear in containers (docs and scenes) - STScaleBar – appears in docs to show the scale of a scene - STLayer – appear georeferenced in scenes - STProcesses – have inputs and/or outputs and runs threads (appears in “new” menu) - STTransform – appear in appropriate data menus - STTransformRaster – supports tiling of raster data - STIO - input and/or output data to/from BlueSpray - STFile - File handlers - STSQL - Database interface class based on structured query language - STNetworkService - Handler for a particular type of service on a network (e.g. a web service) - STProjector – new projection engines (future) - STPainter – render data into a view - STTools – can be used to add and edit content ### STItem Items are objects that appear in the view and typically can be manipulated by the user. Items include boxes, ovals, text blocks, and the documents they are contained in. Scenes that contain layers are also items but new layers should be created from the layers class so they can be georeferenced in a scene. ### STScaleBar BlueSpray allows the addition of different types of scalebars. ### STLayer Layers contain geospatial data including points, vector data, and rasters. You can extend BlueSpray for these types of data or georeferened overlays such as grids or rosettes. ### STSQL The database objects allow geospatial data to be saved and aloded to and from a database such as SQL Server, PostGRES/PostGIS, and MySQL ### STNetworkService Network objects allow access to geospatial data available on the Internet including WMS, WFS, etc. - Not implemented ### STProjector There are a limited number of projection engines available so BlueSpray internally implements all of the major ones (GDAL, GeoTools, and some custom ones). We are not currently supporting external projector engines but let us konw if you'd like to add one and we'll modify BlueSpray to allow external ones. ### STPainter Painters render raster and vector data into the view. This includes borders on items. ### STTools Tools allow the user to create new data in layers and documents.