commit ef8b7f1899742f19532563a913ca2aa1ce06551e Author: Paul Date: Fri Nov 6 14:34:52 2020 +0100 inital commit diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100755 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/.idea.Lernmaschine.dir/.idea/contentModel.xml b/.idea/.idea.Lernmaschine.dir/.idea/contentModel.xml new file mode 100755 index 0000000..50f9fd6 --- /dev/null +++ b/.idea/.idea.Lernmaschine.dir/.idea/contentModel.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Lernmaschine.dir/.idea/encodings.xml b/.idea/.idea.Lernmaschine.dir/.idea/encodings.xml new file mode 100755 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.Lernmaschine.dir/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.Lernmaschine.dir/.idea/indexLayout.xml b/.idea/.idea.Lernmaschine.dir/.idea/indexLayout.xml new file mode 100755 index 0000000..d1a9292 --- /dev/null +++ b/.idea/.idea.Lernmaschine.dir/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Lernmaschine.dir/.idea/modules.xml b/.idea/.idea.Lernmaschine.dir/.idea/modules.xml new file mode 100755 index 0000000..3d8c454 --- /dev/null +++ b/.idea/.idea.Lernmaschine.dir/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Lernmaschine.dir/.idea/projectSettingsUpdater.xml b/.idea/.idea.Lernmaschine.dir/.idea/projectSettingsUpdater.xml new file mode 100755 index 0000000..7f5e4fe --- /dev/null +++ b/.idea/.idea.Lernmaschine.dir/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.Lernmaschine.dir/.idea/workspace.xml b/.idea/.idea.Lernmaschine.dir/.idea/workspace.xml new file mode 100755 index 0000000..165b8f6 --- /dev/null +++ b/.idea/.idea.Lernmaschine.dir/.idea/workspace.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + 1578417191806 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Lernmaschine.dir/riderModule.iml b/.idea/.idea.Lernmaschine.dir/riderModule.iml new file mode 100755 index 0000000..cea4207 --- /dev/null +++ b/.idea/.idea.Lernmaschine.dir/riderModule.iml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/Lernmaschine_jar.xml b/.idea/artifacts/Lernmaschine_jar.xml new file mode 100755 index 0000000..d761c98 --- /dev/null +++ b/.idea/artifacts/Lernmaschine_jar.xml @@ -0,0 +1,23 @@ + + + $PROJECT_DIR$/out/artifacts/Lernmaschine_jar + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/description.html b/.idea/description.html new file mode 100755 index 0000000..db5f129 --- /dev/null +++ b/.idea/description.html @@ -0,0 +1 @@ +Simple Java application that includes a class with main() method \ No newline at end of file diff --git a/.idea/dictionaries/paul.xml b/.idea/dictionaries/paul.xml new file mode 100755 index 0000000..8819e93 --- /dev/null +++ b/.idea/dictionaries/paul.xml @@ -0,0 +1,10 @@ + + + + lerhrveranstaltung + lerndokument + lerndokumente + speicherort + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100755 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100755 index 0000000..a831a27 --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100755 index 0000000..1d882b8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100755 index 0000000..f0136df --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/project-template.xml b/.idea/project-template.xml new file mode 100755 index 0000000..1f08b88 --- /dev/null +++ b/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100755 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Help.jpg b/Help.jpg new file mode 100755 index 0000000..aa4bb8b Binary files /dev/null and b/Help.jpg differ diff --git a/Lernmaschine.iml b/Lernmaschine.iml new file mode 100755 index 0000000..fb8e866 --- /dev/null +++ b/Lernmaschine.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/db.db4o b/db.db4o new file mode 100755 index 0000000..50bb9b4 Binary files /dev/null and b/db.db4o differ diff --git a/libs/lib/.svn/entries b/libs/lib/.svn/entries new file mode 100755 index 0000000..48082f7 --- /dev/null +++ b/libs/lib/.svn/entries @@ -0,0 +1 @@ +12 diff --git a/libs/lib/.svn/format b/libs/lib/.svn/format new file mode 100755 index 0000000..48082f7 --- /dev/null +++ b/libs/lib/.svn/format @@ -0,0 +1 @@ +12 diff --git a/libs/lib/.svn/pristine/02/02d924bbfdb3c244d3841769ceceb3feda839fec.svn-base b/libs/lib/.svn/pristine/02/02d924bbfdb3c244d3841769ceceb3feda839fec.svn-base new file mode 100755 index 0000000..9215dec --- /dev/null +++ b/libs/lib/.svn/pristine/02/02d924bbfdb3c244d3841769ceceb3feda839fec.svn-base @@ -0,0 +1,54 @@ + + +The Apache Software License + + + + The Apache Software License, Version 1.1
+
+ Copyright (C) 2000-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: 
+
    +
  1. Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. 
  2. +
  3. Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. 
  4. +
  5. The end-user documentation included with the redistribution, if any, must include + the following acknowledgment: "This product includes software developed by the Apache + Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if and wherever + such third-party acknowledgments normally appear. 
  6. +
  7. The names "Ant" and "Apache Software Foundation" must not be used to endorse or + promote products derived from this software without prior written permission. For + written permission, please contact apache@apache.org.
  8. +
  9. Products derived from this software may not be called "Apache", nor may "Apache" + appear in their name, without prior written permission of the Apache Software Foundation. +
  10. +
+

+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION + OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +

+

+ This software consists of voluntary contributions made by many individuals on behalf + of the Apache Software Foundation. For more information on the Apache Software Foundation, + please see <http://www.apache.org/>

+ + \ No newline at end of file diff --git a/libs/lib/.svn/pristine/07/07aa064d87ae08b8af4798a36a5839300f0fd310.svn-base b/libs/lib/.svn/pristine/07/07aa064d87ae08b8af4798a36a5839300f0fd310.svn-base new file mode 100755 index 0000000..e34c8e5 --- /dev/null +++ b/libs/lib/.svn/pristine/07/07aa064d87ae08b8af4798a36a5839300f0fd310.svn-base @@ -0,0 +1,40 @@ + + +3rd Party + + + +

+ This distribution comes with the 3rd party libraries listed below. +
+ These are not needed for plain db4o operation, but only for specific use cases involving + native query optimization. +

+

+ bloat-1.0.jar +
+ http://www.cs.purdue.edu/s3/projects/bloat/ +
+ Needed for bytecode analysis during native query optimization. Must be on the runtime + classpath for optimization at load or query execution time, must be present during + the Ant build for class file optimization. +

+

+ ant.jar +
+ http://ant.apache.org/ +
+ Needed for the native query optimization Ant task. +

+

+ Please refer to the license files for these libraries as well as to the Licensing + and Native Query Optimization chapter in the tutorial for further information.

+ + \ No newline at end of file diff --git a/libs/lib/.svn/pristine/0e/0eea27ff3ad49c9a785419c31de90d6473e72b4c.svn-base b/libs/lib/.svn/pristine/0e/0eea27ff3ad49c9a785419c31de90d6473e72b4c.svn-base new file mode 100755 index 0000000..7f74394 Binary files /dev/null and b/libs/lib/.svn/pristine/0e/0eea27ff3ad49c9a785419c31de90d6473e72b4c.svn-base differ diff --git a/libs/lib/.svn/pristine/45/458d02c6af35ba088053f03275ca36b7eeb0dfc6.svn-base b/libs/lib/.svn/pristine/45/458d02c6af35ba088053f03275ca36b7eeb0dfc6.svn-base new file mode 100755 index 0000000..f792ba1 Binary files /dev/null and b/libs/lib/.svn/pristine/45/458d02c6af35ba088053f03275ca36b7eeb0dfc6.svn-base differ diff --git a/libs/lib/.svn/pristine/62/62ddb4b010df72e12da13f324b599d3c22a10ad7.svn-base b/libs/lib/.svn/pristine/62/62ddb4b010df72e12da13f324b599d3c22a10ad7.svn-base new file mode 100755 index 0000000..aa4980e Binary files /dev/null and b/libs/lib/.svn/pristine/62/62ddb4b010df72e12da13f324b599d3c22a10ad7.svn-base differ diff --git a/libs/lib/.svn/pristine/6f/6f255b42a842df258d110c746ebca0500237a685.svn-base b/libs/lib/.svn/pristine/6f/6f255b42a842df258d110c746ebca0500237a685.svn-base new file mode 100755 index 0000000..1cf4a2a Binary files /dev/null and b/libs/lib/.svn/pristine/6f/6f255b42a842df258d110c746ebca0500237a685.svn-base differ diff --git a/libs/lib/.svn/pristine/72/72545d478b64edefe784f9fdf3fe84b101427d34.svn-base b/libs/lib/.svn/pristine/72/72545d478b64edefe784f9fdf3fe84b101427d34.svn-base new file mode 100755 index 0000000..e1a5f67 Binary files /dev/null and b/libs/lib/.svn/pristine/72/72545d478b64edefe784f9fdf3fe84b101427d34.svn-base differ diff --git a/libs/lib/.svn/pristine/7b/7bf0b884b3cb0f3b8230ba1ddcabc48d2157ebf8.svn-base b/libs/lib/.svn/pristine/7b/7bf0b884b3cb0f3b8230ba1ddcabc48d2157ebf8.svn-base new file mode 100755 index 0000000..5e638f9 Binary files /dev/null and b/libs/lib/.svn/pristine/7b/7bf0b884b3cb0f3b8230ba1ddcabc48d2157ebf8.svn-base differ diff --git a/libs/lib/.svn/pristine/84/8460d3fd275876d3305ea126a567c32fe26e63ac.svn-base b/libs/lib/.svn/pristine/84/8460d3fd275876d3305ea126a567c32fe26e63ac.svn-base new file mode 100755 index 0000000..bf03020 Binary files /dev/null and b/libs/lib/.svn/pristine/84/8460d3fd275876d3305ea126a567c32fe26e63ac.svn-base differ diff --git a/libs/lib/.svn/pristine/8b/8b11a58ba1663091fde4e975e083618da340ab1f.svn-base b/libs/lib/.svn/pristine/8b/8b11a58ba1663091fde4e975e083618da340ab1f.svn-base new file mode 100755 index 0000000..8e1d7fe Binary files /dev/null and b/libs/lib/.svn/pristine/8b/8b11a58ba1663091fde4e975e083618da340ab1f.svn-base differ diff --git a/libs/lib/.svn/pristine/97/9746af1a485e50cf18dcb232489032a847067066.svn-base b/libs/lib/.svn/pristine/97/9746af1a485e50cf18dcb232489032a847067066.svn-base new file mode 100755 index 0000000..0a56a58 Binary files /dev/null and b/libs/lib/.svn/pristine/97/9746af1a485e50cf18dcb232489032a847067066.svn-base differ diff --git a/libs/lib/.svn/pristine/97/97b002d475dec96f6444fda43eb2e1e2b167266d.svn-base b/libs/lib/.svn/pristine/97/97b002d475dec96f6444fda43eb2e1e2b167266d.svn-base new file mode 100755 index 0000000..0546228 Binary files /dev/null and b/libs/lib/.svn/pristine/97/97b002d475dec96f6444fda43eb2e1e2b167266d.svn-base differ diff --git a/libs/lib/.svn/pristine/a0/a080a5fdb072a9ffa789b3419c6a6d1a8e01b218.svn-base b/libs/lib/.svn/pristine/a0/a080a5fdb072a9ffa789b3419c6a6d1a8e01b218.svn-base new file mode 100755 index 0000000..60be325 Binary files /dev/null and b/libs/lib/.svn/pristine/a0/a080a5fdb072a9ffa789b3419c6a6d1a8e01b218.svn-base differ diff --git a/libs/lib/.svn/pristine/b8/b8739ad7188d517aeb74c55ebdc856969c013747.svn-base b/libs/lib/.svn/pristine/b8/b8739ad7188d517aeb74c55ebdc856969c013747.svn-base new file mode 100755 index 0000000..1b30881 Binary files /dev/null and b/libs/lib/.svn/pristine/b8/b8739ad7188d517aeb74c55ebdc856969c013747.svn-base differ diff --git a/libs/lib/.svn/pristine/b8/b88a4887b426d0bc71e2be1ae07f5fe7c92d846b.svn-base b/libs/lib/.svn/pristine/b8/b88a4887b426d0bc71e2be1ae07f5fe7c92d846b.svn-base new file mode 100755 index 0000000..e337d58 Binary files /dev/null and b/libs/lib/.svn/pristine/b8/b88a4887b426d0bc71e2be1ae07f5fe7c92d846b.svn-base differ diff --git a/libs/lib/.svn/pristine/cc/cc2ddeab547504594aea9283898dcdb3d8cff010.svn-base b/libs/lib/.svn/pristine/cc/cc2ddeab547504594aea9283898dcdb3d8cff010.svn-base new file mode 100755 index 0000000..be37aea --- /dev/null +++ b/libs/lib/.svn/pristine/cc/cc2ddeab547504594aea9283898dcdb3d8cff010.svn-base @@ -0,0 +1,384 @@ + + +GNU GENERAL PUBLIC LICENSE + + + +

+ GNU GENERAL PUBLIC LICENSE +
+

+ Version 2, June 1991 +
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc. +
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +
+ Everyone is permitted to copy and distribute verbatim copies of this license document, + but changing it is not allowed. +
+
+

+ Preamble

+

+ The licenses for most software are designed to take away your freedom to share and + change it. By contrast, the GNU General Public License is intended to guarantee + your freedom to share and change free software--to make sure the software is free + for all its users. This General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to using it. + (Some other Free Software Foundation software is covered by the GNU Library General + Public License instead.) You can apply it to your programs, too. +
+

+

+ When we speak of free software, we are referring to freedom, not price. Our General + Public Licenses are designed to make sure that you have the freedom to distribute + copies of free software (and charge for this service if you wish), that you receive + source code or can get it if you want it, that you can change the software or use + pieces of it in new free programs; and that you know you can do these things. +
+

+

+ To protect your rights, we need to make restrictions that forbid anyone to deny + you these rights or to ask you to surrender the rights. These restrictions translate + to certain responsibilities for you if you distribute copies of the software, or + if you modify it. +
+
+ For example, if you distribute copies of such a program, whether gratis or for a + fee, you must give the recipients all the rights that you have. You must make sure + that they, too, receive or can get the source code. And you must show them these + terms so they know their rights. +
+
+ We protect your rights with two steps: (1) copyright the software, and (2) offer + you this license which gives you legal permission to copy, distribute and/or modify + the software. +
+
+ Also, for each author's protection and ours, we want to make certain that everyone + understands that there is no warranty for this free software. If the software is + modified by someone else and passed on, we want its recipients to know that what + they have is not the original, so that any problems introduced by others will not + reflect on the original authors' reputations. +
+
+ Finally, any free program is threatened constantly by software patents. We wish + to avoid the danger that redistributors of a free program will individually obtain + patent licenses, in effect making the program proprietary. To prevent this, we have + made it clear that any patent must be licensed for everyone's free use or not licensed + at all. +
+
+ The precise terms and conditions for copying, distribution and modification follow. +
+

+

+ GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +
+
+ 0. This License applies to any program or other work which contains a notice placed + by the copyright holder saying it may be distributed under the terms of this General + Public License. The "Program", below, refers to any such program or work, and a + "work based on the Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another language. (Hereinafter, + translation is included without limitation in the term "modification".) Each licensee + is addressed as "you". +
+
+ Activities other than copying, distribution and modification are not covered by + this License; they are outside its scope. The act of running the Program is not + restricted, and the output from the Program is covered only if its contents constitute + a work based on the Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. +
+
+ 1. You may copy and distribute verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and appropriately publish + on each copy an appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any warranty; and + give any other recipients of the Program a copy of this License along with the Program. +
+
+ You may charge a fee for the physical act of transferring a copy, and you may at + your option offer warranty protection in exchange for a fee. +
+
+ 2. You may modify your copy or copies of the Program or any portion of it, thus + forming a work based on the Program, and copy and distribute such modifications + or work under the terms of Section 1 above, provided that you also meet all of these + conditions: +
+ a) You must cause the modified files to carry prominent notices stating that you + changed the files and the date of any change. +
+ b) You must cause any work that you distribute or publish, that in whole or in part + contains or is derived from the Program or any part thereof, to be licensed as a + whole at no charge to all third parties under the terms of this License. +
+ c) If the modified program normally reads commands interactively when run, you must + cause it, when started running for such interactive use in the most ordinary way, + to print or display an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you provide a warranty) + and that users may redistribute the program under these conditions, and telling + the user how to view a copy of this License. (Exception: if the Program itself is + interactive but does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +
+
+ These requirements apply to the modified work as a whole. If identifiable sections + of that work are not derived from the Program, and can be reasonably considered + independent and separate works in themselves, then this License, and its terms, + do not apply to those sections when you distribute them as separate works. But when + you distribute the same sections as part of a whole which is a work based on the + Program, the distribution of the whole must be on the terms of this License, whose + permissions for other licensees extend to the entire whole, and thus to each and + every part regardless of who wrote it. +
+
+ Thus, it is not the intent of this section to claim rights or contest your rights + to work written entirely by you; rather, the intent is to exercise the right to + control the distribution of derivative or collective works based on the Program. +
+
+ In addition, mere aggregation of another work not based on the Program with the + Program (or with a work based on the Program) on a volume of a storage or distribution + medium does not bring the other work under the scope of this License. +
+
+ 3. You may copy and distribute the Program (or a work based on it, under Section + 2) in object code or executable form under the terms of Sections 1 and 2 above provided + that you also do one of the following: +
+ a) Accompany it with the complete corresponding machine-readable source code, which + must be distributed under the terms of Sections 1 and 2 above on a medium customarily + used for software interchange; or, +
+ b) Accompany it with a written offer, valid for at least three years, to give any + third party, for a charge no more than your cost of physically performing source + distribution, a complete machine-readable copy of the corresponding source code, + to be distributed under the terms of Sections 1 and 2 above on a medium customarily + used for software interchange; or, +
+ c) Accompany it with the information you received as to the offer to distribute + corresponding source code. (This alternative is allowed only for noncommercial distribution + and only if you received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+
+ The source code for a work means the preferred form of the work for making modifications + to it. For an executable work, complete source code means all the source code for + all modules it contains, plus any associated interface definition files, plus the + scripts used to control compilation and installation of the executable. However, + as a special exception, the source code distributed need not include anything that + is normally distributed (in either source or binary form) with the major components + (compiler, kernel, and so on) of the operating system on which the executable runs, + unless that component itself accompanies the executable. +
+
+ If distribution of executable or object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the source code + from the same place counts as distribution of the source code, even though third + parties are not compelled to copy the source along with the object code. +
+
+ 4. You may not copy, modify, sublicense, or distribute the Program except as expressly + provided under this License. Any attempt otherwise to copy, modify, sublicense or + distribute the Program is void, and will automatically terminate your rights under + this License. However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such parties remain + in full compliance. +
+
+ 5. You are not required to accept this License, since you have not signed it. However, + nothing else grants you permission to modify or distribute the Program or its derivative + works. These actions are prohibited by law if you do not accept this License. Therefore, + by modifying or distributing the Program (or any work based on the Program), you + indicate your acceptance of this License to do so, and all its terms and conditions + for copying, distributing or modifying the Program or works based on it. +
+
+ 6. Each time you redistribute the Program (or any work based on the Program), the + recipient automatically receives a license from the original licensor to copy, distribute + or modify the Program subject to these terms and conditions. You may not impose + any further restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to this License. +
+
+ 7. If, as a consequence of a court judgment or allegation of patent infringement + or for any other reason (not limited to patent issues), conditions are imposed on + you (whether by court order, agreement or otherwise) that contradict the conditions + of this License, they do not excuse you from the conditions of this License. If + you cannot distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you may not distribute + the Program at all. For example, if a patent license would not permit royalty-free + redistribution of the Program by all those who receive copies directly or indirectly + through you, then the only way you could satisfy both it and this License would + be to refrain entirely from distribution of the Program. +
+
+ If any portion of this section is held invalid or unenforceable under any particular + circumstance, the balance of the section is intended to apply and the section as + a whole is intended to apply in other circumstances. +
+
+ It is not the purpose of this section to induce you to infringe any patents or other + property right claims or to contest validity of any such claims; this section has + the sole purpose of protecting the integrity of the free software distribution system, + which is implemented by public license practices. Many people have made generous + contributions to the wide range of software distributed through that system in reliance + on consistent application of that system; it is up to the author/donor to decide + if he or she is willing to distribute software through any other system and a licensee + cannot impose that choice. +
+
+ This section is intended to make thoroughly clear what is believed to be a consequence + of the rest of this License. +
+
+ 8. If the distribution and/or use of the Program is restricted in certain countries + either by patents or by copyrighted interfaces, the original copyright holder who + places the Program under this License may add an explicit geographical distribution + limitation excluding those countries, so that distribution is permitted only in + or among countries not thus excluded. In such case, this License incorporates the + limitation as if written in the body of this License. +
+
+ 9. The Free Software Foundation may publish revised and/or new versions of the General + Public License from time to time. Such new versions will be similar in spirit to + the present version, but may differ in detail to address new problems or concerns. +
+
+ Each version is given a distinguishing version number. If the Program specifies + a version number of this License which applies to it and "any later version", you + have the option of following the terms and conditions either of that version or + of any later version published by the Free Software Foundation. If the Program does + not specify a version number of this License, you may choose any version ever published + by the Free Software Foundation. +
+
+ 10. If you wish to incorporate parts of the Program into other free programs whose + distribution conditions are different, write to the author to ask for permission. + For software which is copyrighted by the Free Software Foundation, write to the + Free Software Foundation; we sometimes make exceptions for this. Our decision will + be guided by the two goals of preserving the free status of all derivatives of our + free software and of promoting the sharing and reuse of software generally. +
+
+ NO WARRANTY +
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE + PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED + IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD + THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + OR CORRECTION. +
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY + COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM + AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE + PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE + OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE + WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. +
+
+ END OF TERMS AND CONDITIONS +
+
+ How to Apply These Terms to Your New Programs +
+
+ If you develop a new program, and you want it to be of the greatest possible use + to the public, the best way to achieve this is to make it free software which everyone + can redistribute and change under these terms. +
+
+ To do so, attach the following notices to the program. It is safest to attach them + to the start of each source file to most effectively convey the exclusion of warranty; + and each file should have at least the "copyright" line and a pointer to where the + full notice is found. 
+

+

+ <one line to give the program's name and a brief idea of what it does.>
+ + Copyright (C) <year> <name of author> +

+ +

+ This program is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. +

+

+ This program + is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. +

+

+ You should have received a + copy of the GNU General Public License along with this program; if not, write to + the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA

+
+

+ Also add information on how to contact you by electronic and paper mail. +

+

+ If + the program is interactive, make it output a short notice like this when it starts + in an interactive mode: +

+
+ Gnomovision version 69, Copyright (C) year name of author +
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is + free software, and you are welcome to redistribute it under certain conditions; + type `show c' for details. +
+

+ The hypothetical commands `show w' and `show c' should + show the appropriate parts of the General Public License. Of course, the commands + you use may be called something other than `show w' and `show c'; they could even + be mouse-clicks or menu items + -whatever suits your program. +

+

+ You should also get + your employer (if you work as a programmer) or your school, if any, to sign a "copyright + disclaimer" for the program, if necessary. Here is a sample; alter the names: +

+ +
+

+ Yoyodyne, + Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which + makes passes at compilers) written by James Hacker.

+

+ <signature of Ty Coon>, + 1 April 1989
Ty Coon, President of Vice +

+
+

+ This General Public License does not permit + incorporating your program into proprietary programs. If your program is a subroutine + library, you may consider it more useful to permit linking proprietary applications + with the library. If this is what you want to do, use the GNU Library General Public + License instead of this License. +

