index.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <html>
  2. <head>
  3. <title>JAR Libraries</title>
  4. </head>
  5. <body bgcolor="FFFFFF">
  6. <h1>JAR Libraries</h1>
  7. <h2>Using JAR libraries</h2>
  8. <p>Logisim has two types of circuit components: those that
  9. are designed within Logisim as combinations of components, and those
  10. primitive components that are written in Java. Logisim circuits are easier to design, but
  11. they cannot support sophisticated user interaction, and they
  12. are relatively inefficient.</p>
  13. <p>Logisim contains a fairly thorough collection of built-in
  14. libraries of Java components, but it can also load additional
  15. libraries written by you or others. Once you have downloaded
  16. a library, you can import it into your project by right-clicking
  17. the project in the explorer pane (the top line) and choosing
  18. Load Library &gt; JAR Library.... Then, Logisim will prompt you to select the JAR file.
  19. (In some circumstances, you may have to type the starting class name when
  20. prompted, which would be provided by the library developer. However, a developer
  21. typically configures the JAR library to avoid this (by including a
  22. <q>manifest</q> file in the JAR with a Library-Class attribute
  23. specifying the main class name).)</p>
  24. <h2>Creating JAR libraries</h2>
  25. <p>The remainder of this section is dedicated to a series of
  26. thoroughly commented examples illustrating how to develop Logisim
  27. libraries yourself. You should only attempt this if you're
  28. an experienced Java programmer. You will find the documentation
  29. beyond these examples fairly meager.</p>
  30. <p>You can download a JAR file that allows these examples to be
  31. imported into Logisim via the Logisim Web site's Links section.
  32. That JAR file also contains the source code
  33. contained in these examples.</p>
  34. <dl>
  35. <dt><a href="incr.html">Gray Code Incrementer</a></dt>
  36. <dd><p>Illustrates the essential components of any component type
  37. using a simple example of a component that takes a multibit input
  38. and computes the next Gray code value following it.</p></dd>
  39. <dt><a href="library.html">Library Class</a></dt>
  40. <dd><p>Illustrates how to define a library. This is the entry point
  41. for any JAR file - the class whose name the user enters when
  42. loading the JAR library.</p></dd>
  43. <dt><a href="simpctr.html">Simple Gray Code Counter</a></dt>
  44. <dd><p>Illustrates how to make a component that has internal state,
  45. in particular an 8-bit counter that iterates through Gray codes.</p></dd>
  46. <dt><a href="counter.html">Gray Code Counter</a></dt>
  47. <dd><p>Demonstrates a complete, fairly sophisticated component with
  48. which the user can interact. It implements a Gray code counter where the
  49. number of bits remembered is customizable, and where the user can
  50. edit the current value by clicking on it with the Poke Tool and
  51. typing a value.</p>
  52. <dt><a href="guide.html">Guidelines</a>
  53. <dd>General information for those developing third-party libraries.</p>
  54. </dl>
  55. <h2>License</h2>
  56. <p>The code in this example JAR library is released under the MIT license,
  57. a more permissive license than the GPL, under which the rest of Logisim is
  58. released.</p>
  59. <p>Copyright (c) 2009, Carl Burch.</p>
  60. <p>Permission is hereby granted, free of charge, to any person
  61. obtaining a copy of this software and associated documentation
  62. files (the "Software"), to deal in the Software without
  63. restriction, including without limitation the rights to use,
  64. copy, modify, merge, publish, distribute, sublicense, and/or sell
  65. copies of the Software, and to permit persons to whom the
  66. Software is furnished to do so, subject to the following
  67. conditions:</p>
  68. <p>The above copyright notice and this permission notice shall be
  69. included in all copies or substantial portions of the Software.</p>
  70. <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  71. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  72. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  73. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  74. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  75. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  76. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  77. OTHER DEALINGS IN THE SOFTWARE.</p>
  78. <p><strong>Next:</strong> <a href="incr.html">Gray Code Incrementer</a>.</p>
  79. </body>
  80. </html>