Connecting an editor to a visualizer

"winder" <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
I'm building a CNC machine controller as a NetBeans Platform 8.1 application. I have a backend object which facilitates all machine interaction registered in a CentralLookup (https://blogs.oracle.com/geertjan/entry/central_lookup) which works great.

The CNC machine takes .gcode files, which I have written a 3D visualizer for and integrated it with NetBeans using a basic TopComponent and JogAmp. I have also created a CaretListener to detect when lines are selected.

Now I want to hook up the visualizer and the editor, to display selected code. But each can exist without the other. If both are opened, either could have opened first. My application is limited to a single file being opened at a time, because only one file can be sent to the machine at a time.

Currently I'm thinking about writing some sort of mediator singleton class which the editor can publish to and the visualizer can subscribe to. But I'm wondering if there is a built in NetBeans Platform mechanism that I'm overlooking?




Attachments: 
http://forums.netbeans.org//files/screenshot_209.png
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.