<?xml version="1.0" encoding="UTF-8"?>
<scilabgui usedeprecatedskin="off" version="1.0">
- <figure axes_size="900,600" background="33" default_axes="off" dockable="off" figure_position="0,0" icon="software-update-notinstalled" infobar_visible="off" layout="3" menubar="0" tag="atomsFigure" toolbar="0" toolbar_visible="off" visible="off">
- <frame backgroundcolor="1.0,1.0,1.0" borderoptpadding="5,5" layout="3" tag="MainFrame">
- <frame backgroundcolor="1.0,1.0,1.0" borderposition="0" borderpreferredsize="0,40" layout="3" margins="5.0,5.0,5.0,5.0" tag="msgFrame">
+ <figure axes_size="900,600" background="33" default_axes="off" dockable="off" figure_position="0,0" icon="software-update-notinstalled" infobar_visible="off" layout="border" menubar="none" tag="atomsFigure" toolbar="none" toolbar_visible="off" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" borderoptpadding="5,5" layout="border" tag="MainFrame">
+ <frame backgroundcolor="1.0,1.0,1.0" borderposition="bottom" borderpreferredsize="0,40" layout="border" margins="5.0,5.0,5.0,5.0" tag="msgFrame">
<border style="titled" title="">
<title color="black" style="line" thickness="1"/>
</border>
<text backgroundcolor="1.0,1.0,1.0" fontsize="12.0" horizontalalignment="center" tag="msgText"/>
</frame>
<layer tag="LayerFrame">
- <frame backgroundcolor="1.0,1.0,1.0" layout="3" tag="HomeFrame">
+ <frame backgroundcolor="1.0,1.0,1.0" layout="border" tag="HomeFrame">
<border style="titled" title="">
<title color="black" style="line" thickness="1"/>
</border>
<listbox backgroundcolor="1.0,1.0,1.0" callback="cbAtomsGui" callback_type="0" fontsize="12.0" tag="HomeListbox"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" layout="3" tag="DescFrame" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" layout="border" tag="DescFrame" visible="off">
<border fontangle="normal" fontname="" fontsize="14" fontweight="normal" justification="0" style="titled" title="">
<title color="black" style="line" thickness="1"/>
</border>
- <frame backgroundcolor="1.0,1.0,1.0" borderposition="0" gridoptgrid="1,4" gridoptpadding="20,0" layout="2">
+ <frame backgroundcolor="1.0,1.0,1.0" borderposition="bottom" gridoptgrid="1,4" gridoptpadding="20,0" layout="grid">
<checkbox backgroundcolor="1.0,1.0,1.0" callback="cbAtomsGui" callback_type="0" tag="autoloadCheck"/>
<pushbutton callback="cbAtomsGui" callback_type="0" enable="off" tag="installButton"/>
<pushbutton callback="cbAtomsGui" callback_type="0" enable="off" tag="removeButton"/>
<text backgroundcolor="1.0,1.0,1.0" fontsize="12.0" max="2.0" sliderstep="0.02,0.2" tag="Desc"/>
</frame>
</layer>
- <frame backgroundcolor="1.0,1.0,1.0" borderposition="3" borderpreferredsize="300,0" layout="3" tag="LeftFrame">
+ <frame backgroundcolor="1.0,1.0,1.0" borderposition="left" borderpreferredsize="300,0" layout="border" tag="LeftFrame">
<border style="titled" title="">
<title color="black" style="line" thickness="1"/>
</border>
defaultFontSize = 12;
f = figure( ...
- "dockable", "off" , ...
- "infobar_visible", "off", ...
- "toolbar_visible", "off", ...
- "toolbar", "none", ...
- "menubar_visible", "on", ...
- "menubar", "none", ...
- "default_axes", "off", ...
- "tag", "atomsFigure", ...
- "visible", "off", ...
- "icon", "software-update-notinstalled", ...
- "position", [0 0 figwidth figheight], ...
- "layout", "border");
+ "dockable", "off" , ...
+ "infobar_visible", "off", ...
+ "toolbar_visible", "off", ...
+ "toolbar", "none", ...
+ "menubar_visible", "on", ...
+ "menubar", "none", ...
+ "default_axes", "off", ...
+ "tag", "atomsFigure", ...
+ "visible", "off", ...
+ "icon", "software-update-notinstalled", ...
+ "position", [0 0 figwidth figheight], ...
+ "layout", "border");
h = uimenu( ...
"parent", f, ...
"tag", "helpMenu");
MainFrame = uicontrol(f, ...
- "Style", "frame", ...
- "background", [1 1 1], ...
- "Tag", "MainFrame");
- MainFrame.layout_options = createLayoutOptions("border", [5, 5]);
- MainFrame.layout = "border";
+ "Style", "frame", ...
+ "background", [1 1 1], ...
+ "Tag", "MainFrame");
+ MainFrame.layout_options = createLayoutOptions("border", [5, 5]);
+ MainFrame.layout = "border";
//Left frame + listbox
LeftFrame = uicontrol(MainFrame, ...
- "Style", "frame", ...
- "background", [1 1 1], ...
- "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
- "constraints", createConstraints("border", "left", [300 0]), ...
- "Tag", "LeftFrame");
- LeftFrame.layout = "border";
+ "Style", "frame", ...
+ "background", [1 1 1], ...
+ "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
+ "constraints", createConstraints("border", "left", [300 0]), ...
+ "Tag", "LeftFrame");
+ LeftFrame.layout = "border";
LeftListbox = uicontrol(LeftFrame, ...
- "Style" , "listbox", ...
- "FontSize", defaultFontSize, ...
- "String", "", ...
- "Callback", "cbAtomsGui", ...
- "Tag", "LeftListbox");
+ "Style" , "listbox", ...
+ "FontSize", defaultFontSize, ...
+ "String", "", ...
+ "Callback", "cbAtomsGui", ...
+ "Tag", "LeftListbox");
//layer right frame
LayerFrame = uicontrol(MainFrame, ...
- "style", "layer", ...
- "constraints", createConstraints("border", "center"), ...
- "tag", "LayerFrame");
+ "style", "layer", ...
+ "constraints", createConstraints("border", "center"), ...
+ "tag", "LayerFrame");
//1st layer, description module
DescFrame = uicontrol(LayerFrame, ...
- "style", "frame", ...
- "background", [1 1 1], ...
- "border", createBorder("titled", createBorder("line", "black", 1), "", "", "", createBorderFont("", 14, "normal")), ...
- "layout", "border", ...
- "tag", "DescFrame");
+ "style", "frame", ...
+ "background", [1 1 1], ...
+ "border", createBorder("titled", createBorder("line", "black", 1), "", "", "", createBorderFont("", 14, "normal")), ...
+ "layout", "border", ...
+ "tag", "DescFrame");
Desc = uicontrol(DescFrame, ...
- "Style", "text", ...
- "background", [1 1 1], ...
- "FontSize", defaultFontSize, ...
- "string", [""], ...
- "min", 0, ...
- "max", 2, ...
- "Tag", "Desc");
+ "Style", "text", ...
+ "background", [1 1 1], ...
+ "FontSize", defaultFontSize, ...
+ "string", [""], ...
+ "min", 0, ...
+ "max", 2, ...
+ "Tag", "Desc");
ButtonFrame = uicontrol(DescFrame, ...
- "style", "frame", ...
- "backgroundcolor", [1 1 1], ...
- "constraints", createConstraints("border", "bottom"));
- ButtonFrame.layout_options = createLayoutOptions("grid", [1 4], [20, 0]);
- ButtonFrame.layout = "grid";
+ "style", "frame", ...
+ "backgroundcolor", [1 1 1], ...
+ "constraints", createConstraints("border", "bottom"));
+ ButtonFrame.layout_options = createLayoutOptions("grid", [1 4], [20, 0]);
+ ButtonFrame.layout = "grid";
backButton = uicontrol(ButtonFrame, ...
- "Style" , "pushbutton", ...
- "Callback", "cbAtomsGui", ...
- "Enable", "on", ...
- "Tag", "backButton");
+ "Style" , "pushbutton", ...
+ "Callback", "cbAtomsGui", ...
+ "Enable", "on", ...
+ "Tag", "backButton");
removeButton = uicontrol(ButtonFrame, ...
- "Style" , "pushbutton", ...
- "Callback", "cbAtomsGui", ...
- "Enable", "off", ...
- "Tag", "removeButton");
+ "Style" , "pushbutton", ...
+ "Callback", "cbAtomsGui", ...
+ "Enable", "off", ...
+ "Tag", "removeButton");
installButton = uicontrol(ButtonFrame, ...
- "Style" , "pushbutton", ...
- "Callback", "cbAtomsGui", ...
- "Enable", "off", ...
- "Tag", "installButton");
+ "Style" , "pushbutton", ...
+ "Callback", "cbAtomsGui", ...
+ "Enable", "off", ...
+ "Tag", "installButton");
autoloadCheck = uicontrol(ButtonFrame, ...
- "Style" , "checkbox", ...
- "background", [1 1 1], ...
- "Callback", "cbAtomsGui", ...
- "Enable", "on", ...
- "Tag", "autoloadCheck");
+ "Style" , "checkbox", ...
+ "background", [1 1 1], ...
+ "Callback", "cbAtomsGui", ...
+ "Enable", "on", ...
+ "Tag", "autoloadCheck");
//2nd layer, installed modules
HomeFrame = uicontrol(LayerFrame, ...
- "style", "frame", ...
- "background", [1 1 1], ...
- "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
- "layout", "border", ...
- "tag", "HomeFrame");
+ "style", "frame", ...
+ "background", [1 1 1], ...
+ "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
+ "layout", "border", ...
+ "tag", "HomeFrame");
HomeListbox = uicontrol(HomeFrame,..
- "Style", "listbox",..
- "Background", [1 1 1],..
- "FontSize", defaultFontSize,..
- "Callback", "cbAtomsGui", ..
- "Tag", "HomeListbox");
+ "Style", "listbox",..
+ "Background", [1 1 1],..
+ "FontSize", defaultFontSize,..
+ "Callback", "cbAtomsGui", ..
+ "Tag", "HomeListbox");
//message frame
msgFrame = uicontrol(MainFrame, ...
- "style", "frame", ...
- "Background", [1 1 1], ...
- "layout", "border", ...
- "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
- "constraints", createConstraints("border", "bottom", [0, 40]), ...
- "margins", [5 5 5 5], ...
- "tag", "msgFrame");
+ "style", "frame", ...
+ "Background", [1 1 1], ...
+ "layout", "border", ...
+ "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
+ "constraints", createConstraints("border", "bottom", [0, 40]), ...
+ "margins", [5 5 5 5], ...
+ "tag", "msgFrame");
msgText = uicontrol(msgFrame, ....
- "Style", "text", ...
- "HorizontalAlignment", "center", ...
- "VerticalAlignment", "middle", ...
- "FontSize", defaultFontSize, ...
- "Background", [1 1 1], ...
- "Tag", "msgText");
+ "Style", "text", ...
+ "HorizontalAlignment", "center", ...
+ "VerticalAlignment", "middle", ...
+ "FontSize", defaultFontSize, ...
+ "Background", [1 1 1], ...
+ "Tag", "msgText");
saveGui(f, SCI + "/modules/atoms/gui/atomsGui.xml");
delete(f);
<?xml version="1.0" encoding="UTF-8"?>
<scilabgui usedeprecatedskin="off" version="1.0">
- <figure axes_size="250,526" default_axes="off" dockable="off" figure_id="100000" figure_name="" figure_size="266,565" icon="applications-system" infobar_visible="off" layout="1" menubar="0" menubar_visible="off" tag="scilab_demo_fig" toolbar="0" toolbar_visible="off" visible="off">
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="10,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_10" visible="off">
+ <figure axes_size="250,526" default_axes="off" dockable="off" figure_id="100000" figure_name="" figure_size="266,565" icon="applications-system" infobar_visible="off" layout="gridbag" menubar="none" menubar_visible="off" tag="scilab_demo_fig" toolbar="none" toolbar_visible="off" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="10,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_10" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_10" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_10" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="9,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_9" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="9,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_9" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_9" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_9" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="8,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_8" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="8,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_8" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_8" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_8" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="7,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_7" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="7,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_7" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_7" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_7" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="6,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_6" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="6,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_6" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_6" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_6" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="5,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_5" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="5,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_5" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_5" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_5" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="4,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_4" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="4,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_4" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_4" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_4" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="3,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_3" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="3,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_3" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_3" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_3" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="2,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_2" visible="off">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="2,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_2" visible="off">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_2" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_2" value="3.0"/>
</frame>
- <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="1,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="1" tag="frame_1">
+ <frame backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="1,1,1,1" gridbagpreferredsize="0,0" gridbagweight="1.0,1.0" layout="gridbag" tag="frame_1">
<border color="black" fontangle="normal" fontname="" fontsize="12" fontweight="bold" justification="1" style="titled" title="">
<title style="empty"/>
</border>
- <image backgroundcolor="1.0,1.0,1.0" gridbagfill="3" gridbaggrid="1,5,1,1" gridbagweight="1.0,0.1" horizontalalignment="center" tag="scilab_logo">
+ <image backgroundcolor="1.0,1.0,1.0" gridbagfill="both" gridbaggrid="1,5,1,1" gridbagweight="1.0,0.1" horizontalalignment="center" tag="scilab_logo">
<string cols="1" property="string" rows="1">
<stringitem value="SCI/modules/demo_tools/images/logo_scilab.png"/>
</string>
</image>
- <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="3" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_1" value="3.0"/>
+ <listbox callback="script_path = demo_gui_update();if ~isempty(script_path) then exec(script_path, -1);end;clear script_path;" callback_type="0" fontsize="12.0" gridbagfill="both" gridbaggrid="1,1,1,4" gridbagweight="1.0,1.0" listboxtop="1" tag="listbox_1" value="3.0"/>
</frame>
</figure>
</scilabgui>
import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
import org.scilab.modules.graphic_objects.graphicObject.Visitor;
import org.scilab.modules.graphic_objects.utils.LayoutType;
+
/**
* Figure class
* @author Manuel JULIACHS
public class Figure extends GraphicObject implements AxesContainer {
/** Figure properties names */
private enum FigureProperty {
- INFOMESSAGE, COLORMAP, COLORMAPSIZE, BACKGROUND, ROTATIONTYPE,
- RESIZEFCN, CLOSEREQUESTFCN, RESIZE, TOOLBAR, TOOLBAR_VISIBLE,
- MENUBAR, MENUBAR_VISIBLE, INFOBAR_VISIBLE, DOCKABLE, LAYOUT, LAYOUT_SET,
- GRIDOPT_GRID, GRIDOPT_PADDING, BORDEROPT_PADDING, DEFAULT_AXES, ICON
+ INFOMESSAGE, COLORMAP, COLORMAPSIZE, BACKGROUND, ROTATIONTYPE, RESIZEFCN, CLOSEREQUESTFCN, RESIZE, TOOLBAR, TOOLBAR_VISIBLE, MENUBAR, MENUBAR_VISIBLE, INFOBAR_VISIBLE, DOCKABLE, LAYOUT, LAYOUT_SET, GRIDOPT_GRID, GRIDOPT_PADDING, BORDEROPT_PADDING, DEFAULT_AXES, ICON
};
- /** Specifies whether rotation applies to a single subwindow or to all the figure's subwindows */
- public enum RotationType { UNARY, MULTIPLE;
-
- /**
- * Converts an integer to the corresponding enum
- * @param intValue the integer value
- * @return the rotation type enum
- */
- public static RotationType intToEnum(Integer intValue) {
- switch (intValue) {
- case 0:
- return RotationType.UNARY;
- case 1:
- return RotationType.MULTIPLE;
- default:
- return null;
+ /**
+ * Specifies whether rotation applies to a single subwindow or to all the
+ * figure's subwindows
+ */
+ public enum RotationType {
+ UNARY, MULTIPLE;
+
+ /**
+ * Converts an integer to the corresponding enum
+ * @param intValue the integer value
+ * @return the rotation type enum
+ */
+ public static RotationType intToEnum(Integer intValue) {
+ switch (intValue) {
+ case 0:
+ return RotationType.UNARY;
+ case 1:
+ return RotationType.MULTIPLE;
+ default:
+ return null;
+ }
+ }
+
+ public static RotationType stringToEnum(String value) {
+ if (value.equals("multiple")) {
+ return MULTIPLE;
+ }
+
+ return UNARY;
+ }
+
+ public static String enumToString(RotationType value) {
+ switch (value) {
+ case MULTIPLE:
+ return "multiple";
+ case UNARY:
+ default:
+ return "unary";
+ }
}
}
- }
- public enum BarType { NONE, FIGURE;
- public static BarType intToEnum(Integer intValue) {
- switch (intValue) {
- default:
- case 0:
- return BarType.NONE;
- case 1:
- return BarType.FIGURE;
+
+ public enum BarType {
+ NONE, FIGURE;
+ public static BarType intToEnum(Integer intValue) {
+ switch (intValue) {
+ default:
+ case 0:
+ return BarType.NONE;
+ case 1:
+ return BarType.FIGURE;
+ }
+ }
+
+ public static BarType stringToEnum(String value) {
+ if (value.equals("figure")) {
+ return FIGURE;
+ }
+
+ return NONE;
+ }
+
+ public static String enumToString(BarType value) {
+ switch (value) {
+ case FIGURE:
+ return "figure";
+ case NONE:
+ default:
+ return "none";
+ }
}
}
- }
+
/** Pixel drawing logical operations */
- private enum PixelDrawingMode { CLEAR, AND, ANDREVERSE, COPY, ANDINVERTED, NOOP, XOR, OR, NOR,
- EQUIV, INVERT, ORREVERSE, COPYINVERTED, ORINVERTED, NAND, SET;
-
- /**
- * Converts an integer to the corresponding enum
- * @param intValue the integer value
- * @return the pixel drawing mode enum
- */
- public static PixelDrawingMode intToEnum(Integer intValue) {
- switch (intValue) {
- case 0:
- return PixelDrawingMode.CLEAR;
- case 1:
- return PixelDrawingMode.AND;
- case 2:
- return PixelDrawingMode.ANDREVERSE;
- case 3:
- return PixelDrawingMode.COPY;
- case 4:
- return PixelDrawingMode.ANDINVERTED;
- case 5:
- return PixelDrawingMode.NOOP;
- case 6:
- return PixelDrawingMode.XOR;
- case 7:
- return PixelDrawingMode.OR;
- case 8:
- return PixelDrawingMode.NOR;
- case 9:
- return PixelDrawingMode.EQUIV;
- case 10:
- return PixelDrawingMode.INVERT;
- case 11:
- return PixelDrawingMode.ORREVERSE;
- case 12:
- return PixelDrawingMode.COPYINVERTED;
- case 13:
- return PixelDrawingMode.ORINVERTED;
- case 14:
- return PixelDrawingMode.NAND;
- case 15:
- return PixelDrawingMode.SET;
- default:
- return null;
+ private enum PixelDrawingMode {
+ CLEAR, AND, ANDREVERSE, COPY, ANDINVERTED, NOOP, XOR, OR, NOR, EQUIV, INVERT, ORREVERSE, COPYINVERTED, ORINVERTED, NAND, SET;
+
+ /**
+ * Converts an integer to the corresponding enum
+ * @param intValue the integer value
+ * @return the pixel drawing mode enum
+ */
+ public static PixelDrawingMode intToEnum(Integer intValue) {
+ switch (intValue) {
+ case 0:
+ return PixelDrawingMode.CLEAR;
+ case 1:
+ return PixelDrawingMode.AND;
+ case 2:
+ return PixelDrawingMode.ANDREVERSE;
+ case 3:
+ return PixelDrawingMode.COPY;
+ case 4:
+ return PixelDrawingMode.ANDINVERTED;
+ case 5:
+ return PixelDrawingMode.NOOP;
+ case 6:
+ return PixelDrawingMode.XOR;
+ case 7:
+ return PixelDrawingMode.OR;
+ case 8:
+ return PixelDrawingMode.NOR;
+ case 9:
+ return PixelDrawingMode.EQUIV;
+ case 10:
+ return PixelDrawingMode.INVERT;
+ case 11:
+ return PixelDrawingMode.ORREVERSE;
+ case 12:
+ return PixelDrawingMode.COPYINVERTED;
+ case 13:
+ return PixelDrawingMode.ORINVERTED;
+ case 14:
+ return PixelDrawingMode.NAND;
+ case 15:
+ return PixelDrawingMode.SET;
+ default:
+ return null;
+ }
}
- }
- };
+ };
/** FigureDimensions properties names */
- public enum FigureDimensionsProperty { POSITION, SIZE };
+ public enum FigureDimensionsProperty {
+ POSITION, SIZE
+ };
/**
* FigureDimensions class
* Default constructor
*/
public FigureDimensions() {
- position = new Integer[] {0, 0};
- size = new Integer[] {0, 0};
+ position = new Integer[] { 0, 0 };
+ size = new Integer[] { 0, 0 };
}
/**
}
/** CanvasProperty properties names */
- public enum CanvasProperty { AUTORESIZE, VIEWPORT, AXESSIZE };
+ public enum CanvasProperty {
+ AUTORESIZE, VIEWPORT, AXESSIZE
+ };
/**
* Canvas class
}
/** FigureName properties names */
- public enum FigureNameProperty { NAME, ID };
+ public enum FigureNameProperty {
+ NAME, ID
+ };
/**
* FigureName class
}
/** RenderingMode properties names */
- public enum RenderingModeProperty { PIXELDRAWINGMODE, ANTIALIASING, IMMEDIATEDRAWING };
+ public enum RenderingModeProperty {
+ PIXELDRAWINGMODE, ANTIALIASING, IMMEDIATEDRAWING
+ };
/**
* RenderingMode class
}
/** EventHandler properties names */
- public enum EventHandlerProperty { EVENTHANDLER, EVENTHANDLERENABLE };
+ public enum EventHandlerProperty {
+ EVENTHANDLER, EVENTHANDLERENABLE
+ };
/**
* EventHandler class
private String infoMessage;
/**
- * Default ColorMap: (3 x N) matrix, where N is the
- * number of colors and 3 the number of color channels
+ * Default ColorMap: (3 x N) matrix, where N is the number of colors and 3
+ * the number of color channels
*/
private ColorMap colorMap;
private LayoutType layout;
/** layout options */
- private Integer[] gridOptGrid = new Integer[] {0, 0};
- private Integer[] gridOptPadding = new Integer[] {0, 0};
- private Integer[] borderOptPadding = new Integer[] {0, 0};
+ private Integer[] gridOptGrid = new Integer[] { 0, 0 };
+ private Integer[] gridOptPadding = new Integer[] { 0, 0 };
+ private Integer[] borderOptPadding = new Integer[] { 0, 0 };
/** default axes management */
private Boolean defaultAxes;
copy.renderingMode = new RenderingMode(this.renderingMode);
copy.eventHandler = new EventHandler(this.eventHandler);
- copy.gridOptGrid = new Integer[] {0, 0};
- copy.gridOptPadding = new Integer[] {0, 0};
- copy.borderOptPadding = new Integer[] {0, 0};
+ copy.gridOptGrid = new Integer[] { 0, 0 };
+ copy.gridOptPadding = new Integer[] { 0, 0 };
+ copy.borderOptPadding = new Integer[] { 0, 0 };
copy.setValid(true);
return copy;
*/
public Object getPropertyFromName(int propertyName) {
switch (propertyName) {
- case __GO_POSITION__ :
+ case __GO_POSITION__:
return FigureDimensionsProperty.POSITION;
- case __GO_SIZE__ :
+ case __GO_SIZE__:
return FigureDimensionsProperty.SIZE;
- case __GO_AUTORESIZE__ :
+ case __GO_AUTORESIZE__:
return CanvasProperty.AUTORESIZE;
- case __GO_VIEWPORT__ :
+ case __GO_VIEWPORT__:
return CanvasProperty.VIEWPORT;
- case __GO_AXES_SIZE__ :
+ case __GO_AXES_SIZE__:
return CanvasProperty.AXESSIZE;
- case __GO_NAME__ :
+ case __GO_NAME__:
return FigureNameProperty.NAME;
- case __GO_ID__ :
+ case __GO_ID__:
return FigureNameProperty.ID;
- case __GO_INFO_MESSAGE__ :
+ case __GO_INFO_MESSAGE__:
return FigureProperty.INFOMESSAGE;
- case __GO_COLORMAP__ :
+ case __GO_COLORMAP__:
return FigureProperty.COLORMAP;
- case __GO_COLORMAP_SIZE__ :
+ case __GO_COLORMAP_SIZE__:
return FigureProperty.COLORMAPSIZE;
- case __GO_PIXEL_DRAWING_MODE__ :
+ case __GO_PIXEL_DRAWING_MODE__:
return RenderingModeProperty.PIXELDRAWINGMODE;
- case __GO_ANTIALIASING__ :
+ case __GO_ANTIALIASING__:
return RenderingModeProperty.ANTIALIASING;
- case __GO_IMMEDIATE_DRAWING__ :
+ case __GO_IMMEDIATE_DRAWING__:
return RenderingModeProperty.IMMEDIATEDRAWING;
- case __GO_BACKGROUND__ :
+ case __GO_BACKGROUND__:
return FigureProperty.BACKGROUND;
- case __GO_EVENTHANDLER_NAME__ :
+ case __GO_EVENTHANDLER_NAME__:
return EventHandlerProperty.EVENTHANDLER;
- case __GO_EVENTHANDLER_ENABLE__ :
+ case __GO_EVENTHANDLER_ENABLE__:
return EventHandlerProperty.EVENTHANDLERENABLE;
- case __GO_ROTATION_TYPE__ :
+ case __GO_ROTATION_TYPE__:
return FigureProperty.ROTATIONTYPE;
- case __GO_RESIZEFCN__ :
+ case __GO_RESIZEFCN__:
return FigureProperty.RESIZEFCN;
- case __GO_CLOSEREQUESTFCN__ :
+ case __GO_CLOSEREQUESTFCN__:
return FigureProperty.CLOSEREQUESTFCN;
- case __GO_RESIZE__ :
+ case __GO_RESIZE__:
return FigureProperty.RESIZE;
- case __GO_TOOLBAR__ :
+ case __GO_TOOLBAR__:
return FigureProperty.TOOLBAR;
- case __GO_TOOLBAR_VISIBLE__ :
+ case __GO_TOOLBAR_VISIBLE__:
return FigureProperty.TOOLBAR_VISIBLE;
- case __GO_MENUBAR__ :
+ case __GO_MENUBAR__:
return FigureProperty.MENUBAR;
- case __GO_MENUBAR_VISIBLE__ :
+ case __GO_MENUBAR_VISIBLE__:
return FigureProperty.MENUBAR_VISIBLE;
- case __GO_INFOBAR_VISIBLE__ :
+ case __GO_INFOBAR_VISIBLE__:
return FigureProperty.INFOBAR_VISIBLE;
- case __GO_DOCKABLE__ :
+ case __GO_DOCKABLE__:
return FigureProperty.DOCKABLE;
- case __GO_LAYOUT__ :
+ case __GO_LAYOUT__:
return FigureProperty.LAYOUT;
- case __GO_LAYOUT_SET__ :
+ case __GO_LAYOUT_SET__:
return FigureProperty.LAYOUT_SET;
- case __GO_GRID_OPT_GRID__ :
+ case __GO_GRID_OPT_GRID__:
return FigureProperty.GRIDOPT_GRID;
- case __GO_GRID_OPT_PADDING__ :
+ case __GO_GRID_OPT_PADDING__:
return FigureProperty.GRIDOPT_PADDING;
- case __GO_BORDER_OPT_PADDING__ :
+ case __GO_BORDER_OPT_PADDING__:
return FigureProperty.BORDEROPT_PADDING;
- case __GO_DEFAULT_AXES__ :
+ case __GO_DEFAULT_AXES__:
return FigureProperty.DEFAULT_AXES;
- case __GO_UI_ICON__ :
+ case __GO_UI_ICON__:
return FigureProperty.ICON;
- default :
+ default:
return super.getPropertyFromName(propertyName);
}
}
*/
public UpdateStatus setProperty(Object property, Object value) {
if (property instanceof FigureProperty) {
- switch ((FigureProperty)property) {
+ switch ((FigureProperty) property) {
case BACKGROUND:
return setBackground((Integer) value);
case CLOSEREQUESTFCN:
break;
}
} else if (property instanceof CanvasProperty) {
- switch ((CanvasProperty)property) {
+ switch ((CanvasProperty) property) {
case AUTORESIZE:
return setAutoResize((Boolean) value);
case AXESSIZE:
return setViewport((Integer[]) value);
}
} else if (property instanceof FigureDimensionsProperty) {
- switch ((FigureDimensionsProperty)property) {
+ switch ((FigureDimensionsProperty) property) {
case POSITION:
return setPosition((Integer[]) value);
case SIZE:
return setSize((Integer[]) value);
}
} else if (property instanceof FigureNameProperty) {
- switch ((FigureNameProperty)property) {
+ switch ((FigureNameProperty) property) {
case ID:
return setId((Integer) value);
case NAME:
return setName((String) value);
}
} else if (property instanceof RenderingModeProperty) {
- switch ((RenderingModeProperty)property) {
+ switch ((RenderingModeProperty) property) {
case ANTIALIASING:
return setAntialiasing((Integer) value);
case IMMEDIATEDRAWING:
return setPixelDrawingMode((Integer) value);
}
} else if (property instanceof EventHandlerProperty) {
- switch ((EventHandlerProperty)property) {
+ switch ((EventHandlerProperty) property) {
case EVENTHANDLER:
return setEventHandlerString((String) value);
case EVENTHANDLERENABLE:
return UpdateStatus.Success;
}
-
public Boolean getResize() {
return resize;
}
return UpdateStatus.Fail;
}
- for (int i = 0 ; i < value.length ; i++) {
+ for (int i = 0; i < value.length; i++) {
if (borderOptPadding[i] != value[i]) {
borderOptPadding[i] = value[i];
status = UpdateStatus.Success;
return UpdateStatus.Fail;
}
- for (int i = 0 ; i < value.length ; i++) {
+ for (int i = 0; i < value.length; i++) {
if (gridOptPadding[i] != value[i]) {
gridOptPadding[i] = value[i];
status = UpdateStatus.Success;
return UpdateStatus.Fail;
}
- for (int i = 0 ; i < value.length ; i++) {
+ for (int i = 0; i < value.length; i++) {
if (gridOptGrid[i] != value[i]) {
gridOptGrid[i] = value[i];
status = UpdateStatus.Success;
return UpdateStatus.Success;
}
-
public String getIcon() {
return icon;
}
return UpdateStatus.Success;
}
-
/**
* @return Type as String
*/
TOP, LEFT, BOTTOM, RIGHT;
public static TitlePositionType intToEnum(Integer value) {
switch (value) {
+ default:
case 0:
return TOP;
case 1:
return LEFT;
- default:
case 2:
return BOTTOM;
case 3:
return RIGHT;
}
}
+
+ public static TitlePositionType stringToEnum(String value) {
+ if (value.equals("left")) {
+ return LEFT;
+ }
+
+ if (value.equals("bottom")) {
+ return BOTTOM;
+ }
+
+ if (value.equals("right")) {
+ return RIGHT;
+ }
+
+ return TOP;
+ }
+
+ public static String enumToString(TitlePositionType value) {
+ switch (value) {
+ case BOTTOM:
+ return "bottom";
+ case LEFT:
+ return "left";
+ case RIGHT:
+ return "right";
+ default:
+ case TOP:
+ return "top";
+ }
+ }
}
public enum BorderLayoutType {
}
}
- public static BorderLayoutType stringToEnum(String value) {
+ public static BorderLayoutType stringToEnum2(String value) {
if (value == null || value.equals("")) {
return CENTER;
}
return CENTER;
}
+
+ public static String enumToString(BorderLayoutType value) {
+ switch (value) {
+ case BOTTOM:
+ return "bottom";
+ default:
+ case CENTER:
+ return "center";
+ case LEFT:
+ return "left";
+ case RIGHT:
+ return "right";
+ case TOP:
+ return "top";
+ }
+ }
+
+ public static BorderLayoutType stringToEnum(String value) {
+ if (value.equals("bottom")) {
+ return BOTTOM;
+ }
+
+ if (value.equals("left")) {
+ return LEFT;
+ }
+
+ if (value.equals("right")) {
+ return RIGHT;
+ }
+
+ if (value.equals("top")) {
+ return TOP;
+ }
+
+ return CENTER;
+ }
}
public enum FillType {
return NONE;
}
+
+ public static String enumToString(FillType value) {
+ switch (value) {
+ case BOTH:
+ return "both";
+ case HORIZONTAL:
+ return "horizontal";
+ case NONE:
+ default:
+ return "none";
+ case VERTICAL:
+ return "vertical";
+ }
+ }
}
public enum AnchorType {
}
}
- public static AnchorType stringToEnum(String value) {
+ public static AnchorType stringToEnum2(String value) {
if (value == null || value.equals("")) {
return CENTER;
}
return CENTER;
}
+
+ public static String enumToString(AnchorType value) {
+ switch (value) {
+ default:
+ case CENTER:
+ return "center";
+ case LEFT:
+ return "left";
+ case LOWER:
+ return "lower";
+ case LOWER_LEFT:
+ return "lower_left";
+ case LOWER_RIGHT:
+ return "lower_right";
+ case RIGHT:
+ return "right";
+ case UPPER:
+ return "upper";
+ case UPPER_LEFT:
+ return "upper_left";
+ case UPPER_RIGHT:
+ return "upper_right";
+ }
+ }
+
+ public static AnchorType stringToEnum(String value) {
+ if (value.equals("left")) {
+ return LEFT;
+ }
+
+ if (value.equals("lower")) {
+ return LOWER;
+ }
+
+ if (value.equals("lower_left")) {
+ return LOWER_LEFT;
+ }
+
+ if (value.equals("lower_right")) {
+ return LOWER_RIGHT;
+ }
+
+ if (value.equals("right")) {
+ return RIGHT;
+ }
+
+ if (value.equals("upper")) {
+ return UPPER;
+ }
+
+ if (value.equals("upper_left")) {
+ return UPPER_LEFT;
+ }
+
+ if (value.equals("upper_right")) {
+ return UPPER_RIGHT;
+ }
+
+ return CENTER;
+ }
}
protected static final String RELIEF_DEFAULT = "default";
switch (value) {
default:
case 0:
- return LayoutType.NONE;
+ return NONE;
case 1:
- return LayoutType.GRIDBAG;
+ return GRIDBAG;
case 2:
- return LayoutType.GRID;
+ return GRID;
case 3:
- return LayoutType.BORDER;
+ return BORDER;
}
}
return NONE;
}
+
+ public static String enumToString(LayoutType value) {
+ switch (value) {
+ default:
+ case NONE:
+ return "none";
+ case GRIDBAG:
+ return "gridbag";
+ case GRID:
+ return "grid";
+ case BORDER:
+ return "border";
+ }
+ }
}
switch (layout) {
case BORDER: {
item = XmlTools.getFromMap(map, "position", "center");
- controller.setProperty(uic, __GO_UI_BORDER_POSITION__, Uicontrol.BorderLayoutType.stringToEnum(item).ordinal());
+ controller.setProperty(uic, __GO_UI_BORDER_POSITION__, Uicontrol.BorderLayoutType.stringToEnum2(item).ordinal());
Integer[] preferredsize = new Integer[] { -1, -1};
item = xmlAttributes.get("preferred-size");
if (item != null) {
weight[1] = Double.parseDouble(XmlTools.getFromMap(map, "weighty", "1.0"));
Integer fill = Uicontrol.FillType.stringToEnum(XmlTools.getFromMap(map, "fill", "none")).ordinal();
- Integer anchor = Uicontrol.AnchorType.stringToEnum(XmlTools.getFromMap(map, "anchor", "center")).ordinal();
+ Integer anchor = Uicontrol.AnchorType.stringToEnum2(XmlTools.getFromMap(map, "anchor", "center")).ordinal();
Integer[] padding = new Integer[] { 0, 0 };
padding[0] = Integer.parseInt(XmlTools.getFromMap(map, "ipadx", "0"));
import org.scilab.modules.graphic_objects.ScilabNativeView;
import org.scilab.modules.graphic_objects.builder.Builder;
import org.scilab.modules.graphic_objects.console.Console;
+import org.scilab.modules.graphic_objects.figure.Figure;
+import org.scilab.modules.graphic_objects.figure.Figure.BarType;
import org.scilab.modules.graphic_objects.graphicController.GraphicController;
import org.scilab.modules.graphic_objects.graphicObject.GraphicObject;
+import org.scilab.modules.graphic_objects.uicontrol.Uicontrol;
import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorderType;
+import org.scilab.modules.graphic_objects.utils.LayoutType;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
public class XMLDomLoader {
private enum ModelType {
- BOOLEAN, BOOLEAN_ARRAY, DOUBLE, DOUBLE_ARRAY, STRING, STRING_ARRAY, INTEGER, INTEGER_ARRAY;
+ BOOLEAN, BOOLEAN_ARRAY, DOUBLE, DOUBLE_ARRAY, STRING, STRING_ARRAY, INTEGER, INTEGER_ARRAY,
+ ROTATIONTYPE, BARTYPE, LAYOUTTYPE, FILLTYPE, ANCHORTYPE, POSITIONTYPE;
};
private static final int __NODE_SCILABGUI__ = -10;
figPropToGO.put("immediate_drawing", new Pair<Integer, ModelType>(__GO_IMMEDIATE_DRAWING__, ModelType.BOOLEAN));
figPropToGO.put("background", new Pair<Integer, ModelType>(__GO_BACKGROUND__, ModelType.INTEGER));
figPropToGO.put("visible", new Pair<Integer, ModelType>(__GO_VISIBLE__, ModelType.BOOLEAN));
- figPropToGO.put("rotation_style", new Pair<Integer, ModelType>(__GO_ROTATION_TYPE__, ModelType.STRING));
+ figPropToGO.put("rotation_style", new Pair<Integer, ModelType>(__GO_ROTATION_TYPE__, ModelType.ROTATIONTYPE));
figPropToGO.put("event_handler", new Pair<Integer, ModelType>(__GO_EVENTHANDLER_NAME__, ModelType.STRING));
figPropToGO.put("event_handler_enable", new Pair<Integer, ModelType>(__GO_EVENTHANDLER_ENABLE__, ModelType.BOOLEAN));
figPropToGO.put("resizefcn", new Pair<Integer, ModelType>(__GO_RESIZEFCN__, ModelType.STRING));
figPropToGO.put("closerequestfcn", new Pair<Integer, ModelType>(__GO_CLOSEREQUESTFCN__, ModelType.STRING));
figPropToGO.put("resize", new Pair<Integer, ModelType>(__GO_RESIZE__, ModelType.BOOLEAN));
- figPropToGO.put("toolbar", new Pair<Integer, ModelType>(__GO_TOOLBAR__, ModelType.INTEGER));
+ figPropToGO.put("toolbar", new Pair<Integer, ModelType>(__GO_TOOLBAR__, ModelType.BARTYPE));
figPropToGO.put("toolbar_visible", new Pair<Integer, ModelType>(__GO_TOOLBAR_VISIBLE__, ModelType.BOOLEAN));
- figPropToGO.put("menubar", new Pair<Integer, ModelType>(__GO_MENUBAR__, ModelType.INTEGER));
+ figPropToGO.put("menubar", new Pair<Integer, ModelType>(__GO_MENUBAR__, ModelType.BARTYPE));
figPropToGO.put("menubar_visible", new Pair<Integer, ModelType>(__GO_MENUBAR_VISIBLE__, ModelType.BOOLEAN));
figPropToGO.put("infobar_visible", new Pair<Integer, ModelType>(__GO_INFOBAR_VISIBLE__, ModelType.BOOLEAN));
figPropToGO.put("dockable", new Pair<Integer, ModelType>(__GO_DOCKABLE__, ModelType.BOOLEAN));
- figPropToGO.put("layout", new Pair<Integer, ModelType>(__GO_LAYOUT__, ModelType.INTEGER));
+ figPropToGO.put("layout", new Pair<Integer, ModelType>(__GO_LAYOUT__, ModelType.LAYOUTTYPE));
figPropToGO.put("default_axes", new Pair<Integer, ModelType>(__GO_DEFAULT_AXES__, ModelType.BOOLEAN));
figPropToGO.put("icon", new Pair<Integer, ModelType>(__GO_UI_ICON__, ModelType.STRING));
figPropToGO.put("tag", new Pair<Integer, ModelType>(__GO_TAG__, ModelType.STRING));
UiPropToGO.put("string", new Pair<Integer, ModelType>(__GO_UI_STRING__, ModelType.STRING_ARRAY));
UiPropToGO.put("tooltipstring", new Pair<Integer, ModelType>(__GO_UI_TOOLTIPSTRING__, ModelType.STRING_ARRAY));
UiPropToGO.put("visible", new Pair<Integer, ModelType>(__GO_VISIBLE__, ModelType.BOOLEAN));
- UiPropToGO.put("layout", new Pair<Integer, ModelType>(__GO_LAYOUT__, ModelType.INTEGER));
+ UiPropToGO.put("layout", new Pair<Integer, ModelType>(__GO_LAYOUT__, ModelType.LAYOUTTYPE));
UiPropToGO.put("callback", new Pair<Integer, ModelType>(__GO_CALLBACK__, ModelType.STRING));
UiPropToGO.put("callback_type", new Pair<Integer, ModelType>(__GO_CALLBACKTYPE__, ModelType.INTEGER));
UiPropToGO.put("gridbaggrid", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_GRID__, ModelType.INTEGER_ARRAY));
UiPropToGO.put("gridbagweight", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_WEIGHT__, ModelType.DOUBLE_ARRAY));
- UiPropToGO.put("gridbagfill", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_FILL__, ModelType.INTEGER));
- UiPropToGO.put("gridbaganchor", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_ANCHOR__, ModelType.INTEGER));
+ UiPropToGO.put("gridbagfill", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_FILL__, ModelType.FILLTYPE));
+ UiPropToGO.put("gridbaganchor", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_ANCHOR__, ModelType.ANCHORTYPE));
UiPropToGO.put("gridbagpadding", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_PADDING__, ModelType.INTEGER_ARRAY));
UiPropToGO.put("gridbagpreferredsize", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_PREFERREDSIZE__, ModelType.INTEGER_ARRAY));
- UiPropToGO.put("borderposition", new Pair<Integer, ModelType>(__GO_UI_BORDER_POSITION__, ModelType.INTEGER));
+ UiPropToGO.put("borderposition", new Pair<Integer, ModelType>(__GO_UI_BORDER_POSITION__, ModelType.POSITIONTYPE));
UiPropToGO.put("borderpreferredsize", new Pair<Integer, ModelType>(__GO_UI_BORDER_PREFERREDSIZE__, ModelType.INTEGER_ARRAY));
UiPropToGO.put("margins", new Pair<Integer, ModelType>(__GO_MARGINS__, ModelType.DOUBLE_ARRAY));
UiPropToGO.put("groupname", new Pair<Integer, ModelType>(__GO_UI_GROUP_NAME__, ModelType.STRING));
//menubar
tempnode = attr.getNamedItem("menubar");
if (tempnode != null) {
- menubar = getAttributeAsInteger(tempnode.getNodeValue());
+ menubar = Figure.BarType.stringToEnum(getAttributeAsString(tempnode.getNodeValue())).ordinal();
attr.removeNamedItem("menubar");
}
//toolbar
tempnode = attr.getNamedItem("toolbar");
if (tempnode != null) {
- toolbar = getAttributeAsInteger(tempnode.getNodeValue());
+ toolbar = Figure.BarType.stringToEnum(getAttributeAsString(tempnode.getNodeValue())).ordinal();
attr.removeNamedItem("toolbar");
}
//default_axes
case STRING_ARRAY:
controller.setProperty(fig, pair.getFirst(), getAttributeAsStringArray(prop.getNodeValue()));
break;
+ case ROTATIONTYPE :
+ controller.setProperty(fig, pair.getFirst(), Figure.RotationType.stringToEnum(getAttributeAsString(prop.getNodeValue())).ordinal());
+ break;
+ case BARTYPE :
+ controller.setProperty(fig, pair.getFirst(), Figure.BarType.stringToEnum(getAttributeAsString(prop.getNodeValue())).ordinal());
+ break;
+ case LAYOUTTYPE :
+ controller.setProperty(fig, pair.getFirst(), LayoutType.stringToEnum(getAttributeAsString(prop.getNodeValue())).ordinal());
+ break;
default:
System.out.println("missing type");
break;
case STRING_ARRAY:
//nothing to do, manage as node instead of attributes
break;
+ case LAYOUTTYPE :
+ controller.setProperty(uic, pair.getFirst(), LayoutType.stringToEnum(getAttributeAsString(prop.getNodeValue())).ordinal());
+ break;
+ case FILLTYPE :
+ controller.setProperty(uic, pair.getFirst(), Uicontrol.FillType.stringToEnum(getAttributeAsString(prop.getNodeValue())).ordinal());
+ break;
+ case ANCHORTYPE :
+ controller.setProperty(uic, pair.getFirst(), Uicontrol.AnchorType.stringToEnum(getAttributeAsString(prop.getNodeValue())).ordinal());
+ break;
+ case POSITIONTYPE :
+ controller.setProperty(uic, pair.getFirst(), Uicontrol.BorderLayoutType.stringToEnum(getAttributeAsString(prop.getNodeValue())).ordinal());
+ break;
default:
System.out.println("missing type");
break;
//visible
setAttribute(elemFig, "visible", createAttribute(fig.getVisible()), createAttribute(defaultFig.getVisible()));
//rotation_style
- setAttribute(elemFig, "rotation_style", createAttribute(fig.getRotation()), createAttribute(defaultFig.getRotation()));
+ setAttribute(elemFig, "rotation_style", createAttribute(Figure.RotationType.enumToString(fig.getRotationAsEnum())), createAttribute(Figure.RotationType.enumToString(defaultFig.getRotationAsEnum())));
//event_handler
setAttribute(elemFig, "event_handler", createAttribute(fig.getEventHandlerString()), createAttribute(defaultFig.getEventHandlerString()));
//event_handler_enable
//resize
setAttribute(elemFig, "resize", createAttribute(fig.getResize()), createAttribute(defaultFig.getResize()));
//toolbar
- setAttribute(elemFig, "toolbar", createAttribute(fig.getToolbar()), createAttribute(defaultFig.getToolbar()));
+ setAttribute(elemFig, "toolbar", createAttribute(Figure.BarType.enumToString(fig.getToolbarAsEnum())), createAttribute(Figure.BarType.enumToString(defaultFig.getToolbarAsEnum())));
//toolbar_visible
setAttribute(elemFig, "toolbar_visible", createAttribute(fig.getToolbarVisible()), createAttribute(defaultFig.getToolbarVisible()));
//menubar
- setAttribute(elemFig, "menubar", createAttribute(fig.getMenubar()), createAttribute(defaultFig.getMenubar()));
+ setAttribute(elemFig, "menubar", createAttribute(Figure.BarType.enumToString(fig.getMenubarAsEnum())), createAttribute(Figure.BarType.enumToString(defaultFig.getMenubarAsEnum())));
//menubar_visible
setAttribute(elemFig, "menubar_visible", createAttribute(fig.getMenubarVisible()), createAttribute(defaultFig.getMenubarVisible()));
//infobar_visible
//dockable
setAttribute(elemFig, "dockable", createAttribute(fig.getDockable()), createAttribute(defaultFig.getDockable()));
//layout
- setAttribute(elemFig, "layout", createAttribute(fig.getLayout()), createAttribute(defaultFig.getLayout()));
+ setAttribute(elemFig, "layout", createAttribute(LayoutType.enumToString(fig.getLayoutAsEnum())), createAttribute(LayoutType.enumToString(defaultFig.getLayoutAsEnum())));
//default_axes
setAttribute(elemFig, "default_axes", createAttribute(fig.hasDefaultAxes()), createAttribute(defaultFig.hasDefaultAxes()));
if (layout == LayoutType.GRIDBAG) {
setAttribute(elemUi, "gridbaggrid", createAttribute(uic.getGridBagGrid()), createAttribute(defaultUi.getGridBagGrid()));
setAttribute(elemUi, "gridbagweight", createAttribute(uic.getGridBagWeight()), createAttribute(defaultUi.getGridBagWeight()));
- setAttribute(elemUi, "gridbagfill", createAttribute(uic.getGridBagFill()), createAttribute(defaultUi.getGridBagFill()));
- setAttribute(elemUi, "gridbaganchor", createAttribute(uic.getGridBagAnchor()), createAttribute(defaultUi.getGridBagAnchor()));
+ setAttribute(elemUi, "gridbagfill", createAttribute(Uicontrol.FillType.enumToString(uic.getGridBagFillAsEnum())), createAttribute(Uicontrol.FillType.enumToString(defaultUi.getGridBagFillAsEnum())));
+ setAttribute(elemUi, "gridbaganchor", createAttribute(Uicontrol.AnchorType.enumToString(uic.getGridBagAnchorAsEnum())), createAttribute(Uicontrol.AnchorType.enumToString(defaultUi.getGridBagAnchorAsEnum())));
setAttribute(elemUi, "gridbagpadding", createAttribute(uic.getGridBagPadding()), createAttribute(defaultUi.getGridBagPadding()));
setAttribute(elemUi, "gridbagpreferredsize", createAttribute(uic.getGridBagPreferredSize()), createAttribute(defaultUi.getGridBagPreferredSize()));
} else if (layout == LayoutType.BORDER) {
- setAttribute(elemUi, "borderposition", createAttribute(uic.getBorderPosition()), createAttribute(defaultUi.getBorderPosition()));
+ setAttribute(elemUi, "borderposition", createAttribute(Uicontrol.BorderLayoutType.enumToString(uic.getBorderPositionAsEnum())), createAttribute(Uicontrol.BorderLayoutType.enumToString(defaultUi.getBorderPositionAsEnum())));
setAttribute(elemUi, "borderpreferredsize", createAttribute(uic.getBorderPreferredSize()), createAttribute(defaultUi.getBorderPreferredSize()));
} else if (layout == LayoutType.NONE) {
//Position
}
//Layout
- setAttribute(elemUi, "layout", createAttribute(uic.getLayout()), createAttribute(defaultUi.getLayout()));
+ setAttribute(elemUi, "layout", createAttribute(LayoutType.enumToString(uic.getLayoutAsEnum())), createAttribute(LayoutType.enumToString(defaultUi.getLayoutAsEnum())));
//Layout_options
if (uic.getLayoutAsEnum() == LayoutType.GRID) {
setAttribute(elemUi, "gridoptgrid", createAttribute(uic.getGridOptGrid()), createAttribute(defaultUi.getGridOptGrid()));