Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Adding Tools to HIPE | ||||||||
Line: 7 to 7 | ||||||||
![]() | ||||||||
Line: 17 to 19 | ||||||||
<-- summary -->Tools are processing units that operate on specific data elements. From the Java point of view, a tool is an implementation of the Tool interface. | ||||||||
Changed: | ||||||||
< < | The well-known Tasks are examples of tools within HIPE. In this case, TaskTool![]() | |||||||
> > | The well-known Tasks are examples of tools within HIPE. In this case, TaskTool is used under the hood. | |||||||
If a data element is selected, a list of tools that can operate on that data should appear. Double clicking on the tool will open an associated view (for non-task tools) or a dialog for settings parameters (for task tools). | ||||||||
Line: 25 to 27 | ||||||||
This section explains:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 77 to 79 | ||||||||
} | ||||||||
Changed: | ||||||||
< < | Naming conventions for task when to be registered in Hipe should follow this example assuming that the task will perform the functionality named "reduce" : | |||||||
> > | Naming conventions for task when to be registered in HIPE should follow this example assuming that the task will perform the functionality named "reduce" : | |||||||
Name of the Class : ReduceTask Name of the Task (getName()) : reduce | ||||||||
Line: 91 to 93 | ||||||||
The mechanism above makes you task to become a tool within the system and it appears whenever a variable of type | ||||||||
Changed: | ||||||||
< < | Sometimes this may not be enough, e.g. in certain situations your task will only run on a SpecificProduct if it contains certain contents. A typical situation would be when a SPIRE reduction operates on a ObservationContext: such a task should not be listed whenever a HIFI observation is selected... | |||||||
> > | Sometimes this may not be enough, e.g. in certain situations your task will only run on a SpecificProduct if it contains certain contents. A typical situation would be when a SPIRE reduction operates on an ObservationContext: such a task should not be listed whenever a HIFI observation is selected... | |||||||
You can write a ParameterValidator to do just that:
| ||||||||
Line: 108 to 110 | ||||||||
In other words, rather than writing this logic within the pre-amble or execution block of your task, we recommend you to move that logic into the parameter validation. This way we achieve two things:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Task Dialogs | ||||||||
Line: 130 to 132 | ||||||||
![]() | ||||||||
Changed: | ||||||||
< < | Provided modifiers have been updated but some modifiers are too wide for this layout (ex. AngleModifier, can have 3 texts and 1 combo in a line, see rotate later). | |||||||
> > | Provided modifiers have been updated but some modifiers are too wide for this layout (for instance, AngleModifier can have three texts and one combo in a line, see rotate later). | |||||||
The default dialog for the crop task, with all sections opened: ![]() | ||||||||
Line: 144 to 145 | ||||||||
Parameter Modifiers | ||||||||
Changed: | ||||||||
< < | The system provides a default dialog displaying an input area for setting the values of the parameter based on a composition of Modifiers![]() | |||||||
> > | The system provides a default dialog displaying an input area for setting the values of the parameter based on a composition of Modifier objects. | |||||||
The input area for the crop task: ![]() | ||||||||
Changed: | ||||||||
< < | The composition of Modifiers![]() | |||||||
> > | The composition of Modifier objects is created based on the types of the values of the Task Parameters of the Task Signature. | |||||||
The Modifier for the row1 Parameter of the crop task: ![]() | ||||||||
Line: 172 to 173 | ||||||||
Implement a Modifier | ||||||||
Changed: | ||||||||
< < | The Modifier![]() | |||||||
> > | The ia.gui.apps.Modifier interface consists of two explicit contracts: | |||||||
| ||||||||
Line: 237 to 238 | ||||||||
Implement a Task Signature Component | ||||||||
Changed: | ||||||||
< < | The TaskSignatureComponent![]() | |||||||
> > | The ia.task.gui.dialog.TaskSignatureComponent interface consists of four explicit contracts: | |||||||
| ||||||||
Line: 246 to 247 | ||||||||
| ||||||||
Changed: | ||||||||
< < | An easy way of implementing TaskSignatureComponent![]() ![]() makeModifierMap() method. | |||||||
> > | An easy way of implementing TaskSignatureComponent is by extending ia.task.gui.dialog.JTaskSignatureComponent and providing your own implementation for the makeModifierMap() method. | |||||||
Changed: | ||||||||
< < | For example, if you want to use a custom Signature Component that just wants to use JFilePathModifier![]() | |||||||
> > | For example, if you want to use a custom Signature Component that just wants to use ia.gui.apps.modifier.JFilePathModifier for a parameter aimed for a file name, you could do it like this: | |||||||
public class MySignatureComponent extends JTaskSignatureComponent { | ||||||||
Line: 311 to 309 | ||||||||
Implement a Task Panel | ||||||||
Changed: | ||||||||
< < | The TaskPanel![]() | |||||||
> > | The ia.task.gui.dialog.TaskPanel interface consists of three explicit contracts: | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
and the two implicit contracts inherited by the Extension Registry
| ||||||||
Line: 397 to 395 | ||||||||
List<? extends Parameter> inputs, Category... categories) | ||||||||
Changed: | ||||||||
< < | You provide the variable types you are interested in within the prime input: just return a ToolParameter![]() | |||||||
> > | You provide the variable types you are interested in within the prime input: just return a ia.gui.kernel.ToolParameter initiated with the proper class of data you want to handle: | |||||||
new ToolParameter("data", MyTargetDataType.class) | ||||||||
Line: 422 to 420 | ||||||||
Tool Viewer | ||||||||
Changed: | ||||||||
< < | Every tool has an associated viewer, which must implement EditorComponent![]() ![]() | |||||||
> > | Every tool has an associated viewer, which must implement ia.gui.kernel.parts.EditorComponent (by extending ia.gui.kernel.parts.AbstractEditorComponent or one of its subclasses). | |||||||
Tool RegistryOnce you have your tool and the corresponding viewer, you need to register them like this: |