Current Page:
NeXtMidas Training
Eclipse - Part 2 (GUIs)
Using the GUI Builder
How Does it Work?
|
|
- 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).
|
|
|