Best way to create SVG file from drawing application?

I am developing a drawing application that allow the users to draw and edit static two dimensional images such as Rectangles, Ellipses and Text. I have a superclass SVGShape that contains all the common features of a shape such as x1, x2, color etc. I then have SVGRectangle as a subclass of SVGShape.
I want to know what would be the best way to create an SVG file from this? An idea I have at the minute is to have an abstract method getSVG() in the SVGShape class, and then implement the method in the subclasses. I will then create a new class called SVGManager which iterates through the list of shapes (Btw I'm using MVC, my shapes are stored in a Collection) and uses the getSVG() mehtod in each shape to build up a SVG file.
What do you think of this? Any better ideas?
Thanks guys

I used a visitor for this in a similar project, so that when the svg library is used in a applet or browser and the writing functionality isn't required, it may be omitted from the bundle.
Pete

Similar Messages

  • What the best way to create XML files from JAVA application?

    Hi to all,
    I need to edit and to create new filex in format of xml. I know to parse, but what would be the best way to do:
    1. - Create new file, create like simle text file, or there is some clases that know to do it in more simple way
    2.a - Edit XML file, to take some data and add it to the XML in the place I want to.
    2.b - Also Edit, but not to add fields, just update some of them.
    Code examples or links to samples woul be welcomed.
    Best regards, Nick.

    I have tried working with XML directly using the Java classes but this was a pain. I then looked at DOM4J and JDOM and found JDOM easier to use.

  • What is the best way to create Aperture book from Pages '09 document?

    What is the best way to create Aperture book from Pages '09 document?

    There is no way to import pages documents to Aperture and convert them to an Aperture book. Aperture books can only be created by manually adding images and text to the pages of a book, and using the layout of the predefined templates.
    The best you could do, would be to print your pages document to pdf and import the resulting pdf file into Aperture as a new project. This will create one image for each page. Then select the page images all at once and  create a new book. Select a theme with fullsize page images, like "picture Book", and then add the images of the pages to the empty pages of the book.
    But probably would you get a much better quality and layout, when you recreate your pages document in Aperture, by starting with an empty book and copying and pasting the text from your Pages document. But don't paste the photos from the document - try to use the originals of those photos.

  • What's the best way to create a panorama from a series of images?

    What's the best way to create a panorama from a series of images?

    This is PhotoMerge result
    This is WLPG
    This is a manual merge
    Before anyone comments on the poor image quality, I know. Its not my photography.
    The beach huts were in an arc which doesn't help.
    You can see that the photomerged image has not 'understood' the image and has bad destortion on the doors of some huts. The blend lines are also visible

  • Best way to create an html from application

    I need connect to an Oracle database and generate a static report from the result Query.
    Do you know what can be the best way to create this html file ?
    There is exists some html library to use?
    Thanks in advance

    you don't need a library. html is verry easy to use. you only have to write text to a file with html-tags.
    hope it helps

  • Best way to view Text files from Mac on iPhone 4?

    What is the Best way to view Text files (loaded) from my Mac onto my iPhone 4?
    Will any of the "readers" (e.g. Kindle, Kobo) allow me to put my own text files onto my iPhone and read them easily?
    Thanks

    I actually purchased GoodReader because it is easy to transfer files without iTunes.  I dislike the file sharing through iTunes.   You can use a Mac or PC.  Once I was in the app I clicked the "Wi-Fi" symbol which brings me to "WiFi-transfer."  It will show this --
    "WiFi status: ON
    Use one of the following addresses exactly as you see them
    1. IP-address: http://192.168.0.98:8080 <-- Local LAN address the iPhone is broadcasting on.
    2. Bonjour-address http://Myname-iPhone.local:8080"
    All you have to do is type one of those addresses into your browser. (Safari, etc.)
    It will take you to a page that has iPhone Connection and a list of options.  You can either create a new directory within the application or use an existing one to upload a text file.  It's rather simple, you just select "Choose a file to upload" > Select your file > Press upload > Start the app and see your text/pdf/whatever file.
    You can also connect to a server to download a text file, browse the web, or enter a url.  I see it also has an ICloud folder which I'm not sure if it integrates with Apple's iCloud or not, I think it does.  I'm not affliated with the app and I'm not saying you have to buy it, I'm just a happy user.
    If you don't want to buy this app let me know I'll keep looking for a free or cheaper one for you if you want.

  • What's the best way to create XML file with a schema from a database table?

    Hi,
    I want to create an XML file from a database table (which has over 600 columns) using XML schema (.xsd file). I want to know the best way to do this.
    The output XML file is NOT a direct data dump from the DB table, there�re some logic around it, such as the XML file has some hierarchy with repeating tags.
    I have done this using JAXB by creating Java classes form XML schema, but I don�t want to map 600 DB columns to these Java classes manually, and loop through the record set to create repeating tags.
    I know there are few tools around now like MapForce (Altova), how do people do these now?
    Thanks,
    Chandi

    Can you use a schema when we compose XML doc from Database tables?
    Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me.

  • Best way to import iTunes files from old HD

    Hi
    I have recently changed my internal HD and I would like to import the music from my iTune that is in my old HD to the new.
    May I know what is the best way.
    *What other ways do I have other to transfer the music files from old to new HD?*
    Please help. Thanks.
    Jojo
    P.S: There is a problem with my old HD and I can't use the migration assistant and and I have not created a TimeMachine or a Clone.

    Can the Time Machine migration assistant that pops up with a new computer at setup able to do these specific tasks without an all or none deal?
    Yes. For a detailed walkthrough, see here:
    Setting-up a new Mac from an old one, its backups, or a PC Using Setup Assistant

  • Best way to move Onenote files from offline file location.

    We have a majority of our users now on Win 7 using Office 2010.
    We have redirected folders with offline files syncing Included in this location is the OneNote files.
    After starting to investigate Win 8.1 Update 1 and office 2013. We noticed the message OneNote 2013 throws up about issues with having OneNote files included in the Offline files location (The first version to offer this message). And have started to notice
    issues with users OneNote files corrupting etc.
    Almost certainly from the Offline files syncing and OneNote's own in built cache\syncing abilities. 
    We investigated excluding *.one files from offline syncing but quickly eliminated this because users then wont be able to create any further *.one files in this location.
    My two questions are-
    1) How bad could the issues with corruption of OneNote files get if they stay in their current location? We are concerned the more our users get to know how useful OneNote is the more issues we will get.
    2) Is there an easy way to move the OneNote files to another network location for multiple users with least disruption to them as possible?

    To answer your questions, check below links:
    http://support.microsoft.com/kb/2859902
    http://blogs.msdn.com/b/david_rasmussen/archive/2007/12/10/onenote-shared-notebooks-options-and-troubleshooting-part-1-windows-file-shares.aspx
    To move the notebook, take one of the following actions:
    From On the File menu, click Share, and then click
    Copy this notebook to OneDrive (formerly SkyDrive) or SharePoint.
    Right-click the notebook, click Properties, and then click
    Change Location.
    Flynn

  • Best way to transfer Word files from imac to ipad2

    I have certain Word for Mac files which I would like to transfer to my iPad2 so that I can read them when traveling. What's the best way to accomplish this?

    You're gonna need an application called Pages (Apple's Word). It's around about 12 bucks on each iTunes Store.
    Once you have the app on the iPad you use a feature called File Sharing. File sharing is found in the Apps section of the iPad if you scroll to the bottom.
    When at the File Sharing section you should see Pages on the left. Click on Pages.
    To the Right-hand side you should see to buttons. Add and Save To. Click on Add
    Choose your file you want in the computer and then Ok.
    Sync the iPad.
    Once thats done there should be a little Arrow to the bottom of Pages which imports the documents to the app.

  • What is the best way to transfer PDF files from my MacBook Air to my iPad2?

    I have updated both OS and trying to find an easy way to transfer pdf files to my iPad.  I have PDF expert on my iPad.

    easy
    install acrobat reader on your Ipad
    attach Ipad to your MAC with USB cable
    open Applications ON you Ipad thru ITUNES
    there is a BOX for Acrobat,..........drag and drop PDF from your MAC into that box of Acrobat for Ipad

  • Best way to create a glossay from scratch?

    HI,
    is there any easy way of cerating the Glossay from scratch? or is it just adding word by word 1 ar a time?
    Kind regards
    Rossco

    Use Adobe Acrobat to create a PDF
    This forum is only to discuss how the forums operate, not products
    If you go to the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the Adobe Acrobat

  • What's the best way to transfer mp3 files from a thumb drive to an iphone?

    I have an iphone 5s. I also have multiple mp3's on a thumb drive. What's the best way to get them onto the iphone so that I can listen to them? I don't have a mac. PC only.

    Can itunes be used on a PC?
    Yes.  You are currently in the "iTunes for Windows" Forum.  85% of all iTunes installations on computers are running on Windows.

  • Best way to transfer old files from iBook to iMac?

    About two years ago, my key lime iBook died. Since it was pretty well used, I bought a G5 iMac and didn't worry much about the old laptop. I now want to get files from my iBook to my G5. I replaced the power input board and got the machine to start without incident.
    I purchased a firewire to use Target Disk mode to get the files I want, but I'm having trouble making the two machines talk. The iMac can see the iBook and can tell me how much memory is left, but I can not pull up any specific files. The cursor spins and the finder is useless until I give up and disconnect the iBook.
    My iBook is still using 9.0.4 while my iMac has 10.4.8. I think this gap could be the problem, but I'm not sure what to do about it.
    Is there something I'm missing about TDM? Thanks for the help!

    Welcome to the Apple Discussions!
    Your iBook does not support Target Disk Mode:
    http://docs.info.apple.com/article.html?artnum=58583
    Probably you have to take apart your iBook (quite easy):
    http://www.ifixit.com/Guide/50.0.0.html
    Then you can put the HD in a external enclosure and back-up your stuff.
    The HD will fit in any USB or FireWire 2.5 inch IDE (or ATA) enclosure.
    All this seems difficult, but it is easy!
    Hopefully this is helpfull or solved your problem.
    (Please see the "helpfull" and "solved" button's above this message! Apple: Why reward points?.)

  • Unable to create PDF files from any application in any Acrobat version

    Hello, I am hoping someone can help me find a solution to a problem I am having creating PDF files.
    I have searched the Internet for a solution to this problem and can't find any information that helps me.
    I am running OSX 10.8.5 on a 2.5 GHZ Intel i5 Mac Laptop
    I cannot create PDFs from any program, Quark, Word, ect.
    When I try to print to the PDF printer, the printer pauses when it tries to open the Distiller. When I click resume, it pauses itself again.
    I have tried to save the document and create the PDF from within the distiller itself and get this error log:
    %%[ Error: undefined; OffendingCommand: MMXPR3 ]%%
    %%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
    %%[ Warning: PostScript error. No PDF file produced. ] %%
    I was originally using Acrobat 8, But I installed the trial version of Acrobat 11 and it has the same problem.
    The problem seems to be something to do with the distiller. I have a lot of Adobe software so I am trying to avoid a clean/re-install of Adobe software but will do it as a last resort.
    Thanks in advance for any suggestions.

    Hi,
    Besides pamma has suggested, here are similar issues, you can take a look at:
    http://unsolicitedbutoffered.blogspot.com/2014/01/quick-fix-volume-syntax-error-when.html
    http://crowdsupport.telstra.com.au/t5/T-Suite-Applications/There-was-an-error-opening-this-document-The-filename-directory/td-p/197425
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Lisa Chen
    TechNet Community Support

Maybe you are looking for