Data nodes are displayed in the "Data" top component accessible from the Window -> Data menu item.
To add an action to a node displayed in the "Data" or "File Explorer" top components, extend the com.interactive.intviewerapi.data.AbstractDataNodeAction class.
ATTACHDEVIATIONTOWELLDATAACTION.JAVA
package com.interactive.intviewer.well.data.action;import com.interactive.intviewer.util.LayerPropertiesUtil;import com.interactive.intviewer.well.data.editor.AttachDeviationFileEditor;import com.interactive.intviewerapi.data.AbstractDataNodeAction;import com.interactive.intviewerapi.data.IData;import com.interactive.intviewerapi.data.well.ITrajectoryReader;import com.interactive.intviewerapi.data.well.IWellData;import java.util.logging.Logger;import javax.swing.Action;public class AttachDeviationToWellDataAction extends AbstractDataNodeAction { private static final Logger logger = Logger.getLogger(AttachDeviationToWellDataAction.class.getName()); public AttachDeviationToWellDataAction() { super("Attach Deviation File ..."); } @Override public Action toAction(Object object, int x, int y) { if (object == null || !(object instanceof IWellData)) { return null; } IWellData wellData = (IWellData) object; if (wellData.getTrajectory() != null) { ITrajectoryReader reader = wellData.getTrajectory().select(); if (reader.getNumberOfValues() != 0) { return null; } } return super.toAction(object, x, y); } @Override protected void performAction(IData object, int x, int y) { LayerPropertiesUtil.openSinglePropertiesDialog(false, new AttachDeviationFileEditor((IWellData) object), null); }}Then register this action in the layer.xml file:
LAYER.XML
<folder name="DataNodeActions"> <folder name="WellData"> <file name="com.interactive.intviewer.well.data.action.AttachDeviationToWellDataAction.instance"> <attr name="position" intvalue="400"/> </file> </folder> </folder>Window nodes are displayed in the "Layers" top component accessible from the Window -> Layers menu item.
To add an action to a window node displayed in the "Layers" top component, extend the com.interactive.intviewerapi.data.AbstractViewerWindowNodeAction class.
CLOSEVIEWERWINDOWACTION.JAVA
package com.interactive.intviewer.view2d.actions;import com.interactive.intviewerapi.windows.AbstractViewerWindow;import com.interactive.intviewerapi.windows.AbstractViewerWindowNodeAction;import com.interactive.intviewerapi.windows.IViewerWindow;import java.util.logging.Logger;import javax.swing.Action;public class CloseViewerWindowAction extends AbstractViewerWindowNodeAction{ private static final Logger _logger = Logger.getLogger(CloseViewerWindowAction.class.getName()); public CloseViewerWindowAction() { super("Close Window"); } @Override public Action toAction(Object object, int x, int y) { IViewerWindow viewerWindow = (IViewerWindow) object; if (!(viewerWindow instanceof AbstractViewerWindow)) { return null; } return super.toAction(object, x, y); } @Override protected void performAction(IViewerWindow object, int x, int y) { CloseWindowAction.closeViewerWindow((AbstractViewerWindow) object); } }Then register this action in the layer.xml file:
LAYER.XML
<folder name="ViewerWindowNodeActions"> <folder name="XSectionLayeredWindow"> <file name="com-interactive-intviewer-view2d-actions-CloseViewerWindowAction.instance"> <attr name="position" intvalue="700"/> </file> </folder> </folder>Visual nodes are displayed in the "Layers" top component accessible from the Window -> Layers menu item.
To add an action to a visual node displayed in the "Layers" top component, extend the com.interactive.intviewerapi.data.AbstractVisualNodeAction class.
MOVETOPVISUALACTION.JAVA
package com.interactive.intviewer.control;import com.interactive.intviewerapi.AbstractVisualNodeAction;import com.interactive.intviewerapi.IMovableVisual;import com.interactive.intviewerapi.IVisual;import javax.swing.Action;public class MoveTopVisualAction extends AbstractVisualNodeAction { public MoveTopVisualAction() { super("Move to Top"); } @Override public Action toAction(final Object object, final int x, final int y) { if (!(object instanceof IMovableVisual)) { return null; } return super.toAction(object, x, y); } @Override protected void performAction(IVisual object, int x, int y) { ((IMovableVisual) object).moveToTop(); }}
Then register this action in the layer.xml file:
LAYER.XML
<folder name="VisualNodeActions"> <folder name="ViewerSeismicLayer"> <file name="com-interactive-intviewer-control-MoveTopVisualAction.instance"> <attr name="position" intvalue="700"/> </file> </folder> </folder>