Revision: 2941
Author: seba.wagner
Date: Sun Feb 14 02:06:52 2010
Log: Update LPS
http://code.google.com/p/openmeetings/source/detail?r=2941
Added:
/trunk/singlewebapp/WebContent/lps/components/charts/addon/library.lzx
/trunk/singlewebapp/WebContent/lps/components/charts/addon/slider/slider.lzx
/trunk/singlewebapp/WebContent/lps/components/charts/addon/zoomarea.lzx
=======================================
--- /dev/null
+++ /trunk/singlewebapp/WebContent/lps/components/charts/addon/library.lzx
Sun Feb 14 02:06:52 2010
@@ -0,0 +1,14 @@
+<!---
+ @access public
+ @topic Components
+ @subtopic Charts
+ -->
+<library>
+ <include href="zoomarea.lzx" />
+ <include href="slider/slider.lzx" />
+</library>
+<!-- * X_LZ_COPYRIGHT_BEGIN
***************************************************
+* Copyright 2005-2008 Laszlo Systems, Inc. All Rights
Reserved. *
+* Use is subject to license
terms. *
+* X_LZ_COPYRIGHT_END
****************************************************** -->
+<!-- @LZX_VERSION@
-->
=======================================
--- /dev/null
+++
/trunk/singlewebapp/WebContent/lps/components/charts/addon/slider/slider.lzx
Sun Feb 14 02:06:52 2010
@@ -0,0 +1,186 @@
+<!-- slider is not part of the laszlo charting component. It is here to
serve as an example only -->
+<library>
+ <include href="extensions/drawview.lzx"/>
+ <resource name="slider_background" src="images/slider_background.swf"/>
+ <resource name="slider_l" src="images/slider_l.swf"/>
+ <resource name="slider_m" src="images/slider_m.swf"/>
+ <resource name="slider_r" src="images/slider_r.swf"/>
+ <resource name="slider_back_lc" src="images/slider_back_lc.swf"/>
+ <resource name="slider_back_m" src="images/slider_back_m.swf"/>
+ <resource name="slider_back_rc" src="images/slider_back_rc.swf"/>
+
+ <!--- @keyword private -->
+ <class name="ticks" width="100%" height="10" extends="drawview">
+ <attribute name="numticks" value="2"/>
+ <handler name="oninit">
+ <![CDATA[
+ var spacing = this.width / (numticks - 1);
+
+ for(var i = 0; i < this.numticks; i++)
+ {
+ var xlocation = spacing * i;
+ this.beginPath();
+ this.moveTo(xlocation, 0);
+ this.lineTo(xlocation, 10);
+ this.lineWidth = 1;
+ this.strokeStyle = 0x0000ff;
+ this.stroke();
+ }
+
+ ]]>
+ </handler>
+ </class>
+
+ <resource name="slider_arrow">
+ <frame src="images/slider_arrow_n.swf"/>
+ <frame src="images/slider_arrow_r.swf"/>
+ <frame src="images/slider_arrow_s.swf"/>
+ </resource>
+
+ <script>
+ <![CDATA[
+ function limit(min, max, value)
+ {
+ if (value > max) return max;
+ if (value < min) return min;
+ return value;
+
+ }
+ ]]>
+ </script>
+
+ <!--- @keyword private -->
+ <class name="xdragstate" extends="state">
+ <attribute name="xdoffset" value="this.getMouse( 'x' )"
when="once" />
+ <attribute name="x"
+ value="${limit(minx, maxx,
+ this.immediateparent.getMouse( 'x' ) -
this.xdoffset)}" />
+ </class>
+
+ <!--- @keyword private -->
+ <class name="sliderknob" y="-4" width="1" height="1">
+ <attribute name="minx" value="0"/>
+ <attribute name="maxy" value="100"/>
+ <attribute name="isMouseDown" value="false"/>
+
+ <xdragstate name="dragger" />
+ <basebutton align="center" resource="slider_arrow">
+ <handler name="onmousedown">
+ parent.setAttribute("isMouseDown", true);
+ parent.dragger.setAttribute('applied', true);
+ classroot.bringToFront();
+
+ </handler>
+ <handler name="onmouseup">
+ parent.setAttribute("isMouseDown", false);
+ parent.dragger.setAttribute('applied', false);
+
+ </handler>
+ </basebutton>
+ </class>
+
+ <!--- @keyword private -->
+ <class name="custombaseslider">
+ <attribute name="width" value="100"/>
+ <attribute name="minlimit" value="0"/>
+ <attribute name="maxlimit" value="100"/>
+ <attribute name="valueratio" value="(this.maxlimit -
this.minlimit) / this.width" when="always"/>
+ <attribute name="startlabel" value="this.minlimit" when="once"/>
+ <attribute name="endlabel" value="this.maxlimit" when="once"/>
+ <attribute name="majordivision" value="2"/>
+ <attribute name="minordivision" value="5"/>
+
+
+ <view name="track" x="-3" y="-1" width="${parent.width + 6}">
+ <stableborderlayout axis="x"/>
+ <view resource="slider_back_lc"/>
+ <view resource="slider_back_m" stretches="width"/>
+ <view resource="slider_back_rc"/>
+ </view>
+
+
+ <ticks y="7" numticks="3" height="9" width="${parent.width}"
visible="false"/>
+
+
+ <view name="labels" width="100%" y="20" fgcolor="0x666666">
+ <text name="label1" fgcolor="0x666666"
text="${parent.parent.startlabel.toString()}" align="left" resize="true"
visible="true"/>
+ <text name="label2" fgcolor="0x666666"
text="${parent.parent.endlabel.toString()}" align="right" resize="true"
visible="true"/>
+ </view>
+ </class>
+ <!--- @keyword private -->
+ <class name="simpleslider" extends="custombaseslider">
+ <attribute name="value" value="this.minlimit + this.knob.x *
this.valueratio" when="always"/>
+
+ <view x="-3" width="${parent.knob.x + 6}">
+ <stableborderlayout axis="x"/>
+ <view resource="slider_l"/>
+ <view resource="slider_m" stretches="width"/>
+ <view resource="slider_r"/>
+ </view>
+
+ <sliderknob name="knob" x="$once{parent.track.x + parent.width /
2}">
+ <attribute name="minx" value="0"/>
+ <attribute name="maxx" value="$once{parent.width}"/>
+ </sliderknob>
+
+ </class>
+ <!--- @keyword private -->
+ <class name="rangeslider" extends="custombaseslider">
+ <attribute name="minvalue" value="this.minlimit + this.leftknob.x
* this.valueratio" when="always"/>
+ <attribute name="maxvalue" value="this.minlimit + this.rightknob.x
* this.valueratio" when="always"/>
+ <attribute name="isMouseDown" value="false"/>
+ <view x="${parent.leftknob.x - 3}"
width="${parent.rightknob.x-parent.leftknob.x+6}">
+ <stableborderlayout axis="x"/>
+ <view resource="slider_l"/>
+ <view resource="slider_m" stretches="width"/>
+ <view resource="slider_r"/>
+ </view>
+
+ <sliderknob name="leftknob" x="0">
+ <attribute name="minx" value="0"/>
+ <attribute name="maxx" value="${parent.rightknob.x}"/>
+
+ </sliderknob>
+
+ <sliderknob name="rightknob" x="$once{parent.width}">
+ <attribute name="minx" value="${parent.leftknob.x}"/>
+ <attribute name="maxx" value="$once{parent.width}"/>
+
+ </sliderknob>
+ <handler name="onisMousedown" reference="leftknob">
+ Debug.write("set left");
+ this.setAttribute("isMouseDown", leftknob.isMouseDown);
+ </handler>
+
+ <handler name="onisMousedown" reference="rightknob">
+ Debug.write("set right");
+ this.setAttribute("isMouseDown", rightknob.isMouseDown);
+ </handler>
+
+ <handler name="onmaxlimit">
+ Debug.write("*************slider width: " + this.width);
+ leftknob.setAttribute('x', 0);
+ rightknob.setAttribute('x', this.width);
+ </handler>
+
+ <method name="setMinValue" args="minvalue">
+ <![CDATA[
+ var temp = (minvalue - this.minlimit);
+ if(temp < 0) temp = 0;
+ this.leftknob.setAttribute('x', temp / this.valueratio);
+ ]]>
+ </method>
+
+ <method name="setMaxValue" args="maxvalue">
+ var temp = (maxvalue - this.minlimit);
+
+ this.rightknob.setAttribute('x', temp / this.valueratio);
+ </method>
+
+ </class>
+</library>
+<!-- * X_LZ_COPYRIGHT_BEGIN
***************************************************
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
+* Use is subject to license terms.
+* X_LZ_COPYRIGHT_END
****************************************************** -->
+<!--
@LZX_VERSION@ -->
=======================================
--- /dev/null
+++ /trunk/singlewebapp/WebContent/lps/components/charts/addon/zoomarea.lzx
Sun Feb 14 02:06:52 2010
@@ -0,0 +1,175 @@
+<!---
+ @access public
+ @topic Components
+ @subtopic Charts
+ -->
+<library>
+ <!--- An abstract class that provide basic zooming ability.
+ Allow subclasses to modify the look and feel
+ and action to be taken
+ @access public
+ -->
+ <class name="basezoomarea" visible="false">
+ <!--- the chart instance -->
+ <attribute name="chart" type="expression"/>
+ <!--- @keyword private -->
+ <attribute name="plotarea" type="expression"/>
+ <!--- user is selecting or not -->
+ <attribute name="selecting" type="boolean" value="false"/>
+ <!--- @keyword private -->
+ <attribute name="startx" type="number"/>
+ <!--- @keyword private -->
+ <attribute name="starty" type="number"/>
+ <!--- @keyword private -->
+ <attribute name="endx" type="number"/>
+ <!--- @keyword private -->
+ <attribute name="endy" type="number"/>
+ <!--- enable zoom area -->
+ <attribute name="enabled" type="boolean" value="true"/>
+ <!--- zoom animation duration -->
+ <attribute name="duration" type="number" value="500"/>
+ <!--- @keyword private -->
+ <attribute name="selectionDel"/>
+
+ <!--- @keyword private -->
+ <method name="init">
+ <![CDATA[
+ super.init();
+ if(this["chart"] == null)
+ {
+ this["chart"] = parent;
+ }
+ var del = new LzDelegate(this, "setup");
+ del.register(this.chart, 'oninitdone');
+ ]]>
+ </method>
+
+ <!--- @keyword private -->
+ <method name="setup">
+ <![CDATA[
+ this.plotarea = this.chart.plotarea;
+ var del = new LzDelegate(this, 'plotmousedown');
+ del.register(this.chart.plotarea, 'onmousedown');
+ ]]>
+ </method>
+
+
+
+ <!--- @keyword private -->
+ <method name="plotmousedown">
+ <![CDATA[
+
+ if(!this.enabled)
+ {
+ return;
+ }
+
+ if(!parent.containsPt(plotarea.getMouse("x"),
plotarea.getMouse("y")))
+ {
+ return;
+ }
+
+ this.setAttribute('x', parent.getMouse("x"));
+ this.setAttribute('y', parent.getMouse("y"));
+ this.setAttribute('width', 0);
+ this.setAttribute('height', 0);
+ this.setAttribute('visible', true);
+
+ if(!this["selectionDel"])
+ {
+ this.selectionDel = new LzDelegate(this, 'adjustSize');
+ }
+ this.selectionDel.unregisterAll();
+ this.selectionDel.register(lz.Idle, 'onidle');
+ this.setAttribute("selecting", true);
+ ]]>
+ </method>
+
+ <!--- @private keyword
+ start finish selection
+ -->
+ <handler name="onmouseup" reference="lz.GlobalMouse" args="who">
+ <![CDATA[
+ if(!this.selecting) return;
+
+ this.selectionDel.unregisterAll();
+ this.setAttribute('visible', false);
+
+ if(this.width < 2) return;
+ if(this.height < 2) return;
+ this.setAttribute("startx", plotarea.getMouse("x") -
this.width);
+ this.setAttribute("starty", plotarea.getMouse("y") -
this.height);
+ this.setAttribute("endx", this.startx + this.width);
+ this.setAttribute("endy", this.starty + this.height);
+ this.setAttribute("selecting", false);
+
+
+
+ Debug.write("startx: " + startx);
+ Debug.write("starty: " + starty);
+ Debug.write("endx: " + endx);
+ Debug.write("endy: " + endy);
+
+ var virtualStartX = plotarea.toVirtualX(startx);
+ var virtualStartY = plotarea.toVirtualY(starty);
+ var virtualEndX = plotarea.toVirtualX(endx);
+ var virtualEndY = plotarea.toVirtualY(endy);
+
+ //Debug.write("startx: " + virtualStartX );
+ //Debug.write("starty: " + virtualStartY);
+ //Debug.write("endx: " + virtualEndX);
+ //Debug.write("endy: " + virtualEndY);
+ this.select(virtualStartX, virtualEndY, virtualEndX,
virtualStartY, this.duration, true);
+
+ ]]>
+ </handler>
+
+ <!--- @keyword private -->
+ <method name="adjustSize">
+ <![CDATA[
+ var newWidth = parent.getMouse("x") - this.x;
+ var newHeight = parent.getMouse("y") - this.y;
+ if (newWidth <= 0)
+ {
+ newWidth = 1;
+ }
+ if (newHeight <= 0)
+ {
+ newHeight = 1;
+ }
+ this.setAttribute('height', newHeight);
+ this.setAttribute('width', newWidth);
+ ]]>
+ </method>
+
+ <!--- abstract method that allow subclasses to provide custom
action after selection
+ @param Number minx: min x of the zooomarea
+ @param Number miny: min y of the zooomarea
+ @param Number maxx: max y of the zooomarea
+ @param Number maxy: max y of the zooomarea
+ -->
+ <method name="select" args="minx, miny, maxx, maxy">
+ </method>
+ <view/>
+ </class>
+
+ <!--- chart zoom area -->
+ <class name="zoomarea" extends="basezoomarea" bgcolor="blue"
opacity="0.4">
+ <doc>
+ <text>
+ <warning>This component is of Beta quality and is subject to
change.</warning>
+ </text>
+ </doc>
+ <!--- change the chart to the virtual boundary
+ @param Number minx: min x of the zooomarea
+ @param Number miny: min y of the zooomarea
+ @param Number maxx: max y of the zooomarea
+ @param Number maxy: max y of the zooomarea
+ -->
+ <method name="select" args="minx, miny, maxx, maxy">
+ chart.changeBound(minx, miny, maxx, maxy, this.duration, true);
+ </method>
+ </class>
+</library>
+<!-- Copyright 2008 Laszlo Systems, Inc. All Rights Reserved. Use is
subject to license terms. -->
+
--
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en.