It would be nice if we had an option to save library references using a relative uri.
Here is what I am doing:
I am starting to share some circuits that reference a jar lib (logisimTransistorLib.jar) on a sever that is accessed by windows and linux. When the circuit is saved from one os the other os can't find the lib. This is easy to fix as you just re-point to the lib using the client os. I am thinking it would be nice to have an option to save the reference as either an absolute or relative uri (user controllable).
Open office does this with hyperlinks and it seems to work out nicely. The way that seems to work is, if the "save relative" option is set, then when the main file is saved if the reference is on the same "disk" then the reference is saved relative to the main file. When you open the doc from the other os it looks like it converts the reference to an absolute path again based on the location of the loaded file.
So for example:
Edit in windows and reference the circuit as c:\blah\logisim_circuits\myckt.circ and the lib as file:///c:\blah\logisimLibs\logisimTransistor.jar
When the file is saved realize that the reference is on the same "disk" or server (//server/) and then save the reference relative to the circuit (file:///../logisimLibs/logisimTransistor.jar)
load the saved circuit from linux where it is found as /mnt/logisim/circuits/myckt.circ
convert the lib reference to /mnt/logisim/logisimLibs/logisimTransistorLib.jar
then when you save the circuit back it again saves it as a relative uri and then when it is read in windows the same process is followed.
BTW - it looks like my logisimTransistorLib does not load in logisim versions 2.5.0 and beyond. I will have to take a look at that in the near future.
Is it possible to access the source of your logisimTransistorlib.jar from anywhere?
The source code is actually in the Jar file, just open it with some think like WinRar or any thing else that can read jar files. There is probably a way to have the java command line extract them. If you can't get it that way, let me know and I can send them to you or post it somewhere
John, I think Han was asking for a URL where he could download your library; it doesn't seem to appear in your messages. A brief Google search turns up http://www.cs.cornell.edu/courses/cs3410/2010sp/lecture/logisimTransistorLib.jar , which I imagine is yours. It's a decent library, and I'm glad to you've taken the time to write it.
I'm disappointed that it fell apart in 2.5.0 - I try to maintain backward compatibility for developers like you. Looking at your code, I see that the problem is in Strings.java: It refers to com/cburch/logisim/resources, and it was moved in 2.5.0 to resources/logisim/. I never anticipated that JAR developers would want to use Logisim's internationalization files, so I felt free to move them - which I did starting in 2.5.0 so that translators could access the files more easily.
By the way, versions of the transistor, ground, and power elements should appear in the Logisim's built-in libraries in the upcoming release. You can download development versions including this feature at https://sourceforge.net/projects/circuit/files/2.6.x/2.6.x%20Development/ - though of course those development versions aren't yet "official" (and not entirely debugged). Comments concerning these new components would be welcome.
Your suggestion concerning relative pathnames is noted. I'm pretty sure I intended Logisim to use relative pathnames, but I've been able to confirm that it doesn't actually work. Hopefully that'll get repaired in the next Logisim release. Thanks!
Log in to post a comment.