[Feature] Copy in vector format

Ideas that we are planning to implement in the near future

[Feature] Copy in vector format

Postby Karl DD on Mon, 03 Mar 2008 09:48:45 GMT

Alpha 002 adds the ability to copy the canvas to the clipboard as a bitmap image.
Going one better would be to do this as a vector. After trying to implement this with a PDF file I could not get it to work. I am not sure exactly how this can be implemented in Java at this stage.
User avatar
Karl DD
Site Admin
 
Posts: 592
Joined: Sun, 20 Jan 2008 02:45:28 GMT
Location: Pittsburgh, PA

Re: [Feature] Copy in vector format

Postby q_x on Sun, 16 Mar 2008 20:35:20 GMT

Actually almost no software makes possible to copy vector to clipboard and paste it in other place. If they can do it - they (AFAIK) use WMF or SVG to migrate. Hard, almost impossible task.
Luke
User avatar
q_x
 
Posts: 18
Joined: Sat, 15 Mar 2008 21:15:51 GMT

Re: [Feature] Copy in vector format

Postby Karl DD on Sun, 16 Mar 2008 23:17:06 GMT

Thanks for the heads up about this, being a java application, the job is not made any easier...
For now the Switch Vector function might have to do.
User avatar
Karl DD
Site Admin
 
Posts: 592
Joined: Sun, 20 Jan 2008 02:45:28 GMT
Location: Pittsburgh, PA

Re: [Feature] Copy in vector format

Postby tobias on Tue, 27 May 2008 21:59:04 GMT

The Switch Vector and Switch Bitmap functions doesn't work on Linux. I've tryed to use "/usr/bin/inkscape" for vector and "/usr/bin/gimp" for bitmap.

A simple "/usr/bin/inkscape /tmp/AlchemyTempVectorFile51270.pdf" works. But even with this way I have always to click away the PDF import dialog in Inkscape. It would make the workflow with Inkscape much nicer, if you could export as SVG.
tobias
 
Posts: 9
Joined: Tue, 27 May 2008 21:32:35 GMT

Re: [Feature] Copy in vector format

Postby Karl DD on Wed, 28 May 2008 02:56:52 GMT

Thanks for reporting that.
Looking at the code, I didn't include Linux in there at all:
Code: Select all
   /** Open the appropriate application with the temp file and 'switch' */
    private void openSwitch(String file, String app) {
        File path = new File(app);
        try {
            String[] commands = null;
            switch (Alchemy.PLATFORM) {
                case MACOSX:
                    commands = new String[]{"open", "-a", path.getName(), file};
                    break;
                case WINDOWS:
                    commands = new String[]{"cmd", "/c", "start \"" + path.getName() + "\"", "\"Alchemy\"", file};
                    break;
            }
            if (commands != null) {
                Runtime.getRuntime().exec(commands);
            }
        //Runtime.getRuntime().exec("open "+file);
        } catch (IOException ex) {
            System.err.println(ex);
        }
    }


I just need to find how to launch a file in an application using the exec() command on Linux.
Some info here: http://www.rgagnon.com/javadetails/java-0014.html
In particular:
Code: Select all
String[] cmd = {"/bin/sh", "-c", "ls > hello"};
Runtime.getRuntime().exec(cmd);


Might be time to install linux...

RE: SVG
I figure we could do that for the Switch stuff instead of PDF perhaps. PDF is nice to use for the session saving I think though. We could also add an SVG export to the menu using Batik
User avatar
Karl DD
Site Admin
 
Posts: 592
Joined: Sun, 20 Jan 2008 02:45:28 GMT
Location: Pittsburgh, PA

Re: [Feature] Copy in vector format

Postby tobias on Wed, 28 May 2008 21:27:07 GMT

Please tell me if you have something new. I'll be happy to test it.
tobias
 
Posts: 9
Joined: Tue, 27 May 2008 21:32:35 GMT

Re: [Feature] Copy in vector format

Postby Karl DD on Sat, 31 May 2008 05:49:15 GMT

I have just installed Ubuntu and it is very nice :)
But I was wondering if anyone knows how to open a file in a specific application using the Linux command line?

On OSX this goes like:
Code: Select all
open -a /path/to/app /path/to/file

I found the gnome-open command but it looks like that just launches the file with the default application.
Once I figure out this little bit of command line trivia I can get the switch stuff working in linux... Cheers!
User avatar
Karl DD
Site Admin
 
Posts: 592
Joined: Sun, 20 Jan 2008 02:45:28 GMT
Location: Pittsburgh, PA

Re: [Feature] Copy in vector format

Postby Karl DD on Sat, 31 May 2008 07:25:19 GMT

Ah I figured it out, all it is is:
Code: Select all
/path/to/app /path/to/file

and nothing else, very simple.
User avatar
Karl DD
Site Admin
 
Posts: 592
Joined: Sun, 20 Jan 2008 02:45:28 GMT
Location: Pittsburgh, PA

Re: [Feature] Copy in vector format

Postby Steren on Tue, 18 Aug 2009 22:03:27 GMT

Re: SVG
I would love to be able to "Export" and "Switch Vector" in the SVG file format.
Did you already start something in this way ?

As you said Batik could be used, I've seen the SVGGraphics2D class that could be given to the paintComponent() method of the Alchemy canvas. What do you think ?
User avatar
Steren
 
Posts: 13
Joined: Tue, 18 Aug 2009 21:23:51 GMT
Location: France

Re: [Feature] Copy in vector format

Postby Karl DD on Wed, 19 Aug 2009 12:49:11 GMT

Yeah, we intend to do this... it is just a matter of getting around to it.
If it can overwrite the Alchemy Graphics canvas then it should be pretty easy then.
Do you know Java very well?
User avatar
Karl DD
Site Admin
 
Posts: 592
Joined: Sun, 20 Jan 2008 02:45:28 GMT
Location: Pittsburgh, PA

Next

Return to Planned Ideas

Who is online

Users browsing this forum: No registered users and 0 guests

cron