You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Praveen Nayak <Pr...@telelogic.com> on 2007/12/31 03:00:01 UTC

Rotate entire document

Hi,

 

I have an image in SVG and I use Batik to display that. The user can
Ctrl + Right Click Drag to rotate the entire image. Is there some way I
can reset this rotation to 0 degrees using JavaScript code?


Thanks,

Praveen 
--------------------------------------------------------------------------------
Telelogic Lifecycle Solutions:
Helping You Define, Design & Deliver Advanced Systems & Software 
Learn More at www.telelogic.com 

Praveen Nayak 
Technical Leader 
Telelogic India Pvt Ltd 
#58, 1- 4 HM Towers,
Brigade Road, 
560 025 Bangalore 
India 

Phone: +91 (80) 419 95800 x327 
Fax: 
Mobile phone: 
Praveen.Nayak@telelogic.com 
http://www.telelogic.com 

Telelogic - Requirements-Driven Innovation!
------------------------------------------------------------- 


The information contained in this e-mail, including any attachment or enclosure, is intended only for the person or entity to which it is addressed and may contain confidential material. Any unauthorized use, review, retransmissions, dissemination, copying or other use of this information by persons or entities other than the intended recipient is prohibited.

Re: Rotate entire document

Posted by Cameron McCormack <ca...@mcc.id.au>.
Praveen Nayak:
> I tried
> svgdoc.documentElement.currentRotate = 0;
> 
> but I get the following error:
> 
> Java class "org.apache.batik.dom.svg.SVGOMSVGElement" has no public instance field or method named "currentRotate"

Ah, sorry, that’s in SVG Tiny 1.2, not 1.1.

You’ll have to get the screen transform with
SVGOMElement.getSVGContext().getScreenTransform(), do the matrix
manipulation yourself, then use setScreenTransform().

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Rotate entire document

Posted by Praveen Nayak <Pr...@telelogic.com>.
Hi Cameron,

I tried
svgdoc.documentElement.currentRotate = 0;

but I get the following error:

Java class "org.apache.batik.dom.svg.SVGOMSVGElement" has no public instance field or method named "currentRotate"

Should I be trying something else?

Thanks,
Praveen

-----Original Message-----
From: Cameron McCormack [mailto:cam@mcc.id.au] 
Sent: Monday, December 31, 2007 8:01 AM
To: batik-users@xmlgraphics.apache.org
Subject: Re: Rotate entire document

Hi Praveen.

Praveen Nayak:
> I have an image in SVG and I use Batik to display that. The user can
> Ctrl + Right Click Drag to rotate the entire image. Is there some way I
> can reset this rotation to 0 degrees using JavaScript code?

Yes, just assign 0 to document.documentElement.currentRotate.

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org 
--------------------------------------------------------------------------------
Telelogic Lifecycle Solutions:
Helping You Define, Design & Deliver Advanced Systems & Software 
Learn More at www.telelogic.com 

Praveen Nayak 
Technical Leader 
Telelogic India Pvt Ltd 
#58, 1- 4 HM Towers,
Brigade Road, 
560 025 Bangalore 
India 

Phone: +91 (80) 419 95800 x327 
Fax: 
Mobile phone: 
Praveen.Nayak@telelogic.com 
http://www.telelogic.com 

Telelogic - Requirements-Driven Innovation!
------------------------------------------------------------- 


The information contained in this e-mail, including any attachment or enclosure, is intended only for the person or entity to which it is addressed and may contain confidential material. Any unauthorized use, review, retransmissions, dissemination, copying or other use of this information by persons or entities other than the intended recipient is prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Rotate entire document

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Praveen.

Praveen Nayak:
> I have an image in SVG and I use Batik to display that. The user can
> Ctrl + Right Click Drag to rotate the entire image. Is there some way I
> can reset this rotation to 0 degrees using JavaScript code?

Yes, just assign 0 to document.documentElement.currentRotate.

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org