Difference: DpHipeComponents (1 vs. 23)

Revision 232014-02-18 - AlvarGarcia

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"
<-- ANALYTICS CODE - DO NOT EDIT -->
<-- Google Analytics script BEGIN -->
<-- Google Analytics script END -->
Line: 27 to 27
 

Revision 222013-09-05 - JaimeSaiz

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"
<-- ANALYTICS CODE - DO NOT EDIT -->
<-- Google Analytics script BEGIN -->
<-- Google Analytics script END -->
Line: 215 to 215
 
Deleted:
<
<

Your Explorer Implementation

You may have created an implementation of the former Explorer interface which is used by the dataset inspector (and is registered within that inspector).

If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.dataset.gui.views.AbstractExplorerComponent][ia.dataset.gui.views.AbstractExplorerComponent]:

public class ArrayDataComponent extends AbstractExplorerComponent<ArrayData> {
    private static final Icon ICON = ...

    public ArrayDataComponent() {
	super(ICON);
    }   

    @Override
    protected Class<ArrayData> getVariableType() {
	return ArrayData.class;
    }
}

That's it. Your explorer would be picked up for showing the values it is registered to manage (see next section).

 

Component Registry

Editor components need to be registered for telling the types they are interested in. This is to be done within your __init__.py:

Revision 212012-10-19 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"
Added:
>
>
<-- ANALYTICS CODE - DO NOT EDIT -->
<-- Google Analytics script BEGIN -->
<-- Google Analytics script END -->

<-- END OF ANALYTICS CODE -->
 
<-- 
  • Set TOPICTITLE = Adding components to existing views
-->
Line: 278 to 281
 
<-- END OF COMMENT BOX CODE -->

Added:
>
>
META FILEATTACHMENT attachment="GoogleAnalytics.txt" attr="h" comment="Script for Google Analytics" date="1350658047" name="GoogleAnalytics.txt" path="GoogleAnalytics.txt" size="549" stream="GoogleAnalytics.txt" user="Main.DavideRizzo" version="1"
 
META TOPICMOVED by="DavideRizzo" date="1272527900" from="Hcss.DpHipeComponents" to="Public.DpHipeComponents"

Revision 202012-07-11 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"
Line: 46 to 49
 

Outline View

Changed:
<
<
Whenever the user selects a session variable in the [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.inspector.views.VariablesView][VariablesView]], a [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.gui.kernel.event.SelectionEvent][SelectionEvent]] is sent around.
The [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.inspector.views.OutlineView][OutlineView]] is listening to such event and it tries to find the appropriate component that can show the outline information of that variable.
>
>
Whenever the user selects a session variable in the VariablesView, a SelectionEvent is sent around.
The OutlineView is listening to such event and it tries to find the appropriate component that can show the outline information of that variable.
  The contract for outline components is:
Changed:
<
<
  • Implement the [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.gui.apps.views.outline.OutlineComponent][OutlineComponent]] interface by extending a javax.swing.JComponent.
>
>
 
Changed:
<
<
The recommended way of implementing [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.gui.apps.views.outline.OutlineComponent][OutlineComponent]] is by extending ObjectOutline, which provides a table with basic information about the variable.
>
>
The recommended way of implementing OutlineComponent is by extending ObjectOutline, which provides a table with basic information about the variable.
 Methods getExtraTableInfo() and getExtraComponent() may be overriden as needed for providing extra information about your type.

For example, suppose you want to create an outline for FineTime variables to show their contents in the outline view whenever a session variable of that type is selected by the user.

Line: 95 to 98
 

Source Code of Basic implementations

Changed:
<
<
Package herschel.ia.dataset.gui contains some basic implementations for OutlineComponents:
  • ArrayDataOutline: a simple outline for any array data
  • DatasetOutline: a simple outline for any dataset
  • ProductOutline: a simple outline for any product
>
>
Package herschel.ia.dataset.gui contains some basic implementations for OutlineComponent objects:
 
  • __init__.py: how the above get registered
Changed:
<
<
Tip, idea If you have a sub-class of e.g. a product, you can also create a dedicated OutlineComponent for that sub-class, which will be picked up instead of the default ProductOutline.
>
>
Tip, idea If you have a sub-class of e.g. a product, you can also create a dedicated OutlineComponent for that sub-class, which will be picked up instead of the default ProductOutline.
 
Line: 110 to 113
 
