Trident 1.1 – extension points

October 3rd, 2009 | 1 Comment »

Trident animation library for Java applications is nearing release 1.1 (code-named Bogeyman), and it’s time to take a look at the new APIs added in this version. This entry is going to talk about extending the core functionality of Trident to address custom needs of the specific applications.

Core functionality

The core functionality of the Trident library can be extended to address custom needs of the specific applications. Out of the box Trident supports:

  • The timeline pulses being fired by a dedicated thread that wakes up every 40ms and updates all the timelines
  • Interpolating float and integer fields of any Java object that provides the matching public setter methods.
  • Swing and SWT UI toolkits, respecting the threading rules and providing interpolators for the custom graphic classes

Interested applications can use Trident plugins and Trident configuration APIs to:

  • Provide a custom pulse source to drive the timeline updates
  • Provide additional property interpolators for custom application classes
  • Support additional Java-based UI toolkits

Configuration APIs

The org.pushingpixels.trident.TridentConfig class contains the published configuration APIs. The TridentConfig.getInstance() API retrieves an instance of this class which can then be used for:

Plugins

A Trident plugin is specified by the META-INF/trident-plugin.properties file that should be placed in the runtime classpath. Note that you can have multiple plugins in the same runtime environment – if each one is coming from a different classpath jar, for example.

The format of trident-plugin.properties is simple. Each line in this file should be of the following format:

Key=FullyQualifiedClassName

There supported keys are:

The core Trident library contains a plugin that supports Swing and SWT UI toolkits, as well as property interpolators for a few core classes. The plugin descriptor is META-INF/trident-plugin.properties in the trident.jar

UIToolkitHandler=org.pushingpixels.trident.swing.SwingToolkitHandler
PropertyInterpolatorSource=org.pushingpixels.trident.swing.AWTPropertyInterpolators

UIToolkitHandler=org.pushingpixels.trident.swt.SWTToolkitHandler
PropertyInterpolatorSource=org.pushingpixels.trident.swt.SWTPropertyInterpolators

PropertyInterpolatorSource=org.pushingpixels.trident.interpolator.CorePropertyInterpolators

Related posts:

  1. Trident part 10 – extending the core with plugins Over the course of this week i’m talking about different concepts in the Trident animation...
  2. Trident 1.1 – custom property interpolators Trident animation library for Java applications is nearing release 1.1 (code-named Bogeyman), and it’s time...
  3. Trident part 5 – supporting UI toolkits Over the course of the next few days i’m going to talk about different concepts...
  4. Trident 1.1 – supporting Java-based UI toolkits Trident animation library for Java applications is nearing release 1.1 (code-named Bogeyman), and it’s time...


One Comment on “Trident 1.1 – extension points”

  1. 1 Java desktop links of the week, October 5 | Jonathan Giles said at 8:41 pm on October 3rd, 2009:

    [...] the animation library for Java that he has developed. Topics include interpolating properties, extension points, custom pulse sources, custom property interpolation, and supporting Java-based UI [...]