Difference between revisions of "Extending OpenRocket"

From OpenRocket wiki
Jump to navigation Jump to search
(Created page with " == Extending OpenRocket == OpenRocket is built to be extensible using plugins. You can implement your own functionality or download plugins implemented by others. This doc...")
 
Line 10: Line 10:
  
 
Extensions to OpenRocket are implemented as plugins.  All interfaces that may have multiple implementations should be implemented using plugin interfaces internally.  That way, external plugins may create new implementations.
 
Extensions to OpenRocket are implemented as plugins.  All interfaces that may have multiple implementations should be implemented using plugin interfaces internally.  That way, external plugins may create new implementations.
 +
 +
A plugin is compiled into a JAR file and placed into the OpenRocket plugin directory.  These JAR files are included in the OpenRocket classpath at startup and scanned for classes and interfaces annotated with <code>@Plugin</code>.
 +
 +
* A '''plugin interface''' is a Java interface that is annotated with the <code>@Plugin</code> annotation.  These interfaces are scanned from the classpath at startup and can be queried by the code.
 +
* A '''plugin implementation''' is a Java class that implements a plugin interface and is annotated with the <code>@Plugin</code> annotation.
 +
 +
In practise the plugin interfaces are defined by the internal OpenRocket code, and are extension points which internal and external plugins can implement.
  
 
'''Note:'''  Many of the internal interfaces have not yet been changed to use the plugin interface.  They will be migrated one by one.  Help is appreciated.
 
'''Note:'''  Many of the internal interfaces have not yet been changed to use the plugin interface.  They will be migrated one by one.  Help is appreciated.

Revision as of 21:50, 25 December 2014

Extending OpenRocket

OpenRocket is built to be extensible using plugins. You can implement your own functionality or download plugins implemented by others.

This document describes how to implement your own extensions to OpenRocket.


Plugins

Extensions to OpenRocket are implemented as plugins. All interfaces that may have multiple implementations should be implemented using plugin interfaces internally. That way, external plugins may create new implementations.

A plugin is compiled into a JAR file and placed into the OpenRocket plugin directory. These JAR files are included in the OpenRocket classpath at startup and scanned for classes and interfaces annotated with @Plugin.

  • A plugin interface is a Java interface that is annotated with the @Plugin annotation. These interfaces are scanned from the classpath at startup and can be queried by the code.
  • A plugin implementation is a Java class that implements a plugin interface and is annotated with the @Plugin annotation.

In practise the plugin interfaces are defined by the internal OpenRocket code, and are extension points which internal and external plugins can implement.

Note: Many of the internal interfaces have not yet been changed to use the plugin interface. They will be migrated one by one. Help is appreciated.