{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Capturing Mouse Events At The Window Level","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"capturing-mouse-events-at-the-window-level","__idx":0},"children":["Capturing Mouse Events At The Window Level"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-api-for-layers/layer-event-handlers"},"children":["layer event handler"]}," API allows to customize the behavior of INTViewer when a user clicks on a layer."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You also have the option to customize the behavior at the window level so that this behavior is the same across all layers of the same window."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the example below, a NetBeans Top Component (on the right) shows the pertinent information about the last point clicked in the XSection window in focus."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The implementation of this tool consists of 3 classes:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["a NetBeans top component (DemoPickTopComponent.java, designed with the built-in Swing/Matisse GUI editor, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-tutorial/using-netbeans-swing-components-walkthroughs/adding-a-window-walkthrough"},"children":["Adding a TopComponent Window Walkthrough"]}," for an example)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["an event (DemoPickEvent.java)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["a window event handler (DemoPickWindowEventHandler.java)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The code of this handler is below:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-platform-and-modules/registering-the-layer-xml-file"},"children":["layer.xml"]}," entry registers that window event handler:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"    <folder name=\"ViewerWindowEventHandlers\">\n        <folder name=\"ViewerPlotXV\">\n            <file name=\"com-demo-pick-DemoPickWindowEventHandler.instance\">\n                <attr name=\"position\" intvalue=\"9000\"/>\n            </file>\n        </folder>\n    </folder>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a user clicks, the pick information is captured. This information consists of:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["- the layer where the click occurred"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["- the trace where the click occurred"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["- the time/depth value of this click"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An event is ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/events"},"children":["broadcasted"]}," with this pick info."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The top component listens for this event and displays this information to the end user."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The full code of this project is attached at the bottom of this page. Make sure you have ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-platform-and-modules"},"children":["registered the INTViewer platform"]}," prior to loading this project."]}]},"headings":[{"value":"Capturing Mouse Events At The Window Level","id":"capturing-mouse-events-at-the-window-level","depth":1}],"frontmatter":{"title":"Capturing Mouse Events At The Window Level","pageId":"intviewer-apis-for-windows/capturing-mouse-events-at-the-window-level","seo":{"title":"Capturing Mouse Events At The Window Level"}},"lastModified":"2026-10-22T14:32:05.576Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/intviewer/intviewer-apis-for-windows/capturing-mouse-events-at-the-window-level","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}