📄 automaticdemo.js
字号:
DemoApp.AutomaticDemo = { };/** * Dialog to configure and launch an automatic demo session. */DemoApp.AutomaticDemo.StartDialog = Core.extend(Echo.WindowPane, { _intervalButtons: null, _transitionSelect: null, _transitionSelectLastId: null, _speedFast: null, _speedLudicrous: null, _orderRandom: null, _msg: null, _workspace: null, $construct: function(workspace) { this._workspace = workspace; this._msg = DemoApp.getMessages(); var groupSpeedButtons = Echo.Application.generateUid(); var groupOrderButtons = Echo.Application.generateUid(); Echo.WindowPane.call(this, { styleName: DemoApp.pref.windowStyleName, modal: true, width: "40em", height: "30em", title: this._msg["AutomaticDemo.WindowTitle"], icon: "image/Icon16Play.gif", iconInsets: "6px 10px", events: { close: Core.method(this, this._close) }, children: [ new Echo.SplitPane({ autoPositioned: true, orientation: Echo.SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, children: [ new Echo.Row({ styleName: "ControlPane", children: [ new Echo.Button({ styleName: "ControlPane.Button", text: this._msg["Generic.Start"], icon: "image/Icon24Play.gif", events: { action: Core.method(this, this._start) } }), new Echo.Button({ styleName: "ControlPane.Button", text: this._msg["Generic.Cancel"], icon: "image/Icon24No.gif", events: { action: Core.method(this, this._close) } }) ] }), new Echo.Column({ insets: "10px 30px", cellSpacing: 15, children: [ new Echo.Label({ text: this._msg["AutomaticDemo.Description"] }), new Echo.Column({ styleName: "PreferencesColumn", children: [ new Echo.Label({ styleName: "PreferencesTitle", text: this._msg["AutomaticDemo.SpeedPrompt"] }), new Echo.Row({ cellSpacing: 40, children: [ new Echo.RadioButton({ group: groupSpeedButtons, text: this._msg["AutomaticDemo.SpeedNormal"], selected: true, events: { action: Core.method(this, this._processSpeedChange) } }), this._speedFast = new Echo.RadioButton({ group: groupSpeedButtons, text: this._msg["AutomaticDemo.SpeedFast"], events: { action: Core.method(this, this._processSpeedChange) } }), this._speedLudicrous = new Echo.RadioButton({ group: groupSpeedButtons, text: this._msg["AutomaticDemo.SpeedLudicrous"], events: { action: Core.method(this, this._processSpeedChange) } }) ] }) ] }), new Echo.Column({ styleName: "PreferencesColumn", children: [ new Echo.Label({ styleName: "PreferencesTitle", text: this._msg["AutomaticDemo.OrderPrompt"] }), new Echo.Row({ cellSpacing: 40, children: [ new Echo.RadioButton({ group: groupOrderButtons, text: this._msg["AutomaticDemo.OrderSequential"], selected: true }), this._orderRandom = new Echo.RadioButton({ group: groupOrderButtons, text: this._msg["AutomaticDemo.OrderRandom"] }) ] }) ] }), new Echo.Column({ styleName: "PreferencesColumn", children: [ new Echo.Label({ styleName: "PreferencesTitle", text: this._msg["AutomaticDemo.TransitionPrompt"] }), this._transitionSelect = new Echo.SelectField({ items: [ { id: "Random", text: this._msg["AutomaticDemo.TransitionRandom"] }, { id: "Fade", text: this._msg["AutomaticDemo.TransitionFade"] }, { id: "RandomPan", text: this._msg["AutomaticDemo.TransitionRandomPan"] }, { id: "PanRight", text: this._msg["AutomaticDemo.TransitionPanRight"] }, { id: "None", text: this._msg["AutomaticDemo.TransitionNone"] } ], selectedId: DemoApp.pref.transitionsEnabled ? "Random" : "None" }) ] }) ] }) ] }) ] }); }, _processSpeedChange: function(e) { if (e.source == this._speedLudicrous) { this._transitionSelectLastId = this._transitionSelect.get("selectedId"); this._transitionSelect.set("selectedId", "None"); this._transitionSelect.setEnabled(false); } else { if (!this._transitionSelect.isEnabled()) { this._transitionSelect.set("selectedId", this._transitionSelectLastId); this._transitionSelect.setEnabled(true); } } }, _start: function(e) { var interval = this._speedLudicrous.get("selected") ? 1 : (this._speedFast.get("selected") ? 1500 : 4500); this._workspace.startAutomaticDemo(false, interval, !!this._speedLudicrous.get("selected"), this._transitionSelect.get("selectedId")); this.parent.remove(this); }, _close: function(e) { this.parent.remove(this); }});DemoApp.AutomaticDemo.StopDialog = Core.extend(Echo.WindowPane, { _msg: null, $construct: function(performanceTest, showFps) { this._msg = DemoApp.getMessages(); Echo.WindowPane.call(this, { modal: true, styleName: "GlassBlue2", title: this._msg[performanceTest ? "PerformanceTest.WindowTitle" : "AutomaticDemo.RunWindowTitle"], icon: performanceTest ? "image/Icon16Performance.gif" : "image/Icon16Play.gif", iconInsets: "6px 10px", closable: false, resizable: false, movable: false, positionX: "100%", positionY: "100%", height: "8em", width: "20em" }); if (showFps) { this.add(new Echo.SplitPane({ orienation: Echo.SplitPane.ORIENTATION_HORIZONTAL_LEFT_RIGHT, separatorPosition: "40%", resizable: false, separatorWidth: 1, separatorColor: "#000000", children: [ new Echo.Column({ foreground: "#ffffff", layoutData: { backgroundImage: { url: "image/FpsBackground.png", y: "50%" } }, children: [ this.fpsLabel = new Echo.Label({ layoutData: { alignment: "center" }, font: { size: 22 }, text: "-.-" }), new Echo.Label({ layoutData: { alignment: "center" }, font: { size: 8 }, text: this._msg["AutomaticDemo.Fps"] }) ] }), new Echo.Button({ layoutData: { backgroundImage: { url: "image/StopBackground.png", y: "50%" } }, foreground: "#ffffef", font: { size: 30 }, insets: 5, alignment: { horizontal: "center", vertical: "middle" }, text: this._msg["AutomaticDemo.StopMessage"], events: { action: Core.method(this, this._stop) } }) ] })); } else { this.add(new Echo.ContentPane({ overflow: Echo.ContentPane.OVERFLOW_HIDDEN, backgroundImage: { url: "image/StopBackground.png", y: "50%" }, children: [ new Echo.Button({ foreground: "#ffffef", font: { size: 30 }, insets: 5, alignment: { horizontal: "center",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -