Commit cc63797d authored by apvrille's avatar apvrille

Update on model loading

parent 001ddf1e
<?xml version="1.0" encoding="UTF-8"?>
<TURTLEGMODELING version="1.0beta" ANIMATE_INTERACTIVE_SIMULATION="false" ACTIVATE_PENALTIES="false" UPDATE_INFORMATION_DIPLO_SIM="false" ANIMATE_WITH_INFO_DIPLO_SIM="true" OPEN_DIAG_DIPLO_SIM="false" LAST_SELECTED_MAIN_TAB="0">
<TURTLEGMODELING version="1.0beta" ANIMATE_INTERACTIVE_SIMULATION="false" ACTIVATE_PENALTIES="false" UPDATE_INFORMATION_DIPLO_SIM="false" ANIMATE_WITH_INFO_DIPLO_SIM="true" OPEN_DIAG_DIPLO_SIM="false" LAST_SELECTED_MAIN_TAB="0" LAST_SELECTED_SUB_TAB="0">
<Modeling type="TML Component Design" nameTab="AppC" tabs="TML Component Task Diagram$Application$TCPIP$Timer$InterfaceDevice$SmartCard" >
<TMLComponentTaskDiagramPanel name="TML Component Task Diagram" minX="0" maxX="2724" minY="0" maxY="916" channels="true" events="true" requests="true" zoom="1.0000000000000018" >
......
......@@ -3720,6 +3720,7 @@ public class GTURTLEModeling {
private String header() {
String head = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<TURTLEGMODELING version=\"" + DefaultText.getVersion() + "\"";
ModelParameters.setValueForID("LAST_SELECTED_SUB_TAB", ""+mgui.getCurrentJTabbedPane().getSelectedIndex());
head += ModelParameters.toXML();
head += ">\n\n";
return head;
......@@ -5433,6 +5434,10 @@ public class GTURTLEModeling {
} else {
throw new MalformedModelingException();
}
//Select first tab of current tab
mgui.getCurrentJTabbedPane().setSelectedIndex(0);
}
......@@ -5498,6 +5503,7 @@ public class GTURTLEModeling {
prepareErrors();
int selectedTab = 0;
int selectedSubTab = -1;
try {
// building nodes from xml String
......@@ -5533,6 +5539,7 @@ public class GTURTLEModeling {
TraceManager.addDev("Exception when loading model parameters:" + e.getMessage());
}
selectedTab = ModelParameters.getIntegerValueFromID("LAST_SELECTED_MAIN_TAB");
selectedSubTab = ModelParameters.getIntegerValueFromID("LAST_SELECTED_SUB_TAB");
//designPanelNl = doc.getElementsByTagName("Design");
//analysisNl = doc.getElementsByTagName("Analysis");
......@@ -5579,7 +5586,7 @@ public class GTURTLEModeling {
// Selecting last tab
TraceManager.addDev("Selecting tab:" + selectedTab);
mgui.selectTab(new Point(selectedTab, 0));
mgui.selectTab(new Point(selectedTab, selectedSubTab));
}
/*public void loadModeling(Node node) throws MalformedModelingException, SAXException {
......
......@@ -62,9 +62,10 @@ public class ModelParameters {
"UPDATE_INFORMATION_DIPLO_SIM", // Diplo simulator
"ANIMATE_WITH_INFO_DIPLO_SIM", // Diplo simulator
"OPEN_DIAG_DIPLO_SIM", // Diplo simulator
"LAST_SELECTED_MAIN_TAB"
"LAST_SELECTED_MAIN_TAB",
"LAST_SELECTED_SUB_TAB"
};
private static String[] values = {"true", "true", "true", "true", "false", "0"};
private static String[] values = {"true", "true", "true", "true", "false", "0", "0"};
public static boolean getBooleanValueFromID(String value) {
for(int i=0; i<ids.length; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment