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 Mark Claassen <mc...@ocie.net> on 2006/12/01 20:03:37 UTC
Batik 1.6 and JSVGScrollPane
Back in the day I modified some things in Batik 1.5 to get scrolling to work
the way I wanted it to. I am looking into this again, and I see that the
JSVGScrollPane has been added. Great!
I am porting my code to use this new feature and am having a bit of trouble.
Right now, my main stumbling block is that the document always comes up
fitting the window that it is in. This is not the behavior I want. I want
it to come up at the size specified in the svg document.
I think most of the other zoom controls I have (fit width / fit to page)
will work once I have a consistent initial size.
Thanks,
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: Batik 1.6 and JSVGScrollPane
Posted by th...@kodak.com.
Hi Mark,
Mark Claassen <mc...@ocie.net> wrote on 12/01/2006 04:06:00 PM:
> I have found a way that seems to work. Any comments?...
This is the correct way the modify the initial fitting
of the document to the window. You don't need to check
if the svgElt is the root element IIRC it always will be.
> canvas = new JSVGCanvas() {
> protected AffineTransform calculateViewingTransform(String
> fragIdent, SVGSVGElement svgElt) {
> AffineTransform rval;
> if (svgElt == canvas.getSVGDocument().getRootElement()) {
> Dimension2D d2 = canvas.getSVGDocumentSize();
> Dimension d = new
> Dimension((int)d2.getWidth(),(int)d2.getHeight());
> if (d.width < 1) d.width = 1;
> if (d.height < 1) d.height = 1;
> rval = ViewBox.getViewTransform(fragIdent, svgElt,
> d.width, d.height);
> }
> else
> rval = super.calculateViewingTransform(fragIdent,
> svgElt);
> return rval;
> }
> };
>
>
> -----Original Message-----
> From: Mark Claassen [mailto:mclaassen@ocie.net]
> Sent: Friday, December 01, 2006 2:04 PM
> To: batik-users@xmlgraphics.apache.org
> Subject: Batik 1.6 and JSVGScrollPane
>
> Back in the day I modified some things in Batik 1.5 to get scrolling to
work
> the way I wanted it to. I am looking into this again, and I see that
the
> JSVGScrollPane has been added. Great!
>
> I am porting my code to use this new feature and am having a bit of
trouble.
> Right now, my main stumbling block is that the document always comes up
> fitting the window that it is in. This is not the behavior I want. I
want
> it to come up at the size specified in the svg document.
>
> I think most of the other zoom controls I have (fit width / fit to page)
> will work once I have a consistent initial size.
>
> Thanks,
> Mark
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: Batik 1.6 and JSVGScrollPane
Posted by Mark Claassen <mc...@ocie.net>.
I have found a way that seems to work. Any comments?...
canvas = new JSVGCanvas() {
protected AffineTransform calculateViewingTransform(String
fragIdent, SVGSVGElement svgElt) {
AffineTransform rval;
if (svgElt == canvas.getSVGDocument().getRootElement()) {
Dimension2D d2 = canvas.getSVGDocumentSize();
Dimension d = new
Dimension((int)d2.getWidth(),(int)d2.getHeight());
if (d.width < 1) d.width = 1;
if (d.height < 1) d.height = 1;
rval = ViewBox.getViewTransform(fragIdent, svgElt,
d.width, d.height);
}
else
rval = super.calculateViewingTransform(fragIdent,
svgElt);
return rval;
}
};
-----Original Message-----
From: Mark Claassen [mailto:mclaassen@ocie.net]
Sent: Friday, December 01, 2006 2:04 PM
To: batik-users@xmlgraphics.apache.org
Subject: Batik 1.6 and JSVGScrollPane
Back in the day I modified some things in Batik 1.5 to get scrolling to work
the way I wanted it to. I am looking into this again, and I see that the
JSVGScrollPane has been added. Great!
I am porting my code to use this new feature and am having a bit of trouble.
Right now, my main stumbling block is that the document always comes up
fitting the window that it is in. This is not the behavior I want. I want
it to come up at the size specified in the svg document.
I think most of the other zoom controls I have (fit width / fit to page)
will work once I have a consistent initial size.
Thanks,
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org