Customizing the Window Locator

The window locator is the bar displayed at the bottom of 2D windows, showing the INLINE/XLINE/X/Y/Time coordinates of the cursor.

If you need to modify the behavior of a window locator for an existing window, you can implement your own locator class.

XSECTIONWINDOWLOCATOR.JAVA

package com.interactive.intviewer.view2d;
import com.interactive.intviewer.view2d.util.WindowLocator2DUtil;
import com.interactive.intviewerapi.IVisual;
import com.interactive.intviewerapi.windows.AbstractWindowLocator;
import java.util.Map;
public class XSectionWindowLocator extends AbstractWindowLocator {
    
    public XSectionWindowLocator() {
        
    }
    @Override
    public String getHorizontalText(IVisual layer, Map<String, Double> pmap, int viewportX, int viewportY) {
        return "MyHorizontalText";
    }
    @Override
    public String getVerticalText(IVisual layer, Map<String, Double> pmap, int viewportX, int viewportY) {
        return  "MyVerticalText";
    }
    
    @Override
    public String getContextualText(IVisual visual, Map<String, Double> pmap, int viewportX, int viewportY) {
        return "MyContextualText";
    }
}

Register your class in the layer.xml file.

LAYER.XML

<filesystem>
    <folder name="WindowLocators">
        <folder name="ViewerPlotXV">
            <file name="com-interactive-intviewer-view2d-XSectionWindowLocator.instance"/>                
        </folder>
    </folder>
</filesystem>

The getContextualText method of the window locator class controls the string at the bottom of the contextual menu displayed when right-clicking in a window. This contextual string is shown in yellow in the snapshot below: