logo       

RE: Question about linking the DOM and the presentation: msg#00085

Subject: RE: Question about linking the DOM and the presentation
>>>>> "UK" == Uwe Knauer <knauer@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:

UK> Dear Santa (and anyone else who feels in mood to make a little
UK> computer science student very very happy)

UK> I am looking for a hint or some piece of code that helps me to
UK> understand how I can do a simple drag&drop.

UK> I use JSVGCanvas to show a generated SVG-file. Now I want to
UK> select a shape, e.g. a rectangle, and move it on the screen while
UK> updating the DOM.

UK> My first idea was simply to update the DOM, but I experienced some
UK> problems with understanding the link between DOM and GVT-tree and
UK> how the update mechanism work.  I think I can use the coordinates
UK> and check the nodes of the DOM one by one but I hope there is a
UK> more beautiful way.

    I suspect that you can do this essentially entirely from the DOM.
Just attach mouse event listeners to the DOM elements (either in Java
or in JavaScript (in script elements in the SVG document)).  Then when
your listener is called update the DOM.

    The DOM should then (for dynamic documents) automatically update
the GVT tree.  If your original document doesn't look like a dynamic
document (i.e. no script elements) you will need to tell the bridge to
make it dynamic anyways
(JSVGComponent.setDocumentState(ALWAYS_DYNAMIC)).

    You may need to go to the GVT to test if you have dragged on top
of another element (I don't think we implement that part of the SVG
DOM yet).


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe