[svg-developers] Re: XForms in standalone SVG

2005-06-08 Thread Richard D. Spencer

Isn't it just as effective to build JS objects to manage the SVG-DOM  
nodes (their properties, any animation and any other needed 
functionally)?  This gives us the freedom of not being locked into 
XHTML and still allows us to provide a dynamic UI - to truely become 
a one-page web application within the browser.  I assume that a JS 
manager object could also interface with XFORMS; haven't attempted 
this yet.  Using JS allows us to use any browser that supports XML, 
SVG, XFORMS, XBL, etc


If I'm missing something important in my approach, please let me know 
as I'm already well into the project I'm working on concerning RAD 
for SVG.

Dave


--- In svg-developers@yahoogroups.com, "Mark Birbeck" 
<[EMAIL PROTECTED]> wrote:
> Hi Steve,
> 
> Although I've said this before, I believe that architecting *first 
and
> foremost* in SVG is not sustainable. I know that people will reply 
by saying
> that they have successfully created applications that have hundreds 
of
> thousands of lines of SVG, but it seems to me that the 'mountain 
bike demo'
> discussion a week or so ago made it plain that--despite the 
incredibly
> impressive results--for most developers and projects this approach 
is not an
> option.
> 
> I'll describe the architecture I am working towards, and then 
follow with an
> example that adds dynamic SVG buttons to an existing application by
> 'skinning' it, rather than changing the application. The SVG 
buttons will:
> 
>  * use filters to give a rounded effect;
>  * obtain their captions from the XForms engine, and be updated if
>the data changes;
>  * use the applications's CSS to obtain colours which will be used 
for the
>captions and the background;
>  * use SMIL to 'fly' the button's label in, but use *CSS* 
properties to
>determine *when* to fly the text.
> 
> This last point is I believe a very important development, in that 
we are
> not binding to specific events like mouse-over, but to CSS clasees. 
In other
> words, the functionality in the SVG button is *truly* independent,
> encapsulated and re-usable.
> 
> 
> ARCHITECTURE
> The archtitecture I would recommend to you is one in which the 
foundation of
> an application is an XHTML document. For now that's XHTML 1.1, but 
soon it
> will be XHTML 2. This foundation provides us with a simple 
framework into
> which we can put metadata about the document, links to stylesheets, 
and so
> on.
> 
> Once we have a basic document, what goes inside it depends on what 
you are
> trying to do, but in general I would say that we want it to be as 
abstract
> as possible. We want to specify *what* we want to do, not how it 
will be
> done. If we want to collect an integer from a user, we just use the 
XForms
> input control, and bind it to a node of type xsd:integer. If we 
want to show
> an error message we should use the XForms message element. And so 
on.
> 
> What we *don't* want to do--at this level at least--is start 
defining our
> application in terms of scripts that are non-portable, and don't 
capture the
> *intent* of our application.
> 
> Although we have enabled our Sidewinder Viewer to cope with XForms, 
SVG,
> XHTML and MathML, I would suggest that of these, SVG is not 
an 'abstract'
> language but a rendering one. MathML is abstract, as is XForms, 
whilst XHTML
> has a foot in both camps!
> 
> 
> SKINNING
> So where does SVG come in? Well, once we have created our 
application at an
> abstract level--step 1 enter a number, step 2 request a customer, 
step 3
> allocate the invoice, and so on--we are then ready to 'skin' it, 
and present
> it to our users. Ideal for this is XBL, and inside XBL modules is 
where we
> should put our SVG, VoiceXML, X3D or whatever rendering language we 
care to
> use. We can keep it hidden, and keep it manageable. We can share 
objects,
> replace them with others, or even let the user choose to 'skin' our
> application in a different way to the one that we intended.
> 
> 
> AN EXAMPLE
> If you have looked at our Sidewinder Viewer (available at
> ) you 
might have
> seen that the latest version comes with a full-featured application 
that
> interacts with Google Desktop Search (GDS). The application is 
built using
> standard XForms techniques, with a few clever bits to make 
configuration
> easy. The UI is pretty 'traditional' but on the XForms Wiki we have 
an
> example that shows how to add an SVG widget to replace the normal 
buttons.
> See:
> 
>   
> 
> This topic has all the files needed to add animated buttons to the 
Google
> Search application, and takes you step-by-step through what is 
needed. There
> is also a small Flash video if you just want to see the results.
> 
> 
> CONCLUSION
> Note that the only changes needed to the actual application are a 
link in
> the header to indicate what binding rules should be used; the 
actual code to
> achieve the 'anima

[svg-developers] modify firefox context menu with Javascript?

2005-05-04 Thread Richard D. Spencer

Can anyone show me how to modify FireFox's context menu using 
Javascript as can be done in Adobe SVG Viewer?

Dave





-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[svg-developers] Re: firefox problem

2005-05-04 Thread Richard D. Spencer

