[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [cgmo-webcgm] Re: The highlight() method
Hello, I think that the ability to apply a highlight to a single item is an important feature to have. My first thought was to overload the argument list, but that is not allowed by ecmascript (or javascript). So my thoughts turned to something along the lines of option 4. Can I either create a list on the fly or can I dereference an existing list? creation on the fly would require something like: var aps = pic.getAppStructureById("apsToHighlight"); pic.highlight(aps.makeNodeList(), true); and dereferencing the list would look something like: var list = pic.getAppStructuresByName("listToHighlight"); pic.highlight( list.items(), true ); I think that the dereference option would work because you can have a variable number of arguments in a function. Either one of these would require changes to support. I think that the first has the advantage that all the existing scripts would continue to work... I am not sure that I understand the problem of the live node view of the DOM. A kludge workaround would be to be get the object by id and then get a list of objects that share the same name. You then iterate through the list removing items that do not have the id that you want... (Ugly but can be done) I cannot speak to which version of the spec highlighting should be fixed. -- Stuart Galt SGML Resource Group stuart.a.galt@boeing.com (206) 544-3656 <--- new number! -----Original Message----- From: Benoit Bezaire [mailto:benoit@itedo.com] Sent: Friday, December 09, 2005 7:42 AM To: cgmo-webcgm@lists.oasis-open.org Subject: [cgmo-webcgm] Re: The highlight() method I haven't heard from anyone regarding this one either? Your comments would be appreciated. -- Benoit mailto:benoit@itedo.com Friday, November 25, 2005, 10:54:57 AM, you wrote: > Hi, > Itedo noticed that the highlight() method on the Picture interface > may be problematic. > The prototype is: > void highlight(in WebCGMNodeList nodes, in boolean state); > The method works for the following script: > var list = pic.getAppStructuresByName("listToHighlight"); > pic.highlight( list, true ); > however, the following code is invalid: > var aps = pic.getAppStructureById("apsToHighlight"); > pic.highlight( aps, true ); > getAppStructureById returns a WebCGMNode, not a WebCGMNodeList, doh! > Here are some options that we have: > i) leave it like this, fix in a later version (2.1) but that means > WebCGM 2.0 users will not be able to highlight a single Application > Structures. > ii) change getAppStructureById to return a WebCGMNodeList. This > however will force script writers to write: > var id = pic.getAppStructureById("myID"); > if( id.count > 0 ) > { > id.item(0). etc... > } > every time they want to access and APS by Id. > iii) have two highlight methods. One that is called highlight( > takes a WebCGMNode ) and one called highlightMany( takes a > WebCGMNodeList). It wouldn't look very good in the spec, but hey, it > would work. > iv) introduce some sort of WebCGMNode.makeList() method that > would return a WebCGMNodeList from a WebCGMNode. This approach would > need more thoughts, as it could complicate the 'live' node > implementation of our DOM. > Thoughts,
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]