?? charttest6.xml
字號:
<?xml version="1.0"?><application> <window caption="Chart Test of Serializing and Deserializing" width="800" height="600" centered="true"/> <resources> <script><![CDATA[function ChartTest6() { var win = application.getWindow(); var topComp = new BiComponent; var ta1 = new BiTextArea(); var ta2 = new BiTextArea(); var b1 = new BiButton(">>"); var xmlDoc = BiXmlLoader.load("ronchart.xml") ta1.setText( xmlDoc.xml ); var graph = BiGraph.fromXmlDocument(xmlDoc); var sp = new BiSplitPane("vertical", topComp, graph); sp.setDividerSize(5); topComp.add(ta1); topComp.add(ta2); topComp.add(b1); ta1.setLocation(0,0); ta1.setBottom(0); ta2.setTop(0); ta2.setRight(0); ta2.setBottom(0); ta2.setReadOnly(true); b1.setLocation(260, 100); b1.setWidth(30); graph.setBorder( new BiBorder(1, "solid", "black") ); graph.setBackColor("#cfe0f2"); function layoutTopComponent() { var cw = topComp.getWidth(); ta1.setWidth((cw - 40) / 2); ta2.setWidth((cw - 40) / 2); b1.setLeft((cw - 40) / 2 + 5); b1.setTop( (topComp.getHeight() - b1.getHeight()) / 2 ); BiComponent.prototype.layoutAllChildren.call(this); }; topComp.layoutAllChildren = topComp.layoutAllChildrenX = topComp.layoutAllChildrenY = layoutTopComponent; win.add(sp); sp.setLocation(5,5); sp.setBottom(5); sp.setRight(5); this.ta1 = ta1; this.ta2 = ta2; this.graph = graph; graph.update(); topComp.layoutAllChildren(); b1.addEventListener("action", this.syncXml, this);}ChartTest6.prototype.syncXml = function () { var xmlDoc = new BiXmlDocument; if (xmlDoc.loadXML( this.ta1.getText() )) { this.graph.fromXmlDocument(xmlDoc); this.graph.update(); var xmlDoc2 = this.graph.toXmlDocument(); this.ta2.setText( xmlDoc2.xml ); } else { this.ta2.setText( xmlDoc.parseError.reason ); } this.ta2.setBackColor( this.ta2.getText() == this.ta1.getText() ? "#efe" : "#fee" );};ChartTest6.main = function () { new ChartTest6; }; ]]></script> </resources></application>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -