T
a
b
l
e

o
f

C
o
n
t
e
n
t
s
imjSlideshow
Template - Development Information

Introduction

The core of imjSlideshow are templates. Each template represents a particular effect. There are templates to produce the images, while others modify the images.

Image-/Modification-Template

For an image- or a modification-template you must implement a class that are derived from the class "net.sourceforge.imjSlideshow.model.Template". While image-templates producing new images, modification-templates modifies existing images.

Registration

All templates must be registered in the constructor of the class "net.sourceforge.imjSlideshow.model.Templates".

Constructor

A constructor without parameters or with "Configuration" as parameter must be implemented. With calling the super-constructor, the class is constructed.

Parameter Type Description
id String A unambiguous unique id for the template. It can be a text in the resource-bundle. The id is used in the xml-file of a slideshow to reference the template to use.
name String A name for the template. It must be unique within the category. It should be a text in the resource-bundle.
category String A category for the template. It should be a text in the resource-bundle.
description String A description for the template. It should be a text in the resource-bundle.
parameterTemplates ParameterTemplate[] The possible parameters of the template. The parameterTemplates are described later.
durations Duration[] Sets the count of duration and the default-values of the duration for the image, based upon this template. If "durationCountChangeable" is set to "true", than more duration resp. point in times for the image are possible. A duration consists of the duration in milliseconds and a zoom-factor. Depending on the zoom factor, a change in the whole duration is divided to the several durations.
durationCountChangable boolean If set to true, than the count of duration for an image can be changed. (net yet implemented)
isImageTemplate boolean Must be set to "true", if the template is for an image.
Must be set to "false", if the template is for a modification.

Method "getThumbnailFor"

In the tree-view and the timeline-view an image resp. a modification are shown with the image, that are produced with this method.

public ImageIcon getThumbnailFor( Modification modification)

Parameter Type Description
modification Modification The image for which a thumbnail is to be generated
returns ImageIcon The thumbnail of the image

Method "createOperation"

The actual render process takes place within this method. The methode is called during the rendering for each frame at which the image or the modification is valid.

Template for images must be create a sequence operation.
For details look at imageMagick sequence operation.

Template for modifications must be create a normal operation.
For details look at imageMagick operation.

Both sequence operations and operations can be modified with settings.
For details look at imageMagick settings.

final public Operation createOperation( Time time, Modification imageOrModification)

Parameter Type Description
time Time The point in time, for which the operation will be generated
imageOrModification Modification The image resp. modification for which the operation is to be generated
returns Operation The operation for the image at the point in time

Method "bind"

The optional method "bind" is called, if an image resp. a modification is created with this template. The method binds for example an observer to construct a name for the image with the file-name of the image-file used in an image. (look at ImageShowTemplate)

public void bind( final Modification modification)

Parameter Type Description
modification Modification The image resp. modification that are constructed.

ParameterTemplate

A parameter-template describe the parameter of an image resp. modification.

It is constructed with following parameter:

Parameter Type Description
name String The name of the parameter. It should be a text in the resource-bundle.
description String The description of the parameter. It should be a text in the resource-bundle.
type Class<?> The class of the parameter. It must be a type, that the TypeAdapterManager can give a TypeAdapter. For details look at "net.sourceforge.imjSlideshow.ui.type.TypeAdapterManager"
validationScript ValidationChecker<parameter> An Object, that validates the parameter before rendering takes place.
defaultValues Object...<parameter> Default-values for the parameter for the point in time, where the parameter has a value. The object must be of the class given with the parameter "type".