Basic Anatomy of a Component

This section introduces the basic constituents of an Isight component. Example code is available in the <Isight_install_directory>/<operating_system>examples/development/components directory.

Typically, a component has five classes that extend/implement the specified classes/interfaces defined by the Isight framework:

  • Executor: Used when the component is run.

  • Editor: The GUI to allow configuration of the component.

  • Post-processor: Used to provide a summary of the output.

  • Handler: Used for validation at design time.

  • Preference Editor: Used to specify preferences for all instances of the given component.

You can have other supporting classes as needed. The following table summarizes the Isight framework defined interfaces/classes for the above mentioned entities.

Isight Framework for Component Development

Component Type

Interface

Super-class

Executor

com.engineous.sdk.runtime.Component

com.engineous.sdk.runtime.

AbstractComponent

Editor

com.engineous.desktop.sdk.

DesktopEditor

com.engineous.desktop.sdk.

AbstractDesktopEditor

Post-processor

com.engineous.sdk.runtime.

PostProcessor

com.engineous.sdk.component.

DefaultComponentPostProcessor

Handler

com.engineous.sdk.component.

ComponentHandler

com.engineous.sdk.component.

DefaultComponentHandler

Preference Editor

com.engineous.sdk.preferences.

PreferencePanel

com.engineous.sdk.preferences.

AbstractPreferencePanel

In addition to these classes you must have an xml file called component descriptor and a manifest file. Both files must contain vital information about the component. You must provide the component descriptor file. Typically, the manifest file is created by the project build file.

A typical component descriptor file with numbered placeholders for various values follows:

<?xml version="1.0" encoding="UTF-8"?>
<MetaModel name=" 1 "
supername="com.engineous.system.component.Activity"
superversion="*.*.*" version=" 2 ">

<Requires>
   <SystemRelease>2.0.0</SystemRelease>
</Requires>

<DisplayName> 3 </DisplayName>
<Description> 4 </Description>

<Icon> 5 </Icon>

<Editor type=
"com.engineous.desktop.sdk.DesktopEditor"> 6 </Editor>
<Runtime type="com.engineous.sdk.runtime.Component"> 6 
</Runtime>
<Handler type=
"com.engineous.sdk.component.ComponentHandler">
6 </Handler>
<PostProcessor type=
"com.engineous.sdk.runtime.PostProcessor">
6 </PostProcessor>
<PreferencesPanel type=
"com.engineous.sdk.preferences.PreferencePanel"> 6 
</PreferencesPanel>

<Variables>
   <Variable description=" 4 " model="Local" name=" 7 " 
   tag=" 7 " role="Property" structure="Scalar"
   type="com.engineous.datatype.String 8">
   </Variable>
</Variables>

<Preferences>
   <Preference name=" 7 " tag=" 7 "
   type="com.engineous.datatype.String">
      <Value>" 9 " </Value
   </Preference>
</Preferences>

</MetaModel>

The significance of placeholders in the component descriptor above is:

Placeholder

Value

1

The metamodel name of the component (e.g., com.engineous.component.adams).

2

The version number (e.g., 1.0.0).

3

The name of the component.

4

A brief description.

5

The path to the icon of the component (e.g., com/engineous/component/adams/adamsicon.gif).

6

Full name of the appropriate class (e.g., com.engineous.component.adams.AdamsEditor).

7

The name/tag of the variable/preference.

8

The data type (see Datatype Development).

9

The initial value of the preference.