A special kind of outline is devoted to show previews of FITS files (for images, cubes, spectra...).
Changed:
<
<
This is managed by FitsFileOutline, which reads the product contained in the FITS file in the background, and shows an image preview for it when done.
>
>
This is managed by FitsFileOutline, which reads the product contained in the FITS file in the background, and shows an image preview for it when done.
  For this to work properly, any type that is meaningful to produce a preview should:
Changed:
<
<
1. Extend herschel.ia.gui.kernel.PreviewMaker. For example, for images (herschel.ia.gui.image.Image):
>
>
1. Extend herschel.ia.gui.kernel.PreviewMaker. For example, for images (herschel.ia.gui.image.Image):
 
import herschel.ia.gui.image.Image;

Line: 202 to 205
 

Source Code of Basic implementations

Changed:
<
<
The herschel.ia.gui.apps package contains some basic implementations for EditorComponents:
  • ListEditorComponent: a simple viewer of lists.
  • DefaultFileEditorComponent: a simple viewer of a file.
>
>
The herschel.ia.gui.apps package contains some basic implementations for EditorComponent objects:
 
  • __init__.py: how the above get registered.
Line: 213 to 216
 
You may have created an implementation of the former Explorer interface which is used by the dataset inspector (and is registered within that inspector).
Changed:
<
<
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend ia.dataset.gui.views.AbstractExplorerComponent:
>
>
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.dataset.gui.views.AbstractExplorerComponent][ia.dataset.gui.views.AbstractExplorerComponent]:
 
public class ArrayDataComponent extends AbstractExplorerComponent<ArrayData> {

Revision 192012-07-06 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"
Line: 45 to 46
 

Outline View

Changed:
<
<
Whenever the user selects a session variable in the VariablesView, a SelectionEvent is sent around.
The OutlineView is listening to such event and it tries to find the appropriate component that can show the outline information of that variable.
>
>
Whenever the user selects a session variable in the [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.inspector.views.VariablesView][VariablesView]], a [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.gui.kernel.event.SelectionEvent][SelectionEvent]] is sent around.
The [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.inspector.views.OutlineView][OutlineView]] is listening to such event and it tries to find the appropriate component that can show the outline information of that variable.
  The contract for outline components is:
Changed:
<
<
  • Implement the OutlineComponent interface by extending a javax.swing.JComponent.
>
>
  • Implement the [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.gui.apps.views.outline.OutlineComponent][OutlineComponent]] interface by extending a javax.swing.JComponent.
 
