summaryrefslogtreecommitdiffstats
path: root/web-gui/live/source/class/live
diff options
context:
space:
mode:
Diffstat (limited to 'web-gui/live/source/class/live')
-rw-r--r--web-gui/live/source/class/live/Application.js128
-rw-r--r--web-gui/live/source/class/live/test/DemoTest.js55
-rw-r--r--web-gui/live/source/class/live/theme/Appearance.js18
-rw-r--r--web-gui/live/source/class/live/theme/Color.js18
-rw-r--r--web-gui/live/source/class/live/theme/Decoration.js18
-rw-r--r--web-gui/live/source/class/live/theme/Font.js28
-rw-r--r--web-gui/live/source/class/live/theme/Theme.js21
7 files changed, 286 insertions, 0 deletions
diff --git a/web-gui/live/source/class/live/Application.js b/web-gui/live/source/class/live/Application.js
new file mode 100644
index 0000000..193e506
--- /dev/null
+++ b/web-gui/live/source/class/live/Application.js
@@ -0,0 +1,128 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#asset(live/*)
+
+************************************************************************ */
+
+/**
+ * This is the main application class of your custom application "live"
+ */
+qx.Class.define("live.Application",
+{
+extend : qx.application.Standalone,
+
+properties: {
+ online: {
+ init: false,
+ apply: "__applyOnline",
+ check: "Boolean"
+ }
+},
+
+
+/*
+*****************************************************************************
+ MEMBERS
+*****************************************************************************
+*/
+
+members :
+{
+ __rpc: null,
+ __call: null,
+ __statusImageOn: null,
+ __statusImageOff: null,
+ __statusStack: null,
+ __label: null,
+ /**
+ * This method contains the initial application code and gets called
+ * during startup of the application
+ *
+ * @lint ignoreDeprecated(alert)
+ */
+ main : function()
+ {
+ // Call super class
+ this.base(arguments);
+
+ // Enable logging in debug variant
+ if (qx.core.Variant.isSet("qx.debug", "on"))
+ {
+ // support native logging capabilities, e.g. Firebug for Firefox
+ qx.log.appender.Native;
+ // support additional cross-browser console. Press F7 to toggle visibility
+ qx.log.appender.Console;
+ }
+
+ /*
+ -------------------------------------------------------------------------
+ Below is your actual application code...
+ -------------------------------------------------------------------------
+ */
+
+ // Document is the application root
+ var doc = this.getRoot();
+ doc.setBackgroundColor("#ffffff");
+
+ var back = new qx.ui.basic.Image("live/back.png");
+ back.setScale(true);
+ doc.add(back, {left:0, top: 0});
+
+ this.__label = new qx.ui.basic.Label("The Server is");
+ doc.add(this.__label, {left:50, top: 50});
+ this.__statusStack = new qx.ui.container.Stack();
+ this.__statusStack.setAllowGrowX(false);
+ this.__statusStack.setAllowGrowY(false);
+ doc.add(this.__statusStack, {left:100, top: 100});
+ this.__statusImageOn = new qx.ui.basic.Image("live/network-online.png");
+ this.__statusStack.add(this.__statusImageOn);
+ this.__statusImageOff = new qx.ui.basic.Image("live/network-offline.png");
+ this.__statusStack.add(this.__statusImageOff);
+ this.__statusStack.setSelection([this.__statusImageOff]);
+
+ this.__rpc = new qx.io.remote.Rpc("http://localhost:8080/rpc", "com.pengutronix.jdb.Hello|/");
+
+ var timer = new qx.event.Timer(1000);
+ timer.addListener("interval", this.__tick, this);
+ timer.start();
+ },
+ __applyOnline: function(online) {
+ if (online) {
+ this.__statusStack.setSelection([this.__statusImageOn]);
+ this.__label.setValue("The Server is online.");
+ }
+ else {
+ this.__statusStack.setSelection([this.__statusImageOff]);
+ this.__label.setValue("The Server is offline.");
+ }
+ },
+ __tick : function()
+ {
+ if (this.__call != null) {
+ this.__rpc.abort(this.__call);
+ this.setOnline(false);
+ }
+ this.__call = this.__rpc.callAsync(
+ qx.lang.Function.bind(this.__callback, this),
+ "com.pengutronix.jdb.Hello.HelloWorld");
+ },
+ __callback: function(ret, err, id) {
+ this.__call = null;
+ if (err != null) {
+ this.setOnline(false);
+ return;
+ }
+ this.setOnline(true);
+ }
+}
+});
diff --git a/web-gui/live/source/class/live/test/DemoTest.js b/web-gui/live/source/class/live/test/DemoTest.js
new file mode 100644
index 0000000..0846cc7
--- /dev/null
+++ b/web-gui/live/source/class/live/test/DemoTest.js
@@ -0,0 +1,55 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/**
+ * This class demonstrates how to define unit tests for your application.
+ *
+ * Execute <code>generate.py test</code> to generate a testrunner application
+ * and open it from <tt>test/index.html</tt>
+ *
+ * The methods that contain the tests are instance methods with a
+ * <code>test</code> prefix. You can create an arbitrary number of test
+ * classes like this one. They can be organized in a regular class hierarchy,
+ * i.e. using deeper namespaces and a corresponding file structure within the
+ * <tt>test</tt> folder.
+ */
+qx.Class.define("live.test.DemoTest",
+{
+ extend : qx.dev.unit.TestCase,
+
+ members :
+ {
+ /*
+ ---------------------------------------------------------------------------
+ TESTS
+ ---------------------------------------------------------------------------
+ */
+
+ /**
+ * Here are some simple tests
+ */
+ testSimple : function()
+ {
+ this.assertEquals(4, 3+1, "This should never fail!");
+ this.assertFalse(false, "Can false be true?!");
+ },
+
+ /**
+ * Here are some more advanced tests
+ */
+ testAdvanced: function ()
+ {
+ var a = 3;
+ var b = a;
+ this.assertIdentical(a, b, "A rose by any other name is still a rose");
+ this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!");
+ }
+ }
+});
diff --git a/web-gui/live/source/class/live/theme/Appearance.js b/web-gui/live/source/class/live/theme/Appearance.js
new file mode 100644
index 0000000..0cd7600
--- /dev/null
+++ b/web-gui/live/source/class/live/theme/Appearance.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("live.theme.Appearance",
+{
+ extend : qx.theme.modern.Appearance,
+
+ appearances :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/live/source/class/live/theme/Color.js b/web-gui/live/source/class/live/theme/Color.js
new file mode 100644
index 0000000..23114cc
--- /dev/null
+++ b/web-gui/live/source/class/live/theme/Color.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("live.theme.Color",
+{
+ extend : qx.theme.modern.Color,
+
+ colors :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/live/source/class/live/theme/Decoration.js b/web-gui/live/source/class/live/theme/Decoration.js
new file mode 100644
index 0000000..602f6c9
--- /dev/null
+++ b/web-gui/live/source/class/live/theme/Decoration.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("live.theme.Decoration",
+{
+ extend : qx.theme.modern.Decoration,
+
+ decorations :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/live/source/class/live/theme/Font.js b/web-gui/live/source/class/live/theme/Font.js
new file mode 100644
index 0000000..7abc09e
--- /dev/null
+++ b/web-gui/live/source/class/live/theme/Font.js
@@ -0,0 +1,28 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("live.theme.Font",
+{
+ extend : qx.theme.modern.Font,
+
+ fonts :
+ {
+ "default" :
+ {
+ size : (qx.bom.client.System.WINVISTA || qx.bom.client.System.WIN7) ? 25 : 22,
+ lineHeight : 1.4,
+ family : qx.bom.client.Platform.MAC ? [ "Lucida Grande" ] :
+ (qx.bom.client.System.WINVISTA || qx.bom.client.System.WIN7) ?
+ [ "Segoe UI", "Candara" ] :
+ [ "Tahoma", "Liberation Sans", "Arial", "sans-serif" ],
+ bold : true
+ }
+ }
+});
diff --git a/web-gui/live/source/class/live/theme/Theme.js b/web-gui/live/source/class/live/theme/Theme.js
new file mode 100644
index 0000000..438ea30
--- /dev/null
+++ b/web-gui/live/source/class/live/theme/Theme.js
@@ -0,0 +1,21 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("live.theme.Theme",
+{
+ meta :
+ {
+ color : live.theme.Color,
+ decoration : live.theme.Decoration,
+ font : live.theme.Font,
+ icon : qx.theme.icon.Tango,
+ appearance : live.theme.Appearance
+ }
+}); \ No newline at end of file