Commit 0a9ee57b authored by claes's avatar claes

Fixed bug in languageselection

parent 4571e455
...@@ -137,7 +137,7 @@ public class XttTree extends JPanel ...@@ -137,7 +137,7 @@ public class XttTree extends JPanel
public XttTree(JopSession session, URL url, Object root) public XttTree(JopSession session, URL url, Object root)
{ {
Logg.text_lbl = this.labelMessage; Logg.text_lbl = this.labelMessage;
Logg.logg("ver 1.9.5", 0); Logg.logg("ver 1.9.6", 0);
this.session = session; this.session = session;
this.root = root; this.root = root;
...@@ -261,7 +261,10 @@ public class XttTree extends JPanel ...@@ -261,7 +261,10 @@ public class XttTree extends JPanel
tNodeRoot = new DefaultMutableTreeNode(xttObj); tNodeRoot = new DefaultMutableTreeNode(xttObj);
xttObj.treeNode = tNodeRoot; xttObj.treeNode = tNodeRoot;
xttObj.init(false); xttObj.init(false);
xttObj.refObj.objAttr.treeModel = this.treeModel; if(xttObj.refObj != null)
{
xttObj.refObj.objAttr.treeModel = this.treeModel;
}
rootNode.add(tNodeRoot); rootNode.add(tNodeRoot);
if(gdhr.hasChildren) if(gdhr.hasChildren)
{ {
...@@ -1020,9 +1023,9 @@ public class XttTree extends JPanel ...@@ -1020,9 +1023,9 @@ public class XttTree extends JPanel
this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", true, 0, "ctrl A"); this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", true, 0, "ctrl A");
this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", false, -1, "shift RIGHT"); this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", false, -1, "shift RIGHT");
this.newMethod("COLLAPSENODE", COLLAPSENODE, "COLLAPSENODE", false, -1, "LEFT"); this.newMethod("COLLAPSENODE", COLLAPSENODE, "COLLAPSENODE", false, -1, "LEFT");
this.newMethod(changeValue, CHANGEVALUE, "CHANGEVALUE", true, 0, "ctrl Q");
this.newMethod(openPlc, OPENPLC, "OPENPLC", true, 0, "ctrl L"); this.newMethod(openPlc, OPENPLC, "OPENPLC", true, 0, "ctrl L");
this.newMethod(showCross, SHOWCROSS, "SHOWCROSS", true, 0, "ctrl R"); this.newMethod(showCross, SHOWCROSS, "SHOWCROSS", true, 0, "ctrl R");
this.newMethod(changeValue, CHANGEVALUE, "CHANGEVALUE", true, 0, "ctrl Q");
this.newMethod(debug, DEBUG, "DEBUG", true, 0, "ctrl RIGHT"); this.newMethod(debug, DEBUG, "DEBUG", true, 0, "ctrl RIGHT");
this.newMethod(find, FIND, "FIND", false, 0, "ctrl F"); this.newMethod(find, FIND, "FIND", false, 0, "ctrl F");
this.newMethod(swedish, LAN_SW, "LAN_SW", false, 1, null); this.newMethod(swedish, LAN_SW, "LAN_SW", false, 1, null);
...@@ -1277,9 +1280,9 @@ public class XttTree extends JPanel ...@@ -1277,9 +1280,9 @@ public class XttTree extends JPanel
JMenu menuFunctions = menuBar.getMenu(0); JMenu menuFunctions = menuBar.getMenu(0);
JMenu menuLan = menuBar.getMenu(1); JMenu menuLan = menuBar.getMenu(1);
menuFunctions.setText(functions); menuFunctions.setText(functions);
menuFunctions.getItem(0).setText(openPlc); menuFunctions.getItem(0).setText(openObject);
menuFunctions.getItem(1).setText(showCross); menuFunctions.getItem(1).setText(openPlc);
menuFunctions.getItem(2).setText(openObject); menuFunctions.getItem(2).setText(showCross);
menuFunctions.getItem(3).setText(changeValue); menuFunctions.getItem(3).setText(changeValue);
menuFunctions.getItem(4).setText(debug); menuFunctions.getItem(4).setText(debug);
menuFunctions.getItem(5).setText(find); menuFunctions.getItem(5).setText(find);
...@@ -1288,9 +1291,9 @@ public class XttTree extends JPanel ...@@ -1288,9 +1291,9 @@ public class XttTree extends JPanel
menuLan.getItem(1).setText(english); menuLan.getItem(1).setText(english);
MenuElement[] menuElements = popup.getSubElements(); MenuElement[] menuElements = popup.getSubElements();
((JMenuItem)(menuElements[0])).setText(openPlc); ((JMenuItem)(menuElements[0])).setText(openObject);
((JMenuItem)(menuElements[1])).setText(showCross); ((JMenuItem)(menuElements[1])).setText(openPlc);
((JMenuItem)(menuElements[2])).setText(openObject); ((JMenuItem)(menuElements[2])).setText(showCross);
((JMenuItem)(menuElements[3])).setText(changeValue); ((JMenuItem)(menuElements[3])).setText(changeValue);
((JMenuItem)(menuElements[4])).setText(debug); ((JMenuItem)(menuElements[4])).setText(debug);
} }
...@@ -1658,3 +1661,20 @@ public class XttTree extends JPanel ...@@ -1658,3 +1661,20 @@ public class XttTree extends JPanel
} }
} }
...@@ -137,7 +137,7 @@ public class XttTree extends JPanel ...@@ -137,7 +137,7 @@ public class XttTree extends JPanel
public XttTree(JopSession session, URL url, Object root) public XttTree(JopSession session, URL url, Object root)
{ {
Logg.text_lbl = this.labelMessage; Logg.text_lbl = this.labelMessage;
Logg.logg("ver 1.9.5", 0); Logg.logg("ver 1.9.6", 0);
this.session = session; this.session = session;
this.root = root; this.root = root;
...@@ -261,7 +261,10 @@ public class XttTree extends JPanel ...@@ -261,7 +261,10 @@ public class XttTree extends JPanel
tNodeRoot = new DefaultMutableTreeNode(xttObj); tNodeRoot = new DefaultMutableTreeNode(xttObj);
xttObj.treeNode = tNodeRoot; xttObj.treeNode = tNodeRoot;
xttObj.init(false); xttObj.init(false);
xttObj.refObj.objAttr.treeModel = this.treeModel; if(xttObj.refObj != null)
{
xttObj.refObj.objAttr.treeModel = this.treeModel;
}
rootNode.add(tNodeRoot); rootNode.add(tNodeRoot);
if(gdhr.hasChildren) if(gdhr.hasChildren)
{ {
...@@ -1020,9 +1023,9 @@ public class XttTree extends JPanel ...@@ -1020,9 +1023,9 @@ public class XttTree extends JPanel
this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", true, 0, "ctrl A"); this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", true, 0, "ctrl A");
this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", false, -1, "shift RIGHT"); this.newMethod(openObject, ADDOBJECTINFO, "ADDOBJECTINFO", false, -1, "shift RIGHT");
this.newMethod("COLLAPSENODE", COLLAPSENODE, "COLLAPSENODE", false, -1, "LEFT"); this.newMethod("COLLAPSENODE", COLLAPSENODE, "COLLAPSENODE", false, -1, "LEFT");
this.newMethod(changeValue, CHANGEVALUE, "CHANGEVALUE", true, 0, "ctrl Q");
this.newMethod(openPlc, OPENPLC, "OPENPLC", true, 0, "ctrl L"); this.newMethod(openPlc, OPENPLC, "OPENPLC", true, 0, "ctrl L");
this.newMethod(showCross, SHOWCROSS, "SHOWCROSS", true, 0, "ctrl R"); this.newMethod(showCross, SHOWCROSS, "SHOWCROSS", true, 0, "ctrl R");
this.newMethod(changeValue, CHANGEVALUE, "CHANGEVALUE", true, 0, "ctrl Q");
this.newMethod(debug, DEBUG, "DEBUG", true, 0, "ctrl RIGHT"); this.newMethod(debug, DEBUG, "DEBUG", true, 0, "ctrl RIGHT");
this.newMethod(find, FIND, "FIND", false, 0, "ctrl F"); this.newMethod(find, FIND, "FIND", false, 0, "ctrl F");
this.newMethod(swedish, LAN_SW, "LAN_SW", false, 1, null); this.newMethod(swedish, LAN_SW, "LAN_SW", false, 1, null);
...@@ -1277,9 +1280,9 @@ public class XttTree extends JPanel ...@@ -1277,9 +1280,9 @@ public class XttTree extends JPanel
JMenu menuFunctions = menuBar.getMenu(0); JMenu menuFunctions = menuBar.getMenu(0);
JMenu menuLan = menuBar.getMenu(1); JMenu menuLan = menuBar.getMenu(1);
menuFunctions.setText(functions); menuFunctions.setText(functions);
menuFunctions.getItem(0).setText(openPlc); menuFunctions.getItem(0).setText(openObject);
menuFunctions.getItem(1).setText(showCross); menuFunctions.getItem(1).setText(openPlc);
menuFunctions.getItem(2).setText(openObject); menuFunctions.getItem(2).setText(showCross);
menuFunctions.getItem(3).setText(changeValue); menuFunctions.getItem(3).setText(changeValue);
menuFunctions.getItem(4).setText(debug); menuFunctions.getItem(4).setText(debug);
menuFunctions.getItem(5).setText(find); menuFunctions.getItem(5).setText(find);
...@@ -1288,9 +1291,9 @@ public class XttTree extends JPanel ...@@ -1288,9 +1291,9 @@ public class XttTree extends JPanel
menuLan.getItem(1).setText(english); menuLan.getItem(1).setText(english);
MenuElement[] menuElements = popup.getSubElements(); MenuElement[] menuElements = popup.getSubElements();
((JMenuItem)(menuElements[0])).setText(openPlc); ((JMenuItem)(menuElements[0])).setText(openObject);
((JMenuItem)(menuElements[1])).setText(showCross); ((JMenuItem)(menuElements[1])).setText(openPlc);
((JMenuItem)(menuElements[2])).setText(openObject); ((JMenuItem)(menuElements[2])).setText(showCross);
((JMenuItem)(menuElements[3])).setText(changeValue); ((JMenuItem)(menuElements[3])).setText(changeValue);
((JMenuItem)(menuElements[4])).setText(debug); ((JMenuItem)(menuElements[4])).setText(debug);
} }
...@@ -1658,3 +1661,20 @@ public class XttTree extends JPanel ...@@ -1658,3 +1661,20 @@ public class XttTree extends JPanel
} }
} }
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