+ + \ No newline at end of file diff --git a/libs/lib/.svn/pristine/d0/d04c56a6a57f9c2551d28d3f384763cefe9628f0.svn-base b/libs/lib/.svn/pristine/d0/d04c56a6a57f9c2551d28d3f384763cefe9628f0.svn-base new file mode 100755 index 0000000..9b90c4f Binary files /dev/null and b/libs/lib/.svn/pristine/d0/d04c56a6a57f9c2551d28d3f384763cefe9628f0.svn-base differ diff --git a/libs/lib/.svn/pristine/d8/d87cd15e270f96580def5d2a4379f6fd9529b12f.svn-base b/libs/lib/.svn/pristine/d8/d87cd15e270f96580def5d2a4379f6fd9529b12f.svn-base new file mode 100755 index 0000000..2f212f9 Binary files /dev/null and b/libs/lib/.svn/pristine/d8/d87cd15e270f96580def5d2a4379f6fd9529b12f.svn-base differ diff --git a/libs/lib/.svn/pristine/f4/f46052bc57d87e628d848506ba3806e0a592ef7c.svn-base b/libs/lib/.svn/pristine/f4/f46052bc57d87e628d848506ba3806e0a592ef7c.svn-base new file mode 100755 index 0000000..18268d3 --- /dev/null +++ b/libs/lib/.svn/pristine/f4/f46052bc57d87e628d848506ba3806e0a592ef7c.svn-base @@ -0,0 +1,144 @@ + + +Readme + + + + This folder contains library files, which you can use in your projects. +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ant.jar + ant build tool, used to build db4o sources (http://ant.apache.org/)
+ bloat-1.0.jar + bytecode optimization library, used to optmize Native Queries and Transparent Activation
+ db4o-8.0.276.16149-all-java5.jar + no-dependency jar with all db4o binaries for JDK 5 and JDK 6
+ db4o-8.0.276.16149-bench.jar + IO benchmark library +
+ db4o-8.0.276.16149-core-java5.jar + db4o database engine core for JDK 5 and JDK 6
+ db4o-8.0.276.16149-cs-java5.jar + db4o client/server components for JDK 5 and JDK 6
+ db4o-8.0.276.16149-db4ounit-java1.5.jar + + testing framework for db4o needs for JDK 5 and JDK 6 +
+ db4o-8.0.276.16149-instrumentation.jar + Instrumentation layer on top of bloat +
+ db4o-8.0.276.16149-nqopt.jar + Native Query optimization library. This library should be available in the classpath + for NQ optimization
+ db4o-8.0.276.16149-optional-java5.jar + db4o optional components for JDK 5 and JDK 6
+ db4o-8.0.276.16149-osgi.jar + db4o for OSGi. See OSGi API documentation.
+ db4o-8.0.276.16149-osgi-test.jar + db4o OSGI tests
+ db4o-8.0.276.16149-taj.jar + db4o instrumentation classes for Transparent Activation +
+ db4o-8.0.276.16149-tools.jar + db4o tools user interface, contains db4o enhancer and Ant tasks +
+
+
+

+ USING DB4O LIBRARIES +

+

+ To use db4o you need at least db4o-8.0.276.16149-core-java5.jar. +

+

+ For using db4o in client/server mode you will additionally need the respective + client/server library, i.e. db4o-8.0.276.16149-cs-java5.jar. + You can also use the nodependency db4o library (db4o-8.0.276.16149-all-java5.jar). +

+

+ db4o optional components (BigMath- and UUID-support, file statistics, etc) can be obtained from + db4o optional jars (i.e. db4o-8.0.276.16149-optional-java5.jar. + These components are also included in the nodependency jar (db4o-8.0.276.16149-all-java5.jar). +

+

+ For Native Query optimization you will additionally need:
+ bloat-1.0.jar
+ db4o-8.0.276.16149-instrumentation.jar
+ db4o-8.0.276.16149-nqopt.jar
+ db4o-8.0.276.16149-tools.jar
+ These components are also included in the nodependency jar (db4o-8.0.276.16149-all-java5.jar). +

+

+ For Transparent Activation optimization you will additionally need:
+ bloat-1.0.jar
+ db4o-8.0.276.16149-instrumentation.jar
+ db4o-8.0.276.16149-taj.jar
+ db4o-8.0.276.16149-tools.jar
+ These components are also included in the nodependency jar (db4o-8.0.276.16149-all-java5.jar). +

+ + \ No newline at end of file diff --git a/libs/lib/.svn/wc.db b/libs/lib/.svn/wc.db new file mode 100755 index 0000000..6516301 Binary files /dev/null and b/libs/lib/.svn/wc.db differ diff --git a/libs/lib/.svn/wc.db-journal b/libs/lib/.svn/wc.db-journal new file mode 100755 index 0000000..e69de29 diff --git a/libs/lib/3rdpartylibs.html b/libs/lib/3rdpartylibs.html new file mode 100755 index 0000000..e34c8e5 --- /dev/null +++ b/libs/lib/3rdpartylibs.html @@ -0,0 +1,40 @@ + + +3rd Party + + + +

+ This distribution comes with the 3rd party libraries listed below. +
+ These are not needed for plain db4o operation, but only for specific use cases involving + native query optimization. +

+

+ bloat-1.0.jar +
+ http://www.cs.purdue.edu/s3/projects/bloat/ +
+ Needed for bytecode analysis during native query optimization. Must be on the runtime + classpath for optimization at load or query execution time, must be present during + the Ant build for class file optimization. +

+

+ ant.jar +
+ http://ant.apache.org/ +
+ Needed for the native query optimization Ant task. +

+

+ Please refer to the license files for these libraries as well as to the Licensing + and Native Query Optimization chapter in the tutorial for further information.

+ + \ No newline at end of file diff --git a/libs/lib/ant.jar b/libs/lib/ant.jar new file mode 100755 index 0000000..0a56a58 Binary files /dev/null and b/libs/lib/ant.jar differ diff --git a/libs/lib/ant.license.html b/libs/lib/ant.license.html new file mode 100755 index 0000000..9215dec --- /dev/null +++ b/libs/lib/ant.license.html @@ -0,0 +1,54 @@ + + +The Apache Software License + + + + The Apache Software License, Version 1.1
+
+ Copyright (C) 2000-2002 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: 
+
    +
  1. Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. 
  2. +
  3. Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. 
  4. +
  5. The end-user documentation included with the redistribution, if any, must include + the following acknowledgment: "This product includes software developed by the Apache + Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if and wherever + such third-party acknowledgments normally appear. 
  6. +
  7. The names "Ant" and "Apache Software Foundation" must not be used to endorse or + promote products derived from this software without prior written permission. For + written permission, please contact apache@apache.org.
  8. +
  9. Products derived from this software may not be called "Apache", nor may "Apache" + appear in their name, without prior written permission of the Apache Software Foundation. +
  10. +
+

+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION + OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +

+

+ This software consists of voluntary contributions made by many individuals on behalf + of the Apache Software Foundation. For more information on the Apache Software Foundation, + please see <http://www.apache.org/>

+ + \ No newline at end of file diff --git a/libs/lib/bloat-1.0.jar b/libs/lib/bloat-1.0.jar new file mode 100755 index 0000000..9b90c4f Binary files /dev/null and b/libs/lib/bloat-1.0.jar differ diff --git a/libs/lib/bloat.license.html b/libs/lib/bloat.license.html new file mode 100755 index 0000000..be37aea --- /dev/null +++ b/libs/lib/bloat.license.html @@ -0,0 +1,384 @@ + + +GNU GENERAL PUBLIC LICENSE + + + +

+ GNU GENERAL PUBLIC LICENSE +
+

+ Version 2, June 1991 +
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc. +
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +
+ Everyone is permitted to copy and distribute verbatim copies of this license document, + but changing it is not allowed. +
+
+

+ Preamble

+

+ The licenses for most software are designed to take away your freedom to share and + change it. By contrast, the GNU General Public License is intended to guarantee + your freedom to share and change free software--to make sure the software is free + for all its users. This General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to using it. + (Some other Free Software Foundation software is covered by the GNU Library General + Public License instead.) You can apply it to your programs, too. +
+

+

+ When we speak of free software, we are referring to freedom, not price. Our General + Public Licenses are designed to make sure that you have the freedom to distribute + copies of free software (and charge for this service if you wish), that you receive + source code or can get it if you want it, that you can change the software or use + pieces of it in new free programs; and that you know you can do these things. +
+

+

+ To protect your rights, we need to make restrictions that forbid anyone to deny + you these rights or to ask you to surrender the rights. These restrictions translate + to certain responsibilities for you if you distribute copies of the software, or + if you modify it. +
+
+ For example, if you distribute copies of such a program, whether gratis or for a + fee, you must give the recipients all the rights that you have. You must make sure + that they, too, receive or can get the source code. And you must show them these + terms so they know their rights. +
+
+ We protect your rights with two steps: (1) copyright the software, and (2) offer + you this license which gives you legal permission to copy, distribute and/or modify + the software. +
+
+ Also, for each author's protection and ours, we want to make certain that everyone + understands that there is no warranty for this free software. If the software is + modified by someone else and passed on, we want its recipients to know that what + they have is not the original, so that any problems introduced by others will not + reflect on the original authors' reputations. +
+
+ Finally, any free program is threatened constantly by software patents. We wish + to avoid the danger that redistributors of a free program will individually obtain + patent licenses, in effect making the program proprietary. To prevent this, we have + made it clear that any patent must be licensed for everyone's free use or not licensed + at all. +
+
+ The precise terms and conditions for copying, distribution and modification follow. +
+

+

+ GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +
+
+ 0. This License applies to any program or other work which contains a notice placed + by the copyright holder saying it may be distributed under the terms of this General + Public License. The "Program", below, refers to any such program or work, and a + "work based on the Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another language. (Hereinafter, + translation is included without limitation in the term "modification".) Each licensee + is addressed as "you". +
+
+ Activities other than copying, distribution and modification are not covered by + this License; they are outside its scope. The act of running the Program is not + restricted, and the output from the Program is covered only if its contents constitute + a work based on the Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. +
+
+ 1. You may copy and distribute verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and appropriately publish + on each copy an appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any warranty; and + give any other recipients of the Program a copy of this License along with the Program. +
+
+ You may charge a fee for the physical act of transferring a copy, and you may at + your option offer warranty protection in exchange for a fee. +
+
+ 2. You may modify your copy or copies of the Program or any portion of it, thus + forming a work based on the Program, and copy and distribute such modifications + or work under the terms of Section 1 above, provided that you also meet all of these + conditions: +
+ a) You must cause the modified files to carry prominent notices stating that you + changed the files and the date of any change. +
+ b) You must cause any work that you distribute or publish, that in whole or in part + contains or is derived from the Program or any part thereof, to be licensed as a + whole at no charge to all third parties under the terms of this License. +
+ c) If the modified program normally reads commands interactively when run, you must + cause it, when started running for such interactive use in the most ordinary way, + to print or display an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you provide a warranty) + and that users may redistribute the program under these conditions, and telling + the user how to view a copy of this License. (Exception: if the Program itself is + interactive but does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +
+
+ These requirements apply to the modified work as a whole. If identifiable sections + of that work are not derived from the Program, and can be reasonably considered + independent and separate works in themselves, then this License, and its terms, + do not apply to those sections when you distribute them as separate works. But when + you distribute the same sections as part of a whole which is a work based on the + Program, the distribution of the whole must be on the terms of this License, whose + permissions for other licensees extend to the entire whole, and thus to each and + every part regardless of who wrote it. +
+
+ Thus, it is not the intent of this section to claim rights or contest your rights + to work written entirely by you; rather, the intent is to exercise the right to + control the distribution of derivative or collective works based on the Program. +
+
+ In addition, mere aggregation of another work not based on the Program with the + Program (or with a work based on the Program) on a volume of a storage or distribution + medium does not bring the other work under the scope of this License. +
+
+ 3. You may copy and distribute the Program (or a work based on it, under Section + 2) in object code or executable form under the terms of Sections 1 and 2 above provided + that you also do one of the following: +
+ a) Accompany it with the complete corresponding machine-readable source code, which + must be distributed under the terms of Sections 1 and 2 above on a medium customarily + used for software interchange; or, +
+ b) Accompany it with a written offer, valid for at least three years, to give any + third party, for a charge no more than your cost of physically performing source + distribution, a complete machine-readable copy of the corresponding source code, + to be distributed under the terms of Sections 1 and 2 above on a medium customarily + used for software interchange; or, +
+ c) Accompany it with the information you received as to the offer to distribute + corresponding source code. (This alternative is allowed only for noncommercial distribution + and only if you received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +
+
+ The source code for a work means the preferred form of the work for making modifications + to it. For an executable work, complete source code means all the source code for + all modules it contains, plus any associated interface definition files, plus the + scripts used to control compilation and installation of the executable. However, + as a special exception, the source code distributed need not include anything that + is normally distributed (in either source or binary form) with the major components + (compiler, kernel, and so on) of the operating system on which the executable runs, + unless that component itself accompanies the executable. +
+
+ If distribution of executable or object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the source code + from the same place counts as distribution of the source code, even though third + parties are not compelled to copy the source along with the object code. +
+
+ 4. You may not copy, modify, sublicense, or distribute the Program except as expressly + provided under this License. Any attempt otherwise to copy, modify, sublicense or + distribute the Program is void, and will automatically terminate your rights under + this License. However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such parties remain + in full compliance. +
+
+ 5. You are not required to accept this License, since you have not signed it. However, + nothing else grants you permission to modify or distribute the Program or its derivative + works. These actions are prohibited by law if you do not accept this License. Therefore, + by modifying or distributing the Program (or any work based on the Program), you + indicate your acceptance of this License to do so, and all its terms and conditions + for copying, distributing or modifying the Program or works based on it. +
+
+ 6. Each time you redistribute the Program (or any work based on the Program), the + recipient automatically receives a license from the original licensor to copy, distribute + or modify the Program subject to these terms and conditions. You may not impose + any further restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to this License. +
+
+ 7. If, as a consequence of a court judgment or allegation of patent infringement + or for any other reason (not limited to patent issues), conditions are imposed on + you (whether by court order, agreement or otherwise) that contradict the conditions + of this License, they do not excuse you from the conditions of this License. If + you cannot distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you may not distribute + the Program at all. For example, if a patent license would not permit royalty-free + redistribution of the Program by all those who receive copies directly or indirectly + through you, then the only way you could satisfy both it and this License would + be to refrain entirely from distribution of the Program. +
+
+ If any portion of this section is held invalid or unenforceable under any particular + circumstance, the balance of the section is intended to apply and the section as + a whole is intended to apply in other circumstances. +
+
+ It is not the purpose of this section to induce you to infringe any patents or other + property right claims or to contest validity of any such claims; this section has + the sole purpose of protecting the integrity of the free software distribution system, + which is implemented by public license practices. Many people have made generous + contributions to the wide range of software distributed through that system in reliance + on consistent application of that system; it is up to the author/donor to decide + if he or she is willing to distribute software through any other system and a licensee + cannot impose that choice. +
+
+ This section is intended to make thoroughly clear what is believed to be a consequence + of the rest of this License. +
+
+ 8. If the distribution and/or use of the Program is restricted in certain countries + either by patents or by copyrighted interfaces, the original copyright holder who + places the Program under this License may add an explicit geographical distribution + limitation excluding those countries, so that distribution is permitted only in + or among countries not thus excluded. In such case, this License incorporates the + limitation as if written in the body of this License. +
+
+ 9. The Free Software Foundation may publish revised and/or new versions of the General + Public License from time to time. Such new versions will be similar in spirit to + the present version, but may differ in detail to address new problems or concerns. +
+
+ Each version is given a distinguishing version number. If the Program specifies + a version number of this License which applies to it and "any later version", you + have the option of following the terms and conditions either of that version or + of any later version published by the Free Software Foundation. If the Program does + not specify a version number of this License, you may choose any version ever published + by the Free Software Foundation. +
+
+ 10. If you wish to incorporate parts of the Program into other free programs whose + distribution conditions are different, write to the author to ask for permission. + For software which is copyrighted by the Free Software Foundation, write to the + Free Software Foundation; we sometimes make exceptions for this. Our decision will + be guided by the two goals of preserving the free status of all derivatives of our + free software and of promoting the sharing and reuse of software generally. +
+
+ NO WARRANTY +
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE + PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED + IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD + THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + OR CORRECTION. +
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY + COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM + AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE + PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE + OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE + WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. +
+
+ END OF TERMS AND CONDITIONS +
+
+ How to Apply These Terms to Your New Programs +
+
+ If you develop a new program, and you want it to be of the greatest possible use + to the public, the best way to achieve this is to make it free software which everyone + can redistribute and change under these terms. +
+
+ To do so, attach the following notices to the program. It is safest to attach them + to the start of each source file to most effectively convey the exclusion of warranty; + and each file should have at least the "copyright" line and a pointer to where the + full notice is found. 
+

+

+ <one line to give the program's name and a brief idea of what it does.>
+ + Copyright (C) <year> <name of author> +

+ +

+ This program is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. +

+

+ This program + is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. +

+

+ You should have received a + copy of the GNU General Public License along with this program; if not, write to + the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA

+
+

+ Also add information on how to contact you by electronic and paper mail. +

+

+ If + the program is interactive, make it output a short notice like this when it starts + in an interactive mode: +

+
+ Gnomovision version 69, Copyright (C) year name of author +
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is + free software, and you are welcome to redistribute it under certain conditions; + type `show c' for details. +
+

+ The hypothetical commands `show w' and `show c' should + show the appropriate parts of the General Public License. Of course, the commands + you use may be called something other than `show w' and `show c'; they could even + be mouse-clicks or menu items + -whatever suits your program. +

+

+ You should also get + your employer (if you work as a programmer) or your school, if any, to sign a "copyright + disclaimer" for the program, if necessary. Here is a sample; alter the names: +

+ +
+

+ Yoyodyne, + Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which + makes passes at compilers) written by James Hacker.

+

+ <signature of Ty Coon>, + 1 April 1989
Ty Coon, President of Vice +

+
+

+ This General Public License does not permit + incorporating your program into proprietary programs. If your program is a subroutine + library, you may consider it more useful to permit linking proprietary applications + with the library. If this is what you want to do, use the GNU Library General Public + License instead of this License. +