Changed:
<
<
The recommended way of implementing OutlineComponent is by extending ObjectOutline, which provides a table with basic information about the variable.
>
>
The recommended way of implementing [[http://herschel.esac.esa.int/hcss-doc-12.0/index.jsp#hcss_drm:herschel.ia.gui.apps.views.outline.OutlineComponent][OutlineComponent]] is by extending ObjectOutline, which provides a table with basic information about the variable.
 Methods getExtraTableInfo() and getExtraComponent() may be overriden as needed for providing extra information about your type.

For example, suppose you want to create an outline for FineTime variables to show their contents in the outline view whenever a session variable of that type is selected by the user.

Revision 182012-05-14 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Revision 172011-10-05 - JaimeSaiz

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Revision 162011-06-24 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"
Changed:
<
<

Adding Components to existing Views

>
>
<-- 
  • Set TOPICTITLE = Adding components to existing views
-->

PDF Version Portrait Landscape

Help Did you spot something wrong or missing on this page? If you have an account on this TWiki, you can fix it yourself by editing the page. If you don't have an account, you can send a message to the Editorial Board to tell us about it. Thank you in advance!

Adding components to existing views

 

<-- summary -->
Line: 245 to 253
 
Changed:
<
<
<-- JorgoBakker -->
>
>
Please add your comments!
<--/commentPlugin-->
 

Revision 152011-06-21 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 6 to 6
 
<-- summary -->
The contents of certain views can be extended by developers, such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection made by the user.
Changed:
<
<
Hcss.Here we explain how you can contribute to the outline view and the editor area.
>
>
Here we explain how you can contribute to the outline view and the editor area.
 

Line: 152 to 152
 The above showed an example of extending the outline view by adding an OutlineComponent. Similarly, you can contribute by developing a specific EditorComponent.

Editor components are editors (optionally read-only) of data contents of a specific variable that is selected within in the HIPE session.

Changed:
<
<
They are triggered by double-clicking on a variable, or through the open with menu. Editor components are opened in the editor area.
>
>
They are triggered by double-clicking on a variable, or through the open with menu. Editor components are opened in the editor area.
  The contract for editor components is:

Revision 142010-06-10 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 16 to 16
 

Line: 86 to 86
 

Source Code of Basic implementations

Changed:
<
<
Module ia_dataset_gui contains some basic implementations for OutlineComponents:
>
>
Package herschel.ia.dataset.gui contains some basic implementations for OutlineComponents:
  • ArrayDataOutline: a simple outline for any array data
  • DatasetOutline: a simple outline for any dataset
  • ProductOutline: a simple outline for any product
  • init.py: how the above get registered
 

Tip, idea If you have a sub-class of e.g. a product, you can also create a dedicated OutlineComponent for that sub-class, which will be picked up instead of the default ProductOutline.

Line: 151 to 151
 
The above showed an example of extending the outline view by adding an OutlineComponent. Similarly, you can contribute by developing a specific EditorComponent.
Changed:
<
<
Editor components are editors (optionally read-only) of data contents of a specific variable that is selected within in the HIPE session.
>
>
Editor components are editors (optionally read-only) of data contents of a specific variable that is selected within in the HIPE session.
 They are triggered by double-clicking on a variable, or through the open with menu. Editor components are opened in the editor area.

The contract for editor components is:

Line: 193 to 193
 

Source Code of Basic implementations

Changed:
<
<
The ia_gui_apps contains some basic implementations for EditorComponents:
>
>
The herschel.ia.gui.apps package contains some basic implementations for EditorComponents:
  • ListEditorComponent: a simple viewer of lists.
  • DefaultFileEditorComponent: a simple viewer of a file.
  • init.py: how the above get registered.
 
Line: 204 to 204
 
You may have created an implementation of the former Explorer interface which is used by the dataset inspector (and is registered within that inspector).
Changed:
<
<
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend AbstractExplorerComponent:
>
>
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend ia.dataset.gui.views.AbstractExplorerComponent:
 
public class ArrayDataComponent extends AbstractExplorerComponent<ArrayData> {

Revision 132010-05-17 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 247 to 247
 
<-- JorgoBakker -->
Added:
>
>
<--  
-->
 
META TOPICMOVED by="DavideRizzo" date="1272527900" from="Hcss.DpHipeComponents" to="Public.DpHipeComponents"

Revision 122010-04-29 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 6 to 6
 
<-- summary -->
The contents of certain views can be extended by developers, such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection made by the user.
Changed:
<
<
Here we explain how you can contribute to the outline view and the editor area.
>
>
Hcss.Here we explain how you can contribute to the outline view and the editor area.
 

Line: 19 to 19
 
Changed:
<
<
>
>
 

Line: 29 to 29
 
Changed:
<
<
>
>
  -->
Line: 246 to 246
 

<-- JorgoBakker -->
Added:
>
>
META TOPICMOVED by="DavideRizzo" date="1272527900" from="Hcss.DpHipeComponents" to="Public.DpHipeComponents"

Revision 112010-01-11 - JaimeSaiz

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 38 to 38
 

Whenever the user selects a session variable in the VariablesView, a SelectionEvent is sent around.

Changed:
<
<
The OutlineView is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.
>
>
The OutlineView is listening to such event and it tries to find the appropriate component that can show the outline information of that variable.
  The contract for outline components is:
Line: 48 to 48
 The recommended way of implementing OutlineComponent is by extending ObjectOutline, which provides a table with basic information about the variable.
Methods getExtraTableInfo() and getExtraComponent() may be overriden as needed for providing extra information about your type.
Changed:
<
<
An example:

Suppose you would like to create an outline for FineTime variables and you would like to show the contents in the outline view whenever a session variable of that type is selected by the user.

>
>
For example, suppose you want to create an outline for FineTime variables to show their contents in the outline view whenever a session variable of that type is selected by the user.
 

Component Implementation

Line: 71 to 69
 

Component Registry

Changed:
<
<
The following snippet, could then go into your __init__.py:
>
>
The following snippet would go into your __init__.py:
 
# Register to the variable outline factory

Line: 88 to 86
 

Source Code of Basic implementations

Changed:
<
<
The ia_gui_apps contains some basic implementations for OutlineComponents:
>
>
Module ia_dataset_gui contains some basic implementations for OutlineComponents:

Tip, idea If you have a sub-class of e.g. a product, you can also create a dedicated OutlineComponent for that sub-class, which will be picked up instead of the default ProductOutline.

 
Changed:
<
<
Tip, idea If you have a sub-class of e.g. a product, you can also create a dedicated OutlineComponent for that sub-class, which will be picked up instead of the default ProductOutline.
>
>

FITS Preview Outline

A special kind of outline is devoted to show previews of FITS files (for images, cubes, spectra...).

This is managed by FitsFileOutline, which reads the product contained in the FITS file in the background, and shows an image preview for it when done.

For this to work properly, any type that is meaningful to produce a preview should:

1. Extend herschel.ia.gui.kernel.PreviewMaker. For example, for images (herschel.ia.gui.image.Image):

import herschel.ia.gui.image.Image;

public class ImagePreviewMaker extends PreviewMaker<Image> {

    // PreviewFactory needs that every preview maker provides a default public constructor
    public ImagePreviewMaker() {
	super(Image.class);
    }

    // Either override this method
    @Override public java.awt.Image makeImage(Object o) {
	if (!(o instanceof Image)) return null;
	Image image = (Image)o;
        // create a Java image from the dataset image object
    }

    // or this one, by returning a visible component that will be used for drawing the image
    @Override protected java.awt.Component makeComponent(Image image) {
        // create a Java component from the dataset image
    }
}
2. Register the preview maker in the corresponding __init__.py:
from herschel.ia.gui.kernel import ExtensionRegistry, Extension, PreviewFactory

REGISTRY.register(PreviewFactory.ID, Extension(
                  "Image preview maker",
                  "herschel.ia.gui.image.ImagePreviewMaker",
                  None,   # unused
                  "herschel.ia.dataset.image.Image"))
 

Revision 102009-12-02 - DavideRizzo

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 11 to 11
 
Added:
>
>
 

Revision 92009-02-05 - JaimeSaiz

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 16 to 16
  Some short-cuts
Deleted:
<
<
 
Line: 24 to 23
 
Added:
>
>
 
Line: 35 to 35
 

Outline View

Changed:
<
<
Whenever the user selects a session variable e.g. the VariablesView, a SelectionEvent is sent around. The OutlineView is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.
>
>
Whenever the user selects a session variable in the VariablesView, a SelectionEvent is sent around.
The OutlineView is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.
 
Changed:
<
<
<-- If you follow the contract on outline components -->
>
>
The contract for outline components is:
 
Changed:
<
<
>
>
  • Implement the OutlineComponent interface by extending a javax.swing.JComponent.
 
Added:
>
>
The recommended way of implementing OutlineComponent is by extending ObjectOutline, which provides a table with basic information about the variable.
Methods getExtraTableInfo() and getExtraComponent() may be overriden as needed for providing extra information about your type.
 An example:

Suppose you would like to create an outline for FineTime variables and you would like to show the contents in the outline view whenever a session variable of that type is selected by the user.

Component Implementation

Changed:
<
<
In this example, we simply use a javax.swing.JLabel and write the contents of the FineTime object into the text of that label.
>
>
In this example, we simply add an entry to the ObjectOutline with the contents of the FineTime.
 

Changed:
<
<
public class FineTimeOutline extends JLabel implements OutlineComponent {

public boolean init(Selection selection, OutlineView view) { VariableSelection var=(VariableSelection)selection; setText(var.getValue().toString());

>
>
public class FineTimeOutline extends ObjectOutline {
 
Changed:
<
<
return true;
>
>
@Override protected Object[][] getExtraTableInfo() { Object time = getSelection().getValue(); return new Object[][] { { "time", time.toString() } };
  }
Deleted:
<
<
 }
Line: 98 to 100
 

Editor Area

Changed:
<
<
The above showed an example of extending the outline view by adding a OutlineComponent. Similarly, you can contribute by developing a specific EditorComponent.
>
>
The above showed an example of extending the outline view by adding an OutlineComponent. Similarly, you can contribute by developing a specific EditorComponent.

Editor components are editors (optionally read-only) of data contents of a specific variable that is selected within in the HIPE session.
They are triggered by double-clicking on a variable, or through the open with menu. Editor components are opened in the editor area.

 
Changed:
<
<
Editor components are editors (optionally read-only) of data contents of a specific variable that is selected within in the HIPE session.
>
>
The contract for editor components is:
 
Line: 108 to 113
 

Simple Example Code


Added:
>
>
import herschel.ia.gui.kernel.parts.AbstractVariableEditorComponent;
 /**
Changed:
<
<
* Editor component for MyType.
>
>
* Editor component for SomeType.
  */
Changed:
<
<
public class MyTypeComponent extends AbstractVariableEditorComponent {
>
>
public class SomeEditorComponent extends AbstractVariableEditorComponent<SomeType> {
  public Icon getComponentIcon() { return ...; }

@Override

Changed:
<
<
protected Class getVariableType() { return MyType.class;
>
>
protected Class<SomeType> getVariableType() { return SomeType.class;
  }

@Override protected boolean makeEditorContent() {

Changed:
<
<
...
>
>
String name = getKey(); SomeType value = getValue(); JComponent content = ...; // build the content with the provided value add(content); return true;
  } }
Line: 136 to 147
 The ia_gui_apps contains some basic implementations for EditorComponents:
Changed:
<
<
>
>
 
Line: 144 to 155
 
You may have created an implementation of the former Explorer interface which is used by the dataset inspector (and is registered within that inspector).
Changed:
<
<
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend the AbstractExplorerComponent class:
>
>
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend AbstractExplorerComponent:
 

Changed:
<
<
public class ArrayDataComponent extends AbstractExplorerComponent {
>
>
public class ArrayDataComponent extends AbstractExplorerComponent<ArrayData> {
  private static final Icon ICON = ...

public ArrayDataComponent() { super(ICON); }

Added:
>
>
@Override protected Class<ArrayData> getVariableType() { return ArrayData.class; }
 }
Added:
>
>
That's it. Your explorer would be picked up for showing the values it is registered to manage (see next section).

Component Registry

Editor components need to be registered for telling the types they are interested in. This is to be done within your __init__.py:

# Register to the editor component factory
REGISTRY.register(COMPONENT,Extension(
                 "Some editor",
                 "herschel.your.module.views.SomeEditorComponent",
                 "factory.editor.variable",
                 "herschel.your.module.SomeType"))

 

Revision 82008-08-19 - JaimeSaiz

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

<-- summary -->
Changed:
<
<
the contents of certain views can be extended by developers, such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection made by the user.
>
>
The contents of certain views can be extended by developers, such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection made by the user.
  Here we explain how you can contribute to the outline view and the editor area.

Revision 72008-08-13 - JaimeSaiz

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 26 to 25
 
Added:
>
>
 
Line: 102 to 102
  Editor components are editors (optionally read-only) of data contents of a specific variable that is selected within in the HIPE session.
Changed:
<
<
>
>
 

Simple Example Code

Line: 134 to 134
 

Source Code of Basic implementations

The ia_gui_apps contains some basic implementations for EditorComponents:
Changed:
<
<
>
>
 
Line: 144 to 144
 
You may have created an implementation of the former Explorer interface which is used by the dataset inspector (and is registered within that inspector).
Changed:
<
<
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend the abstract AbstractExplorerComponent class:
>
>
If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend the AbstractExplorerComponent class:
 
public class ArrayDataComponent extends AbstractExplorerComponent {

Revision 62008-02-08 - JorgoBakker

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 13 to 13
 


Added:
>
>
<--
   Some short-cuts  

-->
 
Added:
>
>
 

Outline View

Changed:
<
<
Whenever the user selects a session variable e.g. the Variables View, a SelectionEvent is sent around. The Outline View is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.
>
>
Whenever the user selects a session variable e.g. the VariablesView, a SelectionEvent is sent around. The OutlineView is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.
 
<-- If you follow the contract on outline components -->
Changed:
<
<
  • Implement the herschel.ia.gui.views.OutlineComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.core.ExtensionRegistry in the __init__.py
>
>
  An example:
Changed:
<
<
Suppose you would like to create an outline for herschel.share.fltdyn.time.FineTime and you would like to show the contents in the outline view whenever a session variable of that type is selected by the user.
>
>
Suppose you would like to create an outline for FineTime variables and you would like to show the contents in the outline view whenever a session variable of that type is selected by the user.
 

Component Implementation

Changed:
<
<
In this example, we simply use a javax.swing.JLabel and write the contents of the FineTime object into the text of that label.
>
>
In this example, we simply use a javax.swing.JLabel and write the contents of the FineTime object into the text of that label.
 
public class FineTimeOutline extends JLabel implements OutlineComponent {

Line: 48 to 67
 

Component Registry

Changed:
<
<
The following snippet, could then go into your __init__.py:
>
>
The following snippet, could then go into your __init__.py:
 
# Register to the variable outline factory

Line: 59 to 78
  "herschel.share.fltdyn.time.FineTime"))

Changed:
<
<
See also the Extension Registry documentation for more details.
>
>
See also the Extension Registry documentation for more details.

 
Added:
>
>

Source Code of Basic implementations

The ia_gui_apps contains some basic implementations for OutlineComponents:
 
Added:
>
>
Tip, idea If you have a sub-class of e.g. a product, you can also create a dedicated OutlineComponent for that sub-class, which will be picked up instead of the default ProductOutline.
 
Added:
>
>
 

Editor Area

Changed:
<
<
The above showed an example of extending the outline view by adding a OutlineComponent. Similarly, you can contribute by developing a specific editor component.

Editor components are browsers or editors of data contents of a specific variable that is selected in the HIPE session.

>
>
The above showed an example of extending the outline view by adding a OutlineComponent. Similarly, you can contribute by developing a specific EditorComponent.
 
Changed:
<
<
  • Implement the herschel.ia.kernel.EditorComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.kernel.ExtensionRegistry in the __init__.py
>
>
Editor components are editors (optionally read-only) of data contents of a specific variable that is selected within in the HIPE session.
 
Changed:
<
<
TODO: Example
>
>
 
Added:
>
>

Simple Example Code

 

Changed:
<
<
public interface EditorComponent {
>
>
/** * Editor component for MyType. */ public class MyTypeComponent extends AbstractVariableEditorComponent {
 
Changed:
<
<
boolean init(Selection selection, EditorPart editorPart); boolean aboutToClose();
>
>
public Icon getComponentIcon() { return ...; }
 
Changed:
<
<
Icon getComponentIcon(); String getName(); Selection getSelection();
>
>
@Override protected Class getVariableType() { return MyType.class; }
 
Added:
>
>
@Override protected boolean makeEditorContent() { ... }
 } \ No newline at end of file
Added:
>
>

Source Code of Basic implementations

The ia_gui_apps contains some basic implementations for EditorComponents:

Your Explorer Implementation

You may have created an implementation of the former Explorer interface which is used by the dataset inspector (and is registered within that inspector).

If you do not expect that your explorer needs to talk to other parts within the HIPE application, you can simply extend the abstract AbstractExplorerComponent class:

public class ArrayDataComponent extends AbstractExplorerComponent {
    private static final Icon ICON = ...

    public ArrayDataComponent() {
	super(ICON);
    }   
}

<-- JorgoBakker -->

Revision 52008-01-15 - JaimeSaiz

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 71 to 71
  Editor components are browsers or editors of data contents of a specific variable that is selected in the HIPE session.
Changed:
<
<
  • Implement the herschel.ia.core.EditorComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.core.ExtensionRegistry in the __init__.py
>
>
  • Implement the herschel.ia.kernel.EditorComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.kernel.ExtensionRegistry in the __init__.py
  TODO: Example

Revision 42008-01-15 - JorgoBakker

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

<-- summary -->
Changed:
<
<
Certain views as well can be extended by developers such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection by the user.
>
>
the contents of certain views can be extended by developers, such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection made by the user.

Here we explain how you can contribute to the outline view and the editor area.

 

Line: 49 to 51
 The following snippet, could then go into your __init__.py:


Changed:
<
<
# convenience short-cuts from herschel.ia.core import ExtensionRegistry, Extension FACTORY=ExtensionRegistry.FACTORY COMPONENT=ExtensionRegistry.COMPONENT REGISTRY=ExtensionRegistry.getInstance()

# Register to the variable outline factory

>
>
# Register to the variable outline factory
 REGISTRY.register(COMPONENT,Extension( "My FineTime Outline", "resides.in.java.package.FineTimeOutline", "factory.outline.variable", "herschel.share.fltdyn.time.FineTime"))
Deleted:
<
<
# clean-up del(FACTORY,COMPONENT,REGISTRY)
 
Added:
>
>
See also the Extension Registry documentation for more details.
 
Deleted:
<
<
More information about the extension registry can be found in its Java API (herschel.ia.core.ExtensionRegistry).
 

Revision 32008-01-15 - JorgoBakker

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 13 to 13
 

Outline View

Added:
>
>
 Whenever the user selects a session variable e.g. the Variables View, a SelectionEvent is sent around. The Outline View is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.

<-- If you follow the contract on outline components -->
Line: 25 to 26
 Suppose you would like to create an outline for herschel.share.fltdyn.time.FineTime and you would like to show the contents in the outline view whenever a session variable of that type is selected by the user.

Component Implementation

Added:
>
>
 In this example, we simply use a javax.swing.JLabel and write the contents of the FineTime object into the text of that label.


Line: 39 to 41
  }
Added:
>
>
 

Component Registry

Added:
>
>
 The following snippet, could then go into your __init__.py:


Line: 63 to 67
 

More information about the extension registry can be found in its Java API (herschel.ia.core.ExtensionRegistry).

Added:
>
>
 
Added:
>
>
 

Editor Area

Added:
>
>
 The above showed an example of extending the outline view by adding a OutlineComponent. Similarly, you can contribute by developing a specific editor component.

Editor components are browsers or editors of data contents of a specific variable that is selected in the HIPE session.

Line: 87 to 94
  }
Added:
>
>
 \ No newline at end of file

Revision 22008-01-14 - JorgoBakker

Line: 1 to 1
 
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

Line: 30 to 30
 
public class FineTimeOutline extends JLabel implements OutlineComponent {

Changed:
<
<
public boolean setOutline(Selection selection, OutlineView view) {
>
>
public boolean init(Selection selection, OutlineView view) {
  VariableSelection var=(VariableSelection)selection; setText(var.getValue().toString());
Line: 74 to 74
 
  • Register your implementation to the herschel.ia.core.ExtensionRegistry in the __init__.py

TODO: Example

Added:
>
>
public interface EditorComponent {

    boolean init(Selection selection, EditorPart editorPart);
    boolean aboutToClose();

    Icon getComponentIcon();
    String getName();   
    Selection getSelection();

}

Revision 12008-01-14 - JorgoBakker

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="DpHipe"

Adding Components to existing Views

<-- summary -->
Certain views as well can be extended by developers such as the Outline View and the Editor Area. Both are examples of the system reacting on a data selection by the user.


Outline View

Whenever the user selects a session variable e.g. the Variables View, a SelectionEvent is sent around. The Outline View is listening to such an event and it tries to find the appropriate component that can show the outline information of that variable.

<-- If you follow the contract on outline components -->

  • Implement the herschel.ia.gui.views.OutlineComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.core.ExtensionRegistry in the __init__.py

An example:

Suppose you would like to create an outline for herschel.share.fltdyn.time.FineTime and you would like to show the contents in the outline view whenever a session variable of that type is selected by the user.

Component Implementation

In this example, we simply use a javax.swing.JLabel and write the contents of the FineTime object into the text of that label.

public class FineTimeOutline extends JLabel implements OutlineComponent {

    public boolean setOutline(Selection selection, OutlineView view) {
	VariableSelection var=(VariableSelection)selection;
        setText(var.getValue().toString());

	return true;
    }

}

Component Registry

The following snippet, could then go into your __init__.py:

# convenience short-cuts
from herschel.ia.core import ExtensionRegistry, Extension
FACTORY=ExtensionRegistry.FACTORY
COMPONENT=ExtensionRegistry.COMPONENT
REGISTRY=ExtensionRegistry.getInstance()

# Register to the variable outline factory
REGISTRY.register(COMPONENT,Extension(
		"My FineTime Outline",
		"resides.in.java.package.FineTimeOutline",
		"factory.outline.variable",
		"herschel.share.fltdyn.time.FineTime"))

# clean-up
del(FACTORY,COMPONENT,REGISTRY)

More information about the extension registry can be found in its Java API (herschel.ia.core.ExtensionRegistry).

Editor Area

The above showed an example of extending the outline view by adding a OutlineComponent. Similarly, you can contribute by developing a specific editor component.

Editor components are browsers or editors of data contents of a specific variable that is selected in the HIPE session.

  • Implement the herschel.ia.core.EditorComponent interface by extending a javax.swing.JComponent
  • Register your implementation to the herschel.ia.core.ExtensionRegistry in the __init__.py

TODO: Example

 
This site is powered by the TWiki collaboration platform Powered by Perl