Return-Path: Delivered-To: apmail-xml-batik-users-archive@www.apache.org Received: (qmail 67577 invoked from network); 25 Jan 2005 14:06:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jan 2005 14:06:42 -0000 Received: (qmail 37778 invoked by uid 500); 25 Jan 2005 14:06:39 -0000 Delivered-To: apmail-xml-batik-users-archive@xml.apache.org Received: (qmail 37760 invoked by uid 500); 25 Jan 2005 14:06:39 -0000 Mailing-List: contact batik-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: "Batik Users" Delivered-To: mailing list batik-users@xml.apache.org Received: (qmail 37728 invoked by uid 99); 25 Jan 2005 14:06:39 -0000 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HELO_DYNAMIC_IPADDR2,HELO_DYNAMIC_SPLIT_IP,RCVD_BY_IP,RCVD_DOUBLE_IP_LOOSE,RCVD_NUMERIC_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from 64.83.43.208.dsl207-static-phi.cavtel.net (HELO 64.83.43.208.dsl207-static-phi.cavtel.net) (64.83.43.207) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 25 Jan 2005 06:06:37 -0800 Received: from [64.83.10.149] by 64.83.43.208.dsl207-static-phi.cavtel.net (AppleShare IP Mail Server 6.3.1) id 141868 via TCP with SMTP; Tue, 25 Jan 2005 09:06:35 -0500 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: References: Content-Type: multipart/alternative; boundary=Apple-Mail-1--494243009 Message-Id: <470CD438-6EDA-11D9-B3F3-00306549AFB0@onemileup.com> From: Andres Toussaint Subject: Re: Opening an SVG image to a certain scale Date: Tue, 25 Jan 2005 09:06:15 -0500 To: "Batik Users" X-Mailer: Apple Mail (2.619) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --Apple-Mail-1--494243009 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed I would suggest the following: //... svgCanvas.addSVGDocumentLoaderListener(new=20 SVGDocumentLoaderAdapter() { public void documentLoadingStarted(SVGDocumentLoaderEvent=20= e) { //.... } public void documentLoadingCompleted(SVGDocumentLoaderEvent=20= e) { SVGDocument document =3D e.getSVGDocument(); SVGOMSVGElement documentElement =3D=20 (SVGOMSVGElement)document.getDocumentElement(); String theW =3D "yourWidthHere"; String theH =3D "yourHeightHere"; documentElement.setAttributeNS(svgNS, "viewBox", "0 0=20= "+ theW +" "+ theH); documentElement.setAttributeNS(svgNS, "width", theW ); documentElement.setAttributeNS(svgNS, "height", theH = ); } }); //... I use this on Dynamic JSVGCanvas, and have not tried it on Static=20 Canvas. Andres. On Jan 24, 2005, at 3:38 PM, Caron, Michael R wrote: > Each tile is a separate JSVGCanvas, not loading them as =20 > elements. > =A0 > Output is a JPanel: > =A0 > //... > private void init() { > =A0=A0=A0=A0=A0=A0=A0 addListeners(); > =A0=A0=A0=A0=A0=A0=A0 setLayout(new BorderLayout()); > =A0 > =A0=A0=A0=A0=A0=A0=A0 // status is a JLabel > =A0=A0=A0=A0=A0=A0=A0 status.setFont(new = Font(PANEL_FONT_NAME,PANEL_FONT_STYLE, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 PANEL_FONT_SIZE)); > =A0=A0=A0=A0=A0=A0=A0 status.setText("svg"); > =A0=A0=A0=A0=A0=A0=A0 = status.setHorizontalAlignment(SwingConstants.CENTER); > =A0=A0=A0=A0=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0 // stick the SVG into an etched pane to make it = look nice > =A0=A0=A0=A0=A0=A0=A0 JPanel borderedPanel =3D new JPanel(new=20 > FlowLayout(FlowLayout.CENTER, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0,0)); > =A0=A0=A0=A0=A0=A0=A0 = borderedPanel.setBorder(BorderFactory.createEtchedBorder()); > =A0=A0=A0=A0=A0=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0 // svgThumbnail is a=A0JSVGCanvas > =A0=A0=A0=A0=A0=A0=A0 svgThumbnail.setPreferredSize(new = Dimension(ICON_HEIGHT,=20 > ICON_WIDTH)); > =A0=A0=A0=A0=A0=A0=A0 borderedPanel.add(svgThumbnail); > =A0=A0=A0=A0=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0 // add the SVG > =A0=A0=A0=A0=A0=A0=A0 add(borderedPanel, BorderLayout.CENTER); > =A0=A0=A0=A0=A0=A0=A0 > =A0=A0=A0=A0=A0=A0=A0 // add the status line > =A0=A0=A0=A0=A0=A0=A0 add(status, BorderLayout.SOUTH); > =A0 > =A0=A0=A0 } > //... > =A0 > Mike > > > From: Andres Toussaint [mailto:andres@onemileup.com] > Sent: Monday, January 24, 2005 2:34 PM > To: Batik Users > Subject: Re: Opening an SVG image to a certain scale > > Is each of your SVG tiles a separate JSVGCanvas? > > > Or are you loading your SVG Tiles as elements? > > > What is your output? A Java Swing window, a raster image, a web page? > > > > > On Jan 24, 2005, at 2:55 PM, Caron, Michael R wrote: > > > Hi all, > > > I'd like to open an SVG file to certain dimensions. Essentially,=20 > create a thumbnail, but forget about the original sizes. I've tried to=20= > go with the code example from the Squiggle app, but I can't seem to=20 > get any output. I've looked at the transcoding option, but that=20 > doesn't do what I want. What I want is to load up a bunch of svgs into=20= > a grid of svg tiles no bigger than 40px x 40px. I figured I could do a=20= > transform after the GVTTree was built, but that just gave me some null=20= > pointers. > > > Any ideas? > > > L > Michael Caron > Software Development > IR&D - PCES Program > > > x4889 --Apple-Mail-1--494243009 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=ISO-8859-1 I would suggest the following: //... svgCanvas.addSVGDocumentLoaderListener(new SVGDocumentLoaderAdapter() { public void documentLoadingStarted(SVGDocumentLoaderEvent e) { //.... } public void documentLoadingCompleted(SVGDocumentLoaderEvent e) { SVGDocument document =3D e.getSVGDocument(); SVGOMSVGElement documentElement =3D (SVGOMSVGElement)document.getDocumentElement(); =20 String theW =3D "yourWidthHere"; String theH =3D "yourHeightHere"; documentElement.setAttributeNS(svgNS, "viewBox", "0 0 "+ theW +" "+ theH); documentElement.setAttributeNS(svgNS, "width", theW ); documentElement.setAttributeNS(svgNS, "height", theH ); } }); //... I use this on Dynamic JSVGCanvas, and have not tried it on Static Canvas. Andres. On Jan 24, 2005, at 3:38 PM, Caron, Michael R wrote: = Arial0000,0000,FFFFEach tile is a separate JSVGCanvas, not loading them as < = elements. =A0 = Arial0000,0000,FFFFOutput is a JPanel: =A0 Courier = New//... Courier Newprivate void init() { Courier New=A0=A0=A0=A0=A0=A0=A0= addListeners(); Courier New=A0=A0=A0=A0=A0=A0=A0= setLayout(new BorderLayout()); =A0 Courier New=A0=A0=A0=A0=A0=A0=A0= // status is a JLabel Courier New=A0=A0=A0=A0=A0=A0=A0= status.setFont(new = Font(PANEL_FONT_NAME,PANEL_FONT_STYLE, Courier New=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 PANEL_FONT_SIZE)); Courier New=A0=A0=A0=A0=A0=A0=A0= status.setText("svg"); Courier New=A0=A0=A0=A0=A0=A0=A0= = status.setHorizontalAlignment(SwingConstants.CENTER); Courier New=A0=A0=A0=A0=A0=A0=A0= Courier New =A0=A0=A0=A0=A0=A0=A0= // stick the SVG into an etched pane to make it look = nice Courier New=A0=A0=A0=A0=A0=A0=A0= JPanel borderedPanel =3D new JPanel(new = FlowLayout(FlowLayout.CENTER, Courier New=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 0,0)); Courier New=A0=A0=A0=A0=A0=A0=A0= = borderedPanel.setBorder(BorderFactory.createEtchedBorder()); Courier = New=A0=A0=A0=A0=A0=A0=A0=A0 Courier New=A0=A0=A0=A0=A0=A0=A0= // svgThumbnail is a=A0JSVGCanvas Courier New=A0=A0=A0=A0=A0=A0=A0= svgThumbnail.setPreferredSize(new Dimension(ICON_HEIGHT, = ICON_WIDTH)); Courier New=A0=A0=A0=A0=A0=A0=A0= borderedPanel.add(svgThumbnail); Courier New=A0=A0=A0=A0=A0=A0=A0= Courier New =A0=A0=A0=A0=A0=A0=A0= // add the SVG Courier New=A0=A0=A0=A0=A0=A0=A0= add(borderedPanel, BorderLayout.CENTER); Courier New=A0=A0=A0=A0=A0=A0=A0= Courier New =A0=A0=A0=A0=A0=A0=A0= // add the status line Courier New=A0=A0=A0=A0=A0=A0=A0= add(status, BorderLayout.SOUTH); =A0 Courier New=A0=A0=A0 = } Courier = New//... =A0 = Arial0000,0000,FFFFMike = TahomaFrom:Tahoma Andres Toussaint [mailto:andres@onemileup.com] Tahoma Sent: Monday, January 24, 2005 2:34 PM = TahomaTo:= Tahoma Batik Users = TahomaSubject:Tahoma Re: Opening an SVG image to a certain scale Is each of your SVG tiles a separate JSVGCanvas? Or are you loading your SVG Tiles as < elements? What is your output? A Java Swing window, a raster image, a web page? On Jan 24, 2005, at 2:55 PM, Caron, Michael R wrote: ArialHi all,=20 ArialI'd like to open an SVG file to certain dimensions. Essentially, create a thumbnail, but forget about the original sizes. I've tried to go with the code example from the Squiggle app, but I can't seem to get any output. I've looked at the transcoding option, but that doesn't do what I want. What I want is to load up a bunch of svgs into a grid of svg tiles no bigger than 40px x 40px. I figured I could do a transform after the GVTTree was built, but that just gave me some null pointers.=20 ArialAny ideas?=20 = 0000,0000,FFFFL=20 Book AntiquaMichael Caron=20 Book AntiquaSoftware Development=20 Book AntiquaIR&D - PCES Program=20 Book = Antiquax4889=20 = --Apple-Mail-1--494243009--