+ + \ No newline at end of file diff --git a/libs/lib/db4o-8.0.276.16149-all-java5.jar b/libs/lib/db4o-8.0.276.16149-all-java5.jar new file mode 100755 index 0000000..60be325 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-all-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-bench.jar b/libs/lib/db4o-8.0.276.16149-bench.jar new file mode 100755 index 0000000..e337d58 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-bench.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-core-java5.jar b/libs/lib/db4o-8.0.276.16149-core-java5.jar new file mode 100755 index 0000000..0546228 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-core-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-cs-java5.jar b/libs/lib/db4o-8.0.276.16149-cs-java5.jar new file mode 100755 index 0000000..bf03020 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-cs-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-cs.optional-java5.jar b/libs/lib/db4o-8.0.276.16149-cs.optional-java5.jar new file mode 100755 index 0000000..aa4980e Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-cs.optional-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-db4ounit-java5.jar b/libs/lib/db4o-8.0.276.16149-db4ounit-java5.jar new file mode 100755 index 0000000..1cf4a2a Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-db4ounit-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-instrumentation-java5.jar b/libs/lib/db4o-8.0.276.16149-instrumentation-java5.jar new file mode 100755 index 0000000..7f74394 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-instrumentation-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-nqopt-java5.jar b/libs/lib/db4o-8.0.276.16149-nqopt-java5.jar new file mode 100755 index 0000000..5e638f9 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-nqopt-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-optional-java5.jar b/libs/lib/db4o-8.0.276.16149-optional-java5.jar new file mode 100755 index 0000000..f792ba1 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-optional-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-osgi-java5.jar b/libs/lib/db4o-8.0.276.16149-osgi-java5.jar new file mode 100755 index 0000000..e1a5f67 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-osgi-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-osgi-test-java5.jar b/libs/lib/db4o-8.0.276.16149-osgi-test-java5.jar new file mode 100755 index 0000000..8e1d7fe Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-osgi-test-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-taj-java5.jar b/libs/lib/db4o-8.0.276.16149-taj-java5.jar new file mode 100755 index 0000000..2f212f9 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-taj-java5.jar differ diff --git a/libs/lib/db4o-8.0.276.16149-tools-java5.jar b/libs/lib/db4o-8.0.276.16149-tools-java5.jar new file mode 100755 index 0000000..1b30881 Binary files /dev/null and b/libs/lib/db4o-8.0.276.16149-tools-java5.jar differ diff --git a/libs/lib/readme.html b/libs/lib/readme.html new file mode 100755 index 0000000..18268d3 --- /dev/null +++ b/libs/lib/readme.html @@ -0,0 +1,144 @@ + + +Readme + + + + This folder contains library files, which you can use in your projects. +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ant.jar + ant build tool, used to build db4o sources (http://ant.apache.org/)
+ bloat-1.0.jar + bytecode optimization library, used to optmize Native Queries and Transparent Activation
+ db4o-8.0.276.16149-all-java5.jar + no-dependency jar with all db4o binaries for JDK 5 and JDK 6
+ db4o-8.0.276.16149-bench.jar + IO benchmark library +
+ db4o-8.0.276.16149-core-java5.jar + db4o database engine core for JDK 5 and JDK 6
+ db4o-8.0.276.16149-cs-java5.jar + db4o client/server components for JDK 5 and JDK 6
+ db4o-8.0.276.16149-db4ounit-java1.5.jar + + testing framework for db4o needs for JDK 5 and JDK 6 +
+ db4o-8.0.276.16149-instrumentation.jar + Instrumentation layer on top of bloat +
+ db4o-8.0.276.16149-nqopt.jar + Native Query optimization library. This library should be available in the classpath + for NQ optimization
+ db4o-8.0.276.16149-optional-java5.jar + db4o optional components for JDK 5 and JDK 6
+ db4o-8.0.276.16149-osgi.jar + db4o for OSGi. See OSGi API documentation.
+ db4o-8.0.276.16149-osgi-test.jar + db4o OSGI tests
+ db4o-8.0.276.16149-taj.jar + db4o instrumentation classes for Transparent Activation +
+ db4o-8.0.276.16149-tools.jar + db4o tools user interface, contains db4o enhancer and Ant tasks +
+
+
+

+ USING DB4O LIBRARIES +

+

+ To use db4o you need at least db4o-8.0.276.16149-core-java5.jar. +

+

+ For using db4o in client/server mode you will additionally need the respective + client/server library, i.e. db4o-8.0.276.16149-cs-java5.jar. + You can also use the nodependency db4o library (db4o-8.0.276.16149-all-java5.jar). +

+

+ db4o optional components (BigMath- and UUID-support, file statistics, etc) can be obtained from + db4o optional jars (i.e. db4o-8.0.276.16149-optional-java5.jar. + These components are also included in the nodependency jar (db4o-8.0.276.16149-all-java5.jar). +

+

+ For Native Query optimization you will additionally need:
+ bloat-1.0.jar
+ db4o-8.0.276.16149-instrumentation.jar
+ db4o-8.0.276.16149-nqopt.jar
+ db4o-8.0.276.16149-tools.jar
+ These components are also included in the nodependency jar (db4o-8.0.276.16149-all-java5.jar). +

+

+ For Transparent Activation optimization you will additionally need:
+ bloat-1.0.jar
+ db4o-8.0.276.16149-instrumentation.jar
+ db4o-8.0.276.16149-taj.jar
+ db4o-8.0.276.16149-tools.jar
+ These components are also included in the nodependency jar (db4o-8.0.276.16149-all-java5.jar). +

+ + \ No newline at end of file diff --git a/out/production/Lernmaschine/LearningMachine/LearningMachine.class b/out/production/Lernmaschine/LearningMachine/LearningMachine.class new file mode 100755 index 0000000..f911004 Binary files /dev/null and b/out/production/Lernmaschine/LearningMachine/LearningMachine.class differ diff --git a/out/production/Lernmaschine/LearningMachine/ServerSetup.class b/out/production/Lernmaschine/LearningMachine/ServerSetup.class new file mode 100755 index 0000000..8a65a55 Binary files /dev/null and b/out/production/Lernmaschine/LearningMachine/ServerSetup.class differ diff --git a/out/production/Lernmaschine/LearningMachine/StartServer.class b/out/production/Lernmaschine/LearningMachine/StartServer.class new file mode 100755 index 0000000..13053e9 Binary files /dev/null and b/out/production/Lernmaschine/LearningMachine/StartServer.class differ diff --git a/out/production/Lernmaschine/LearningMachine/StopServer.class b/out/production/Lernmaschine/LearningMachine/StopServer.class new file mode 100755 index 0000000..43687d1 Binary files /dev/null and b/out/production/Lernmaschine/LearningMachine/StopServer.class differ diff --git a/out/production/Lernmaschine/META-INF/Lernmaschine.kotlin_module b/out/production/Lernmaschine/META-INF/Lernmaschine.kotlin_module new file mode 100755 index 0000000..a49347a Binary files /dev/null and b/out/production/Lernmaschine/META-INF/Lernmaschine.kotlin_module differ diff --git a/out/production/Lernmaschine/META-INF/MANIFEST.MF b/out/production/Lernmaschine/META-INF/MANIFEST.MF new file mode 100755 index 0000000..ce31649 --- /dev/null +++ b/out/production/Lernmaschine/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Main-Class: LearningMachine.LearningMachine + + diff --git a/out/production/Lernmaschine/storage/Category.class b/out/production/Lernmaschine/storage/Category.class new file mode 100755 index 0000000..32bb5e8 Binary files /dev/null and b/out/production/Lernmaschine/storage/Category.class differ diff --git a/out/production/Lernmaschine/storage/Database_db4o.class b/out/production/Lernmaschine/storage/Database_db4o.class new file mode 100755 index 0000000..a152677 Binary files /dev/null and b/out/production/Lernmaschine/storage/Database_db4o.class differ diff --git a/out/production/Lernmaschine/storage/Format.class b/out/production/Lernmaschine/storage/Format.class new file mode 100755 index 0000000..7f1aecc Binary files /dev/null and b/out/production/Lernmaschine/storage/Format.class differ diff --git a/out/production/Lernmaschine/storage/LearningDocument.class b/out/production/Lernmaschine/storage/LearningDocument.class new file mode 100755 index 0000000..8b7932e Binary files /dev/null and b/out/production/Lernmaschine/storage/LearningDocument.class differ diff --git a/out/production/Lernmaschine/storage/Lecture.class b/out/production/Lernmaschine/storage/Lecture.class new file mode 100755 index 0000000..b9c1989 Binary files /dev/null and b/out/production/Lernmaschine/storage/Lecture.class differ diff --git a/out/production/Lernmaschine/storage/Rating.class b/out/production/Lernmaschine/storage/Rating.class new file mode 100755 index 0000000..5502504 Binary files /dev/null and b/out/production/Lernmaschine/storage/Rating.class differ diff --git a/out/production/Lernmaschine/storage/StorageInterface.class b/out/production/Lernmaschine/storage/StorageInterface.class new file mode 100755 index 0000000..7a33426 Binary files /dev/null and b/out/production/Lernmaschine/storage/StorageInterface.class differ diff --git a/out/production/Lernmaschine/ui/GUI.class b/out/production/Lernmaschine/ui/GUI.class new file mode 100755 index 0000000..e825c92 Binary files /dev/null and b/out/production/Lernmaschine/ui/GUI.class differ diff --git a/out/production/Lernmaschine/ui/SwingTableView$1.class b/out/production/Lernmaschine/ui/SwingTableView$1.class new file mode 100755 index 0000000..633c9af Binary files /dev/null and b/out/production/Lernmaschine/ui/SwingTableView$1.class differ diff --git a/out/production/Lernmaschine/ui/SwingTableView$2.class b/out/production/Lernmaschine/ui/SwingTableView$2.class new file mode 100755 index 0000000..c733f87 Binary files /dev/null and b/out/production/Lernmaschine/ui/SwingTableView$2.class differ diff --git a/out/production/Lernmaschine/ui/SwingTableView$3$1.class b/out/production/Lernmaschine/ui/SwingTableView$3$1.class new file mode 100755 index 0000000..fadc9ba Binary files /dev/null and b/out/production/Lernmaschine/ui/SwingTableView$3$1.class differ diff --git a/out/production/Lernmaschine/ui/SwingTableView$3$2.class b/out/production/Lernmaschine/ui/SwingTableView$3$2.class new file mode 100755 index 0000000..f03a0d9 Binary files /dev/null and b/out/production/Lernmaschine/ui/SwingTableView$3$2.class differ diff --git a/out/production/Lernmaschine/ui/SwingTableView$3.class b/out/production/Lernmaschine/ui/SwingTableView$3.class new file mode 100755 index 0000000..5a13833 Binary files /dev/null and b/out/production/Lernmaschine/ui/SwingTableView$3.class differ diff --git a/out/production/Lernmaschine/ui/SwingTableView.class b/out/production/Lernmaschine/ui/SwingTableView.class new file mode 100755 index 0000000..7201749 Binary files /dev/null and b/out/production/Lernmaschine/ui/SwingTableView.class differ diff --git a/out/production/Lernmaschine/ui/UserInterface$1.class b/out/production/Lernmaschine/ui/UserInterface$1.class new file mode 100755 index 0000000..a364ee8 Binary files /dev/null and b/out/production/Lernmaschine/ui/UserInterface$1.class differ diff --git a/out/production/Lernmaschine/ui/UserInterface.class b/out/production/Lernmaschine/ui/UserInterface.class new file mode 100755 index 0000000..a9434f3 Binary files /dev/null and b/out/production/Lernmaschine/ui/UserInterface.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/AddRatingsListener.class b/out/production/Lernmaschine/ui/eventlistener/AddRatingsListener.class new file mode 100755 index 0000000..de1f2c6 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/AddRatingsListener.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/HelpActionListener.class b/out/production/Lernmaschine/ui/eventlistener/HelpActionListener.class new file mode 100755 index 0000000..75ce315 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/HelpActionListener.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/RegisterMenuListener$1.class b/out/production/Lernmaschine/ui/eventlistener/RegisterMenuListener$1.class new file mode 100755 index 0000000..4f1ad93 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/RegisterMenuListener$1.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/RegisterMenuListener.class b/out/production/Lernmaschine/ui/eventlistener/RegisterMenuListener.class new file mode 100755 index 0000000..858df17 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/RegisterMenuListener.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$1.class b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$1.class new file mode 100755 index 0000000..c6b552c Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$1.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$2.class b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$2.class new file mode 100755 index 0000000..2db923f Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$2.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3$1.class b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3$1.class new file mode 100755 index 0000000..d29d9ff Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3$1.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3$2.class b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3$2.class new file mode 100755 index 0000000..b2cede2 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3$2.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3.class b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3.class new file mode 100755 index 0000000..6a17a05 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener$3.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener.class b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener.class new file mode 100755 index 0000000..61584b3 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListElaborationListener.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$1.class b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$1.class new file mode 100755 index 0000000..85aaa87 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$1.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$2.class b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$2.class new file mode 100755 index 0000000..5f2b211 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$2.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3$1.class b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3$1.class new file mode 100755 index 0000000..5a5b1ac Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3$1.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3$2.class b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3$2.class new file mode 100755 index 0000000..ecb9628 Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3$2.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3.class b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3.class new file mode 100755 index 0000000..c738fdf Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener$3.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener.class b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener.class new file mode 100755 index 0000000..9bb885d Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowListLearningDocumentListener.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener$1.class b/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener$1.class new file mode 100755 index 0000000..ba163bf Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener$1.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener$2.class b/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener$2.class new file mode 100755 index 0000000..351478b Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener$2.class differ diff --git a/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener.class b/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener.class new file mode 100755 index 0000000..6b6fe4a Binary files /dev/null and b/out/production/Lernmaschine/ui/eventlistener/ShowRatingsListener.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddElaborationDialog$1.class b/out/production/Lernmaschine/ui/guiDialogs/AddElaborationDialog$1.class new file mode 100755 index 0000000..4032881 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddElaborationDialog$1.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddElaborationDialog.class b/out/production/Lernmaschine/ui/guiDialogs/AddElaborationDialog.class new file mode 100755 index 0000000..11f2f23 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddElaborationDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddLearningDocumentDialog$1.class b/out/production/Lernmaschine/ui/guiDialogs/AddLearningDocumentDialog$1.class new file mode 100755 index 0000000..9614e8b Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddLearningDocumentDialog$1.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddLearningDocumentDialog.class b/out/production/Lernmaschine/ui/guiDialogs/AddLearningDocumentDialog.class new file mode 100755 index 0000000..57835ff Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddLearningDocumentDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddLectureDialog$1.class b/out/production/Lernmaschine/ui/guiDialogs/AddLectureDialog$1.class new file mode 100755 index 0000000..d21aa0f Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddLectureDialog$1.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddLectureDialog.class b/out/production/Lernmaschine/ui/guiDialogs/AddLectureDialog.class new file mode 100755 index 0000000..a2c1409 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddLectureDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$1.class b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$1.class new file mode 100755 index 0000000..498cf04 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$1.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$2.class b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$2.class new file mode 100755 index 0000000..6add3b8 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$2.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$RatingDialog.class b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$RatingDialog.class new file mode 100755 index 0000000..76d2f12 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog$RatingDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog.class b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog.class new file mode 100755 index 0000000..77fad24 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/AddRatingDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/EditElaborationDialog$1.class b/out/production/Lernmaschine/ui/guiDialogs/EditElaborationDialog$1.class new file mode 100755 index 0000000..941dd26 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/EditElaborationDialog$1.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/EditElaborationDialog.class b/out/production/Lernmaschine/ui/guiDialogs/EditElaborationDialog.class new file mode 100755 index 0000000..ea23534 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/EditElaborationDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog$1.class b/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog$1.class new file mode 100755 index 0000000..e45a6c1 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog$1.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog$2.class b/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog$2.class new file mode 100755 index 0000000..6383ed4 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog$2.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog.class b/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog.class new file mode 100755 index 0000000..72dcb95 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/EditLearningDocumentDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/EditLectureDialog$1.class b/out/production/Lernmaschine/ui/guiDialogs/EditLectureDialog$1.class new file mode 100755 index 0000000..05cfa71 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/EditLectureDialog$1.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/EditLectureDialog.class b/out/production/Lernmaschine/ui/guiDialogs/EditLectureDialog.class new file mode 100755 index 0000000..e2d9fc9 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/EditLectureDialog.class differ diff --git a/out/production/Lernmaschine/ui/guiDialogs/ViewRatingDialog.class b/out/production/Lernmaschine/ui/guiDialogs/ViewRatingDialog.class new file mode 100755 index 0000000..59cb013 Binary files /dev/null and b/out/production/Lernmaschine/ui/guiDialogs/ViewRatingDialog.class differ diff --git a/out/production/Lernmaschine/ui/guimenus/EditMenu.class b/out/production/Lernmaschine/ui/guimenus/EditMenu.class new file mode 100755 index 0000000..56424f6 Binary files /dev/null and b/out/production/Lernmaschine/ui/guimenus/EditMenu.class differ diff --git a/out/production/Lernmaschine/ui/guimenus/HelpMenu.class b/out/production/Lernmaschine/ui/guimenus/HelpMenu.class new file mode 100755 index 0000000..621a365 Binary files /dev/null and b/out/production/Lernmaschine/ui/guimenus/HelpMenu.class differ diff --git a/out/production/Lernmaschine/ui/guimenus/JTableMenus.class b/out/production/Lernmaschine/ui/guimenus/JTableMenus.class new file mode 100755 index 0000000..bc1cbbf Binary files /dev/null and b/out/production/Lernmaschine/ui/guimenus/JTableMenus.class differ diff --git a/out/production/Lernmaschine/ui/guimenus/RegisterMenu.class b/out/production/Lernmaschine/ui/guimenus/RegisterMenu.class new file mode 100755 index 0000000..6b6034d Binary files /dev/null and b/out/production/Lernmaschine/ui/guimenus/RegisterMenu.class differ diff --git a/src/LearningMachine/LearningMachine.java b/src/LearningMachine/LearningMachine.java new file mode 100755 index 0000000..238a8f4 --- /dev/null +++ b/src/LearningMachine/LearningMachine.java @@ -0,0 +1,28 @@ +package LearningMachine; + +import storage.*; +import ui.SwingTableView; +import ui.UserInterface; + +/** + * the main class of the application + */ +public class LearningMachine { + + public static String server = ""; //information about the adress of the data server + + /** + * the main method that is launched first when starting the application + * @param args external arguments given before code execution + */ + public static void main(String[] args) { + StorageInterface db = null; + UserInterface ui = null; + db = new Database_db4o(); + ui = new SwingTableView(db); + if(ui != null) + ui.start(); + } + +} + diff --git a/src/LearningMachine/ServerSetup.java b/src/LearningMachine/ServerSetup.java new file mode 100755 index 0000000..2e78a0a --- /dev/null +++ b/src/LearningMachine/ServerSetup.java @@ -0,0 +1,30 @@ +package LearningMachine; + +public interface ServerSetup { + + /** + * the host to be used. + * If you want to run the client server examples on two computers, + * enter the computer name of the one that you want to use as server. + */ + public String HOST = "localhost"; + /** + * the database file to be used by the server. + */ + public String FILE = "LearningMachine.db4o"; + + /** + * the port to be used by the server. + */ + public int PORT = 0xdb40; + + /** + * the user name for access control. + */ + public String USER = "admin"; + + /** + * the pasword for access control. + */ + public String PASS = "admin"; +} \ No newline at end of file diff --git a/src/LearningMachine/StartServer.java b/src/LearningMachine/StartServer.java new file mode 100755 index 0000000..bf7b124 --- /dev/null +++ b/src/LearningMachine/StartServer.java @@ -0,0 +1,100 @@ +package LearningMachine; + +import com.db4o.ObjectContainer; +import com.db4o.ObjectServer; +import com.db4o.cs.Db4oClientServer; +import com.db4o.cs.config.ServerConfiguration; +import com.db4o.messaging.MessageContext; +import com.db4o.messaging.MessageRecipient; + +/** *//** + * starts a db4o server with the settings from {@link ServerSetup}.
+ *
+ * This is a typical setup for a long running server.
+ *
+ * The Server may be stopped from a remote location by running StopServer. The + * StartServer instance is used as a MessageRecipient and reacts to receiving an + * instance of a StopServer object.
+ *
+ * Note that all user classes need to be present on the server side and that all + * possible Db4oEmbedded.configure() calls to alter the db4o configuration need + * to be executed on the client and on the server. + */ +public class StartServer implements ServerSetup, MessageRecipient { + + /** *//** + * setting the value to true denotes that the server should be closed + */ + private boolean stop = false; + + /** *//** + * starts a db4o server using the configuration from + * {@link ServerSetup}. + */ + public static void main(String[] arguments) { + new StartServer().runServer(); + } + + // end main + + /** *//** + * opens the ObjectServer, and waits forever until close() is called or a + * StopServer message is being received. + */ + public void runServer() { + synchronized (this) { + // Using the messaging functionality to redirect all + // messages to this.processMessage + ServerConfiguration config = Db4oClientServer.newServerConfiguration(); + config.networking().messageRecipient(this); + + ObjectServer db4oServer = Db4oClientServer.openServer( + config, FILE, PORT); + db4oServer.grantAccess(USER, PASS); + + + // to identify the thread in a debugger + Thread.currentThread().setName(this.getClass().getName()); + + // We only need low priority since the db4o server has + // it's own thread. + Thread.currentThread().setPriority(Thread.MIN_PRIORITY); + try { + if (!stop) { + // wait forever for notify() from close() + this.wait(Long.MAX_VALUE); + } + } catch (Exception e) { + e.printStackTrace(); + } + db4oServer.close(); + } + } + + // end runServer + + /** *//** + * messaging callback + * + * @see com.db4o.messaging.MessageRecipient#processMessage(ObjectContainer, + * Object) + */ + public void processMessage(MessageContext context, Object message) { + if (message instanceof StopServer) { + close(); + } + } + + // end processMessage + + /** *//** + * closes this server. + */ + public void close() { + synchronized (this) { + stop = true; + this.notify(); + } + } + // end close +} diff --git a/src/LearningMachine/StopServer.java b/src/LearningMachine/StopServer.java new file mode 100755 index 0000000..facc193 --- /dev/null +++ b/src/LearningMachine/StopServer.java @@ -0,0 +1,47 @@ +package LearningMachine; + +import com.db4o.*; +import com.db4o.cs.Db4oClientServer; +import com.db4o.messaging.*; + +/** *//** + * stops the db4o Server started with {@link StartServer}.
+ *
+ * This is done by opening a client connection to the server and by sending a + * StopServer object as a message. {@link StartServer} will react in it's + * processMessage method. + */ +public class StopServer implements ServerSetup { + + /** *//** + * stops a db4o Server started with StartServer. + * + * @throws Exception + */ + public static void main(String[] args) { + ObjectContainer objectContainer = null; + try { + + // connect to the server + objectContainer = Db4oClientServer.openClient(Db4oClientServer + .newClientConfiguration(), HOST, PORT, USER, PASS); + + } catch (Exception e) { + e.printStackTrace(); + } + + if (objectContainer != null) { + + // get the messageSender for the ObjectContainer + MessageSender messageSender = objectContainer.ext().configure() + .clientServer().getMessageSender(); + + // send an instance of a StopServer object + messageSender.send(new StopServer()); + + // close the ObjectContainer + objectContainer.close(); + } + } + // end main +} diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100755 index 0000000..ce31649 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Main-Class: LearningMachine.LearningMachine + + diff --git a/src/storage/Category.java b/src/storage/Category.java new file mode 100755 index 0000000..b65c870 --- /dev/null +++ b/src/storage/Category.java @@ -0,0 +1,11 @@ +package storage; + +/** + * the different categories for the documents saved by the learning machine + */ +public enum Category { + SCRIPT, + EXAM, + PRACTICE_SHEET, + ELABORATION +} diff --git a/src/storage/Database_db4o.java b/src/storage/Database_db4o.java new file mode 100755 index 0000000..6668aea --- /dev/null +++ b/src/storage/Database_db4o.java @@ -0,0 +1,369 @@ +package storage; + +import LearningMachine.LearningMachine; +import com.db4o.Db4oEmbedded; +import com.db4o.ObjectContainer; +import com.db4o.ObjectSet; +import com.db4o.config.EmbeddedConfiguration; +import com.db4o.cs.Db4oClientServer; +import com.db4o.cs.config.ClientConfiguration; +import com.db4o.reflect.jdk.JdkReflector; + +import java.util.TreeMap; + +/** + * the implementation for the usage of a db4o database + */ +public class Database_db4o implements StorageInterface { + private ObjectContainer oc; //the object container saved in the database + private String filename = "db.db4o"; //the db4o file name/ location + protected TreeMap lectures = new TreeMap(); //a mirror of the lectures stored in the database + + //region general database operations + /** + * enables the data exchange with the database + * @throws Exception in case there is a problem while enabling the database connection + */ + public void openDB() throws Exception{ + //run local without a server + EmbeddedConfiguration config = Db4oEmbedded.newConfiguration(); + config.common().reflectWith(new JdkReflector(Thread.currentThread().getContextClassLoader())); + config.common().activationDepth(14); + config.common().updateDepth(14); + oc = Db4oEmbedded.openFile(config, filename); + } + + /** + * updates the mirror from the database + * @throws Exception in case of a problem with the connection to the database + */ + @Override + public void readData() throws Exception { + openDB(); + try { + for (Lecture l : oc.query(Lecture.class)){ + lectures.put(l.getName(),l); + } + } + finally { + oc.close(); + } + } + + /** + * writes the mirror to the database + * @throws Exception in case of a problem with the database connection + */ + @Override + public void saveData() throws Exception { + openDB(); + try { + oc.store(lectures); + } + finally { + oc.close(); + } + } + //endregion + + //region lecture operations + /** + * @return the lectures stored in the database + */ + @Override + public TreeMap getLectures() { + return lectures; + } + + /** + * @param name the name of a specific lecture + * @return the requested lecture + */ + @Override + public Lecture getLecture(String name) { + return lectures.get(name); + } + + /** + * @param name the name of a specific lecture + * @return a boolean whether or not the requested lecture exists in the database + */ + @Override + public boolean lectureExists(String name) { + return lectures.containsKey(name); + } + + /** + * @return the total number of lectures saved in the database + */ + @Override + public int getLectureAmount() { + return lectures.size(); + } + + /** + * adds a lecture to the database + * @param lecture the new lecture + * @return the added lecture + * @throws Exception in case of a database problem + */ + @Override + public Lecture addLecture(Lecture lecture) throws Exception { + openDB(); + try { + Lecture l = lectures.put(lecture.getName(),lecture); + oc.store(lecture); + return l; + } + finally { + oc.close(); + } + } + + /** + * deletes a lecture from the database + * @param lecture the lecture that is to be deleted + * @return the deleted lecture + * @throws Exception in case of a database problem + */ + @Override + public Lecture deleteLecture(Lecture lecture) throws Exception { + openDB(); + try { + //read the lecture from the database + ObjectSet result = oc.queryByExample(lecture); + //remove lecture from database and mirror + lectures.remove(lecture.getName()); + Lecture found = (Lecture) result.next(); + oc.delete(found); + return found; + } + finally { + oc.close(); + } + } + //endregion + + //region elaboration operations + /** + * adds a elaboration to the database + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration that should be saved + * @return the elaboration that has been saved to the database + * @throws Exception in case of a database problem + */ + @Override + public LearningDocument addElaboration(Lecture lecture, LearningDocument learningDocument, LearningDocument elaboration) throws Exception { + openDB(); + try{ + //read the parent document and lecture from the database + Lecture l = (Lecture) oc.queryByExample(lecture).next(); + LearningDocument ld = l.getLearningDocument(learningDocument.getName()); + //modify the database data and the mirror + LearningDocument e = ld.addElaboration(elaboration); + learningDocument.addElaboration(elaboration); + //save the modified lecture to the database + oc.store(l); + return e; + } + finally { + oc.close(); + } + } + + /** + * deletes a elaboration + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration that is to be deleted + * @return the delted elaboration + * @throws Exception in case a database problem occurs + */ + @Override + public LearningDocument deleteElaboration(Lecture lecture, LearningDocument learningDocument, + LearningDocument elaboration) throws Exception { + openDB(); + try{ + //read the parent document and the lecture from the db + Lecture l = (Lecture) oc.queryByExample(lecture).next(); + LearningDocument ld = l.getLearningDocument(learningDocument.getName()); + //modify the databse data and the mirror data + LearningDocument el = ld.deleteElaboration(elaboration.getName()); + learningDocument.deleteElaboration(elaboration.getName()); + //save the modified lecture to the database + oc.store(l); + return el; + } + finally { + oc.close(); + } + } + //endregion + + //region learning document operations + /** + * adds a learning document to the database + * @param lecture the lecture the learning document belongs to + * @param learningDocument the new learning document + * @return the added learning document + * @throws Exception in case of a database problem + */ + @Override + public LearningDocument addLearningDocument(Lecture lecture, LearningDocument learningDocument) throws Exception { + openDB(); + try { + //read lecture from the database + Lecture l = (Lecture) oc.queryByExample(lecture).next(); + //modifiy the database data and mirror + LearningDocument ld = l.addLearningDocument(learningDocument); + lecture.addLearningDocument(learningDocument); + //save changes to the database + oc.store(l); + return ld; + } + finally { + oc.close(); + } + } + + /** + * deletes a learning document + * @param lecture the lecture the learning document belongs to + * @param learningDocument the learning document that is to be deleted + * @return the deleted learning document + * @throws Exception in case of a database problem + */ + @Override + public LearningDocument deleteLearningDocument(Lecture lecture, LearningDocument learningDocument) throws Exception { + openDB(); + try { + //read lecture from the database + Lecture l = (Lecture) oc.queryByExample(lecture).next(); + //modify the database data and the mirror + LearningDocument ld = l.deleteLearningDocument(learningDocument.getName()); + lecture.deleteLearningDocument(learningDocument.getName()); + //save changes + oc.store(l); + return ld; + } + finally { + oc.close(); + } + } + //endregion + + //region rating operations + /** + * adds a rating to a learning document + * @param lecture the lecture the learning document belongs to + * @param learningDocument the learning document that is rated + * @param rating the new rating + * @return the added rating + * @throws Exception in case of a database problem + */ + @Override + public Rating addRating(Lecture lecture, LearningDocument learningDocument, Rating rating) throws Exception { + openDB(); + try { + //read lecture and learning document + Lecture l= (Lecture) oc.queryByExample(lecture).next(); + LearningDocument ld = l.getLearningDocument(learningDocument.getName()); + //modify the learning document + Rating r = ld.addRating(rating); + learningDocument.addRating(rating); + //save changes to the database + oc.store(l); + return r; + } + finally { + oc.close(); + } + } + + /** + * adds a rating to an elaboration + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration that is being rated + * @param rating the new rating + * @return the added rating + * @throws Exception in case of a database problem + */ + @Override + public Rating addRating(Lecture lecture, LearningDocument learningDocument, LearningDocument elaboration, Rating rating) throws Exception { + openDB(); + try{ + //read the lecture, parent document and elaboration from the database + Lecture l= (Lecture) oc.queryByExample(lecture).next(); + LearningDocument ld = l.getLearningDocument(learningDocument.getName()); + LearningDocument el = ld.getElaboration(elaboration.getName()); + //modify the data + Rating r = el.addRating(rating); + elaboration.addRating(rating); + //save changes + oc.store(l); + return r; + } + finally { + oc.close(); + } + } + + /** + * deletes a rating from a learning document + * @param lecture the lecture the learning document belongs to + * @param learningDocument the learning document being rated + * @param rating the rating that is to be removed + * @return the removed rating + * @throws Exception in case of a database problem + */ + @Override + public Rating deleteRating(Lecture lecture, LearningDocument learningDocument, Rating rating) throws Exception { + openDB(); + try{ + //read lecture and learning document from the database + Lecture l = (Lecture) oc.queryByExample(lecture).next(); + LearningDocument ld = l.getLearningDocument(learningDocument.getName()); + //modify the data + Rating r = ld.deleteRating(rating.getID()); + learningDocument.deleteRating(rating.getID()); + //save changes + oc.store(l); + return r; + } + finally { + oc.close(); + } + } + + /** + * deletes rating from a elaboration + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration being rated + * @param rating the rating that is to be removed + * @return the removed rating + * @throws Exception in case of a database problem + */ + @Override + public Rating deleteRating(Lecture lecture, LearningDocument learningDocument, LearningDocument elaboration, Rating rating) throws Exception { + openDB(); + try { + //read the lecture, parent document and elaboration from the database + Lecture l = (Lecture) oc.queryByExample(lecture).next(); + LearningDocument ld = l.getLearningDocument(learningDocument.getName()); + LearningDocument el = ld.getElaboration(elaboration.getName()); + //modify the data + Rating r = el.deleteRating(rating.getID()); + elaboration.deleteRating(rating.getID()); + //save changes + oc.store(l); + return r; + } + finally { + oc.close(); + } + } + //endregion +} diff --git a/src/storage/Format.java b/src/storage/Format.java new file mode 100755 index 0000000..fff5709 --- /dev/null +++ b/src/storage/Format.java @@ -0,0 +1,11 @@ +package storage; + +/** + * the different file formats supported by the application + */ +public enum Format { + PDF, + WORD, + TEXT, + URL +} diff --git a/src/storage/LearningDocument.java b/src/storage/LearningDocument.java new file mode 100755 index 0000000..b0a00fa --- /dev/null +++ b/src/storage/LearningDocument.java @@ -0,0 +1,173 @@ +package storage; + +import java.io.Serializable; +import java.time.LocalDate; +import java.util.TreeMap; + +/** + * the class for documents + */ +public class LearningDocument implements Serializable { + + private String name; //the name of the document + private Category category; //the category of the document + private String memLocation; //the memory location of the document + private LocalDate date; //the date at which the document was created + private Format format; //the format of the document + private TreeMap elaborations; //the elaborations belonging to the document + private TreeMap ratings; //the ratings given to the document + + + /** + * the constructor for a learning document + * @param name the name of the document + * @param category the category of the document + * @param memLocation the memory location of the document + * @param format the format of the document + */ + public LearningDocument(String name, Category category, String memLocation, Format format){ + this.name = name; + this.category = category; + this.memLocation = memLocation; + this.date = LocalDate.now(); + this.format = format; + elaborations= new TreeMap<>(); + ratings = new TreeMap<>(); + } + + //region general getters + /** + * @return the name of the document + */ + public String getName() { + return name; + } + + /** + * @return the category of the document + */ + public Category getCategory() { + return category; + } + + /** + * @return the creation date of the document + */ + public LocalDate getDate() { + return date; + } + + /** + * @return the format of the document + */ + public Format getFormat() { + return format; + } + + /** + * @return the memory location of the document + */ + public String getMemLocation() { + return memLocation; + } + //endregion + + //region elaboration operations + /** + * adds an elaboration to the document + * @param elaboration the new elaboration + * @return the added elaboration + */ + public LearningDocument addElaboration(LearningDocument elaboration){ + return elaborations.put(elaboration.getName(),elaboration); + } + + /** + * @return the TreeMap of the elaborations belonging to the document + */ + public TreeMap getElaborations() { + return elaborations; + } + + /** + * returns a specific elaboration + * @param name the name of the requested elaboration + * @return the requested elaboration + */ + public LearningDocument getElaboration(String name){ + return elaborations.get(name); + } + + /** + * @return the number of elaborations belonging to the document + */ + public int getElaborationsAmount(){ + return elaborations.size(); + } + + /** + * deletes a specific elaboration + * @param name the name of the elaboration + * @return the deleted elaboration + */ + public LearningDocument deleteElaboration(String name){ + return elaborations.remove(name); + } + //endregion + + //region rating operations + /** + * @return the average rating as a decimal value + */ + public double getRating() { + final double[] rating = {0.0}; + if(ratings.size()==0){return rating[0];} + ratings.forEach((k,v)->{ + rating[0] += v.getRating(); + }); + return rating[0]/ratings.size(); + } + + /** + * @return the TreeMap containing all ratings given to the document + */ + public TreeMap getRatings(){ + return ratings; + } + + /** + * adds a rating to the document + * @param rating the new rating + * @return the added rating + */ + public Rating addRating(Rating rating){ + return ratings.put(rating.getID(),rating); + } + + /** + * returns a specific rating + * @param id the id of the requested rating + * @return the requested rating + */ + public Rating getRating(String id){ + return ratings.get(id); + } + + /** + * deletes a specific rating + * @param id the id of the rating + * @return the deleted rating + */ + public Rating deleteRating(String id){ + return ratings.remove(id); + } + + /** + * @return the number of ratings given to the document + */ + public int getRatingsAmount() { + return ratings.size(); + } + //endregion + +} diff --git a/src/storage/Lecture.java b/src/storage/Lecture.java new file mode 100755 index 0000000..c2d1f8b --- /dev/null +++ b/src/storage/Lecture.java @@ -0,0 +1,69 @@ +package storage; + +import java.io.Serializable; +import java.time.LocalDate; +import java.util.TreeMap; + +public class Lecture implements Serializable { + + private String name; //the name of the lecture + private TreeMap learningDocuments; //the learning documents belonging to the lecture + + /** + * the constructor of the lecture class + * @param name the name of the lecture + */ + public Lecture(String name){ + this.name = name; + learningDocuments = new TreeMap<>(); + } + + /** + * @return the name of the lecture + */ + public String getName() { + return name; + } + + /** + * adds a learning document to the lecture + * @param learningDocument the new learning document + * @return the added learning document + */ + public LearningDocument addLearningDocument(LearningDocument learningDocument){ + return learningDocuments.put(learningDocument.getName(),learningDocument); + } + + /** + * deletes a learning document + * @param name the name of the learning document + * @return the deleted learning document + */ + public LearningDocument deleteLearningDocument(String name){ + return learningDocuments.remove(name); + } + + /** + * @return the number of learning documents belonging to the lecture + */ + public int getLearningDocumentAmount(){ + return learningDocuments.size(); + } + + /** + * @return all the learning documents belonging to the lecture + */ + public TreeMap getLearningDocuments(){ + return learningDocuments; + } + + /** + * returns a specific learning document + * @param name the name of the requested learning document + * @return the requested learning document + */ + public LearningDocument getLearningDocument(String name){ + return learningDocuments.get(name); + } + +} diff --git a/src/storage/Rating.java b/src/storage/Rating.java new file mode 100755 index 0000000..3689cb3 --- /dev/null +++ b/src/storage/Rating.java @@ -0,0 +1,60 @@ +package storage; + +import java.time.LocalDate; + +public class Rating { + private String ID; //the id of the rating + private String ratingText; //the comment given to the rating + private String username; //the username of the user that created the rating + private LocalDate date; //the creation date of the rating + private int rating; //the rating value of the rating (1-5) + + /** + * the constructor for the rating class + * @param ratingText the comment given to the rating + * @param username the username of the user creating the rating + * @param rating the value of the rating (1-5) + */ + public Rating(String ratingText, String username, int rating){ + this.ratingText = ratingText; + this.username = username; + this.date = LocalDate.now(); + this.rating = rating; + ID = Integer.toString((int) (Math.random()*100000)); + } + + /** + * @return the id of the rating + */ + public String getID() { + return ID; + } + + /** + * @return the comment given to the rating + */ + public String getRatingText() { + return ratingText; + } + + /** + * @return the username of the user that created the rating + */ + public String getUsername() { + return username; + } + + /** + * @return the creation date of the rating + */ + public LocalDate getDate() { + return date; + } + + /** + * @return the value of the rating (1-5) + */ + public int getRating() { + return rating; + } +} diff --git a/src/storage/StorageInterface.java b/src/storage/StorageInterface.java new file mode 100755 index 0000000..72e9511 --- /dev/null +++ b/src/storage/StorageInterface.java @@ -0,0 +1,149 @@ +package storage; + +import java.util.TreeMap; +import java.util.concurrent.ExecutionException; + +/** + * the interface to access the stored data + */ +public interface StorageInterface { + /** + * @return the stored lectures + */ + TreeMap getLectures(); + + /** + * returns a specific lecture + * @param name the name of the requested lecture + * @return the requested lecture + */ + Lecture getLecture(String name); + + /** + * returns whether or not a specific lecture exists + * @param name the name of the lecture + * @return whether or not the requested lecture exists + */ + boolean lectureExists(String name); + + /** + * @return the number of stored lectures + */ + int getLectureAmount(); + + /** + * reads the data from the data source + * @throws Exception in case of a problem with the data source + */ + void readData() throws Exception; + + /** + * saves data to the data source + * @throws Exception in case of a problem with the data source + */ + void saveData() throws Exception; + + /** + * stores a new elaboration + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the new elaboration + * @return the added elaboration + * @throws Exception in case of a problem with the storage + */ + LearningDocument addElaboration(Lecture lecture, + LearningDocument learningDocument, + LearningDocument elaboration) throws Exception; + + /** + * deletes a elaboration + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration that is to be deleted + * @return the deleted elaboration + * @throws Exception in case of a problem with the storage + */ + LearningDocument deleteElaboration(Lecture lecture, + LearningDocument learningDocument, + LearningDocument elaboration) throws Exception; + + /** + * adds a new learning document to the storage + * @param lecture the lecture the learning document belongs to + * @param learningDocument the new learning document + * @return the added learning document + * @throws Exception in case of a problem with the storage + */ + LearningDocument addLearningDocument(Lecture lecture, + LearningDocument learningDocument) throws Exception; + + /** + * deletes a learning document from the storage + * @param lecture the lecture the learning document belongs to + * @param learningDocument the learning document that is to be deleted + * @return the deleted learning document + * @throws Exception in case of a problem with the storage + */ + LearningDocument deleteLearningDocument(Lecture lecture, + LearningDocument learningDocument) throws Exception; + + /** + * adds a new lecture to the storage + * @param lecture the new lecture + * @return the added lecture + * @throws Exception in case of a problem with the storage + */ + Lecture addLecture(Lecture lecture) throws Exception; + + /** + * deletes a lecture from the storage + * @param lecture the lecture that is to be deleted + * @return the deleted lecture + * @throws Exception in case of a problem with the storage + */ + Lecture deleteLecture(Lecture lecture) throws Exception; + + /** + * adds a new rating to a learning document + * @param lecture the lecture the parent document belongs to + * @param learningDocument the parent document + * @param rating the new rating + * @return the added rating + * @throws Exception in case of a problem with the storage + */ + Rating addRating(Lecture lecture, LearningDocument learningDocument, Rating rating) throws Exception; + + /** + * adds a rating to an elaboration + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration + * @param rating the new rating + * @return the added rating + * @throws Exception in case of a problem with the storage + */ + Rating addRating(Lecture lecture, LearningDocument learningDocument, LearningDocument elaboration, + Rating rating) throws Exception; + + /** + * deletes a rating from a learning document + * @param lecture the lecture the learning document belongs to + * @param learningDocument the learning document + * @param rating the rating + * @return the deleted rating + * @throws Exception in case of a problem with the storage + */ + Rating deleteRating(Lecture lecture, LearningDocument learningDocument, Rating rating) throws Exception; + + /** + * deletes a rating from a elaboration + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration + * @param rating the rating + * @return the deleted rating + * @throws Exception in case of a problem with the storage + */ + Rating deleteRating(Lecture lecture, LearningDocument learningDocument, LearningDocument elaboration, + Rating rating) throws Exception; +} diff --git a/src/ui/GUI.java b/src/ui/GUI.java new file mode 100755 index 0000000..5c1b3dd --- /dev/null +++ b/src/ui/GUI.java @@ -0,0 +1,68 @@ +package ui; + +import LearningMachine.LearningMachine; +import storage.StorageInterface; + +import javax.swing.*; + +/** + * the basic class for the graphic user interface + */ +public abstract class GUI extends UserInterface { + protected JFrame frame = new JFrame(); + protected String frameTitle = "User " + System.getProperty("user.name")+ ", willkommen bei der Lernmaschine!"; + + private boolean startupDone = false; + + /** + * the constructor for the GUI + * @param storageInterface the interface for accessing the stored database + */ + public GUI(StorageInterface storageInterface) { + super(storageInterface); + readData(); + } + + /** + * starts the GUI + */ + @Override + public void start() { + SwingUtilities.invokeLater(()->guiBuildAndShow()); + } + + protected abstract void guiBuildAndShow(); + + public abstract void updateTableModel(); + + public JFrame getFrame(){return frame;} + + public StorageInterface getDB(){return db;} + + public void readData(){ + if(LearningMachine.server.equals("")){ + frame.setTitle(frameTitle + " (lokaler Betrieb)"); + } + else{ + frame.setTitle(frameTitle + " (Client von: " + LearningMachine.server + ")"); + } + try { + db.readData(); + startupDone = true; + } + catch (Exception e){ + String ort = "Daten vom Server " + LearningMachine.server; + if(LearningMachine.server.equals("")){ort = "lokale Daten";} + String message = "Die "+ ort + " konnten nicht eingelesen werden!\n"; + if(startupDone){ + JOptionPane.showMessageDialog(null,message + "Fehlerart: " + e, + "Kein Datenbankzugriff", JOptionPane.WARNING_MESSAGE); + } + else{ + JOptionPane.showMessageDialog(null, message + "Fehlerart: " + e, + "Fataler Fehler!", JOptionPane.ERROR_MESSAGE); + System.exit(1); + } + } + } +} diff --git a/src/ui/SwingTableView.java b/src/ui/SwingTableView.java new file mode 100755 index 0000000..3b462a6 --- /dev/null +++ b/src/ui/SwingTableView.java @@ -0,0 +1,257 @@ +package ui; + +import storage.Lecture; +import storage.StorageInterface; +import ui.eventlistener.*; +import ui.guiDialogs.EditLectureDialog; +import ui.guimenus.*; + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.text.DefaultEditorKit; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * the swing table view + */ +public class SwingTableView extends GUI{ + private Container cp; + private JTable table; + private DefaultTableModel tableModel = new DefaultTableModel(){ + public boolean isCellEditable(int rowIndex, int columnIndex){return false;} + }; + private GUI gui = this; + + /** + * the constructor for the swing table view + * @param db the interface to the database + */ + public SwingTableView(StorageInterface db){ + super(db); + } + + /** + * builds and displays the table view + */ + protected void guiBuildAndShow(){ + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + buildMenus(); + + cp = frame.getContentPane(); + + buildTable(); + buildSelectionBar(); + + frame.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + frame.pack(); + GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); + Point centerPoint = graphicsEnvironment.getCenterPoint(); + frame.setLocation(centerPoint.x/4, centerPoint.y/4); + frame.setVisible(true); + } + + /** + * build the menu bar in the main view + */ + public void buildMenus(){ + JMenuBar menuBar = new JMenuBar(); + //build all menus + JMenu editMenu = JTableMenus.EDIT.createMenu(); + JMenu registerMenu = JTableMenus.REGISTER.createMenu(); + JMenu helpMenu = JTableMenus.HELP.createMenu(); + + //add menus to menu bar + menuBar.add(editMenu); + menuBar.add(registerMenu); + menuBar.add(helpMenu); + + //menu entries for the edit menu + JMenuItem cut = new JMenuItem(new DefaultEditorKit.CutAction()); + cut.setText(EditMenu.CUT.toString()); + JMenuItem copy = new JMenuItem(new DefaultEditorKit.CopyAction()); + copy.setText(EditMenu.COPY.toString()); + JMenuItem paste = new JMenuItem(new DefaultEditorKit.PasteAction()); + paste.setText(EditMenu.PASTE.toString()); + editMenu.add(cut); + editMenu.add(copy); + editMenu.add(paste); + + //menu entries for the register menu + RegisterMenuListener registerMenuListener = new RegisterMenuListener(this); + for(RegisterMenu registerItem : RegisterMenu.values()){ + registerMenu.add(registerItem.createMenuItemWithListener(registerMenuListener)); + } + + //menu entries for the help menu + JMenuItem pHelp = new JMenuItem(HelpMenu.INFO.toString()); + pHelp.addActionListener(new HelpActionListener(this)); + helpMenu.add(pHelp); + + //add menu bar to the frame + frame.setJMenuBar(menuBar); + } + + /** + * builds the table in the main view + */ + public void buildTable(){ + //set column names + String[] columnNames = {"Lehrveranstaltung(LV)","Lerndokumente","Ausarbeitungen"}; + tableModel.setColumnIdentifiers(columnNames); + + //load data + updateTableModel(); + + //generate JTable and ScrollPane + table = new JTable(tableModel); + //enable row selection + table.setRowSelectionAllowed(true); + table.setColumnSelectionAllowed(false); + table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + JScrollPane scrollPane = new JScrollPane(table); + + //define size of scroll pane + table.setPreferredScrollableViewportSize(new Dimension(300,80)); + cp.add(scrollPane); + } + + /** + * builds the lecture selection bar in the main view + */ + public void buildSelectionBar(){ + JPanel jPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); + jPanel.add(new JLabel("LV:")); + final JTextField textField = new JTextField(13); + jPanel.add(textField); + JButton searchButton = new JButton("Lerndokumente anzeigen"); + searchButton.addActionListener(new ShowListLearningDocumentListener(this, textField)); + jPanel.add(searchButton); + JButton searchElaborationButton = new JButton("Ausarbeitungen anzeigen"); + searchElaborationButton.addActionListener(new ShowListElaborationListener(this, textField)); + jPanel.add(searchElaborationButton); + + //add the panel to the frame + cp.add(jPanel); + + //copy the selected lecture to the textfield + table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + /** + * updates the text field in the selection view + * @param e the selection event that triggered this function + */ + @Override + public void valueChanged(ListSelectionEvent e) { + int[] selectedRows = table.getSelectedRows(); + if(selectedRows.length==0){ + textField.setText(""); + }else{ + int selectedRow = selectedRows[0]; + textField.setText((String) table.getValueAt(selectedRow, 0)); + } + } + }); + + //popup menu on right mouse click + table.addMouseListener(new MouseAdapter() { + /** + * the function that is triggered when the user right clicks on a lecture + */ + @Override + public void mouseReleased(MouseEvent e) { + //set row under mouse as selected row in table + int r = table.rowAtPoint(e.getPoint()); + if(r>=0 && r=0 && r=0 && r23){ + return longText.substring(0,20)+"..."; + } + return longText; + } +} diff --git a/src/ui/guiDialogs/AddElaborationDialog.java b/src/ui/guiDialogs/AddElaborationDialog.java new file mode 100755 index 0000000..0f3c745 --- /dev/null +++ b/src/ui/guiDialogs/AddElaborationDialog.java @@ -0,0 +1,126 @@ +package ui.guiDialogs; + +import storage.*; +import ui.GUI; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; + +/** + * the dialog to add an elaboration + */ +public class AddElaborationDialog { + private String title = "Ausarbeitung hinzufügen..."; + private JFrame frame; + private StorageInterface db; + + /** + * the constructor for the dialog + * @param gui the main GUI + */ + public AddElaborationDialog(GUI gui){ + frame = gui.getFrame(); + db = gui.getDB(); + final JDialog dialog = new JDialog(frame, title, false); + + //region Learning Document Selection + JLabel learningDocumentLable = new JLabel("Wählen Sie ein Lerndokument aus:"); + ArrayList learningDocumentsNames = new ArrayList<>(); + try{ + for(Lecture l : db.getLectures().values()){ + for(LearningDocument ld : l.getLearningDocuments().values()){ + learningDocumentsNames.add(l.getName() + "|" + ld.getName()); + } + } + }catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lerndokumente konnten nicht " + + "ausgelesen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + final JComboBox learningDocumentSelection = new JComboBox(learningDocumentsNames.toArray()); + //endregion + + //region Name Selection + JLabel nameLabel = new JLabel("Name der Ausarbeitung:"); + JTextField nametextField = new JTextField(13); + //endregion + + //region memory Location Selection + JLabel memLocationLabel = new JLabel("Speicherstelle der Ausarbeitung:"); + JTextField memLocationTextField = new JTextField(32); + //endregion + + //region Format Selection + JLabel formatLabel = new JLabel("Format der Ausarbeitung"); + final JComboBox formatSelection = new JComboBox(Format.class.getEnumConstants()); + //endregion + + JButton finishButton = new JButton("Speichern"); + finishButton.addActionListener(new ActionListener(){ + + /** + * the function that is triggered when the finish button is pressed + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //test the input + if(nametextField.getText()==null + ||nametextField.getText()=="" + || learningDocumentSelection.getSelectedItem()==null){ + //if the input is incomplete display an error message + JOptionPane.showMessageDialog(null,"Die Eingabe war unvollständig!", + "Unvollständige Eingabe", + JOptionPane.WARNING_MESSAGE); + } + try { + //get the information needed for the elaboration creation + String learningDocumentText = (String) learningDocumentSelection.getSelectedItem(); + int dividerPosition = learningDocumentText.indexOf("|"); + String lectureName = learningDocumentText.substring(0,dividerPosition); + Lecture lecture= db.getLecture(lectureName); + String name = nametextField.getText(); + Category category = Category.ELABORATION; + String memLocation = memLocationTextField.getText(); + Format format = (Format) formatSelection.getSelectedItem(); + String learningDocumentName = learningDocumentText.substring(dividerPosition+1); + LearningDocument learningDocument = lecture.getLearningDocument(learningDocumentName); + + //create the new elaboration + LearningDocument elaboration = new LearningDocument(name,category,memLocation,format); + + //store the new elaboration + db.addElaboration(lecture, learningDocument, elaboration); + dialog.dispose(); + gui.updateTableModel(); + } catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Ausarbeitung konnte nicht " + + "eingetragen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + + //build the dialog + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(learningDocumentLable); + cp.add(learningDocumentSelection); + cp.add(nameLabel); + cp.add(nametextField); + cp.add(memLocationLabel); + cp.add(memLocationTextField); + cp.add(formatLabel); + cp.add(formatSelection); + cp.add(finishButton); + + //display the dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } +} diff --git a/src/ui/guiDialogs/AddLearningDocumentDialog.java b/src/ui/guiDialogs/AddLearningDocumentDialog.java new file mode 100755 index 0000000..bd5a376 --- /dev/null +++ b/src/ui/guiDialogs/AddLearningDocumentDialog.java @@ -0,0 +1,145 @@ +package ui.guiDialogs; + +import storage.*; +import ui.GUI; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; + +/** + * the dialog to add a learning document + */ +public class AddLearningDocumentDialog{ + private String title = "Lerndokument hinzufügen..."; + private JFrame frame; + private StorageInterface db; + + /** + * the constructor for the dialog + * @param gui the main GUI + */ + public AddLearningDocumentDialog(GUI gui){ + frame = gui.getFrame(); + db = gui.getDB(); + final JDialog dialog = new JDialog(frame, title, false); + + //region Lecture Selection + JLabel lectureLabel = new JLabel("Wählen Sie eine Lehrveranstaltung aus:"); + ArrayList lectureNames = new ArrayList(); + try{ + for(Lecture l : db.getLectures().values()){ + lectureNames.add(l.getName()); + } + }catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lehrveranstaltungen konnten nicht " + + "ausgelesen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + final JComboBox lectureSelection = new JComboBox(lectureNames.toArray()); + //endregion + + //region Name Selection + JLabel nameLabel = new JLabel("Name des Lerndokumentes:"); + JTextField nametextField = new JTextField(13); + //endregion + + //region Category Selection + JLabel categoryLabel = new JLabel("Kategorie des Lerndokumentes:"); + String[] categories = {"Skript", "Übungsblatt","Klausur"}; + final JComboBox categorySelection = new JComboBox(categories); + //endregion + + //region memory Location Selection + JLabel memLocationLabel = new JLabel("Speicherstelle des Lerndokumentes:"); + JTextField memLocationTextField = new JTextField(32); + //endregion + + //region Format Selection + JLabel formatLabel = new JLabel("Format des Lerndokumentes"); + final JComboBox formatSelection = new JComboBox(Format.class.getEnumConstants()); + //endregion + + JButton finishButton = new JButton("Speichern"); + finishButton.addActionListener(new ActionListener(){ + + /** + * the function triggered by the user when pressing the finish button + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //test the input + if(nametextField.getText()==null + ||nametextField.getText()=="" + ||lectureSelection.getSelectedItem()==null + ||categorySelection.getSelectedItem()==null){ + //when the input is incomplete show an error message + JOptionPane.showMessageDialog(null,"Die Eingabe war unvollständig!", + "Unvollständige Eingabe", + JOptionPane.WARNING_MESSAGE); + } + try { + //get the information needed for the creation of the learning document + Lecture lecture= db.getLecture((String)lectureSelection.getSelectedItem()); + String name = nametextField.getText(); + Category category = getCategoryFromString((String)categorySelection.getSelectedItem()); + String memLocation = memLocationTextField.getText(); + Format format = (Format) formatSelection.getSelectedItem(); + + //create the new learning document + LearningDocument learningDocument = new LearningDocument(name,category,memLocation,format); + //store the learning document + db.addLearningDocument(lecture, learningDocument); + dialog.dispose(); + gui.updateTableModel(); + } catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lehrveranstaltung konnte nicht " + + "eingetragen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + + //build the dialog + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(lectureLabel); + cp.add(lectureSelection); + cp.add(nameLabel); + cp.add(nametextField); + cp.add(categoryLabel); + cp.add(categorySelection); + cp.add(memLocationLabel); + cp.add(memLocationTextField); + cp.add(formatLabel); + cp.add(formatSelection); + cp.add(finishButton); + + //display the dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } + + /** + * converts a string to a category + * @param category the category that is to be converted + * @return the resulting String + */ + private Category getCategoryFromString(String category){ + switch (category){ + case "Skript": + return Category.SCRIPT; + case "Übungsblatt": + return Category.PRACTICE_SHEET; + case "Klausur": + return Category.EXAM; + default: + return null; + } + } +} diff --git a/src/ui/guiDialogs/AddLectureDialog.java b/src/ui/guiDialogs/AddLectureDialog.java new file mode 100755 index 0000000..060e268 --- /dev/null +++ b/src/ui/guiDialogs/AddLectureDialog.java @@ -0,0 +1,72 @@ +package ui.guiDialogs; + +import storage.Lecture; +import storage.StorageInterface; +import ui.GUI; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * the dialog for adding a new lecture + */ +public class AddLectureDialog{ + private String title = "Lehrveranstaltung hinzufügen..."; + private JFrame frame; + private StorageInterface db; + + /** + * the constructor for the dialog + * @param gui the main GUI + */ + public AddLectureDialog(GUI gui){ + frame = gui.getFrame(); + db = gui.getDB(); + //initialize the dialog + final JDialog dialog = new JDialog(frame, title,false); + JLabel label = new JLabel("Geben Sie den Namen der Lehrveranstaltung an: "); + JTextField textField = new JTextField(13); + JButton finishButton = new JButton("Speichern"); + finishButton.addActionListener(new ActionListener(){ + + /** + * the function that is triggered by the user clicking the finish button + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //test the input + if(textField.getText()==null||textField.getText()==""){ + //if the input is incomplete display an error message + JOptionPane.showMessageDialog(null,"Der Name des Lehrveranstaltung " + + "darf nicht leer sein!","Name der Lehrveranstaltung fehlt", + JOptionPane.WARNING_MESSAGE); + } + try { + //store the new lecture + db.addLecture(new Lecture(textField.getText())); + dialog.dispose(); + gui.updateTableModel(); + } catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lehrveranstaltung konnte nicht " + + "eingetragen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + //build the dialog + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(label); + cp.add(textField); + cp.add(finishButton); + + //display the dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } +} diff --git a/src/ui/guiDialogs/AddRatingDialog.java b/src/ui/guiDialogs/AddRatingDialog.java new file mode 100755 index 0000000..d665ede --- /dev/null +++ b/src/ui/guiDialogs/AddRatingDialog.java @@ -0,0 +1,186 @@ +package ui.guiDialogs; + +import storage.LearningDocument; +import storage.Lecture; +import storage.Rating; +import storage.StorageInterface; +import ui.GUI; +import ui.eventlistener.ShowListElaborationListener; +import ui.eventlistener.ShowListLearningDocumentListener; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.time.LocalDate; + +/** + * the dialog for adding a rating + */ +public class AddRatingDialog { + private String title = "Bewertung abgeben..."; + private JFrame frame; + private StorageInterface db; + + /** + * constructor for adding a rating to an elaboration + * @param gui the main GUI + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration + * @param showListElaborationListener the list elaboration listener that calls for this dialog + */ + public AddRatingDialog(GUI gui, Lecture lecture, LearningDocument learningDocument, LearningDocument elaboration, + ShowListElaborationListener showListElaborationListener){ + frame = gui.getFrame(); + db = gui.getDB(); + + //gets the rating dialog + RatingDialog dialog = new RatingDialog(); + //add the action listener to the finish button in the rating dialog + dialog.finishButton.addActionListener(new ActionListener() { + /** + * the function that is triggered by the the user clicking the finish button + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //create a new rating + Rating rating = new Rating(dialog.getComment(), System.getProperty("user.name"), dialog.getRating()); + try{ + //store the rating + db.addRating(lecture, learningDocument, elaboration,rating); + dialog.dispose(); + gui.updateTableModel(); + showListElaborationListener.updateTableModel(lecture); + }catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Bewertung konnte nicht " + + "eingetragen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + } + + /** + * the constructor for adding a rating to a learning document + * @param gui the main GUI + * @param lecture the lecture the learning document belongs to + * @param learningDocument the learning document the rating is added to + * @param showListLearningDocumentListener the list learning document listener that calls for the dialog + */ + public AddRatingDialog(GUI gui, Lecture lecture, LearningDocument learningDocument, + ShowListLearningDocumentListener showListLearningDocumentListener){ + frame = gui.getFrame(); + db = gui.getDB(); + + //get the rating dialog + RatingDialog dialog = new RatingDialog(); + //add an action listener to the finish button of the rating dialog + dialog.finishButton.addActionListener(new ActionListener() { + /** + * the function that is triggered by the user clicking the finish button + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //create the rating + Rating rating = new Rating(dialog.getComment(), System.getProperty("user.name"), dialog.getRating()); + //store the rating + try{ + db.addRating(lecture, learningDocument,rating); + dialog.dispose(); + gui.updateTableModel(); + showListLearningDocumentListener.updateTableModel(lecture); + }catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Bewertung konnte nicht " + + "eingetragen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + } + + /** + * the dialog that is mutual to a rating for an elaboration and a learning document + */ + private class RatingDialog + { + private JDialog dialog; + private JButton finishButton; + private JComboBox ratingComboBox; + private JTextArea commentTextArea; + + /** + * the constructor for the dialog + */ + public RatingDialog(){ + //initialize a the dialog + dialog = new JDialog(frame, title, false); + + //region rating selection + JLabel ratingLabel = new JLabel("Geben Sie eine Bewertung ab:"); + String[] possibleRatings = {"★☆☆☆☆","★★☆☆☆","★★★☆☆","★★★★☆","★★★★★"}; + ratingComboBox = new JComboBox(possibleRatings); + //endregion + + //region comment section + JLabel commentLabel = new JLabel("Kommentar:"); + commentTextArea = new JTextArea(8,13); + //endregion + + //finish button + finishButton = new JButton("Bewertung abgeben"); + + //build dialog + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(ratingLabel); + cp.add(ratingComboBox); + cp.add(commentLabel); + cp.add(commentTextArea); + cp.add(finishButton); + + //display the dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } + + /** + * @return the selected rating as an Integer + */ + private int getRating(){ + String selectedRating= (String)ratingComboBox.getSelectedItem(); + switch (selectedRating){ + case "★☆☆☆☆": + return 1; + case "★★☆☆☆": + return 2; + case "★★★☆☆": + return 3; + case "★★★★☆": + return 4; + case "★★★★★": + return 5; + default: + return 0; + } + } + + /** + * @return the comment as String + */ + private String getComment(){ + return commentTextArea.getText(); + } + + /** + * disposes the dialog + */ + private void dispose(){ + dialog.dispose(); + } + } +} diff --git a/src/ui/guiDialogs/EditElaborationDialog.java b/src/ui/guiDialogs/EditElaborationDialog.java new file mode 100755 index 0000000..5b9daf2 --- /dev/null +++ b/src/ui/guiDialogs/EditElaborationDialog.java @@ -0,0 +1,137 @@ +package ui.guiDialogs; + +import storage.*; +import ui.GUI; +import ui.eventlistener.ShowListElaborationListener; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; + +/** + * the dialog for editing the elaboration + */ +public class EditElaborationDialog { + private String title = "Ausarbeitung bearbeiten..."; + private JFrame frame; + private StorageInterface db; + + + /** + * the constructor for the dialog + * @param gui the main GUI + * @param lecture the lecture the elaboration belongs to + * @param learningDocument the parent document of the elaboration + * @param elaboration the elaboration + * @param showListElaborationListener the list elaboration listener requesting the dialog + */ + public EditElaborationDialog(GUI gui, Lecture lecture, LearningDocument learningDocument, LearningDocument elaboration, + ShowListElaborationListener showListElaborationListener){ + frame = gui.getFrame(); + db = gui.getDB(); + final JDialog dialog = new JDialog(frame, title, false); + + //region Learning Document Selection + JLabel learningDocumentLable = new JLabel("Wählen Sie ein Lerndokument aus:"); + ArrayList learningDocumentsNames = new ArrayList<>(); + try{ + for(Lecture l : db.getLectures().values()){ + for(LearningDocument ld : l.getLearningDocuments().values()){ + learningDocumentsNames.add(l.getName() + "|" + ld.getName()); + } + } + }catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lerndokumente konnten nicht " + + "ausgelesen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + final JComboBox learningDocumentSelection = new JComboBox(learningDocumentsNames.toArray()); + learningDocumentSelection.setSelectedItem((lecture.getName()+"|"+learningDocument.getName())); + //endregion + + //region Name Selection + JLabel nameLabel = new JLabel("Name der Ausarbeitung:"); + JTextField nameTextField = new JTextField(13); + nameTextField.setText(elaboration.getName()); + //endregion + + //region memory Location Selection + JLabel memLocationLabel = new JLabel("Speicherstelle der Ausarbeitung:"); + JTextField memLocationTextField = new JTextField(32); + memLocationTextField.setText(elaboration.getMemLocation()); + //endregion + + //region Format Selection + JLabel formatLabel = new JLabel("Format der Ausarbeitung"); + final JComboBox formatSelection = new JComboBox(Format.class.getEnumConstants()); + formatSelection.setSelectedItem(elaboration.getFormat()); + //endregion + + JButton finishButton = new JButton("Speichern"); + finishButton.addActionListener(new ActionListener(){ + + /** + * the function that is triggered when the user clicks the finish button + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //test the input + if(nameTextField.getText()==null + ||nameTextField.getText()=="" + || learningDocumentSelection.getSelectedItem()==null){ + //if the input is incomplete display an error message + JOptionPane.showMessageDialog(null,"Die Eingabe war unvollständig!", + "Unvollständige Eingabe", + JOptionPane.WARNING_MESSAGE); + } + try { + //get the information needed to modify the elaboration + String learningDocumentText = (String) learningDocumentSelection.getSelectedItem(); + int dividerPosition = learningDocumentText.indexOf("|"); + String lectureName = learningDocumentText.substring(0,dividerPosition); + Lecture l= db.getLecture(lectureName); + String name = nameTextField.getText(); + Category category = Category.ELABORATION; + String memLocation = memLocationTextField.getText(); + Format format = (Format) formatSelection.getSelectedItem(); + String learningDocumentName = learningDocumentText.substring(dividerPosition+1); + LearningDocument ld = lecture.getLearningDocument(learningDocumentName); + LearningDocument el = new LearningDocument(name,category,memLocation,format); + //remove the old elaboration + db.deleteElaboration(lecture,learningDocument,elaboration); + //store the modified elaboration + db.addElaboration(l, ld, el); + dialog.dispose(); + gui.updateTableModel(); + showListElaborationListener.updateTableModel(lecture); + } catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Ausarbeitung konnte nicht " + + "eingetragen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + + //build the dialog + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(learningDocumentLable); + cp.add(learningDocumentSelection); + cp.add(nameLabel); + cp.add(nameTextField); + cp.add(memLocationLabel); + cp.add(memLocationTextField); + cp.add(formatLabel); + cp.add(formatSelection); + cp.add(finishButton); + + //display the dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } +} diff --git a/src/ui/guiDialogs/EditLearningDocumentDialog.java b/src/ui/guiDialogs/EditLearningDocumentDialog.java new file mode 100755 index 0000000..22f9737 --- /dev/null +++ b/src/ui/guiDialogs/EditLearningDocumentDialog.java @@ -0,0 +1,176 @@ +package ui.guiDialogs; + +import storage.*; +import ui.GUI; +import ui.eventlistener.ShowListLearningDocumentListener; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; + +/** + * the dialog for editing a learning document + */ +public class EditLearningDocumentDialog{ + private String title = "Lehrndokument bearbeiten..."; + private JFrame frame; + private StorageInterface db; + + /** + * the constructor for the dialog + * @param gui the main GUI + * @param lecture the lecture the learning document belongs to + * @param learningDocument the learning document + * @param showListLearningDocumentListener the listener requesting the dialog + */ + public EditLearningDocumentDialog(GUI gui, Lecture lecture, LearningDocument learningDocument, + ShowListLearningDocumentListener showListLearningDocumentListener){ + frame = gui.getFrame(); + db = gui.getDB(); + + //initialize the dialog + final JDialog dialog = new JDialog(frame, title, false); + + //region Lecture Selection + JLabel lectureLabel = new JLabel("Lehrveranstaltung:"); + ArrayList lectureNames = new ArrayList(); + try{ + for(Lecture l : db.getLectures().values()){ + lectureNames.add(l.getName()); + } + }catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lehrveranstaltungen konnten nicht " + + "ausgelesen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + final JComboBox lectureSelection = new JComboBox(lectureNames.toArray()); + lectureSelection.setSelectedItem(lecture.getName()); + //endregion + + //region Name Selection + JLabel nameLabel = new JLabel("Name des Lerndokumentes:"); + JTextField nameTextField = new JTextField(13); + nameTextField.setText(learningDocument.getName()); + //endregion + + //region Category Selection + JLabel categoryLabel = new JLabel("Kategorie des Lerndokumentes:"); + String[] categories = {"Skript", "Übungsblatt","Klausur"}; + final JComboBox categorySelection = new JComboBox(categories); + categorySelection.setSelectedItem(getStringFromCategory(learningDocument.getCategory())); + //endregion + + //region memory Location Selection + JLabel memLocationLabel = new JLabel("Speicherstelle des Lerndokumentes:"); + JTextField memLocationTextField = new JTextField(32); + memLocationTextField.setText(learningDocument.getMemLocation()); + //endregion + + //region Format Selection + JLabel formatLabel = new JLabel("Format des Lerndokumentes"); + final JComboBox formatSelection = new JComboBox(Format.class.getEnumConstants()); + formatSelection.setSelectedItem(learningDocument.getFormat()); + //endregion + + JButton finishButton = new JButton("Speichern"); + finishButton.addActionListener(new ActionListener(){ + + /** + * the function that is triggered when the user clicks the finish button + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //input check + if(nameTextField.getText()==null + ||nameTextField.getText()=="" + ||lectureSelection.getSelectedItem()==null + ||categorySelection.getSelectedItem()==null){ + //if the input is incomplete display an error message + JOptionPane.showMessageDialog(null,"Die Eingabe war unvollständig!", + "Unvollständige Eingabe", + JOptionPane.WARNING_MESSAGE); + } + try { + //get the information needed for modifying the learning document + Lecture l= db.getLecture((String)lectureSelection.getSelectedItem()); + String name = nameTextField.getText(); + Category category = getCategoryFromString((String)categorySelection.getSelectedItem()); + String memLocation = memLocationTextField.getText(); + Format format = (Format) formatSelection.getSelectedItem(); + LearningDocument lDocument = new LearningDocument(name,category,memLocation,format); + //delete the old learning document + db.deleteLearningDocument(lecture, learningDocument); + //store the modified learning document + db.addLearningDocument(l, lDocument); + dialog.dispose(); + gui.updateTableModel(); + showListLearningDocumentListener.updateTableModel(lecture); + } catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lehrveranstaltung konnte nicht " + + "eingetragen werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + + //build the dialog + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(lectureLabel); + cp.add(lectureSelection); + cp.add(nameLabel); + cp.add(nameTextField); + cp.add(categoryLabel); + cp.add(categorySelection); + cp.add(memLocationLabel); + cp.add(memLocationTextField); + cp.add(formatLabel); + cp.add(formatSelection); + cp.add(finishButton); + + //display the dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } + + /** + * converts the category from a String + * @param category the String + * @return the converted category + */ + private Category getCategoryFromString(String category){ + switch (category){ + case "Skript": + return Category.SCRIPT; + case "Übungsblatt": + return Category.PRACTICE_SHEET; + case "Klausur": + return Category.EXAM; + default: + return null; + } + } + + /** + * converts a category to a String + * @param category the category + * @return the converted String + */ + private String getStringFromCategory(Category category){ + switch (category){ + case SCRIPT: + return "Skript"; + case PRACTICE_SHEET: + return "Übungsblatt"; + case EXAM: + return "Klausur"; + default: + return null; + } + } +} diff --git a/src/ui/guiDialogs/EditLectureDialog.java b/src/ui/guiDialogs/EditLectureDialog.java new file mode 100755 index 0000000..d2bd22d --- /dev/null +++ b/src/ui/guiDialogs/EditLectureDialog.java @@ -0,0 +1,76 @@ +package ui.guiDialogs; + +import storage.Lecture; +import storage.StorageInterface; +import ui.GUI; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * the dialog for editing a lecture + */ +public class EditLectureDialog { + private String title = "Lehrveranstaltung bearbeiten"; + private JFrame frame; + private StorageInterface db; + + /** + * the constructor for the dialog + * @param gui the main GUI + * @param lecture the lecture to be edited + */ + public EditLectureDialog(GUI gui, Lecture lecture){ + frame = gui.getFrame(); + db = gui.getDB(); + + //initialize the dialog + final JDialog dialog = new JDialog(frame, title,false); + JLabel label = new JLabel("Namen der Lehrveranstaltung an: "); + JTextField textField = new JTextField(13); + textField.setText(lecture.getName()); + JButton finishButton = new JButton("Speichern"); + finishButton.addActionListener(new ActionListener(){ + /** + * the function that is triggered when the user clicks the finish button + * @param actionEvent the action event that triggered the function + */ + @Override + public void actionPerformed(ActionEvent actionEvent) { + //input check + if(textField.getText()==null||textField.getText()==""){ + //in case of invalid input display an error message + JOptionPane.showMessageDialog(null,"Der Name des Lehrveranstaltung " + + "darf nicht leer sein!","Name der Lehrveranstaltung fehlt", + JOptionPane.WARNING_MESSAGE); + } + try { + //delete the old lecture + db.deleteLecture(lecture); + //add the modified lecture + db.addLecture(new Lecture(textField.getText())); + dialog.dispose(); + gui.updateTableModel(); + } catch (Exception e) { + JOptionPane.showMessageDialog(null,"Die Lehrveranstaltung konnte nicht " + + "geändert werden!\n - " + e, "Aufruf fehlgeschlagen", + JOptionPane.WARNING_MESSAGE); + } + } + }); + //build the dialog + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(label); + cp.add(textField); + cp.add(finishButton); + + //display the dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } +} diff --git a/src/ui/guiDialogs/ViewRatingDialog.java b/src/ui/guiDialogs/ViewRatingDialog.java new file mode 100755 index 0000000..11c001f --- /dev/null +++ b/src/ui/guiDialogs/ViewRatingDialog.java @@ -0,0 +1,72 @@ +package ui.guiDialogs; + +import storage.Rating; +import storage.StorageInterface; +import ui.GUI; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * the dialog to view a rating + */ +public class ViewRatingDialog { + private JFrame frame; + private StorageInterface db; + + /** + * the constructor for the dialog + * @param gui main GUI + * @param rating the requested rating + */ + public ViewRatingDialog(GUI gui, Rating rating){ + frame = gui.getFrame(); + db = gui.getDB(); + + //initialize dialog + final JDialog dialog = new JDialog(frame, "Detailansicht Bewertung", false); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + //Rating meta data + JLabel ratingLabel = new JLabel(ratingToStars(rating.getRating()) + " | " + rating.getUsername() + + " | " + rating.getDate()); + //rating text + JTextArea commentTextArea = new JTextArea(8,13); + commentTextArea.setText(rating.getRatingText()); + commentTextArea.setEditable(false); + + //build dialog + Container cp = dialog.getContentPane(); + dialog.setLayout(new BoxLayout(cp, BoxLayout.PAGE_AXIS)); + cp.add(ratingLabel); + cp.add(commentTextArea); + + //display dialog + dialog.pack(); + dialog.setLocationRelativeTo(frame); + dialog.setVisible(true); + } + + /** + * converts rating value to a String of stars + * @param rating the rating value + * @return the String of stars + */ + private String ratingToStars(int rating){ + switch (rating){ + case 1: + return "★☆☆☆☆"; + case 2: + return "★★☆☆☆"; + case 3: + return "★★★☆☆"; + case 4: + return "★★★★☆"; + case 5: + return "★★★★★"; + default: + return "☆☆☆☆☆"; + } + } +} diff --git a/src/ui/guimenus/EditMenu.java b/src/ui/guimenus/EditMenu.java new file mode 100755 index 0000000..9df4230 --- /dev/null +++ b/src/ui/guimenus/EditMenu.java @@ -0,0 +1,18 @@ +package ui.guimenus; + +public enum EditMenu { + CUT("Ausschneiden"), + COPY("Kopieren"), + PASTE("Einfügen"); + + private final String menuItem; + + EditMenu(String menuItem){ + this.menuItem = menuItem; + } + + @Override + public String toString() { + return menuItem; + } +} diff --git a/src/ui/guimenus/HelpMenu.java b/src/ui/guimenus/HelpMenu.java new file mode 100755 index 0000000..d9e5222 --- /dev/null +++ b/src/ui/guimenus/HelpMenu.java @@ -0,0 +1,16 @@ +package ui.guimenus; + +public enum HelpMenu { + INFO("Info"); + + private final String menuItem; + + HelpMenu(String menuItem){ + this.menuItem = menuItem; + } + + @Override + public String toString() { + return menuItem; + } +} diff --git a/src/ui/guimenus/JTableMenus.java b/src/ui/guimenus/JTableMenus.java new file mode 100755 index 0000000..e2d2939 --- /dev/null +++ b/src/ui/guimenus/JTableMenus.java @@ -0,0 +1,24 @@ +package ui.guimenus; + +import javax.swing.*; + +public enum JTableMenus { + EDIT("Bearbeiten"), + REGISTER("Erfassen"), + HELP("Hilfe"); + + private final String menuName; + + JTableMenus(String menuName){ + this.menuName = menuName; + } + + @Override + public String toString() { + return menuName; + } + + public JMenu createMenu(){ + return new JMenu( menuName ); + } +} \ No newline at end of file diff --git a/src/ui/guimenus/RegisterMenu.java b/src/ui/guimenus/RegisterMenu.java new file mode 100755 index 0000000..a3492e5 --- /dev/null +++ b/src/ui/guimenus/RegisterMenu.java @@ -0,0 +1,27 @@ +package ui.guimenus; + +import javax.swing.*; +import java.awt.event.ActionListener; + +public enum RegisterMenu { + ADD_LECTURE("neue Lehrveranstaltung"), + ADD_LEARNING_DOCUMENT("neues Lerndokument"), + ADD_ELABORATION("neue Ausarbeitung"); + + private final String menuItem; + + RegisterMenu(String menuItem){ + this.menuItem = menuItem; + } + + @Override + public String toString() { + return menuItem; + } + + public JMenuItem createMenuItemWithListener(ActionListener actionListener){ + JMenuItem mItem = new JMenuItem(menuItem); + mItem.addActionListener(actionListener); + return mItem; + } +}