Artifact Actions

The Seismic Workbench plugin has been designed so that you are capable of adding your own actions to utilize with artifact data. This is a two step process.

  • Step 1: Create a class that extends AbstractDataNodeAction, and fill out the performAction method.
  • Step 2: Create a layer.xml entry that registers your new action.

For Step 1 you must override the performAction method. The method's signature is as follows: protected void performAction(IData data, int i, int i1). Both of the integer variables are specific to an INTViewer implementation of a DataNodeAction and refer to the coordinates of a mouse click. Obviously this does not apply to Seismic Workbench artifact actions. The IData data returned by Seismic Workbench will always be ISeismicData.

The following code is a simple implementation, which simply displays the data in a new XSection Window:

    protected void performAction(IData seismicData, int i, int i1) {
        try {
            IXSectionWindow xsectionWindow = IXSectionWindow.factory.createWindow();
            NamedProps layerProperties = new NamedProps();
            layerProperties.putProperty(ISeismicLayer.PLOT_TYPE, ISeismicLayer.WIGGLE | ISeismicLayer.POSITIVE_FILL);
            ISeismicLayer layer = ISeismicLayer.factory.createLayer(xsectionWindow, seismicData, layerProperties, false);
        } catch (Exception ex) {
            // Does nothing in this example.
        }
    }

User created actions can exist for the whole catalog of executables, only specific libraries, specific groups, or even specific executables. This registration is again done through the use of the layer.xml file. The following example layer.xml shows how you would register the new window action that is already a part of the Seismic Workbench.

LAYER.XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
    <folder name="Artifacts">
        <folder name="Catalog">
            <file name="OpenNewWindowAction"/>
        </folder>
    </folder>
    <folder name="ArtifactActions">
        <file name="com-interactive-intviewer-seismicworkbench-actions-OpenNewWindowAction.instance" />
    </folder>
</filesystem>

If you would like your action to only apply to one executable, let's say segyread, you need to modify the layer.xml as follows:

LAYER.XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
    <folder name="Artifacts">
        <folder name="Catalog">
            <folder name="SULibrary">
                <folder name="Data Conversion">
                    <folder name="segyread">
                        <file name="OpenNewWindowAction"/>
                    </folder>
                </folder>
            </folder>
        </folder>
    </folder>
    <folder name="ArtifactActions">
        <file name="com-interactive-intviewer-seismicworkbench-actions-OpenNewWindowAction.instance" />
    </folder>
</filesystem>

As you can see, the level that the file corresponding to your action will determine where the action is available. It starts at the folder level it is located at, and will apply to everything contained within and below that folder.