That works!  I thought that including the namespace in the root svg 
was enough: I was wrong.

Thanks,
Dave



--- In svg-developers@yahoogroups.com, "Martin Honnen" 
<[EMAIL PROTECTED]> wrote:
> --- In svg-developers@yahoogroups.com, "Richard D. Spencer"
> <[EMAIL PROTECTED]> wrote:
> 
> > 2.  various declared svg files are loaded.  Here is the first:
> > 
> > 
> >> transform="matrix(1,0,0,1,0,0)" fill-opacity="0.4" >
> >  > stroke="black" stroke-width="2" fill="lightblue" />
> >   
> > 
> > 
> > responseText is an exact replication of the original file.
> 
> But in that sample the namespace declaration is indeed missing, you
> need to have
>   http://www.w3.org/2000/svg"; id="universalContainer">
> ...
>   
> to allow the XML parser to recognize the elements as SVG elements 
and
> not simply as arbitrary XML elements.




-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[svg-developers] Re: Problems getting JavaScirpt working

2005-05-04 Thread Richard D. Spencer

Is this the problem?

http://www.mozilla.org/projects/svg/faq.html#source


Dave


--- In svg-developers@yahoogroups.com, "bacchus119" <[EMAIL PROTECTED]> 
wrote:
> Hey there,
> 
> I've been building web sites for going on 6 years now and just 
> recently discovered SVG graphics.  So, I decided to learn them to 
> see what they really can do.   I need some basic help, and I 
figured 
> that this was a good place to go.  
> 
> I'm going through the book SVG Programming-The Graphical Web, and 
am 
> running through the examples and discovered that when I try to 
serve 
> what I wrote through a web server (either apache or IIS), the pages 
> do not work correctly, but when I open the directly in an IE 
browser 
> off of the file system, they work fine.
> 
> The end of this post has sample files of what I'm doing.  The files 
> are simple enough.  The html page takes polygon parameters (number 
o 
> sides, length of each side, etc.) and draws the corresponding 
> polygon (I'm explore the interaction between HTML form fields and 
an 
> SVG image through JavaScript).  
> 
> IF you create both files and put them in one directory, then open 
> GeneratePolygon.html directly in IE, it works just fine.  If you 
try 
> to server both files from a Web server, the JavaScript doesn't work 
> at all.  
> 
> I'm curious as to what I'm missing.
> 
> Thanks in advance for your help.
> 
> -- Rick P. 
> 
> 
> - Begin GeneratePolygon.html ---
> 
> 
> 
>  Polygon Generator 
>  //   function passBackSVG(){ 
>   var embedNodes=document.embeds;
>   var i;
>   for (i=0;i   embedNode=embedNodes[i];
>   if (embedNode.window.passState){
>   embedNode.window.passState
> (embedNode);
>   }
>   }
>   }
> //]]
> 
> 
> 
> 
>  Polygon Generator
> 
>   
>   Polygon or Path 
>
>selected>polygon
>Path
>   
>   
>   
>   
>   number of Sides 
>
>   
>   
>   Radius 
>
>   
>   
>   Angular Offset 
> value="0">
>   
>   
>   Center X 
>
>   
>   
>   Center Y 
>
>   
>   
>    
>   
>   
>   
>   
>   
>
> onclick="setColor(color.value)"/>
>   
>
> 
>  
> 
>   function getRegularPolygon (n, r, angleOffset, cw, cy, 
> sColor) {
>   var polyBuf="";
>   polyTypeNode=document.all("polytype");
>   elementType=polyTypeNode.options.item
> (polyTypeNode.options.selectedIndex).id;
>   for (var i=0; i   var angle=(2*3.1415927*i/n) + 
> (angleOffset/180)*3.1415927;
>   var x=parseFloat(cy) + Math.floor(parseFloat
> (r) * Math.sin(angle));
>   var y=parseFloat(cy) + Math.floor(parseFloat
> (r) * Math.cos(angle));
>   if (elementType=="path") {
>   if (i==0) {
>   polyBuf="m";
>   }
>   else {
>   polyBuf += "L";
>   }
>   }
>   polyBuf += x+"," + y + " ";
>   }
>   if (elementType=="polygon"){
>   buf = '<polygon points="' + polyBuf + '" 
> fill="red" stroke="black" stroke-width="6"/>';
>   }
>   else {
>   buf = '<path points="' + polyBuf + '" 
> fill="red" stroke="black" stroke-width="6"/>';
>   }
>   buffer.innerHTML=buf;
>   var shape=window.display_polygon;
>   shape.setPoints(polyBuf, sColor);
>   return buf;
>   }
>   function setColor (sColor) {
>   var shape=window.display_polygon;
>   shape.changeColor(sColor);
>   }
> 
>wmode="transparent" points="50,0 97,35 79,91 20,91 2,35"
>   id="display_polygon"
>   style="position:absolute;to:200;left:0"/>
> 
> 
> 
> - End GeneratePolygon.html ---
> 
> - Begin Polygon.svg ---
> http://www.w3.org/2000/svg";
>   xmlns:xlink="http://www.w3.org/1999/xlink";
>   width="500"
>   height="500"
>   viewbox="0 0 1000 1000"
>   perserveAspectRatio="none"
>   onload="initSVG(evt)">
>type="text/javascript">// 
>   var svg=null;
>   function initSVG(evt){
>   svg=evt.target.ownerDocument;
>   }
>   
>   function passState(extObject){
>   ext

[svg-developers] Re: firefox problem

2005-05-03 Thread Richard D. Spencer


1.  the namespace is correct.

2.  various declared svg files are loaded.  Here is the first:


  

  


responseText is an exact replication of the original file.

Thanks for your time,
Dave



--- In svg-developers@yahoogroups.com, "Martin Honnen" 
<[EMAIL PROTECTED]> wrote:
> --- In svg-developers@yahoogroups.com, "Richard D. Spencer"
> <[EMAIL PROTECTED]> wrote:
> > I'm trying to get my svg project working in FireFox.
> > 
> > 
> > 1.  Using
> > 
> >  libUrl.getURL(sFilePath, function(resp){code...} and
> >  var oSvgDocFrag = libXml.parseXML(resp.responseText);
> >  var oDocFrag = libXml.importNode(oSvgDocFrag.firstChild, true);
> >  
> > from "JavaScript O Lait" library (great semi-OOP).
> > 
> > resp.responseText is the same (and correct)in both IE+Adobe6 and 
> > FireFox
> 
> How does that responseText look then? Make sure you have your SVG
> elements in the proper namespace e.g.
>   http://www.w3.org/2000/svg";>
> or
>   http://www.w3.org/2000/svg";>
> otherwise Mozilla can't recognize them during parsing as SVG 
elements.





-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[svg-developers] firefox problem

2005-05-03 Thread Richard D. Spencer
I'm trying to get my svg project working in FireFox.


1.  Using

 libUrl.getURL(sFilePath, function(resp){code...} and
 var oSvgDocFrag = libXml.parseXML(resp.responseText);
 var oDocFrag = libXml.importNode(oSvgDocFrag.firstChild, true);
 
from "JavaScript O Lait" library (great semi-OOP).

resp.responseText is the same (and correct)in both IE+Adobe6 and 
FireFox


2.  Here are the differences (because XMLHttpRequest() is used for 
mozilla):

IE+Adobe6:
oSvgDocFrag = [object Document]
oDocFrag = [object SVGSVGElement]

FireFox:
oSvgDocFrag = [object XMLDocument]
oDocFrag = [object Element]


3. the problem in FireFox (OK in IE) is:

oNewParentNode.appendChild(oDocFrag);
var oNodeTarget = oNewParentNode.lastChild;

but oNodeTarget = undefined, so oNewParentNode.appendChild(oDocFrag)
didn't work.


4.  Questions:

Do I have to change [object XMLDocument] to [object Document] and
[object Element] to [object SVGSVGElement] to get it to work 
correctly in FireFox?

Can someone point me in the right direction to get this solved?

Thanks,
Dave






-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[svg-developers] Problem with context menu

2005-02-15 Thread Richard D. Spencer


This is the problem:

When a parent element's attrbuteNS value is represented in the 
context menu  and is toggled using the context menu, then all its 
children with same attributeNS have their "checked" value  changed to 
match the parent.  The same happens to the parent if a child 
attributeNS is toggled.

This may be standard behavior but it is not what I want: I need the 
parent and the children to be independant and maintain their own 
attributesNS state and have this state correctly displayed in the 
context menu.

Is there a simple way to do limit the item value change to just that 
item?

Thanks,
Dave





-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[svg-developers] Re: How to detect a right-button mouse press in Adobe viewer 6?

2005-02-07 Thread Richard D. Spencer




Thanks, Michel.  Works great!


Dave


--- In svg-developers@yahoogroups.com, "pilatfr" <[EMAIL PROTECTED]> wrote:
> 
> --- In svg-developers@yahoogroups.com, "Richard D. Spencer" 
> <[EMAIL PROTECTED]> wrote:
> 
> Use evt.button
> return 0 for left, 1 for central or wheel, 2 for right button
> 
> Michel
> 
> > I have all script to handle mouse events but I need to be able to 
> > detect when a mouse event is a right-button down event so I can 
> > handle dynamic context menu changes properly.
> > 
> > Cab anyone help?
> > 
> > Dave





-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[svg-developers] How to detect a right-button mouse press in Adobe viewer 6?

2005-02-07 Thread Richard D. Spencer




I have all script to handle mouse events but I need to be able to 
detect when a mouse event is a right-button down event so I can 
handle dynamic context menu changes properly.

Cab anyone help?

Dave






-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/