Previous Next        Current Page: NeXtMidas Training / NetBeans - Part 2 (GUIs) / Using the GUI Builder / How Does it Work?
back
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
   + Setting up the GUI Builder   
   + Matisse   
   - Using the GUI Builder   
      - How Does it Work?   
      - Demo   
         - Step 1 - Create GUI Form   
         - Step 2 - Edit GUI Form   
         - Step 3 - Add Widget   
         - Step 4 - Add Widget Cont.   
         - Step 5 - Final Layout   
         - Step 6 - Using GUI Form   
      - Do I need a macro?   
   + Lab1   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • How Does it Work?
    • Let's say you have an existing NeXtMidas macro for which you want to make a new Swing GUI.
    • When your macro runs everything is laid out by PANEL and GCONTROL.
    • If you use the /JSETUP switch this tells PANEL that you want to use the setup defined in your Swing JFrame rather than the default setup provided by PANEL.
    • When you provide the /JSETUP switch, PANEL loads your Swing GUI.
      • When it loads your Swing GUI it uses reflection to figure out what widgets and displays you have in your GUI.
      • For each widget (JButton, JTextField, etc.) it finds, PANEL adds the necessary listeners so that the widget will send its message to the processMessage procedure in your macro.
      • Also, for each widget, PANEL adds the necessary wrapper so that you can use GC.<name>.VALUE to set/get the value of the widget.
      • When PANEL sees a MidasControls component named pane0 (this is a special name that must be used if you use MidasControls) it instructs GCONTROL to add all of the GControls to this component.
        • The GControls will look and function the same as they would in a traditional NeXtMidas GUI and are not customizable within the GUI builder.
      • If PANEL does not find a MidasControls it assumes that you do not care about the GControls because you are using Swing controls in place of them.
      • For each MidasDisplay included in your GUI that has a variable name that matches the ID of your PLOT or LIST2 it will tell PLOT or LIST2 to attach themselves to the MidasDisplay in your GUI.
        • If you have this line in your macro:
          plot/id=MYPLOT world.prm
          You will need to set the variable name of your MidasDisplay to myplot (by convention variable names are lowercase).

back