Results 1 to 6 of 6
  1. #1
    Mekonom is offline Member
    Join Date
    Nov 2009
    Posts
    71
    Rep Power
    0

    Default how to cerate own file format?

    Hi all..I am tryıng to make my own fıle format for my Diagram Editor.My program draws x and y gates and ties them with line and so on .I want to save this drawşng as a some format. and I want to open this file with my program and make some correction or edit..How can ı make some thing like this?Where to start????

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    XML? Perhaps, not sure.

  3. #3
    Mekonom is offline Member
    Join Date
    Nov 2009
    Posts
    71
    Rep Power
    0

    Default

    and?I will out put onl somename.xml?or some sysntax? or how must I search this topic on internet?I couldent find any think. ((

  4. #4
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    235
    Rep Power
    5

    Default

    Heres how I did it without java:
    1)open notepad and put the information you want in it
    2)hit file -> save as
    3)change type to all files
    4)save with the name as "something.abc"
    5) you will now have a file something with type abc

    Note: this was done on vista, but I think it will work pretty much anywhere

  5. #5
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    i have been thinking for a while it would be neat to use an embedded database, such as H2 database, the BDB-JE (berkley database java edition), or that sqlite java wrapper.

    Where a database to store the contents of my application allow for a lot of flexibility, and reduce the problem to that of writing database tables and java code to map objects to these tables. Though if you are already familiar with tools like hibernate this is likely less work to do.

    I like the H2 database for its functionality. though it does create many files. I was thinking a work around would be to have something that reads a zip file of the individual files into a temporary folder when that file is opened by the application, have the application work with the db files in that folder, and on save, pack the files back into the zip file again. Where you file format is really then just a zip file of the embedded database backing files. Though if having the file be human readable without having to boot up a database connection to it is a priority, then this would not be helpful.

    Though I would imagine a database would allow for larger amounts of data to be organized and accessed efficiently, loading a huge xml file would likely require you to build an in-memory structure to hold it all, and searching through it would take some amount of work to build tools to manipulate the structure, which is why I think embedded database would be cool. Then again, I am more of a DBA type.

  6. #6
    Mekonom is offline Member
    Join Date
    Nov 2009
    Posts
    71
    Rep Power
    0

    Default

    Quote Originally Posted by travishein View Post
    i have been thinking for a while it would be neat to use an embedded database, such as H2 database, the BDB-JE (berkley database java edition), or that sqlite java wrapper.

    Where a database to store the contents of my application allow for a lot of flexibility, and reduce the problem to that of writing database tables and java code to map objects to these tables. Though if you are already familiar with tools like hibernate this is likely less work to do.

    I like the H2 database for its functionality. though it does create many files. I was thinking a work around would be to have something that reads a zip file of the individual files into a temporary folder when that file is opened by the application, have the application work with the db files in that folder, and on save, pack the files back into the zip file again. Where you file format is really then just a zip file of the embedded database backing files. Though if having the file be human readable without having to boot up a database connection to it is a priority, then this would not be helpful.

    Though I would imagine a database would allow for larger amounts of data to be organized and accessed efficiently, loading a huge xml file would likely require you to build an in-memory structure to hold it all, and searching through it would take some amount of work to build tools to manipulate the structure, which is why I think embedded database would be cool. Then again, I am more of a DBA type.
    I was thinking creating xml file but database may be a solusiton too.but for example if i will use an Mysql database ad if on another machine there is no data base or some another data base ?

Similar Threads

  1. Format of class file
    By makpandian in forum New To Java
    Replies: 15
    Last Post: 05-07-2009, 02:40 PM
  2. how to convert one format to another format
    By mahipal_reddy621 in forum New To Java
    Replies: 1
    Last Post: 12-02-2008, 10:21 AM
  3. PNG file format decoder in Java
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-21-2008, 08:51 PM
  4. Convertin a .DAT file into readable format
    By janakiram.attuluri in forum Advanced Java
    Replies: 1
    Last Post: 12-07-2007, 10:00 PM
  5. Date format display in CSV file after exporting
    By latha in forum Advanced Java
    Replies: 0
    Last Post: 08-03-2007, 08:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •